settings_information.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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 "settings/settings_common_session.h"
  9. class UserData;
  10. namespace Ui {
  11. struct UnreadBadgeStyle;
  12. } // namespace Ui
  13. namespace Main {
  14. class Account;
  15. } // namespace Main
  16. namespace Settings {
  17. class Information : public Section<Information> {
  18. public:
  19. Information(
  20. QWidget *parent,
  21. not_null<Window::SessionController*> controller);
  22. [[nodiscard]] rpl::producer<QString> title() override;
  23. private:
  24. void setupContent(not_null<Window::SessionController*> controller);
  25. };
  26. struct AccountsEvents {
  27. rpl::producer<> closeRequests;
  28. };
  29. AccountsEvents SetupAccounts(
  30. not_null<Ui::VerticalLayout*> container,
  31. not_null<Window::SessionController*> controller);
  32. void UpdatePhotoLocally(not_null<UserData*> user, const QImage &image);
  33. namespace Badge {
  34. [[nodiscard]] Ui::UnreadBadgeStyle Style();
  35. struct UnreadBadge {
  36. int count = 0;
  37. bool muted = false;
  38. };
  39. [[nodiscard]] not_null<Ui::RpWidget*> AddRight(
  40. not_null<Ui::SettingsButton*> button);
  41. [[nodiscard]] not_null<Ui::RpWidget*> CreateUnread(
  42. not_null<Ui::RpWidget*> container,
  43. rpl::producer<UnreadBadge> value);
  44. void AddUnread(
  45. not_null<Ui::SettingsButton*> button,
  46. rpl::producer<UnreadBadge> value);
  47. } // namespace Badge
  48. } // namespace Settings