|
VR-Engage
2.2
|
DtVreHeaderFooterUIBase provides a foundation for UI components that use a standard header and footer layout. It manages the visibility, initialization, and event handling for these UI elements, as well as common dialogs like settings and exit confirmation. This class simplifies the creation of consistent UI components throughout the application.
#include <vreHeaderFooterUIBase.h>
Public Slots | |
| virtual void | slot_settingsOpened () |
| virtual void | slot_settingsClosed () |
| virtual void | slot_displayEngineConfigClicked () |
| virtual void | slot_weatherAndEnvClicked () |
| virtual void | slot_advancedVisualSettingsClicked () |
| virtual void | slot_aboutClicked () |
| virtual void | slot_soundVolumeChanged (qreal volume) |
| virtual void | slot_soundEnabledChanged (bool enabled) |
| virtual void | slot_exitOpened () |
| virtual void | slot_exitClosed () |
| virtual void | slot_exitAccepted () |
| virtual void | slot_exitRejected () |
| virtual void | slot_playClicked () |
| virtual void | slot_pauseClicked () |
| virtual void | slot_rewindClicked () |
| virtual void | slot_connectionClicked () |
| virtual void | slot_helpOpened () |
| virtual void | slot_helpClosed () |
| virtual void | slot_backClicked () |
Public Member Functions | |
| DtVreHeaderFooterUIBase (DtPlayerStationApp &app, const std::string &file, const std::string &target_window="") | |
| DtVreHeaderFooterUIBase (DtPlayerStationApp &app, const std::string &file, const std::string &headerId, const std::string &footerId, const std::string &mainContentId, const std::string &target_window) | |
| virtual | ~DtVreHeaderFooterUIBase () override |
| QQuickItem * | root () |
| virtual void | initMain ()=0 |
| virtual void | tick (double dt)=0 |
| virtual void | setVisibility (bool visible) |
| virtual bool | isVisible () |
| virtual void | close () |
| virtual void | open () |
| virtual void | initHeader () |
| virtual bool | isHeaderVisible () |
| virtual void | setHeaderVisiblility (bool visible) |
| virtual void | setMenuTitle (const QString &title) |
| virtual void | setShowCutoutVisible (bool visible) |
| virtual void | setButtonEnabled (const std::string &id, bool enabled) |
| virtual bool | isButtonEnabled (const std::string &id) |
| virtual void | setAllCutoutControlsEnabled (bool enabled) |
| virtual void | setShowTopRightControlsVisible (bool visible) |
| virtual void | initFooter () |
| virtual bool | isFooterVisible () |
| virtual void | setFooterVisiblility (bool visible) |
| virtual void | setShowBottomBackButtonVisible (bool visible) |
| virtual bool | isMainContentVisible () |
| virtual void | setMainContentVisibility (bool visible) |
| virtual void | registerMessageHandlers () |
| virtual void | deregisterMessageHandlers () |
| DtVreMessageResult | handleBackButtonClicked (DtVreMessage *msg) |
| DtVreMessageResult | handleEscapeMessage (DtVreMessage *msg) |
Protected Member Functions | |
| virtual void | runningStateUpdated (bool runState) |
| virtual void | closeAllSettingsPages (std::string pageName="") |
| virtual void | appModeUpdated (const std::string &newAppMode, const std::string &oldAppMode) |
| virtual void | updateModalState (bool open) |
| DtVreMessageResult | handleApplicationMode (DtVreMessage *msg) |
| DtVreMessageResult | handleSessionPlayState (DtVreMessage *msg) |
| DtVreMessageResult | handleToggleHelp (DtVreMessage *msg) |
Protected Attributes | |
| DtPlayerStationApp & | myApp |
| QQuickItem * | myRoot |
| std::string | myTargetWindow |
| std::string | myTargetFile |
| std::string | myHeaderId |
| std::string | myFooterId |
| std::string | myMainContentId |
| makVre::DtVreHeaderFooterUIBase::DtVreHeaderFooterUIBase | ( | DtPlayerStationApp & | app, |
| const std::string & | file, | ||
| const std::string & | target_window = "" ) |
Simple constructor.
| app | Reference to the player station application |
| file | Path to the QML file defining the UI |
| target_window | Name of the window to display in (empty for default) |
Creates a new UI component using the specified QML file for the given window. Uses default IDs for header, footer, and main content elements.
| makVre::DtVreHeaderFooterUIBase::DtVreHeaderFooterUIBase | ( | DtPlayerStationApp & | app, |
| const std::string & | file, | ||
| const std::string & | headerId, | ||
| const std::string & | footerId, | ||
| const std::string & | mainContentId, | ||
| const std::string & | target_window ) |
Detailed constructor.
| app | Reference to the player station application |
| file | Path to the QML file defining the UI |
| headerId | ID of the header element in the QML |
| footerId | ID of the footer element in the QML |
| mainContentId | ID of the main content element in the QML |
| target_window | Name of the window to display in |
Creates a new UI component using the specified QML file with custom IDs for the header, footer, and main content elements. This allows for more fine-grained control over UI structure and appearance.
|
overridevirtual |
Virtual destructor.
Ensures proper cleanup of UI component resources.
|
pure virtual |
Core functionality methods.
Initializes the main UI component
Pure virtual method that must be implemented by derived classes to initialize the UI component. This typically involves setting up signals/slots connections, initial state, and other component-specific initialization.
Implemented in makVre::DtPlayerStationPersistentNotification, makVre::DtVreAppPage, makVre::DtVreChooseRolePage, makVre::DtVreLoadingPage, makVre::DtVreSelectConnectionPage, makVre::DtVreStartPage, and makVre::DtVreWaitingPage.
|
pure virtual |
Updates the UI component each frame.
| dt | Time in seconds since the last update |
Pure virtual method that must be implemented by derived classes to handle per-frame updates for the UI component. This is called once per frame and allows for animations, state updates, and other time-based operations.
Implemented in makVre::DtPlayerStationPersistentNotification, makVre::DtVreAppPage, makVre::DtVreChooseRolePage, makVre::DtVreLoadingPage, makVre::DtVreSelectConnectionPage, makVre::DtVreStartPage, and makVre::DtVreWaitingPage.
|
virtual |
Visibility control methods.
Sets the visibility of the entire UI component
| visible | True to show the component, false to hide it |
Controls the visibility of the root object of this UI component. This affects the entire component, not individual elements within it.
Reimplemented in makVre::DtPlayerStationPersistentNotification, makVre::DtVreAppPage, makVre::DtVreChooseRolePage, makVre::DtVreLoadingPage, makVre::DtVreSelectConnectionPage, makVre::DtVreStartPage, and makVre::DtVreWaitingPage.
|
virtual |
Checks if the UI component is visible.
Determines whether the UI component is currently visible to the user.
|
virtual |
Closes the UI component.
Convenience method that hides the UI component by calling setVisibility(false).
|
virtual |
Opens the UI component.
Convenience method that shows the UI component by calling setVisibility(true).
Referenced by updateModalState().
|
virtual |
Header control methods.
Initializes the header portion of the UI
Sets up the header elements and their initial state. This is typically called during component initialization.
|
virtual |
Checks if the header is visible.
Determines whether the header portion of the UI is currently visible.
|
virtual |
Sets the visibility of the header.
| visible | True to show the header, false to hide it |
Controls the visibility of the header portion of the UI.
|
virtual |
Sets the title displayed in the header.
| title | Text to display as the menu title |
Updates the title text shown in the header area of the UI.
|
virtual |
Sets the visibility of the cutout area in the header.
| visible | True to show the cutout area, false to hide it |
Controls the visibility of the cutout area in the header, which typically contains action buttons or status information.
|
virtual |
Enables or disables a specific button in the header.
| id | Identifier of the button to modify |
| enabled | True to enable the button, false to disable it |
Controls whether a specific button in the header is enabled or disabled. Disabled buttons are typically grayed out and do not respond to clicks.
|
virtual |
Checks if a specific button is enabled.
| id | Identifier of the button to check |
Determines whether a specific button in the header is currently enabled.
|
virtual |
Enables or disables all cutout controls.
| enabled | True to enable all controls, false to disable them |
Controls whether all buttons and controls in the cutout area are enabled or disabled.
|
virtual |
Sets the visibility of top-right controls.
| visible | True to show the controls, false to hide them |
Controls the visibility of controls located in the top-right area of the header.
|
virtual |
Footer control methods.
Initializes the footer portion of the UI
Sets up the footer elements and their initial state. This is typically called during component initialization.
Reimplemented in makVre::DtVreSelectConnectionPage.
|
virtual |
Checks if the footer is visible.
Determines whether the footer portion of the UI is currently visible.
|
virtual |
Sets the visibility of the footer.
| visible | True to show the footer, false to hide it |
Controls the visibility of the footer portion of the UI.
|
virtual |
Sets the visibility of the back button in the footer.
| visible | True to show the back button, false to hide it |
Controls the visibility of the back button located in the footer area.
|
virtual |
Main content control methods.
Checks if the main content is visible
Determines whether the main content area of the UI is currently visible.
|
virtual |
Sets the visibility of the main content.
| visible | True to show the main content, false to hide it |
Controls the visibility of the main content area of the UI.
|
virtual |
Message handling methods.
Registers message handlers for this UI component
Sets up handlers for messages that this UI component needs to process. This is typically called during initialization or when the component becomes active.
|
virtual |
Deregisters message handlers for this UI component.
Removes handlers for messages that this UI component was processing. This is typically called during cleanup or when the component becomes inactive.
| DtVreMessageResult makVre::DtVreHeaderFooterUIBase::handleBackButtonClicked | ( | DtVreMessage * | msg | ) |
Handles back button click messages.
| msg | Pointer to the button click message |
Processes messages generated when the back button is clicked. This typically navigates back to a previous screen or state.
| DtVreMessageResult makVre::DtVreHeaderFooterUIBase::handleEscapeMessage | ( | DtVreMessage * | msg | ) |
Handles escape key press messages.
| msg | Pointer to the key press message |
Processes messages generated when the escape key is pressed. This typically closes dialogs or navigates back.
| QQuickItem * makVre::DtVreHeaderFooterUIBase::root | ( | ) |
Gets the root UI element.
Provides access to the root QQuickItem of this UI component. This can be used to directly manipulate the UI element tree if needed.
|
virtualslot |
Settings dialog slots.
Called when the settings dialog is opened
Handles the opening of the settings dialog, performing any necessary initialization for the settings UI.
|
virtualslot |
Called when the settings dialog is closed.
Handles the closing of the settings dialog, performing any necessary cleanup or state updates.
|
virtualslot |
Called when display engine configuration is clicked.
Handles navigation to the display engine configuration settings page.
|
virtualslot |
Called when weather and environment settings are clicked.
Handles navigation to the weather and environment settings page.
|
virtualslot |
Called when advanced visual settings are clicked.
Handles navigation to the advanced visual settings page.
|
virtualslot |
Called when the about option is clicked.
Handles navigation to the about dialog or page.
|
virtualslot |
Called when the sound volume is changed.
| volume | New volume level (typically 0.0 to 1.0) |
Handles changes to the sound volume setting.
|
virtualslot |
Called when sound enabled state is changed.
| enabled | True if sound is enabled, false otherwise |
Handles changes to the sound enabled/disabled setting.
|
virtualslot |
Exit confirmation dialog slots.
Called when the exit confirmation dialog is opened
Handles the opening of the exit confirmation dialog, preparing the UI and any state needed for the confirmation process.
|
virtualslot |
Called when the exit confirmation dialog is closed.
Handles the closing of the exit confirmation dialog, performing any necessary cleanup regardless of the user's choice.
|
virtualslot |
Called when exit is confirmed (Yes/OK clicked)
Handles the user confirming the exit action, typically by initiating the actual exit process.
|
virtualslot |
Called when exit is rejected (No/Cancel clicked)
Handles the user rejecting the exit action, typically by returning to the previous state.
|
virtualslot |
Playback control slots.
Called when the play button is clicked
Handles requests to start or resume playback of the simulation.
|
virtualslot |
Called when the pause button is clicked.
Handles requests to pause the simulation.
|
virtualslot |
Called when the rewind button is clicked.
Handles requests to rewind or reset the simulation to a starting point.
|
virtualslot |
Connection control slots.
Called when the connection button is clicked
Handles requests to manage connection settings or status.
Reimplemented in makVre::DtVreSelectConnectionPage.
|
virtualslot |
Help system slots.
Called when the help system is opened
Handles the opening of the help dialog or overlay.
|
virtualslot |
Called when the help system is closed.
Handles the closing of the help dialog or overlay.
|
virtualslot |
Navigation control slots.
Called when the back button is clicked
Handles navigation requests to go back to a previous screen or state.
|
inlineprotectedvirtual |
Updates the running state.
| runState | True if the simulation is running, false if paused |
Updates the UI to reflect the current running state of the simulation. This base implementation does nothing and should be overridden by derived classes.
Reimplemented in makVre::DtVreAppPage.
|
protectedvirtual |
Closes settings pages.
| pageName | Name of the page to keep open (empty to close all) |
Closes all settings pages, optionally keeping one specified page open. If no page name is passed, all pages are closed. If a page name is provided, every page except the specified one is closed.
|
protectedvirtual |
Handles application mode updates.
| newAppMode | Identifier of the new application mode |
| oldAppMode | Identifier of the previous application mode |
Called when the application mode changes, allowing the UI to update its state appropriately for the new mode.
Reimplemented in makVre::DtVreChooseRolePage, makVre::DtVreSelectConnectionPage, and makVre::DtVreStartPage.
|
protectedvirtual |
Updates the modal dialog state.
| open | True if a modal dialog is open, false otherwise |
Notifies the system about the presence of a modal dialog or popup. This allows other components to adjust their behavior appropriately when modal dialogs are active.
References open().
|
protected |
Internal message handlers.
Handles application mode change messages
| msg | Pointer to the application mode message |
Processes messages about changes to the application mode.
|
protected |
Handles session play state messages.
| msg | Pointer to the play state message |
Processes messages about changes to the session play state (playing, paused, etc.).
|
protected |
Handles help toggle messages.
| msg | Pointer to the help toggle message |
Processes messages requesting to show or hide the help system.
|
protected |
Reference to the player station application.
Provides access to application services and state.
|
protected |
Pointer to the root QML item.
Reference to the root UI element for this component.
|
protected |
Name of the target window.
Identifies which window the UI should be displayed in.
|
protected |
Path to the QML file.
Specifies the QML file that defines this UI component.
|
protected |
ID of the header element.
Identifies the header element in the QML structure.
|
protected |
ID of the footer element.
Identifies the footer element in the QML structure.
|
protected |
ID of the main content element.
Identifies the main content element in the QML structure.