VR-Engage  2.2
Loading...
Searching...
No Matches
makVre::DtVreChatWindow Class Reference

Detailed Description

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>

Inheritance diagram for makVre::DtVreChatWindow:
[legend]

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 ()
 
DtVreChatQMLgetChatObject ()
 
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< DtVreChatQMLmyChatObject
 
QQuickItem * myRoot
 
DtPlayerStationAppmyApp
 
DtFilename myDefaultChatConfigFile
 
DtFilename myCurrentChatConfigFile
 
DtFilename myDefaultConfigFilename = "defaultChatConfig.mtl"
 
DtFilename myDefaultConfigDirectory = "$(APP_DIR)/settings"
 
DtFilename myDefaultChatConfigUserFilenamePostfix = "_ChatConfig.mtl"
 
DtFilename myDefaultChatConfigUserDirectory = "$(USER_DIR)/chatConfigs"
 
DtAttributeCallbackManager myAttributeCallbacks
 

Constructor & Destructor Documentation

◆ DtVreChatWindow()

makVre::DtVreChatWindow::DtVreChatWindow ( DtPlayerStationApp & app)

Constructor.

Parameters
appReference 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.

◆ ~DtVreChatWindow()

virtual makVre::DtVreChatWindow::~DtVreChatWindow ( )
overridevirtual

Virtual destructor.

Ensures proper cleanup of chat window resources.

Member Function Documentation

◆ setVisibility()

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

Sets the visibility of the chat window.

Parameters
visibleTrue 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.

◆ isVisible()

virtual bool makVre::DtVreChatWindow::isVisible ( )
virtual

Checks if the chat window is currently visible.

Returns
True if the chat window is visible, false otherwise

◆ isFullChatVisible()

virtual bool makVre::DtVreChatWindow::isFullChatVisible ( )
virtual

Checks if the full chat window is visible.

Returns
True if the full chat window is visible, false if minimized or hidden

Determines if the chat window is fully visible, as opposed to being minimized or showing only a notification area.

◆ close()

virtual void makVre::DtVreChatWindow::close ( )
virtual

Closes the chat window.

Hides the chat window and performs any necessary cleanup.

◆ open()

virtual void makVre::DtVreChatWindow::open ( )
virtual

Opens the chat window.

Shows the chat window and ensures it's properly initialized.

◆ openOrFocus()

virtual void makVre::DtVreChatWindow::openOrFocus ( )
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.

◆ togglePinChat()

virtual void makVre::DtVreChatWindow::togglePinChat ( )
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.

◆ getChatObject()

DtVreChatQML * makVre::DtVreChatWindow::getChatObject ( )

Gets the chat QML object.

Returns
Pointer to the chat QML interface, or nullptr if not available

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.

◆ updatePositionFromState()

virtual void makVre::DtVreChatWindow::updatePositionFromState ( const std::string & state)
virtual

Updates the chat window position based on application state.

Parameters
stateCurrent 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.

◆ getChatConfigFile()

virtual DtFilename makVre::DtVreChatWindow::getChatConfigFile ( const DtFilename & scenarioFilename)
virtual

Gets the chat configuration file for a scenario.

Parameters
scenarioFilenameFilename of the scenario (can be empty)
Returns
Path to the appropriate chat configuration file

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.

◆ updateChatChannelsFromScenario()

virtual bool makVre::DtVreChatWindow::updateChatChannelsFromScenario ( const DtFilename & scenario)
virtual

Updates chat channels based on a scenario file.

Parameters
scenarioFilename of the scenario
Returns
True if the chat configuration changed, false otherwise

Updates the available chat channels based on the specified scenario. Returns true if the chat configuration changed as a result of this update.

◆ updateChatChannelsFromConfigFile()

virtual bool makVre::DtVreChatWindow::updateChatChannelsFromConfigFile ( const DtFilename & chatConfigFile)
virtual

Updates chat channels from a configuration file.

Parameters
chatConfigFilePath to the chat configuration file
Returns
True if the chat configuration changed, false otherwise

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.

◆ handlePlayerCreatedMessage()

makVre::DtVreMessageResult makVre::DtVreChatWindow::handlePlayerCreatedMessage ( DtVreMessage * msg)
protected

Handles messages about player entity creation.

Parameters
msgPointer to the player created message
Returns
Message handling result

Processes notifications about new player entities being created, updating channel participant lists and potentially adjusting the current username if this is the local player.

◆ handlePlayerDestroyedMessage()

makVre::DtVreMessageResult makVre::DtVreChatWindow::handlePlayerDestroyedMessage ( DtVreMessage * msg)
protected

Handles messages about player entity destruction.

Parameters
msgPointer to the player destroyed message
Returns
Message handling result

Processes notifications about player entities being removed, updating channel participant lists accordingly.

◆ handleIncomingChatMessage()

makVre::DtVreMessageResult makVre::DtVreChatWindow::handleIncomingChatMessage ( DtVreMessage * msg)
protected

Handles incoming chat messages.

Parameters
msgPointer to the incoming chat message
Returns
Message handling result

Processes incoming chat messages from other participants or the system, adding them to the appropriate channel and updating the UI.

◆ handleVrfSessionStatusMessage()

makVre::DtVreMessageResult makVre::DtVreChatWindow::handleVrfSessionStatusMessage ( DtVreMessage * msg)
protected

Handles session status messages.

Parameters
msgPointer to the session status message
Returns
Message handling result

Processes notifications about changes to the VRF session status, adjusting the chat system's state accordingly.

◆ onCurrentStateChanged()

virtual void makVre::DtVreChatWindow::onCurrentStateChanged ( std::string state)
protectedvirtual

Handles changes to the current application state.

Parameters
stateNew 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.

Member Data Documentation

◆ myChatObject

std::unique_ptr<DtVreChatQML> makVre::DtVreChatWindow::myChatObject
protected

Chat QML interface object.

Manages the bridge between C++ and QML for chat functionality.

◆ myRoot

QQuickItem* makVre::DtVreChatWindow::myRoot
protected

Root QML item for the chat window.

The top-level QML item that contains the entire chat window UI.

◆ myApp

DtPlayerStationApp& makVre::DtVreChatWindow::myApp
protected

Reference to the player station application.

Provides access to application services during chat operations.

◆ myDefaultChatConfigFile

DtFilename makVre::DtVreChatWindow::myDefaultChatConfigFile
protected

Path to the default chat configuration file.

◆ myCurrentChatConfigFile

DtFilename makVre::DtVreChatWindow::myCurrentChatConfigFile
protected

Path to the current chat configuration file in use.

◆ myDefaultConfigFilename

DtFilename makVre::DtVreChatWindow::myDefaultConfigFilename = "defaultChatConfig.mtl"
protected

Default configuration filename.

◆ myDefaultConfigDirectory

DtFilename makVre::DtVreChatWindow::myDefaultConfigDirectory = "$(APP_DIR)/settings"
protected

Directory containing default configuration files.

◆ myDefaultChatConfigUserFilenamePostfix

DtFilename makVre::DtVreChatWindow::myDefaultChatConfigUserFilenamePostfix = "_ChatConfig.mtl"
protected

Filename postfix for user-specific chat configurations.

◆ myDefaultChatConfigUserDirectory

DtFilename makVre::DtVreChatWindow::myDefaultChatConfigUserDirectory = "$(USER_DIR)/chatConfigs"
protected

Directory containing user-specific chat configurations.

◆ myAttributeCallbacks

DtAttributeCallbackManager makVre::DtVreChatWindow::myAttributeCallbacks
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.


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