VR-Engage  2.2
Loading...
Searching...
No Matches
playerStationPersistentNotification.h
Go to the documentation of this file.
1/******************************************************************************
2** Copyright (c) 2025 MAK Technologies
3** All rights reserved.
4******************************************************************************/
5
6//! \file playerStationPersistentNotification.h
7//! \brief Defines a UI component for persistent notifications in VR-Engage
8//!
9//! This file contains the DtPlayerStationPersistentNotification class which
10//! provides a persistent notification system that can display state information
11//! to the user, such as the current play/pause state during engagement.
12
13#pragma once
14
17
18#include <QObject>
19
20//! \brief Forward declaration of QQuickItem
21class QQuickItem;
22
23namespace makVre
24{
25//! \brief Forward declaration of the player station application class
27
28//! \brief Persistent notification UI component for VR-Engage
29//!
30//! DtPlayerStationPersistentNotification provides a UI component for displaying
31//! persistent notifications to the user during gameplay. It typically shows
32//! important state information, such as whether the simulation is running or paused,
33//! and can be positioned in the header or footer area of the application window.
35{
36 Q_OBJECT;
37
38public:
39 //! \brief Constructor
40 //! \param app Reference to the player station application
41 //! \param target_window Name of the target window to display in (empty for default)
42 //!
43 //! Creates a new persistent notification component associated with the
44 //! specified player station application and target window.
45 DtPlayerStationPersistentNotification(DtPlayerStationApp& app, const std::string& target_window = "");
46
47 //! \brief Virtual destructor
48 //!
49 //! Ensures proper cleanup of notification resources.
51
52 //! \brief Initializes the main notification UI
53 //!
54 //! Sets up the QML components and connects signals and slots for
55 //! the notification system. This should be called after construction
56 //! but before the notification is used.
57 virtual void initMain() override;
58
59 //! \brief Updates the notification each frame
60 //! \param dt Time in seconds since the last update
61 //!
62 //! Handles per-frame updates for the notification, such as
63 //! checking for state changes that should be displayed.
64 virtual void tick(double dt) override;
65
66 //! \brief Sets the visibility of the notification
67 //! \param visible True to show the notification, false to hide it
68 //!
69 //! Controls whether the notification is visible to the user.
70 //! This overrides the base class implementation to provide
71 //! notification-specific visibility behavior.
72 virtual void setVisibility(bool visible) override;
73
74 //! \brief Checks if the notification is visible
75 //! \return True if the notification is visible, false otherwise
76 //!
77 //! Currently commented out implementation of isVisible() override.
78 // virtual bool isVisible() override;
79
80public slots:
81 //! \brief Handles updates to the simulation running state
82 //! \param runState True if the simulation is running, false if paused
83 //!
84 //! Slot called from QML when the running state changes, allowing
85 //! the notification to update its display accordingly.
86 virtual void runningStateUpdated(bool runState) override;
87
88protected:
89 //! \brief Sets the running state for the notification
90 //! \param running True if the simulation is running, false if paused
91 //!
92 //! Updates the internal running state and triggers UI updates
93 //! to reflect the new state in the notification display.
94 virtual void setRunning(bool running);
95
96protected:
97 //! \brief Flag indicating whether the simulation is currently playing
98 //!
99 //! Tracks whether the simulation is in a running (true) or paused (false) state.
100 //! This affects how the notification is displayed to the user.
102};
103} // namespace makVre
Top-level class representing the VR-Engage application.
Definition playerStationApp.h:163
DtPlayerStationPersistentNotification(DtPlayerStationApp &app, const std::string &target_window="")
Constructor.
virtual void setVisibility(bool visible) override
Sets the visibility of the notification.
virtual ~DtPlayerStationPersistentNotification() override
Virtual destructor.
bool myIsPlaying
Flag indicating whether the simulation is currently playing.
Definition playerStationPersistentNotification.h:101
virtual void tick(double dt) override
Updates the notification each frame.
virtual void runningStateUpdated(bool runState) override
Checks if the notification is visible.
virtual void setRunning(bool running)
Sets the running state for the notification.
virtual void initMain() override
Initializes the main notification UI.
Defines export macros for the VR-Engage Player Station library.
#define PLAYERSTATION_DLL
Definition export.h:24
Include export definitions for this library.
Definition glsVreMessageUtil.h:49