Cockatrice 2025-11-30-Development-2.11.0-beta.38
A cross-platform virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
ChatView Class Reference

#include <chat_view.h>

Inheritance diagram for ChatView:
[legend]
Collaboration diagram for ChatView:
[legend]

Signals

void openMessageDialog (const QString &userName, bool focus)
void cardNameHovered (QString cardName)
void showCardInfoPopup (const QPoint &pos, const CardRef &cardRef)
void deleteCardInfoPopup (QString cardName)
void addMentionTag (QString mentionTag)
void messageClickedSignal ()
void showMentionPopup (const QString &userName)

Public Member Functions

 ChatView (TabSupervisor *_tabSupervisor, AbstractGame *_game, bool _showTimestamps, QWidget *parent=nullptr)
void retranslateUi ()
void appendHtml (const QString &html)
virtual void appendHtmlServerMessage (const QString &html, bool optionalIsBold=false, QString optionalFontColor=QString())
void appendMessage (QString message, RoomMessageTypeFlags messageType={}, const ServerInfo_User &userInfo={}, bool playerBold=false)
void clearChat ()
void redactMessages (const QString &userName, int amount)

Protected Member Functions

void enterEvent (QEnterEvent *event) override
void leaveEvent (QEvent *event) override
void mouseMoveEvent (QMouseEvent *event) override
void mousePressEvent (QMouseEvent *event) override
void mouseReleaseEvent (QMouseEvent *event) override

Protected Attributes

TabSupervisor *const tabSupervisor
AbstractGame *const game

Private Types

enum  HoveredItemType { HoveredNothing , HoveredUrl , HoveredCard , HoveredUser }

Private Slots

void openLink (const QUrl &link)
void actMessageClicked ()

Private Member Functions

QTextFragment getFragmentUnderMouse (const QPoint &pos) const
QTextCursor prepareBlock (bool same=false)
void appendCardTag (QTextCursor &cursor, const QString &cardName)
void appendUrlTag (QTextCursor &cursor, QString url)
void showSystemPopup (const QString &userName)
bool isModeratorSendingGlobal (QFlags< ServerInfo_User::UserLevelFlag > userLevelFlag, QString message)
void checkTag (QTextCursor &cursor, QString &message)
void checkMention (QTextCursor &cursor, QString &message, const QString &userName, UserLevelFlags userLevel)
void checkWord (QTextCursor &cursor, QString &message)
QString extractNextWord (QString &message, QString &rest)

Static Private Member Functions

static QColor getCustomMentionColor ()
static QColor getCustomHighlightColor ()

Private Attributes

const UserListProxy *const userListProxy
UserContextMenuuserContextMenu
QString lastSender
QString ownUserName
QString mention
QTextCharFormat mentionFormat
QTextCharFormat highlightFormat
QTextCharFormat mentionFormatOtherUser
QTextCharFormat defaultFormat
QStringList highlightedWords
bool evenNumber
bool showTimestamps
HoveredItemType hoveredItemType
QString hoveredContent
QAction * messageClicked
QMap< QString, QVector< UserMessagePosition > > userMessagePositions
QColor otherUserColor = QColor(0, 65, 255)
QColor serverMessageColor = QColor(0x85, 0x15, 0x15)
QColor linkColor

Member Enumeration Documentation

◆ HoveredItemType

Enumerator
HoveredNothing 
HoveredUrl 
HoveredCard 
HoveredUser 

Constructor & Destructor Documentation

◆ ChatView()

ChatView::ChatView ( TabSupervisor * _tabSupervisor,
AbstractGame * _game,
bool _showTimestamps,
QWidget * parent = nullptr )
Here is the call graph for this function:
Here is the caller graph for this function:

Member Function Documentation

◆ actMessageClicked

void ChatView::actMessageClicked ( )
privateslot

◆ addMentionTag

void ChatView::addMentionTag ( QString mentionTag)
signal
Here is the caller graph for this function:

◆ appendCardTag()

void ChatView::appendCardTag ( QTextCursor & cursor,
const QString & cardName )
private

◆ appendHtml()

void ChatView::appendHtml ( const QString & html)
Here is the caller graph for this function:

◆ appendHtmlServerMessage()

void ChatView::appendHtmlServerMessage ( const QString & html,
bool optionalIsBold = false,
QString optionalFontColor = QString() )
virtual
Here is the caller graph for this function:

◆ appendMessage()

void ChatView::appendMessage ( QString message,
RoomMessageTypeFlags messageType = {},
const ServerInfo_User & userInfo = {},
bool playerBold = false )
Here is the caller graph for this function:

◆ appendUrlTag()

void ChatView::appendUrlTag ( QTextCursor & cursor,
QString url )
private

◆ cardNameHovered

void ChatView::cardNameHovered ( QString cardName)
signal
Here is the caller graph for this function:

◆ checkMention()

void ChatView::checkMention ( QTextCursor & cursor,
QString & message,
const QString & userName,
UserLevelFlags userLevel )
private

◆ checkTag()

void ChatView::checkTag ( QTextCursor & cursor,
QString & message )
private

◆ checkWord()

void ChatView::checkWord ( QTextCursor & cursor,
QString & message )
private

◆ clearChat()

void ChatView::clearChat ( )
Here is the call graph for this function:

◆ deleteCardInfoPopup

void ChatView::deleteCardInfoPopup ( QString cardName)
signal
Here is the caller graph for this function:

◆ enterEvent()

void ChatView::enterEvent ( QEnterEvent * event)
overrideprotected

◆ extractNextWord()

QString ChatView::extractNextWord ( QString & message,
QString & rest )
private

◆ getCustomHighlightColor()

QColor ChatView::getCustomHighlightColor ( )
staticprivate
Here is the call graph for this function:

◆ getCustomMentionColor()

QColor ChatView::getCustomMentionColor ( )
staticprivate
Here is the call graph for this function:

◆ getFragmentUnderMouse()

QTextFragment ChatView::getFragmentUnderMouse ( const QPoint & pos) const
nodiscardprivate

◆ isModeratorSendingGlobal()

bool ChatView::isModeratorSendingGlobal ( QFlags< ServerInfo_User::UserLevelFlag > userLevelFlag,
QString message )
private

◆ leaveEvent()

void ChatView::leaveEvent ( QEvent * event)
overrideprotected

◆ messageClickedSignal

void ChatView::messageClickedSignal ( )
signal
Here is the caller graph for this function:

◆ mouseMoveEvent()

void ChatView::mouseMoveEvent ( QMouseEvent * event)
overrideprotected

◆ mousePressEvent()

void ChatView::mousePressEvent ( QMouseEvent * event)
overrideprotected

◆ mouseReleaseEvent()

void ChatView::mouseReleaseEvent ( QMouseEvent * event)
overrideprotected

◆ openLink

void ChatView::openLink ( const QUrl & link)
privateslot
Here is the caller graph for this function:

◆ openMessageDialog

void ChatView::openMessageDialog ( const QString & userName,
bool focus )
signal
Here is the caller graph for this function:

◆ prepareBlock()

QTextCursor ChatView::prepareBlock ( bool same = false)
private

◆ redactMessages()

void ChatView::redactMessages ( const QString & userName,
int amount )
Here is the caller graph for this function:

◆ retranslateUi()

void ChatView::retranslateUi ( )
Here is the call graph for this function:

◆ showCardInfoPopup

void ChatView::showCardInfoPopup ( const QPoint & pos,
const CardRef & cardRef )
signal
Here is the caller graph for this function:

◆ showMentionPopup

void ChatView::showMentionPopup ( const QString & userName)
signal
Here is the caller graph for this function:

◆ showSystemPopup()

void ChatView::showSystemPopup ( const QString & userName)
private
Here is the call graph for this function:

Member Data Documentation

◆ defaultFormat

QTextCharFormat ChatView::defaultFormat
private

◆ evenNumber

bool ChatView::evenNumber
private

◆ game

AbstractGame* const ChatView::game
protected

◆ highlightedWords

QStringList ChatView::highlightedWords
private

◆ highlightFormat

QTextCharFormat ChatView::highlightFormat
private

◆ hoveredContent

QString ChatView::hoveredContent
private

◆ hoveredItemType

HoveredItemType ChatView::hoveredItemType
private

◆ lastSender

QString ChatView::lastSender
private

◆ linkColor

QColor ChatView::linkColor
private

◆ mention

QString ChatView::mention
private

◆ mentionFormat

QTextCharFormat ChatView::mentionFormat
private

◆ mentionFormatOtherUser

QTextCharFormat ChatView::mentionFormatOtherUser
private

◆ messageClicked

QAction* ChatView::messageClicked
private

◆ otherUserColor

QColor ChatView::otherUserColor = QColor(0, 65, 255)
private

◆ ownUserName

QString ChatView::ownUserName
private

◆ serverMessageColor

QColor ChatView::serverMessageColor = QColor(0x85, 0x15, 0x15)
private

◆ showTimestamps

bool ChatView::showTimestamps
private

◆ tabSupervisor

TabSupervisor* const ChatView::tabSupervisor
protected

◆ userContextMenu

UserContextMenu* ChatView::userContextMenu
private

◆ userListProxy

const UserListProxy* const ChatView::userListProxy
private

◆ userMessagePositions

QMap<QString, QVector<UserMessagePosition> > ChatView::userMessagePositions
private

The documentation for this class was generated from the following files:
  • cockatrice/src/interface/widgets/server/chat_view/chat_view.h
  • cockatrice/src/interface/widgets/server/chat_view/chat_view.cpp