VR-Engage  2.3
Loading...
Searching...
No Matches
vreHeaderFooterUI.h
Go to the documentation of this file.
1/******************************************************************************
2** Copyright (c) 2025 MAK Technologies
3** All rights reserved.
4******************************************************************************/
5
6//! \file vreHeaderFooterUI.h
7//! \brief Defines the shared header/footer UI component for VR-Engage
8//!
9//! DtVreHeaderFooterUI owns the single persistent Header and Footer layer
10//! (persistentNotification.qml). All page-specific QML files no longer
11//! embed their own Header/Footer. Pages configure the shared instance
12//! through its public API and react to its Qt signals.
13
14#pragma once
15
18
19#include <QObject>
21
22class QQuickItem;
23
24namespace makVre
25{
27
28//! \brief Shared header/footer UI component
29//!
30//! Loads persistentNotification.qml (which contains VREItems.Header and
31//! VREItems.Footer). Handles all header QML signals (play, pause, rewind,
32//! connection, settings, help, exit) internally and emits Qt signals so
33//! the currently visible page can react. Provides a configuration API
34//! so pages can set the title, cutout visibility, controls, etc.
36{
37 Q_OBJECT
38
39public:
40 //! \brief Constructor
41 //! \param app Reference to the player station application
42 //! \param target_window Name of the target window (empty for default)
43 DtVreHeaderFooterUI(DtPlayerStationApp& app, const std::string& target_window = "");
44
45 //! \brief Virtual destructor
46 virtual ~DtVreHeaderFooterUI() override;
47
48 //! \brief Initializes header/footer signal connections and initial state
49 virtual void initMain() override;
50
51 //! \brief Per-frame update (currently empty)
52 virtual void tick(double dt) override;
53
54 //! \brief Animation-based show/hide for the header/footer
55 //! \param visible True triggers slide-in animation, false triggers slide-out
56 virtual void setVisibility(bool visible) override;
57
58 //! \brief Persistent mode control
59 //! @{
60
61 //! \brief Sets persistent mode
62 //! \param persistent When true, header/footer stays visible (no auto-hide timer)
63 virtual void setPersistent(bool persistent);
64
65 //! \brief Checks persistent mode
66 //! \return True if the header/footer is in persistent mode
67 virtual bool isPersistent() const;
68 //! @}
69
70 //! \brief Header configuration API
71 //! @{
72 virtual void setMenuTitle(const QString& title);
73 virtual void setShowCutoutVisible(bool visible);
74 virtual void setShowCutoutControlsVisible(bool visible);
75 virtual void setButtonEnabled(const std::string& id, bool enabled);
76 virtual bool isButtonEnabled(const std::string& id);
77 virtual void updateCutoutControlsEnabled(bool enabled);
78 virtual void setShowTopRightControlsVisible(bool visible);
79
80 virtual bool isHeaderVisible();
81 virtual void setHeaderVisibility(bool visible);
82 //! @}
83
84 //! \brief Footer configuration API
85 //! @{
86 virtual bool isFooterVisible();
87 virtual void setFooterVisibility(bool visible);
88 virtual void setShowBottomBackButtonVisible(bool visible);
89 //! @}
90
91signals:
92 //! \brief Emitted when the header's connection button is clicked
93 //!
94 //! Pages connected to this signal should check isVisible() and handle
95 //! navigation to the connection page (or override the default in DtVreBaseUI).
97
98 //! \brief Emitted when any popup (settings, help, exit) opens
99 //!
100 //! Pages connected to this signal can hide content panels during popups.
102
103 //! \brief Emitted when any popup (settings, help, exit) closes
104 //!
105 //! Pages connected to this signal can restore content panels after popups.
107
108 //! \brief Emitted when the application mode changes
109 //! \param newAppMode The new mode identifier (e.g. "admin", "user")
110 //! \param oldAppMode The previous mode identifier
111 void sig_appModeChanged(const std::string& newAppMode, const std::string& oldAppMode);
112
113public slots:
114 //! \brief Header QML signal handlers
115 //! @{
117 virtual void slot_playClicked();
118 virtual void slot_pauseClicked();
119 virtual void slot_rewindClicked();
120 //! @}
121
122 //! \brief Settings popup lifecycle
123 //! @{
124 virtual void slot_settingsOpened();
125 virtual void slot_settingsClosed();
129 virtual void slot_aboutClicked();
130 virtual void slot_soundVolumeChanged(qreal volume);
131 virtual void slot_soundEnabledChanged(bool enabled);
132 //! @}
133
134 //! \brief Exit dialog lifecycle
135 //! @{
136 virtual void slot_exitOpened();
137 virtual void slot_exitClosed();
138 virtual void slot_exitAccepted();
139 virtual void slot_exitRejected();
140 //! @}
141
142 //! \brief Help popup lifecycle
143 //! @{
144 virtual void slot_helpOpened();
145 virtual void slot_helpClosed();
146 //! @}
147
148 //! \brief Footer back button
149 virtual void slot_backClicked();
150
151 //! \brief Running state updated from QML
152 //! \param runState True if running, false if paused
153 virtual void runningStateUpdated(bool runState);
154
155 //! \brief Header/Footer visbility changes
158
159protected:
160 //! \brief No-op — this class IS the header/footer, so it does not connect to itself
161 virtual void connectToHeaderFooter() override;
162
163 //! \brief Sets the running state on the QML root
164 virtual void setRunning(bool running);
165
166 //! \brief Closes VRV settings page collections
167 virtual void closeAllSettingsPages(std::string pageName = "");
168
169 //! \brief Updates the modal state attribute
170 virtual void updateModalState(bool open);
171
172 //! \brief Updates settings popup admin mode when app mode changes
173 virtual void appModeUpdated(const std::string& newAppMode, const std::string& oldAppMode);
174
175 //! \brief VRE message handlers
176 //! @{
183 //! @}
184
185protected:
186 //! \brief Header element object name in QML
187 std::string myHeaderId;
188
189 //! \brief Footer element object name in QML
190 std::string myFooterId;
191
192 //! \brief Whether the simulation is currently playing
194
195 //! \brief Whether persistent mode is active
197
200};
201} // namespace makVre
Provides handle classes for safe access to attributes.
Type-specific handle class for attributes.
Definition attributeHandle.h:229
Top-level class representing the VR-Engage application.
Definition playerStationApp.h:155
virtual void open()
Shows the page.
DtVreBaseUI(DtPlayerStationApp &app, const std::string &file, const std::string &target_window="")
Constructor.
Abstract base class for all VREngage messages.
Definition vreMessage.h:50
Defines export macros for the VR-Engage Player Station library.
#define PLAYERSTATION_DLL
Definition export.h:24
!
Definition glsVreMessageUtil.h:50
DtVreMessageResult
Enumeration of possible message handling results.
Definition vreMessage.h:33
Defines the thin base class for VR-Engage QML page components.