Cockatrice 2026-10-19-Development-3.1.2-beta.2
A virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
tab_account.h
Go to the documentation of this file.
1
6
7#ifndef TAB_ACCOUNT_H
8#define TAB_ACCOUNT_H
9
10#include "tab.h"
11
12#include <QString>
13#include <qtmetamacros.h>
14#include <string>
15// IWYU pragma: keep
16// ServerInfo_User appears by value and inside QList in slot signatures, so the
17// moc-generated code needs the complete type.
18#include <libcockatrice/protocol/pb/serverinfo_user.pb.h>
19
20class AbstractClient;
21class Event_AddToList;
24class Event_UserLeft;
26class QPushButton;
27class Response;
28class ServerInfo_User;
29class UserInfoBox;
30class UserListWidget;
31class TabSupervisor;
32template <typename T> class QList;
33
34class TabAccount : public Tab
35{
36 Q_OBJECT
37signals:
38 void openMessageDialog(const QString &userName, bool focus);
39 void userLeft(const QString &userName);
40 void userJoined(const ServerInfo_User &userInfo);
41
42private slots:
43 void processListUsersResponse(const Response &response);
45 void processUserLeftEvent(const Event_UserLeft &event);
46 void buddyListReceived(const QList<ServerInfo_User> &_buddyList);
47 void ignoreListReceived(const QList<ServerInfo_User> &_ignoreList);
48 void processAddToListEvent(const Event_AddToList &event);
50 void addToIgnoreList();
51 void addToBuddyList();
52 void openMyReports();
53
54private:
62 QPushButton *myReportsButton;
63 void addToList(const std::string &listName, const QString &userName);
64
65public:
66 explicit TabAccount(TabSupervisor *_tabSupervisor, AbstractClient *_client, const ServerInfo_User &userInfo);
67 void retranslateUi() override;
68 [[nodiscard]] QString getTabText() const override
69 {
70 return tr("Account");
71 }
72};
73
74#endif
Definition abstract_client.h:73
Definition custom_line_edit.h:21
Definition remote_connection_controller.h:20
void processListUsersResponse(const Response &response)
Definition tab_account.cpp:155
void openMessageDialog(const QString &userName, bool focus)
void addToList(const std::string &listName, const QString &userName)
Definition tab_account.cpp:132
void buddyListReceived(const QList< ServerInfo_User > &_buddyList)
Definition tab_account.cpp:210
void openMyReports()
Definition tab_account.cpp:264
void processAddToListEvent(const Event_AddToList &event)
Definition tab_account.cpp:228
TabAccount(TabSupervisor *_tabSupervisor, AbstractClient *_client, const ServerInfo_User &userInfo)
Definition tab_account.cpp:31
LineEditUnfocusable * addBuddyEdit
Definition tab_account.h:60
UserInfoBox * userInfoBox
Definition tab_account.h:59
void ignoreListReceived(const QList< ServerInfo_User > &_ignoreList)
Definition tab_account.cpp:219
void processRemoveFromListEvent(const Event_RemoveFromList &event)
Definition tab_account.cpp:247
void retranslateUi() override
Definition tab_account.cpp:141
void addToBuddyList()
Definition tab_account.cpp:108
void userJoined(const ServerInfo_User &userInfo)
void userLeft(const QString &userName)
QString getTabText() const override
Definition tab_account.h:68
LineEditUnfocusable * addIgnoreEdit
Definition tab_account.h:61
UserListWidget * ignoreList
Definition tab_account.h:58
QPushButton * myReportsButton
Definition tab_account.h:62
void addToIgnoreList()
Definition tab_account.cpp:120
void processUserLeftEvent(const Event_UserLeft &event)
Definition tab_account.cpp:192
UserListWidget * buddyList
Definition tab_account.h:57
UserListWidget * allUsersList
Definition tab_account.h:56
AbstractClient * client
Definition tab_account.h:55
void processUserJoinedEvent(const Event_UserJoined &event)
Definition tab_account.cpp:172
Definition tab_supervisor.h:92
Tab(TabSupervisor *_tabSupervisor)
Definition tab.cpp:16
Definition user_info_box.h:24
Definition user_list_widget.h:78
Definition event_add_to_list.proto:4
Definition event_remove_from_list.proto:3
Definition event_user_joined.proto:4
Definition event_user_left.proto:3
Definition response.proto:11
Definition serverinfo_user.proto:2