VR-Engage  2.3
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 () 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
 

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 ( ) const
overridevirtual

Checks if the chat window is currently visible.

Returns
True if the chat window is visible, false otherwise

Implements makVre::DtChatWindowInterface.

◆ isFullChatVisible()

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

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.

Implements makVre::DtChatWindowInterface.

◆ close()

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

Closes the chat window.

Hides the chat window and performs any necessary cleanup.

Implements makVre::DtChatWindowInterface.

◆ open()

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

Opens the chat window.

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

Implements makVre::DtChatWindowInterface.

◆ openOrFocus()

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

◆ togglePinChat()

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

◆ send()

virtual void makVre::DtVreChatWindow::send ( const std::string & message)
overridevirtual

Sends a message or slash command to the chat system.

Parameters
messageText message or /command string

Implements makVre::DtChatWindowInterface.

◆ sendChatMessage()

virtual void makVre::DtVreChatWindow::sendChatMessage ( const std::string & message,
const std::string & channel,
int force )
overridevirtual

Sends a chat message to a specific channel.

Parameters
messageText message to send
channelTarget channel name
forceForce identifier for the channel

Implements makVre::DtChatWindowInterface.

◆ sendToSystemChannel()

virtual void makVre::DtVreChatWindow::sendToSystemChannel ( const std::string & message)
overridevirtual

Sends a message to the system (notification) channel.

Parameters
messageText to display in the system channel

Implements makVre::DtChatWindowInterface.

◆ isChannelActive()

virtual bool makVre::DtVreChatWindow::isChannelActive ( const std::string & channelName,
int force ) const
overridevirtual

Checks whether a channel is currently active.

Parameters
channelNameName of the channel to check
forceForce identifier of the channel
Returns
True if the channel is active, false otherwise

Implements makVre::DtChatWindowInterface.

◆ addChannel()

virtual bool makVre::DtVreChatWindow::addChannel ( const std::string & channelName,
int force,
bool active,
const std::vector< std::string > & entities )
overridevirtual

Adds a channel to the available channels list.

Parameters
channelNameName of the channel
forceForce identifier associated with the channel
activeWhether the channel starts active
entitiesList of entity markings that belong to this channel
Returns
True if the channel was added, false if it already existed

Implements makVre::DtChatWindowInterface.

◆ updateAvailableChannels()

virtual void makVre::DtVreChatWindow::updateAvailableChannels ( )
overridevirtual

Refreshes the active-channel list based on current entity state.

Implements makVre::DtChatWindowInterface.

◆ clearChannels()

virtual void makVre::DtVreChatWindow::clearChannels ( )
overridevirtual

Removes all channels from the chat system.

Implements makVre::DtChatWindowInterface.

◆ setEntityMarkingText()

virtual void makVre::DtVreChatWindow::setEntityMarkingText ( const std::string & text)
overridevirtual

Sets the entity marking text used for username generation.

Parameters
textMarking (call sign) of the local entity

Implements makVre::DtChatWindowInterface.

◆ setEntityForce()

virtual void makVre::DtVreChatWindow::setEntityForce ( int force)
overridevirtual

Sets the entity force identifier used for channel filtering.

Parameters
forceForce identifier

Implements makVre::DtChatWindowInterface.

◆ setEntityRole()

virtual void makVre::DtVreChatWindow::setEntityRole ( const std::string & role)
overridevirtual

Sets the entity role used for username generation.

Parameters
roleRole description string

Implements makVre::DtChatWindowInterface.

◆ updateUsername()

virtual void makVre::DtVreChatWindow::updateUsername ( )
overridevirtual

Regenerates the displayed username from current settings.

Implements makVre::DtChatWindowInterface.

◆ displayReceivedMessage()

virtual void makVre::DtVreChatWindow::displayReceivedMessage ( const std::string & username,
int force,
const std::string & channel,
const std::string & message )
overridevirtual

Displays an incoming chat message received over the network.

Parameters
usernameSender's username
forceForce identifier of the sender
channelChannel the message arrived on
messageRaw message text (will be HTML-converted by the implementation)

Implements makVre::DtChatWindowInterface.

◆ 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)
overridevirtual

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.

Implements makVre::DtChatWindowInterface.

◆ isShowingAllowed()

virtual bool makVre::DtVreChatWindow::isShowingAllowed ( ) const
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.

Returns
True if the chat window is allowed to be shown, false otherwise

Implements makVre::DtChatWindowInterface.

References myCanShowChatWindow.

◆ setShowingAllowed()

virtual void makVre::DtVreChatWindow::setShowingAllowed ( const bool canShow)
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.

Parameters
canShowTrue to allow the chat window to be shown, false to disallow

Implements makVre::DtChatWindowInterface.

References myCanShowChatWindow.

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.

◆ myCanShowChatWindow

bool makVre::DtVreChatWindow::myCanShowChatWindow = false
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.

See also
isShowingAllowed()
setShowingAllowed()

Referenced by isShowingAllowed(), and setShowingAllowed().


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