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>
62 explicit Ribbon(QWidget* parent =
nullptr);
109 return m_groups[group_name];
124 return m_index_groups[index];
193 return group(location);
200 void resizeEvent(QResizeEvent *resize_event)
override;
252 bool m_inverse_ribbon_area;
254 uint01 m_fixed_num_of_rows;
The equivelent of std::vector but with a bit more control.
A hash-based key-value store, useful for quick associative lookups.
Represents the "Tab" of a widget.
void setInverseRibbonArea(bool inverse_ribbon_area)
Sets whether the ribbon area orientation should be inverted.
void setFixedNumOfRows(uint01 fixed_num_of_rows)
Sets a fixed number of rows for the ribbon layout.
SectionWidget * section() const
Returns the parent section widget that contains this ribbon.
virtual RibbonGroup * addGroup(const TranslatedString &label)
Adds a new ribbon group with the given label, creating it if necessary.
virtual bool hasGroup(const TranslatedString &group) const
Checks whether a ribbon group with the given name exists.
virtual void removeAllGroups()
Removes all ribbon groups from the ribbon.
bool isVertical()
Returns whether the ribbon is oriented vertically.
DockWidget< RibbonGroup > * groupDock(uint04 index)
Returns the dock widget for the ribbon group at the given index.
virtual void addGroup(uint04 index, RibbonGroup *group)
Adds an existing ribbon group at a specific index.
QSize sizeHint() const override
Returns the recommended size for the ribbon.
void addBottomRightWidget(QWidget *widget)
Adds a widget to the bottom-right area of the ribbon (after the groups).
Ribbon(QWidget *parent=nullptr)
Constructs a ribbon widget.
const RibbonGroup & group(const TranslatedString &group_name) const
Returns a const reference to the ribbon group with the given name.
void slideInIdx(uint04 idx, enum StackAnimationDirection direction=StackAnimationDirection::e_automatic) override
Slides to the ribbon page at the given index with an optional animation direction.
void cleanupEmpty()
Removes any empty ribbon groups.
void addTopLeftWidget(QWidget *widget)
Adds a widget to the top-left area of the ribbon (before the groups).
RibbonGroup & group(uint04 index)
Returns a mutable reference to the ribbon group at the given index.
Dictionary< TranslatedString, DockWidget< RibbonGroup > * > & groups()
Returns a reference to the dictionary of all ribbon groups keyed by name.
void setLayoutMode(RibbonLayoutMode mode)
Sets the layout mode for how ribbon groups are arranged.
virtual void removeGroup(const TranslatedString &label)
Removes the ribbon group with the given label.
DockWidget< RibbonGroup > * groupDock(const RibbonGroup *group)
Returns the dock widget wrapping the given ribbon group.
virtual void addGroup(RibbonGroup *group)
Adds an existing ribbon group to the ribbon.
RibbonGroup & operator[](const TranslatedString &location)
Returns the ribbon group with the given name, creating it if it does not exist.
virtual RibbonGroup * addGroup(uint04 index, const TranslatedString &label)
Adds a new ribbon group at a specific index with the given label.
virtual void removeGroup(RibbonGroup *group)
Removes a specific ribbon group.
virtual void _setVertical(bool is_vertical)
Sets the ribbon orientation to vertical or horizontal.
void setTabLock(bool tab_lock)
Sets whether tabs are locked (preventing the user from switching tabs).
void updateRibbonLayout()
Recalculates and updates the layout of all ribbon groups.
void setGroupName(uint04 index, const TranslatedString &group_name)
Renames the ribbon group at the given index.
QSize minimumSizeHint() const override
Returns the minimum recommended size for the ribbon.
virtual void removeGroup(uint04 index)
Removes the ribbon group at the given index.
DockWidget< RibbonGroup > * groupDock(const TranslatedString &group_name)
Returns the dock widget for the ribbon group with the given name.
RibbonGroup & group(const TranslatedString &group_name)
Returns a mutable reference to the ribbon group with the given name.
Any text displayed to the user should be defined as a TranslatedString which allows the program to lo...
The primary namespace for the NDEVR SDK.
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
uint8_t uint01
-Defines an alias representing a 1 byte, unsigned integer -Can represent exact integer values 0 throu...
RibbonLayoutMode
The orientations a ribbon can take on.