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

Detailed Description

Data container for a single chat message entry.

DtChatEntry encapsulates a single chat message in the chat system, including the sender's username, force affiliation, target channel, message content, and display properties such as opacity and visibility. Each entry corresponds to one message bubble in the chat UI.

This simple data class demonstrates the pattern for Qt-compatible data objects. All fields use Qt types (QString, double) for seamless integration with Qt models.

#include <vreChatWindowModel.h>

Public Member Functions

 DtChatEntry (const std::string &username, int force, const std::string &channel, const std::string &message)
 
 ~DtChatEntry ()=default
 
QString username () const
 
void setUsername (QString val)
 
QString channel () const
 
void setChannel (QString val)
 
int force () const
 
void setForce (int val)
 
QString message () const
 
void setMessage (QString val)
 
double opacity () const
 
void setOpacity (double val)
 
bool timerStarted () const
 
void setTimerStarted (bool val)
 
bool visible () const
 
void setVisible (bool val)
 
 DtChatEntry ()
 
 DtChatEntry (const QString &sender, const QString &receiver, const double time, const QString &message)
 
QString getSender () const
 
void setSender (const QString &sender)
 
QString getReceiver () const
 
void setReceiver (const QString &receiver)
 
double getTime () const
 
void setTime (const double time)
 
QString getMessage () const
 
void setMessage (const QString &message)
 

Protected Attributes

QString myUsername
 
QString myChannel
 
int myForce
 
QString myMessage
 
double myOpacity
 
bool myTimerStarted
 
bool myVisible
 
QString mySender
 
QString myReceiver
 
double myTime
 

Constructor & Destructor Documentation

◆ DtChatEntry() [1/3]

makVre::DtChatEntry::DtChatEntry ( const std::string & username,
int force,
const std::string & channel,
const std::string & message )

Constructor.

Parameters
usernameName of the user who sent the message
forceForce identifier of the sender (friendly=1, enemy=2, etc.)
channelTarget channel for the message
messageContent of the chat message

Creates a new chat entry with the specified sender information and message content.

References channel(), force(), message(), and username().

◆ ~DtChatEntry()

makVre::DtChatEntry::~DtChatEntry ( )
default

Default destructor.

◆ DtChatEntry() [2/3]

makVre::DtChatEntry::DtChatEntry ( )

Default constructor initializing empty chat entry.

◆ DtChatEntry() [3/3]

makVre::DtChatEntry::DtChatEntry ( const QString & sender,
const QString & receiver,
const double time,
const QString & message )

Constructor with all chat entry fields.

Parameters
senderEntity name (marking text) who sent the message
receiverEntity name (marking text) who received the message
timeSimulation time when message was sent
messageThe text content of the message

References message().

Member Function Documentation

◆ username()

QString makVre::DtChatEntry::username ( ) const

Gets the username of the message sender.

Returns
Username as a QString

Referenced by DtChatEntry().

◆ setUsername()

void makVre::DtChatEntry::setUsername ( QString val)

Sets the username of the message sender.

Parameters
valNew username

◆ channel()

QString makVre::DtChatEntry::channel ( ) const

Gets the channel the message was sent to.

Returns
Channel name as a QString

Referenced by DtChatEntry().

◆ setChannel()

void makVre::DtChatEntry::setChannel ( QString val)

Sets the channel for the message.

Parameters
valNew channel name

◆ force()

int makVre::DtChatEntry::force ( ) const

Gets the force identifier of the sender.

Returns
Force identifier (friendly=1, enemy=2, etc.)

Referenced by DtChatEntry().

◆ setForce()

void makVre::DtChatEntry::setForce ( int val)

Sets the force identifier of the sender.

Parameters
valNew force identifier

◆ message()

QString makVre::DtChatEntry::message ( ) const

Gets the content of the message.

Returns
Message text as a QString

Referenced by DtChatEntry(), DtChatEntry(), and setMessage().

◆ setMessage() [1/2]

void makVre::DtChatEntry::setMessage ( QString val)

Sets the content of the message.

Parameters
valNew message text

◆ opacity()

double makVre::DtChatEntry::opacity ( ) const

Gets the opacity of the message in the UI.

Returns
Opacity value (0.0 to 1.0)

◆ setOpacity()

void makVre::DtChatEntry::setOpacity ( double val)

Sets the opacity of the message in the UI.

Parameters
valNew opacity value

◆ timerStarted()

bool makVre::DtChatEntry::timerStarted ( ) const

Checks if the message fade timer has started.

Returns
True if timer has started, false otherwise

◆ setTimerStarted()

void makVre::DtChatEntry::setTimerStarted ( bool val)

Sets the timer started flag for message fading.

Parameters
valNew timer started state

◆ visible()

bool makVre::DtChatEntry::visible ( ) const

Checks if the message is visible in the UI.

Returns
True if visible, false if hidden

◆ setVisible()

void makVre::DtChatEntry::setVisible ( bool val)

Sets the visibility of the message in the UI.

Parameters
valNew visibility state

◆ getSender()

QString makVre::DtChatEntry::getSender ( ) const

Gets the sender's entity name.

◆ setSender()

void makVre::DtChatEntry::setSender ( const QString & sender)

Sets the sender's entity name.

◆ getReceiver()

QString makVre::DtChatEntry::getReceiver ( ) const

Gets the receiver's entity name.

◆ setReceiver()

void makVre::DtChatEntry::setReceiver ( const QString & receiver)

Sets the receiver's entity name.

◆ getTime()

double makVre::DtChatEntry::getTime ( ) const

Gets the simulation time of the message.

◆ setTime()

void makVre::DtChatEntry::setTime ( const double time)

Sets the simulation time of the message.

◆ getMessage()

QString makVre::DtChatEntry::getMessage ( ) const

Gets the message text content.

◆ setMessage() [2/2]

void makVre::DtChatEntry::setMessage ( const QString & message)

Sets the message text content.

References message().

Member Data Documentation

◆ myUsername

QString makVre::DtChatEntry::myUsername
protected

Username of the message sender.

◆ myChannel

QString makVre::DtChatEntry::myChannel
protected

Channel the message was sent to.

◆ myForce

int makVre::DtChatEntry::myForce
protected

Force identifier of the sender (friendly=1, enemy=2, etc.)

◆ myMessage

QString makVre::DtChatEntry::myMessage
protected

Content of the chat message.

Text content of message.

◆ myOpacity

double makVre::DtChatEntry::myOpacity
protected

Opacity of the message in the UI (0.0 to 1.0)

◆ myTimerStarted

bool makVre::DtChatEntry::myTimerStarted
protected

Flag indicating if the fade timer has started.

◆ myVisible

bool makVre::DtChatEntry::myVisible
protected

Flag indicating if the message is visible in the UI.

◆ mySender

QString makVre::DtChatEntry::mySender
protected

Entity name of message sender.

◆ myReceiver

QString makVre::DtChatEntry::myReceiver
protected

Entity name of message receiver.

◆ myTime

double makVre::DtChatEntry::myTime
protected

Simulation time of message.


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