|
VR-Engage
2.3
|
DtVreChatWindow manages the chat window user interface in VR-Engage, including its visibility, position, and content. It serves as the primary interface between the application and the chat functionality, coordinating message handling, configuration loading, and UI state management. This class uses the DtVreChatQML class to bridge between C++ and the QML-based UI.
#include <vreChatWindow.h>
Public Member Functions | |
| DtVreChatWindow (DtPlayerStationApp &app) | |
| virtual | ~DtVreChatWindow () override |
| virtual void | setVisibility (bool visible) |
| virtual bool | isVisible () const override |
| virtual bool | isFullChatVisible () const override |
| virtual void | close () override |
| virtual void | open () override |
| virtual void | openOrFocus () override |
| virtual void | togglePinChat () override |
| virtual void | send (const std::string &message) override |
| virtual void | sendChatMessage (const std::string &message, const std::string &channel, int force) override |
| virtual void | sendToSystemChannel (const std::string &message) override |
| virtual bool | isChannelActive (const std::string &channelName, int force) const override |
| virtual bool | addChannel (const std::string &channelName, int force, bool active, const std::vector< std::string > &entities) override |
| virtual void | updateAvailableChannels () override |
| virtual void | clearChannels () override |
| virtual void | setEntityMarkingText (const std::string &text) override |
| virtual void | setEntityForce (int force) override |
| virtual void | setEntityRole (const std::string &role) override |
| virtual void | updateUsername () override |
| virtual void | displayReceivedMessage (const std::string &username, int force, const std::string &channel, const std::string &message) override |
| DtVreChatQML * | getChatObject () |
| virtual void | updatePositionFromState (const std::string &state) override |
| virtual bool | isShowingAllowed () const override |
| virtual void | setShowingAllowed (const bool canShow) override |
Public Member Functions inherited from makVre::DtChatWindowInterface | |
| virtual | ~DtChatWindowInterface ()=default |
Protected Attributes | |
| std::unique_ptr< DtVreChatQML > | myChatObject |
| QQuickItem * | myRoot |
| DtPlayerStationApp & | myApp |
| bool | myCanShowChatWindow = false |
| makVre::DtVreChatWindow::DtVreChatWindow | ( | DtPlayerStationApp & | app | ) |
Constructor.
| app | Reference to the player station application |
Creates a new chat window manager associated with the specified application. The constructor initializes the chat UI and establishes necessary connections to the message system for handling chat-related messages.
|
overridevirtual |
Virtual destructor.
Ensures proper cleanup of chat window resources.
|
virtual |
Sets the visibility of the chat window.
| visible | True to show the window, false to hide it |
Controls the visibility of the entire chat window. This affects the root object of the chat UI, not individual components within it.
|
overridevirtual |
Checks if the chat window is currently visible.
Implements makVre::DtChatWindowInterface.
|
overridevirtual |
Checks if the full chat window is visible.
Determines if the chat window is fully visible, as opposed to being minimized or showing only a notification area.
Implements makVre::DtChatWindowInterface.
|
overridevirtual |
Closes the chat window.
Hides the chat window and performs any necessary cleanup.
Implements makVre::DtChatWindowInterface.
|
overridevirtual |
Opens the chat window.
Shows the chat window and ensures it's properly initialized.
Implements makVre::DtChatWindowInterface.
|
overridevirtual |
Opens the chat window or gives it focus if already open.
If the chat window is already open, this gives it focus. Otherwise, it opens the window. This is typically used when the user invokes the chat functionality through a hotkey or menu option.
Implements makVre::DtChatWindowInterface.
|
overridevirtual |
Toggles the pinned state of the chat window.
Switches between pinned (always visible) and unpinned (auto-hide) states for the chat window. This affects how the chat behaves when the user interacts with other parts of the application.
Implements makVre::DtChatWindowInterface.
|
overridevirtual |
Sends a message or slash command to the chat system.
| message | Text message or /command string |
Implements makVre::DtChatWindowInterface.
|
overridevirtual |
Sends a chat message to a specific channel.
| message | Text message to send |
| channel | Target channel name |
| force | Force identifier for the channel |
Implements makVre::DtChatWindowInterface.
|
overridevirtual |
Sends a message to the system (notification) channel.
| message | Text to display in the system channel |
Implements makVre::DtChatWindowInterface.
|
overridevirtual |
Checks whether a channel is currently active.
| channelName | Name of the channel to check |
| force | Force identifier of the channel |
Implements makVre::DtChatWindowInterface.
|
overridevirtual |
Adds a channel to the available channels list.
| channelName | Name of the channel |
| force | Force identifier associated with the channel |
| active | Whether the channel starts active |
| entities | List of entity markings that belong to this channel |
Implements makVre::DtChatWindowInterface.
|
overridevirtual |
Refreshes the active-channel list based on current entity state.
Implements makVre::DtChatWindowInterface.
|
overridevirtual |
Removes all channels from the chat system.
Implements makVre::DtChatWindowInterface.
|
overridevirtual |
Sets the entity marking text used for username generation.
| text | Marking (call sign) of the local entity |
Implements makVre::DtChatWindowInterface.
|
overridevirtual |
Sets the entity force identifier used for channel filtering.
| force | Force identifier |
Implements makVre::DtChatWindowInterface.
|
overridevirtual |
Sets the entity role used for username generation.
| role | Role description string |
Implements makVre::DtChatWindowInterface.
|
overridevirtual |
Regenerates the displayed username from current settings.
Implements makVre::DtChatWindowInterface.
|
overridevirtual |
Displays an incoming chat message received over the network.
| username | Sender's username |
| force | Force identifier of the sender |
| channel | Channel the message arrived on |
| message | Raw message text (will be HTML-converted by the implementation) |
Implements makVre::DtChatWindowInterface.
| DtVreChatQML * makVre::DtVreChatWindow::getChatObject | ( | ) |
Gets the chat QML object.
Provides access to the underlying DtVreChatQML object that manages the chat functionality. The caller does not take ownership of the returned pointer and should not delete it.
|
overridevirtual |
Updates the chat window position based on application state.
| state | Current application state identifier |
Adjusts the position of the chat window based on the current state of the application. Different states may require different positioning to avoid interfering with other UI elements.
Implements makVre::DtChatWindowInterface.
|
inlineoverridevirtual |
Checks if the chat window is allowed to be shown.
Indicates whether the chat window has permission to be displayed. This is separate from whether it is currently visible. The chat may be allowed but not currently shown, or may be disallowed entirely.
Implements makVre::DtChatWindowInterface.
References myCanShowChatWindow.
|
inlineoverridevirtual |
Sets whether the chat window is allowed to be shown.
Controls whether the chat window has permission to be displayed. When set to false, the chat window cannot be opened regardless of user actions. This does not affect the current visibility state directly.
| canShow | True to allow the chat window to be shown, false to disallow |
Implements makVre::DtChatWindowInterface.
References myCanShowChatWindow.
|
protected |
Chat QML interface object.
Manages the bridge between C++ and QML for chat functionality.
|
protected |
Root QML item for the chat window.
The top-level QML item that contains the entire chat window UI.
|
protected |
Reference to the player station application.
Provides access to application services during chat operations.
|
protected |
Whether the chat window can be shown.
Stores whether the chat window is permitted to be displayed. This is used to control chat window availability based on player station state transitions.
Default value is false.
Referenced by isShowingAllowed(), and setShowingAllowed().