|
VR-Engage
2.2
|
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 () |
| virtual bool | isFullChatVisible () |
| virtual void | close () |
| virtual void | open () |
| virtual void | openOrFocus () |
| virtual void | togglePinChat () |
| DtVreChatQML * | getChatObject () |
| virtual void | updatePositionFromState (const std::string &state) |
| virtual DtFilename | getChatConfigFile (const DtFilename &scenarioFilename) |
| virtual bool | updateChatChannelsFromScenario (const DtFilename &scenario) |
| virtual bool | updateChatChannelsFromConfigFile (const DtFilename &chatConfigFile) |
Protected Member Functions | |
| makVre::DtVreMessageResult | handlePlayerCreatedMessage (DtVreMessage *msg) |
| makVre::DtVreMessageResult | handlePlayerDestroyedMessage (DtVreMessage *msg) |
| makVre::DtVreMessageResult | handleIncomingChatMessage (DtVreMessage *msg) |
| makVre::DtVreMessageResult | handleVrfSessionStatusMessage (DtVreMessage *msg) |
| virtual void | onCurrentStateChanged (std::string state) |
Protected Attributes | |
| std::unique_ptr< DtVreChatQML > | myChatObject |
| QQuickItem * | myRoot |
| DtPlayerStationApp & | myApp |
| DtFilename | myDefaultChatConfigFile |
| DtFilename | myCurrentChatConfigFile |
| DtFilename | myDefaultConfigFilename = "defaultChatConfig.mtl" |
| DtFilename | myDefaultConfigDirectory = "$(APP_DIR)/settings" |
| DtFilename | myDefaultChatConfigUserFilenamePostfix = "_ChatConfig.mtl" |
| DtFilename | myDefaultChatConfigUserDirectory = "$(USER_DIR)/chatConfigs" |
| DtAttributeCallbackManager | myAttributeCallbacks |
| 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.
|
virtual |
Checks if the chat window is currently visible.
|
virtual |
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.
|
virtual |
Closes the chat window.
Hides the chat window and performs any necessary cleanup.
|
virtual |
Opens the chat window.
Shows the chat window and ensures it's properly initialized.
|
virtual |
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.
|
virtual |
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.
| 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.
|
virtual |
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.
|
virtual |
Gets the chat configuration file for a scenario.
| scenarioFilename | Filename of the scenario (can be empty) |
Determines the appropriate chat configuration file to use based on the scenario name. If a scenario-specific chat configuration exists, it will be returned; otherwise, the default chat configuration file is returned.
|
virtual |
Updates chat channels based on a scenario file.
| scenario | Filename of the scenario |
Updates the available chat channels based on the specified scenario. Returns true if the chat configuration changed as a result of this update.
|
virtual |
Updates chat channels from a configuration file.
| chatConfigFile | Path to the chat configuration file |
Loads chat channel definitions from the specified configuration file and updates the available channels. Returns true if the configuration changed as a result of this update.
|
protected |
Handles messages about player entity creation.
| msg | Pointer to the player created message |
Processes notifications about new player entities being created, updating channel participant lists and potentially adjusting the current username if this is the local player.
|
protected |
Handles messages about player entity destruction.
| msg | Pointer to the player destroyed message |
Processes notifications about player entities being removed, updating channel participant lists accordingly.
|
protected |
Handles incoming chat messages.
| msg | Pointer to the incoming chat message |
Processes incoming chat messages from other participants or the system, adding them to the appropriate channel and updating the UI.
|
protected |
Handles session status messages.
| msg | Pointer to the session status message |
Processes notifications about changes to the VRF session status, adjusting the chat system's state accordingly.
|
protectedvirtual |
Handles changes to the current application state.
| state | New application state identifier |
Called when the application state changes, allowing the chat window to adjust its appearance, position, and behavior to suit the new state.
|
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 |
Path to the default chat configuration file.
|
protected |
Path to the current chat configuration file in use.
|
protected |
Default configuration filename.
|
protected |
Directory containing default configuration files.
|
protected |
Filename postfix for user-specific chat configurations.
|
protected |
Directory containing user-specific chat configurations.
|
protected |
Member-scope instance of Attribute callback manager.
Used to manage Attribute change callback connections and ensure that all callbacks are unregistered when this class instance is destroyed.