GlobalLobbyWindow.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. * GlobalLobbyWindow.h, part of VCMI engine
  3. *
  4. * Authors: listed in file AUTHORS in main folder
  5. *
  6. * License: GNU General Public License v2.0 or later
  7. * Full text of license available in license.txt file, in main folder
  8. *
  9. */
  10. #pragma once
  11. #include "../windows/CWindowObject.h"
  12. class GlobalLobbyWidget;
  13. struct GlobalLobbyAccount;
  14. struct GlobalLobbyRoom;
  15. class GlobalLobbyWindow : public CWindowObject
  16. {
  17. std::string chatHistory;
  18. std::string currentChannelType;
  19. std::string currentChannelName;
  20. std::shared_ptr<GlobalLobbyWidget> widget;
  21. std::set<std::string> unreadChannels;
  22. std::set<std::string> unreadInvites;
  23. public:
  24. GlobalLobbyWindow();
  25. // Callbacks for UI
  26. void doSendChatMessage();
  27. void doCreateGameRoom();
  28. void doOpenChannel(const std::string & channelType, const std::string & channelName, const std::string & roomDescription);
  29. void doInviteAccount(const std::string & accountID);
  30. void doJoinRoom(const std::string & roomID);
  31. /// Returns true if provided chat channel is the one that is currently open in UI
  32. bool isChannelOpen(const std::string & channelType, const std::string & channelName) const;
  33. bool isChannelUnread(const std::string & channelType, const std::string & channelName) const;
  34. bool isInviteUnread(const std::string & gameRoomID) const;
  35. // Callbacks for network packs
  36. void onGameChatMessage(const std::string & sender, const std::string & message, const std::string & when, const std::string & channelType, const std::string & channelName);
  37. void onActiveAccounts(const std::vector<GlobalLobbyAccount> & accounts);
  38. void onActiveRooms(const std::vector<GlobalLobbyRoom> & rooms);
  39. void onMatchesHistory(const std::vector<GlobalLobbyRoom> & history);
  40. void onInviteReceived(const std::string & invitedRoomID);
  41. void onJoinedRoom();
  42. void onLeftRoom();
  43. };