34#include <NDEVR/Ribbon.h>
35#include <NDEVR/KeyController.h>
53 class QTWindowManager;
55 class SnapsEditorWidget;
59 class QTResourceListener;
61 class NDEVRRibbonWidget;
73 struct NDEVRRibbonOptions
440 class NDEVRRibbonWidget :
public QWidget
443 explicit NDEVRRibbonWidget(QWidget* parent =
nullptr);
444 void setIsVertical(
bool is_vertical) {
m_is_vertical = is_vertical; };
445 QSize sizeHint()
const override;
BasicKeyController(const TranslatedString &key_controller_title)
Constructs a BasicKeyController with the given title.
The equivelent of std::vector but with a bit more control.
A core object representing a user view as well as convenience functions for moving this view through ...
A core class where all Design Objects including models, materials, and geometries are stored.
Describes a user key press event used to trigger behavior in the NDEVR API.
The primary Window within the NDEVR API.
QTResourceListener * m_command_listener
Listener for command history resource changes.
void showHome(bool visible)
Shows or hides the home ribbon tab.
Buffer< QPointer< Button > > m_disable_with_no_project_buttons
Buttons that should be disabled when no project is loaded.
Buffer< Button * > m_window_theme_buttons
Buttons for switching window color themes.
RibbonGroup * homeRibbonGroup()
Gets the ribbon group for objects on the "home" tab.
SnapsEditorWidget * m_snaps_dock
The snap settings editor dock widget.
void addLeftWidget(QWidget *widget)
Adds a widget to the left of the normal ribbon objects.
NDEVRRibbon(MainWindow *window, WindowManager *window_manager, QTModelManager *manager, RibbonArea area)
Constructs the ribbon attached to a main window.
Button * m_log_button
The application log button.
Ribbon * m_ribbon
The underlying ribbon widget.
void showEdit(bool visible)
Shows or hides the edit ribbon tab.
bool m_is_vertical
Whether the ribbon is in vertical layout mode.
RibbonGroup * viewRibbonGroup()
Gets or creates the view ribbon group.
bool m_scene_visible
Whether a 3D scene is currently visible.
Button * m_wifi_button
The wifi status/settings button.
QTResourceListener * m_background_listener
Listener for background task resource changes.
RibbonGroup * m_home_ribbon_group
The home tab ribbon group.
RibbonGroup * editRibbonGroup()
Gets the ribbon group for objects on the "edit" tab.
Button * m_settings_button
The application settings button.
Button * m_save_button
The save button.
RibbonGroup * drawRibbonGroup()
Gets or creates the draw ribbon group.
Button * m_main_icon_button
The main application icon button.
WindowManager * m_window_manager
The window manager for UI coordination.
NDEVRRibbonOptions m_ribbon_options
The current ribbon visibility options.
Button * m_redo_button
The redo button.
Buffer< Button * > m_buttons_to_add_to_home_general_subgroup
Buttons queued for adding to the home/general subgroup.
RibbonSubGroup * homeGeneralRibbonSubGroup()
Gets the ribbon sub-group for objects on the "home/general" tab.
Button * m_project_settings_button
The project settings button.
RibbonSubGroup * homeFileRibbonSubGroup()
Gets the ribbon sub-group for objects on the "home/file" tab.
void setup()
To be called by WindowManager when UI is ready to be displayed.
Button * m_export_button
The export button.
void setRibbonOptions(const NDEVRRibbonOptions &options)
Sets the ribbon options and immediately refreshes the widget.
void resetKeyControllerToDefaults() override
Resets all key mappings to their default values.
MainWindow * m_main_window
The main application window.
Button * m_about_button
The about/info button.
Button * m_project_browser
The project file browser button.
void onClearAllSlot()
Handles clearing all project data.
RibbonGroup * measureRibbonGroup()
Gets or creates the measure ribbon group.
void showDraw(bool visible)
Shows or hides the draw ribbon tab.
Button * m_open_button
The open project button.
void setSceneVisible(bool scene_visible)
To be called by WindowManager when a scene is added or removed from the program.
void setIsVertical(bool is_vertical)
Defines whether buttons are layed out horizontally, or vertically.
std::function< void(const PopupInfo &)> m_main_button_callback
Custom callback for the main button press.
void addButtonToGeneralFile(Button *button, bool disable_with_no_project)
Adds a button to the general/file tab.
const NDEVRRibbonOptions & options() const
Gets the active options of the ribbon.
LayerWidget * m_layer_tools_dock
The layer tools dock widget.
Ribbon * ribbon() const
Gets the underlying ribbon object used for this widget.
RibbonGroup * m_view_ribbon_group
The view tab ribbon group.
Button * m_save_as_button
The save-as button.
Buffer< QWidget * > m_left_widgets
Widgets added to the left side of the ribbon.
void addButtonToGeneralHome(Button *button, bool disable_with_no_project)
Adds a button to the general/home tab.
void initializeRibbon()
Creates and initializes all ribbon groups, buttons, and layout.
Buffer< QWidget * > m_right_widgets
Widgets added to the right side of the ribbon.
Button * m_exit_button
The exit application button.
RibbonGroup * m_measure_ribbon_group
The measure tab ribbon group.
QTModelManager * m_model_manager
The model manager for accessing design data.
QWidget * m_main_button_widget
The container widget for the main icon button.
Button * m_undo_button
The undo button.
void showMeasure(bool visible)
Shows or hides the measure ribbon tab.
RibbonSubGroup * m_home_file_subgroup
The file subgroup within the home tab.
void showView(bool visible)
Shows or hides the view ribbon tab.
Buffer< Button * > m_buttons_to_add_to_home_file_subgroup
Buttons queued for adding to the home/file subgroup.
Buffer< Button * > m_ui_theme_buttons
Buttons for switching UI themes.
void updateButtonStates()
Updates enabled/disabled states of all buttons based on current application state.
Buffer< Button * > m_touch_theme_buttons
Buttons for switching touch/desktop mode.
void createEditRibbonGroup()
Creates the edit ribbon group and populates it with edit action buttons.
void addRightWidget(QWidget *widget)
Adds a widget to the right of the normal ribbon objects.
RibbonGroup * m_draw_ribbon_group
The draw tab ribbon group.
void createDrawRibbonGroup()
Creates the draw ribbon group and populates it with drawing action buttons.
void setMainButtonCallback(const std::function< void(const PopupInfo &)> &main_callback)
Sets a callback for when the round "Main" button is pressed.
RibbonGroup * m_edit_ribbon_group
The edit tab ribbon group.
void refreshWidget()
Refreshes the widget layout and visibility based on current options.
RibbonSubGroup * m_home_general_subgroup
The general subgroup within the home tab.
void retranslate()
Retranslates all UI text for the current locale.
Button * m_import_file_button
The import file button.
virtual bool processKeyEvent(const StringView &id, const KeyEvent &key_event, DesignObjectLookup *lookup, Camera *camera) override
Processes a key event identified by its string ID.
NDEVRRibbon(WindowManager *window_manager, QTModelManager *manager, RibbonArea area)
Constructs the ribbon without a main window reference.
void updateUndoRedoSlot(UUID last_command)
Updates the undo/redo button states when the command history changes.
A wrapper around DesignObjectLookup that provides signal and slot functionality and adds rendering ca...
A ResourceListener which will always be executed on the main UI thread and can be tied to a Qt Object...
Represents the "Tab" of a widget.
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 core String View class for the NDEVR API.
A universally unique identifier (UUID) is a 128-bit number used to identify information in computer s...
Manages all windows and logic surrounding dialogs and views for displaying and managing any environme...
The primary namespace for the NDEVR SDK.
NDEVRRibbonAction
Enumerates the standard ribbon actions available in the NDEVR application.
@ e_settings
Open the settings dialog.
@ e_save_file
Save the current project file.
@ e_save_as_file
Save the current project to a new file.
@ e_help
Show help information.
@ e_open_project
Open an existing project.
@ e_ribbon_action_size
The number of ribbon actions.
@ e_redo
Redo the last undone operation.
@ e_undo
Undo the last operation.
RibbonArea
Requests a ribbon or tab area to be in a certain location and orientation relative to another widget.
RibbonVisibleOption wifi_visible
Whether or not to show the wifi button.
bool showLog() const
Whether the log button should be shown.
RibbonVisibleOption main_button_visible
Whether or not to show the rounded main button on the far left.
bool showHomeGeneral() const
Whether the home/general ribbon section should be shown.
RibbonVisibleOption save_visible
Whether or not to show the save button.
RibbonVisibleOption edit_actions_visible
Whether or not to show draw edit actions tab (Note that draw functionality must be enabled).
bool showLayers() const
Whether the layers section should be shown.
bool showExit() const
Whether the exit button should be shown.
bool showDrawActions() const
Whether the draw actions ribbon tab should be shown.
RibbonVisibleOption exit_visible
Whether or not to show the close/exit button.
bool showMainButton() const
Whether the main icon button should be shown.
RibbonVisibleOption measure_actions_visible
Whether or not to show measurement actions tab (Note that measure functionality must be enabled).
RibbonVisibleOption about_visible
Whether or not to show the about button with application information.
bool showAbout() const
Whether the about button should be shown.
RibbonVisibleOption save_as_visible
Whether or not to show the save-as button.
RibbonVisibleOption touch_theme_visible
Whether or not to show the touch theme button which changes the application mode.
RibbonVisibleOption project_browser_visible
Whether or not to show the browse button for the native file browser.
RibbonVisibleOption view_actions_visible
Whether or not to show view actions tab which controls aspects of the UI.
RibbonVisibleOption home_general_visible
Whether or not to show general settings on the home tab.
bool showSaveAs() const
Whether the save-as button should be shown.
bool showSave() const
Whether the save button should be shown.
RibbonVisibleOption
Controls whether a ribbon element is visible, hidden, or uses the default behavior.
@ e_default
The element uses the default visibility based on application state.
@ e_visible
The element is always visible.
@ e_not_visible
The element is always hidden.
bool showWifi() const
Whether the wifi button should be shown.
RibbonVisibleOption layers_visible
Whether or not to show layers (Note that layers functionality must be enabled).
bool showViewActions() const
Whether the view actions ribbon tab should be shown.
static bool ShouldShow(RibbonVisibleOption option, bool default_option)
Determines whether a ribbon element should be shown given its option and the default.
RibbonVisibleOption file_actions_visible
Whether or not to show file settings on the home tab.
bool showEditActions() const
Whether the edit actions ribbon tab should be shown.
bool showWidgetMode() const
Whether the widget mode toggle should be shown.
bool showProjectBrowser() const
Whether the project browser button should be shown.
bool showMeasureActions() const
Whether the measure actions ribbon tab should be shown.
RibbonVisibleOption log_visible
Whether or not to show the log button for application logs.
bool showColorTheme() const
Whether the color theme toggle should be shown.
bool showFileActions() const
Whether the file actions ribbon section should be shown.
RibbonVisibleOption draw_actions_visible
Whether or not to show draw actions tab (Note that draw functionality must be enabled).
RibbonVisibleOption light_theme_visible
Whether or not to show the color theme button.