![]() |
Cockatrice 2026-10-19-Development-3.1.2-beta.2
A virtual tabletop for multiplayer card games
|
#include <chat_view.h>
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) |
| void | cockatriceLinkActivated (const QString &url) |
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) |
| QString | getRecentChatLog (int maxMessages=50) const |
Protected Member Functions | |
| virtual QString | getCurrentTime () const |
| 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 () |
| void | adjustColorsToPalette () |
| void | refreshBlockColors () |
| void | onScrollBarRangeChanged () |
| void | onScrollBarValueChanged (int value) |
Private Member Functions | |
| QTextFragment | getFragmentUnderMouse (const QPoint &pos) const |
| QTextCursor | prepareBlock (bool same=false) |
| void | scrollToBottom () |
| void | appendCardTag (QTextCursor &cursor, const QString &cardName) |
| void | appendUrlTag (QTextCursor &cursor, QString url) |
| void | appendGameLinkTag (QTextCursor &cursor, const 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 |
| UserContextMenu * | userContextMenu |
| QString | lastSender |
| QString | ownUserName |
| QString | mention |
| QTextCharFormat | mentionFormat |
| QTextCharFormat | highlightFormat |
| QTextCharFormat | mentionFormatOtherUser |
| QTextCharFormat | defaultFormat |
| QStringList | highlightedWords |
| bool | evenNumber |
| bool | showTimestamps |
| bool | stickToBottom = false |
| HoveredItemType | hoveredItemType |
| QString | hoveredContent |
| QAction * | messageClicked |
| QMap< QString, QVector< UserMessagePosition > > | userMessagePositions |
| QList< ChatLogEntry > | chatHistory |
| QColor | otherUserColor = QColor(0, 65, 255) |
| QColor | serverMessageColor = QColor(0x85, 0x15, 0x15) |
| QColor | linkColor |
| QColor | unresolvedCardTagColor |
Static Private Attributes | |
| static constexpr int | MAX_CHAT_HISTORY = 200 |
|
private |
| ChatView::ChatView | ( | TabSupervisor * | _tabSupervisor, |
| AbstractGame * | _game, | ||
| bool | _showTimestamps, | ||
| QWidget * | parent = nullptr ) |
|
privateslot |
|
signal |
|
privateslot |
|
private |
|
private |
| void ChatView::appendHtml | ( | const QString & | html | ) |
|
virtual |
| void ChatView::appendMessage | ( | QString | message, |
| RoomMessageTypeFlags | messageType = {}, | ||
| const ServerInfo_User & | userInfo = {}, | ||
| bool | playerBold = false ) |
|
private |
|
signal |
|
private |
|
private |
|
private |
| void ChatView::clearChat | ( | ) |
|
signal |
|
signal |
|
overrideprotected |
|
private |
|
nodiscardprotectedvirtual |
Reimplemented in MessageLogWidget.
|
staticprivate |
|
staticprivate |
|
nodiscardprivate |
| QString ChatView::getRecentChatLog | ( | int | maxMessages = 50 | ) | const |
|
private |
|
overrideprotected |
|
signal |
|
overrideprotected |
|
overrideprotected |
|
overrideprotected |
|
privateslot |
|
privateslot |
|
privateslot |
|
signal |
|
private |
| void ChatView::redactMessages | ( | const QString & | userName, |
| int | amount ) |
|
privateslot |
| void ChatView::retranslateUi | ( | ) |
|
private |
|
signal |
|
signal |
|
private |
|
private |
|
private |
|
private |
|
protected |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
staticconstexprprivate |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
protected |
|
private |
|
private |
|
private |
|
private |