mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-29 01:53:54 -07:00
* refactored cardzone.cpp, added doc and changed if to switch case * started moving every files into different folders * remove undercase to match with other files naming convention * refactored dialog files * ran format.sh * refactored client/tabs folder * refactored client/tabs folder * refactored client/tabs folder * refactored client folder * refactored carddbparser * refactored dialogs * Create sonar-project.properties temporary file for lint * Create build.yml temporary file for lint * removed all files from root directory * removed all files from root directory * added current branch to workflow * fixed most broken import * fixed issues while renaming files * fixed oracle importer * fixed dbconverter * updated translations * made sub-folders for client * removed linter * removed linter folder * fixed oracle import * revert card_zone documentation * renamed db parser files name and deck_view imports * fixed dlg file issue * ran format file and fixed test file * fixed carddb test files * moved player folder in game * updated translations and format files * fixed peglib import * format cmake files * removing vcpkg to try to add it back later * tried fixing vcpkg file * renamed filter to filters and moved database parser to cards folder * reverted translation files * reverted oracle translated * Update cockatrice/src/dialogs/dlg_register.cpp Co-authored-by: tooomm <tooomm@users.noreply.github.com> * Update cockatrice/src/client/ui/window_main.cpp Co-authored-by: tooomm <tooomm@users.noreply.github.com> * removed empty line at file start * removed useless include from tab_supervisor.cpp * refactored cardzone.cpp, added doc and changed if to switch case * started moving every files into different folders * remove undercase to match with other files naming convention * refactored dialog files * ran format.sh * refactored client/tabs folder * refactored client folder * refactored carddbparser * refactored dialogs * removed all files from root directory * Create sonar-project.properties temporary file for lint * Create build.yml temporary file for lint * added current branch to workflow * fixed most broken import * fixed issues while renaming files * fixed oracle importer * fixed dbconverter * updated translations * made sub-folders for client * removed linter * removed linter folder * fixed oracle import * revert card_zone documentation * renamed db parser files name and deck_view imports * fixed dlg file issue * ran format file and fixed test file * fixed carddb test files * moved player folder in game * updated translations and format files * fixed peglib import * reverted translation files * format cmake files * removing vcpkg to try to add it back later * tried fixing vcpkg file * pre-updating of cockatrice changes * removed empty line at file start * reverted oracle translated * Update cockatrice/src/dialogs/dlg_register.cpp Co-authored-by: tooomm <tooomm@users.noreply.github.com> * Update cockatrice/src/client/ui/window_main.cpp Co-authored-by: tooomm <tooomm@users.noreply.github.com> * removed useless include from tab_supervisor.cpp --------- Co-authored-by: tooomm <tooomm@users.noreply.github.com>
124 lines
2.9 KiB
C++
124 lines
2.9 KiB
C++
#ifndef TAB_ROOM_H
|
|
#define TAB_ROOM_H
|
|
|
|
#include "../ui/line_edit_completer.h"
|
|
#include "tab.h"
|
|
|
|
#include <QFocusEvent>
|
|
#include <QGroupBox>
|
|
#include <QKeyEvent>
|
|
#include <QMap>
|
|
|
|
namespace google
|
|
{
|
|
namespace protobuf
|
|
{
|
|
class Message;
|
|
}
|
|
} // namespace google
|
|
class AbstractClient;
|
|
class UserList;
|
|
class QLabel;
|
|
class ChatView;
|
|
class QPushButton;
|
|
class QTextTable;
|
|
class QCompleter;
|
|
class RoomEvent;
|
|
class ServerInfo_Room;
|
|
class ServerInfo_Game;
|
|
class Event_ListGames;
|
|
class Event_JoinRoom;
|
|
class Event_LeaveRoom;
|
|
class Event_RoomSay;
|
|
class Event_RemoveMessages;
|
|
class GameSelector;
|
|
class Response;
|
|
class PendingCommand;
|
|
class ServerInfo_User;
|
|
class LineEditCompleter;
|
|
|
|
class TabRoom : public Tab
|
|
{
|
|
Q_OBJECT
|
|
private:
|
|
AbstractClient *client;
|
|
int roomId;
|
|
QString roomName;
|
|
ServerInfo_User *ownUser;
|
|
QMap<int, QString> gameTypes;
|
|
|
|
GameSelector *gameSelector;
|
|
UserList *userList;
|
|
ChatView *chatView;
|
|
QLabel *sayLabel;
|
|
LineEditCompleter *sayEdit;
|
|
QGroupBox *chatGroupBox;
|
|
|
|
QMenu *roomMenu;
|
|
QAction *aLeaveRoom;
|
|
QAction *aOpenChatSettings;
|
|
QAction *aClearChat;
|
|
QString sanitizeHtml(QString dirty) const;
|
|
|
|
QStringList autocompleteUserList;
|
|
QCompleter *completer;
|
|
signals:
|
|
void roomClosing(TabRoom *tab);
|
|
void openMessageDialog(const QString &userName, bool focus);
|
|
void maximizeClient();
|
|
void notIdle();
|
|
private slots:
|
|
void sendMessage();
|
|
void sayFinished(const Response &response);
|
|
void actLeaveRoom();
|
|
void actClearChat();
|
|
void actOpenChatSettings();
|
|
void addMentionTag(QString mentionTag);
|
|
void focusTab();
|
|
void actShowMentionPopup(const QString &sender);
|
|
void actShowPopup(const QString &message);
|
|
void actCompleterChanged();
|
|
|
|
void processListGamesEvent(const Event_ListGames &event);
|
|
void processJoinRoomEvent(const Event_JoinRoom &event);
|
|
void processLeaveRoomEvent(const Event_LeaveRoom &event);
|
|
void processRoomSayEvent(const Event_RoomSay &event);
|
|
void processRemoveMessagesEvent(const Event_RemoveMessages &event);
|
|
void refreshShortcuts();
|
|
|
|
public:
|
|
TabRoom(TabSupervisor *_tabSupervisor,
|
|
AbstractClient *_client,
|
|
ServerInfo_User *_ownUser,
|
|
const ServerInfo_Room &info);
|
|
~TabRoom();
|
|
void retranslateUi();
|
|
void closeRequest();
|
|
void tabActivated();
|
|
void processRoomEvent(const RoomEvent &event);
|
|
int getRoomId() const
|
|
{
|
|
return roomId;
|
|
}
|
|
const QMap<int, QString> &getGameTypes() const
|
|
{
|
|
return gameTypes;
|
|
}
|
|
QString getChannelName() const
|
|
{
|
|
return roomName;
|
|
}
|
|
QString getTabText() const
|
|
{
|
|
return roomName;
|
|
}
|
|
const ServerInfo_User *getUserInfo() const
|
|
{
|
|
return ownUser;
|
|
}
|
|
|
|
PendingCommand *prepareRoomCommand(const ::google::protobuf::Message &cmd);
|
|
void sendRoomCommand(PendingCommand *pend);
|
|
};
|
|
|
|
#endif
|