VR-Engage  2.3
Loading...
Searching...
No Matches
makVre::DtVreBaseUI Class Referenceabstract

Detailed Description

Loads a QML file, stores the root item, and provides visibility, main-content visibility, and connection-page back-navigation. Derived classes implement initMain() for page-specific setup and tick() for per-frame updates. Access the shared header/footer through headerFooterUI().

#include <vreBaseUI.h>

Inheritance diagram for makVre::DtVreBaseUI:
[legend]

Public Member Functions

 DtVreBaseUI (DtPlayerStationApp &app, const std::string &file, const std::string &target_window="")
 
virtual ~DtVreBaseUI () override
 
virtual void initMain ()=0
 
virtual void tick (double dt)=0
 
QQuickItem * root ()
 
DtVreHeaderFooterUI * headerFooterUI ()
 
virtual void setVisibility (bool visible)
 
virtual bool isVisible ()
 
virtual void close ()
 
virtual void open ()
 
virtual bool isMainContentVisible ()
 
virtual void setMainContentVisibility (bool visible)
 
DtVreMessageResult handleBackButtonClicked (DtVreMessage *msg)
 
DtVreMessageResult handleEscapeMessage (DtVreMessage *msg)
 

Protected Member Functions

virtual void connectToHeaderFooter ()
 
virtual void onConnectionClicked ()
 
virtual void onPopupOpened ()
 
virtual void onPopupClosed ()
 
virtual void onAppModeChanged (const std::string &newAppMode, const std::string &oldAppMode)
 

Protected Attributes

DtPlayerStationApp & myApp
 
QQuickItem * myRoot
 
std::string myTargetWindow
 
std::string myTargetFile
 
std::string myMainContentId
 

Private Attributes

DtVreHeaderFooterUI * myHeaderFooterUI
 

Constructor & Destructor Documentation

◆ DtVreBaseUI()

makVre::DtVreBaseUI::DtVreBaseUI ( DtPlayerStationApp & app,
const std::string & file,
const std::string & target_window = "" )

Constructor.

Parameters
appReference to the player station application
filePath to the QML file defining the UI (relative to UI root)
target_windowName of the target window (empty for default)

Loads the specified QML file asynchronously. When loading completes, the callback sets myRoot, calls initMain(), connects to the shared header/footer, and hides the page.

◆ ~DtVreBaseUI()

virtual makVre::DtVreBaseUI::~DtVreBaseUI ( )
overridevirtual

Virtual destructor.

Member Function Documentation

◆ initMain()

virtual void makVre::DtVreBaseUI::initMain ( )
pure virtual

Initializes page-specific QML elements.

Called once from the QML load callback after myRoot is set. Derived classes set up QML context properties, signal connections, and initial element state here.

Implemented in makVre::DtVreAppPage, makVre::DtVreChooseRolePage, makVre::DtVreHeaderFooterUI, makVre::DtVreLoadingPage, makVre::DtVreLoadingPlayerPage, makVre::DtVreSelectConnectionPage, makVre::DtVreStartPage, and makVre::DtVreWaitingPage.

◆ tick()

virtual void makVre::DtVreBaseUI::tick ( double dt)
pure virtual

◆ setVisibility()

virtual void makVre::DtVreBaseUI::setVisibility ( bool visible)
virtual

Visibility control.

Sets the visibility of this page

Parameters
visibleTrue to show, false to hide

Toggles the root QML item visibility, enabled state, and focus.

Reimplemented in makVre::DtVreAppPage, makVre::DtVreChooseRolePage, makVre::DtVreHeaderFooterUI, makVre::DtVreLoadingPage, makVre::DtVreLoadingPlayerPage, makVre::DtVreSelectConnectionPage, makVre::DtVreStartPage, and makVre::DtVreWaitingPage.

◆ isVisible()

virtual bool makVre::DtVreBaseUI::isVisible ( )
virtual

Checks whether this page is visible.

Returns
True if the root QML item is visible

◆ close()

virtual void makVre::DtVreBaseUI::close ( )
virtual

Hides the page.

◆ open()

virtual void makVre::DtVreBaseUI::open ( )
virtual

Shows the page.

Referenced by makVre::DtVreHeaderFooterUI::updateModalState().

◆ isMainContentVisible()

virtual bool makVre::DtVreBaseUI::isMainContentVisible ( )
virtual

Main content visibility.

◆ setMainContentVisibility()

virtual void makVre::DtVreBaseUI::setMainContentVisibility ( bool visible)
virtual

Main content visibility.

◆ handleBackButtonClicked()

DtVreMessageResult makVre::DtVreBaseUI::handleBackButtonClicked ( DtVreMessage * msg)

Connection-page back-navigation handlers.

Handles back-button messages while the connection page is open

Parameters
msgThe UIBackButtonClickedMessage
Returns
EATEN if the connection page was visible, IGNORED otherwise

◆ handleEscapeMessage()

DtVreMessageResult makVre::DtVreBaseUI::handleEscapeMessage ( DtVreMessage * msg)

Handles escape messages while the connection page is open.

Parameters
msgThe EscapeMessage
Returns
EATEN if the connection page was visible, IGNORED otherwise

◆ root()

QQuickItem * makVre::DtVreBaseUI::root ( )

Provides access to the root QML item.

Returns
A non-owning pointer to the root QQuickItem, or nullptr if not loaded

◆ headerFooterUI()

DtVreHeaderFooterUI * makVre::DtVreBaseUI::headerFooterUI ( )

Provides access to the shared header/footer UI.

Returns
A non-owning pointer to the DtVreHeaderFooterUI instance, or nullptr

◆ connectToHeaderFooter()

virtual void makVre::DtVreBaseUI::connectToHeaderFooter ( )
protectedvirtual

Called after initMain() in the QML load callback.

Connects this page to the shared DtVreHeaderFooterUI signals (connectionClicked, popupOpened, popupClosed, appModeChanged). Override in DtVreHeaderFooterUI to skip self-connection.

Reimplemented in makVre::DtVreHeaderFooterUI.

◆ onConnectionClicked()

virtual void makVre::DtVreBaseUI::onConnectionClicked ( )
protectedvirtual

Default handler for the connection-clicked signal.

Opens the SelectConnectionPage and registers back/escape handlers so the user can return to this page. Override in derived classes for custom behavior (e.g., hiding a panel before navigating).

Reimplemented in makVre::DtVreChooseRolePage, makVre::DtVreSelectConnectionPage, and makVre::DtVreWaitingPage.

◆ onPopupOpened()

virtual void makVre::DtVreBaseUI::onPopupOpened ( )
protectedvirtual

Default handler for popup-opened signal.

Called when any popup (settings, help, exit) opens in the shared header/footer. Base implementation does nothing.

Reimplemented in makVre::DtVreChooseRolePage.

◆ onPopupClosed()

virtual void makVre::DtVreBaseUI::onPopupClosed ( )
protectedvirtual

Default handler for popup-closed signal.

Called when any popup closes. Base implementation does nothing.

Reimplemented in makVre::DtVreChooseRolePage.

◆ onAppModeChanged()

virtual void makVre::DtVreBaseUI::onAppModeChanged ( const std::string & newAppMode,
const std::string & oldAppMode )
protectedvirtual

Default handler for application-mode-changed signal.

Parameters
newAppModeThe new application mode identifier
oldAppModeThe previous application mode identifier

Called when the application mode changes. Base implementation does nothing. Override in pages that show mode-dependent UI.

Reimplemented in makVre::DtVreChooseRolePage, makVre::DtVreSelectConnectionPage, and makVre::DtVreStartPage.

Member Data Documentation

◆ myApp

DtPlayerStationApp& makVre::DtVreBaseUI::myApp
protected

Reference to the player station application.

◆ myRoot

QQuickItem* makVre::DtVreBaseUI::myRoot
protected

Pointer to the root QML item (set asynchronously after load)

◆ myTargetWindow

std::string makVre::DtVreBaseUI::myTargetWindow
protected

Target window name (empty for default)

◆ myTargetFile

std::string makVre::DtVreBaseUI::myTargetFile
protected

Relative path to the QML file.

◆ myMainContentId

std::string makVre::DtVreBaseUI::myMainContentId
protected

Object name of the main content element in QML.

◆ myHeaderFooterUI

DtVreHeaderFooterUI* makVre::DtVreBaseUI::myHeaderFooterUI
private

Cached pointer to the shared header/footer UI.


The documentation for this class was generated from the following file: