Cockatrice 2026-10-19-Development-3.1.2-beta.2
A virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
tab_message.h
Go to the documentation of this file.
1
6
7#ifndef TAB_MESSAGE_H
8#define TAB_MESSAGE_H
9
10#include "tab.h"
11
12#include <QLoggingCategory>
13#include <QString>
14#include <QVariant>
15#include <qtmetamacros.h>
16
17class QAction;
18class QMenu;
19class TabSupervisor;
20
21inline Q_LOGGING_CATEGORY(TabMessageLog, "tab_message");
22
23class AbstractClient;
24class ChatView;
27class Response;
28class ServerInfo_User;
30
31class TabMessage : public Tab
32{
33 Q_OBJECT
34private:
40
43
44 QAction *aLeave;
45signals:
48private slots:
49 void sendMessage();
50 void messageSent(const Response &response, const CommandContainer &commandContainer, const QVariant &extraData);
51 void addMentionTag(QString mentionTag);
52 void messageClicked();
53
54protected slots:
55 void closeEvent(QCloseEvent *event) override;
56
57public:
58 TabMessage(TabSupervisor *_tabSupervisor,
59 AbstractClient *_client,
60 const ServerInfo_User &_ownUserInfo,
61 const ServerInfo_User &_otherUserInfo,
62 bool _userOnline);
63 ~TabMessage() override;
64 void retranslateUi() override;
65 void tabActivated() override;
66 [[nodiscard]] QString getUserName() const;
67 [[nodiscard]] QString getTabText() const override;
68
70
71 void processUserLeft();
72 void processUserJoined(const ServerInfo_User &_userInfo);
73
74 [[nodiscard]] bool isUserOnline() const;
75 void sendPrivateMessage(const QString &text);
76 void sendInviteMessage(const QString &text);
77
78private:
80 void showSystemPopup(const Event_UserMessage &event);
81 void notifyUserOffline();
82};
83
84#endif
Definition abstract_client.h:73
Definition chat_view.h:56
Definition custom_line_edit.h:21
LineEditUnfocusable * sayEdit
Definition tab_message.h:42
void sendMessage()
Definition tab_message.cpp:124
void addMentionTag(QString mentionTag)
Definition tab_message.cpp:71
void processUserMessageEvent(const Event_UserMessage &event)
Definition tab_message.cpp:167
bool shouldShowSystemPopup(const Event_UserMessage &event)
Definition tab_message.cpp:185
void showSystemPopup(const Event_UserMessage &event)
Definition tab_message.cpp:192
ChatView * chatView
Definition tab_message.h:41
void notifyUserOffline()
Definition tab_message.cpp:224
TabMessage(TabSupervisor *_tabSupervisor, AbstractClient *_client, const ServerInfo_User &_ownUserInfo, const ServerInfo_User &_otherUserInfo, bool _userOnline)
Definition tab_message.cpp:30
ServerInfo_User * otherUserInfo
Definition tab_message.h:38
ServerInfo_User * ownUserInfo
Definition tab_message.h:37
void sendInviteMessage(const QString &text)
Definition tab_message.cpp:144
QAction * aLeave
Definition tab_message.h:44
void tabActivated() override
Definition tab_message.cpp:83
void messageSent(const Response &response, const CommandContainer &commandContainer, const QVariant &extraData)
Definition tab_message.cpp:150
void processUserLeft()
Definition tab_message.cpp:211
void talkClosing(TabMessage *tab)
QMenu * messageMenu
Definition tab_message.h:36
void closeEvent(QCloseEvent *event) override
Definition tab_message.cpp:100
AbstractClient * client
Definition tab_message.h:35
void maximizeClient()
bool userOnline
Definition tab_message.h:39
bool isUserOnline() const
Definition tab_message.cpp:139
QString getUserName() const
Definition tab_message.cpp:90
void messageClicked()
Definition tab_message.cpp:204
void processUserJoined(const ServerInfo_User &_userInfo)
Definition tab_message.cpp:217
void retranslateUi() override
Definition tab_message.cpp:77
void sendPrivateMessage(const QString &text)
Definition tab_message.cpp:106
QString getTabText() const override
Definition tab_message.cpp:95
Definition tab_supervisor.h:92
Tab(TabSupervisor *_tabSupervisor)
Definition tab.cpp:16
Q_LOGGING_CATEGORY(CrashReportLog, "crash_report")
Definition commands.proto:8
Definition event_user_message.proto:3
Definition response.proto:11
Definition serverinfo_user.proto:2