3#include <NDEVR/QTTools.h>
4#include <NDEVR/Button.h>
5#include <NDEVR/RibbonLayoutMode.h>
27 class NDEVR_WIDGETS_API InterfaceOrientationController
30 InterfaceOrientationController();
31 ~InterfaceOrientationController();
52 void run(QWidget*
object,
const std::function<
void(
bool is_horizontal)>& function);
59 void run(QBoxLayout* l, QBoxLayout::Direction horz = QBoxLayout::LeftToRight, QBoxLayout::Direction vert = QBoxLayout::TopToBottom);
78 void run(QSplitter* splitter,
bool inverted_splitter =
false);
109 static InterfaceOrientationController&
Default();
114 struct OrientationOption :
public QObject
116 OrientationOption(InterfaceOrientationController* parent, QLayout* l,
bool inverted_stack);
117 OrientationOption(InterfaceOrientationController* parent, QWidget* w,
bool inverted_stack);
118 ~OrientationOption();
119 QLayout* layout =
nullptr;
120 QWidget* widget =
nullptr;
121 uint04 state_horz = Constant<uint04>::Invalid;
122 uint04 state_vert = Constant<uint04>::Invalid;
123 bool inverted =
false;
126 std::function<void(
bool is_horizontal)> function;
128 InterfaceOrientationController* m_parent;
132 void addOption(OrientationOption* inter);
135 bool m_is_horizontal;
A hash-based key-value store, useful for quick associative lookups.
This class is responsible for notifying and providing default layout logic when the orientation of th...
void run(Ribbon *widget, RibbonLayoutMode horz_mode=RibbonLayoutMode::e_horizontal, RibbonLayoutMode vert_mode=RibbonLayoutMode::e_vertical)
Registers a Ribbon to change its layout mode on orientation change.
void run(QBoxLayout *l, QBoxLayout::Direction horz=QBoxLayout::LeftToRight, QBoxLayout::Direction vert=QBoxLayout::TopToBottom)
Registers a QBoxLayout to switch direction on orientation change.
static InterfaceOrientationController & Default()
Returns the default global InterfaceOrientationController instance.
void run(QWidget *object, const std::function< void(bool is_horizontal)> &function)
Registers a widget with a custom callback for orientation changes.
void run(PointWidget *widget, uint04 lines_horz=2, uint04 lines_vert=3)
Registers a PointWidget to change its line count on orientation change.
void run(Button *w, Button::ButtonState horz=Button::ButtonState::e_push_button, Button::ButtonState vert=Button::ButtonState::e_large)
Registers a Button to change its state on orientation change.
void run(RibbonSubGroup *widget, RibbonLayoutMode horz_mode=RibbonLayoutMode::e_horizontal, RibbonLayoutMode vert_mode=RibbonLayoutMode::e_vertical)
Registers a RibbonSubGroup to change its layout mode on orientation change.
void run(QCustomTabWidget *w, bool inverted_stack=false)
Registers a QCustomTabWidget to update on orientation change.
void remove(QObject *widget)
Removes a widget from orientation tracking.
static bool isScreenHorizontal()
Returns whether the screen is currently in horizontal (landscape) orientation.
void setHorizontal(bool is_horizontal)
Sets the orientation mode and updates all registered widgets.
void run(QSplitter *splitter, bool inverted_splitter=false)
Registers a QSplitter to change orientation on layout change.
bool isHorizontalMode()
Returns whether the current mode is horizontal.
Represents a sub-section of "Tab" of a ribbon representing a grouping of buttons or widgets within a ...
The UI ribbon is a horizontal menu bar typically located at the top of the application interface or a...
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...
RibbonLayoutMode
The orientations a ribbon can take on.