API Documentation
Loading...
Searching...
No Matches
Ribbon.h
Go to the documentation of this file.
1/**--------------------------------------------------------------------------------------------
2Copyright (c) 2019, NDEVR LLC
3tyler.parke@ndevr.org
4 __ __ ____ _____ __ __ _______
5 | \ | | | __ \ | ___|\ \ / / | __ \
6 | \ | | | | \ \ | |___ \ \ / / | |__) |
7 | . \| | | |__/ / | |___ \ V / | _ /
8 | |\ |_|_____/__|_____|___\_/____| | \ \
9 |__| \__________________________________| \__\
10
11Subject to the terms of the Enterprise+ Agreement, NDEVR hereby grants
12Licensee a limited, non-exclusive, non-transferable, royalty-free license
13(without the right to sublicense) to use the API solely for the purpose of
14Licensee's internal development efforts to develop applications for which
15the API was provided.
16
17The above copyright notice and this permission notice shall be included in all
18copies or substantial portions of the Software.
19
20THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
21INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
22PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
23FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
24OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25DEALINGS IN THE SOFTWARE.
26
27Library: Widgets
28File: Ribbon
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include "DLLInfo.h"
34#include <NDEVR/RibbonLayoutMode.h>
35#include <NDEVR/ContainerWidget.h>
36#include <NDEVR/QCustomDockWidget.h>
37#include <NDEVR/RibbonArea.h>
38#include <NDEVR/String.h>
39#include <NDEVR/BaseValues.h>
40#include <NDEVR/Dictionary.h>
41#include <QFrame>
42class QBoxLayout;
43namespace NDEVR
44{
45 class RibbonGroup;
47 {
48 public:
49 explicit Ribbon(QWidget* parent = nullptr);
50 ~Ribbon();
51 bool isVertical() { return m_is_vertical; };
52 const RibbonGroup& group(const TranslatedString& group_name) const;
53 void setGroupName(uint04 index, const TranslatedString& group_name);
54 void setInverseRibbonArea(bool inverse_ribbon_area);
55 RibbonGroup& group(const TranslatedString& group_name);
56 DockWidget<RibbonGroup>* groupDock(const RibbonGroup* group);
58 {
59 return m_groups[group_name];
60 }
61
62 RibbonGroup& group(uint04 index);
64 {
65 return m_index_groups[index];
66 }
67 void updateRibbonLayout();
68 /// Handle window drag events
69 virtual RibbonGroup* addGroup(const TranslatedString& label);
70 virtual void addGroup(RibbonGroup* group);
71 virtual void removeGroup(const TranslatedString& label);
72 virtual void removeGroup(uint04 index);
73 virtual void removeAllGroups();
74 virtual bool hasGroup(const TranslatedString& group) const;
75 SectionWidget* section() const;
77 {
78 if (!hasGroup(location))
79 addGroup(location);
80 return group(location);
81 }
82 void setLayoutMode(RibbonLayoutMode mode);
83 void resizeEvent(QResizeEvent *resize_event) override;
84 void setFixedNumOfRows(uint01 fixed_num_of_rows);
85 QSize sizeHint() const override;
86 QSize minimumSizeHint() const override;
88 void addTopLeftWidget(QWidget* widget);
89 void addBottomRightWidget(QWidget* widget);
90 void slideInIdx(uint04 idx, enum t_direction direction = t_direction::AUTOMATIC) override {
91 QCustomStackedWidgetBase::slideInIdx(idx, direction);
92 }
93 void setTabLock(bool tab_lock) { ContainerWidgetBase::setTabLock(tab_lock); }
94 protected:
95 virtual void _setVertical(bool is_vertical);
96
97 protected:
107 };
108
109
110}
#define NDEVR_WIDGETS_API
Definition DLLInfo.h:81
The equivelent of std::vector but with a bit more control. The basic array unit of the library.
Definition Buffer.hpp:64
Definition ContainerWidget.h:85
Definition Dictionary.h:48
Definition QCustomDockWidget.h:117
t_direction
Definition QCustomStackedWidget.h:50
Definition RibbonGroup.h:47
Definition Ribbon.h:47
DockWidget< RibbonGroup > * groupDock(uint04 index)
Definition Ribbon.h:63
bool m_inverse_ribbon_area
Definition Ribbon.h:99
void setTabLock(bool tab_lock)
Definition Ribbon.h:93
Dictionary< TranslatedString, DockWidget< RibbonGroup > * > & groups()
Definition Ribbon.h:87
bool m_is_vertical
Definition Ribbon.h:98
void slideInIdx(uint04 idx, enum t_direction direction=t_direction::AUTOMATIC) override
Definition Ribbon.h:90
Buffer< DockWidget< RibbonGroup > * > m_index_groups
Definition Ribbon.h:103
Buffer< QPointer< QWidget > > m_top_left_widgets
Definition Ribbon.h:104
Dictionary< TranslatedString, DockWidget< RibbonGroup > * > m_groups
Definition Ribbon.h:102
RibbonLayoutMode m_layout_mode
Definition Ribbon.h:100
uint01 m_fixed_num_of_rows
Definition Ribbon.h:101
RibbonGroup & operator[](const TranslatedString &location)
Definition Ribbon.h:76
Buffer< QPointer< QWidget > > m_bottom_right_widgets
Definition Ribbon.h:105
bool isVertical()
Definition Ribbon.h:51
DockWidget< RibbonGroup > * groupDock(const TranslatedString &group_name)
Definition Ribbon.h:57
Buffer< TranslatedString > m_index_names
Definition Ribbon.h:106
Definition SectionWidget.h:55
Definition TranslatedString.h:9
Definition ACIColor.h:37
QAction * group(nullptr)
uint8_t uint01
-Defines an alias representing a 1 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:98
RibbonLayoutMode
Definition RibbonLayoutMode.hpp:36
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:120