GlobalLobbyWindow.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. public:
  23. GlobalLobbyWindow();
  24. // Callbacks for UI
  25. void doSendChatMessage();
  26. void doCreateGameRoom();
  27. void doOpenChannel(const std::string & channelType, const std::string & channelName, const std::string & roomDescription);
  28. void doInviteAccount(const std::string & accountID);
  29. void doJoinRoom(const std::string & roomID);
  30. /// Returns true if provided chat channel is the one that is currently open in UI
  31. bool isChannelOpen(const std::string & channelType, const std::string & channelName);
  32. bool isChannelUnread(const std::string & channelType, const std::string & channelName);
  33. // Callbacks for network packs
  34. void onGameChatMessage(const std::string & sender, const std::string & message, const std::string & when, const std::string & channelType, const std::string & channelName);
  35. void onActiveAccounts(const std::vector<GlobalLobbyAccount> & accounts);
  36. void onActiveRooms(const std::vector<GlobalLobbyRoom> & rooms);
  37. void onMatchesHistory(const std::vector<GlobalLobbyRoom> & history);
  38. void onInviteReceived(const std::string & invitedRoomID, const std::string & invitedByAccountID);
  39. void onJoinedRoom();
  40. void onLeftRoom();
  41. };