info_media_buttons.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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 "lang/lang_keys.h"
  9. #include "storage/storage_shared_media.h"
  10. namespace Ui {
  11. class AbstractButton;
  12. class MultiSlideTracker;
  13. class SettingsButton;
  14. class VerticalLayout;
  15. template <typename Widget>
  16. class SlideWrap;
  17. } // namespace Ui
  18. namespace Window {
  19. class SessionNavigation;
  20. } // namespace Window
  21. namespace Info::Media {
  22. using Type = Storage::SharedMediaType;
  23. [[nodiscard]] tr::phrase<lngtag_count> MediaTextPhrase(Type type);
  24. [[nodiscard]] Fn<QString(int)> MediaText(Type type);
  25. [[nodiscard]] not_null<Ui::SlideWrap<Ui::SettingsButton>*> AddCountedButton(
  26. Ui::VerticalLayout *parent,
  27. rpl::producer<int> &&count,
  28. Fn<QString(int)> &&textFromCount,
  29. Ui::MultiSlideTracker &tracker);
  30. [[nodiscard]] not_null<Ui::SettingsButton*> AddButton(
  31. Ui::VerticalLayout *parent,
  32. not_null<Window::SessionNavigation*> navigation,
  33. not_null<PeerData*> peer,
  34. MsgId topicRootId,
  35. PeerData *migrated,
  36. Type type,
  37. Ui::MultiSlideTracker &tracker);
  38. [[nodiscard]] not_null<Ui::SettingsButton*> AddCommonGroupsButton(
  39. Ui::VerticalLayout *parent,
  40. not_null<Window::SessionNavigation*> navigation,
  41. not_null<UserData*> user,
  42. Ui::MultiSlideTracker &tracker);
  43. [[nodiscard]] not_null<Ui::SettingsButton*> AddSimilarPeersButton(
  44. Ui::VerticalLayout *parent,
  45. not_null<Window::SessionNavigation*> navigation,
  46. not_null<PeerData*> peer,
  47. Ui::MultiSlideTracker &tracker);
  48. [[nodiscard]] not_null<Ui::SettingsButton*> AddStoriesButton(
  49. Ui::VerticalLayout *parent,
  50. not_null<Window::SessionNavigation*> navigation,
  51. not_null<PeerData*> peer,
  52. Ui::MultiSlideTracker &tracker);
  53. [[nodiscard]] not_null<Ui::SettingsButton*> AddSavedSublistButton(
  54. Ui::VerticalLayout *parent,
  55. not_null<Window::SessionNavigation*> navigation,
  56. not_null<PeerData*> peer,
  57. Ui::MultiSlideTracker &tracker);
  58. [[nodiscard]] not_null<Ui::SettingsButton*> AddPeerGiftsButton(
  59. Ui::VerticalLayout *parent,
  60. not_null<Window::SessionNavigation*> navigation,
  61. not_null<PeerData*> peer,
  62. Ui::MultiSlideTracker &tracker);
  63. } // namespace Info::Media