info_profile_members_controllers.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. This file is part of Telegram Desktop,
  3. the official desktop application for the Telegram messaging service.
  4. For license and copyright information please follow this link:
  5. https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
  6. */
  7. #pragma once
  8. #include "boxes/peer_list_controllers.h"
  9. #include "ui/unread_badge.h"
  10. class ParticipantsBoxController;
  11. namespace Window {
  12. class SessionNavigation;
  13. } // namespace Window
  14. namespace Info {
  15. namespace Profile {
  16. class MemberListRow final : public PeerListRowWithLink {
  17. public:
  18. enum class Rights {
  19. Normal,
  20. Admin,
  21. Creator,
  22. };
  23. struct Type {
  24. Rights rights;
  25. QString adminRank;
  26. };
  27. MemberListRow(not_null<UserData*> user, Type type);
  28. void setType(Type type);
  29. bool rightActionDisabled() const override;
  30. QMargins rightActionMargins() const override;
  31. void refreshStatus() override;
  32. not_null<UserData*> user() const;
  33. private:
  34. Type _type;
  35. };
  36. std::unique_ptr<ParticipantsBoxController> CreateMembersController(
  37. not_null<Window::SessionNavigation*> navigation,
  38. not_null<PeerData*> peer);
  39. } // namespace Profile
  40. } // namespace Info