prepare_short_info_box.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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 "base/object_ptr.h"
  9. class PeerData;
  10. namespace style {
  11. struct ShortInfoCover;
  12. struct ShortInfoBox;
  13. } // namespace style
  14. namespace ChatHelpers {
  15. class Show;
  16. } // namespace ChatHelpers
  17. namespace Ui::Menu {
  18. struct MenuCallback;
  19. } // namespace Ui::Menu
  20. namespace Ui {
  21. class BoxContent;
  22. } // namespace Ui
  23. namespace Window {
  24. class SessionNavigation;
  25. } // namespace Window
  26. struct PeerShortInfoUserpic;
  27. struct PreparedShortInfoUserpic {
  28. rpl::producer<PeerShortInfoUserpic> value;
  29. Fn<void(int)> move;
  30. };
  31. [[nodiscard]] object_ptr<Ui::BoxContent> PrepareShortInfoBox(
  32. not_null<PeerData*> peer,
  33. Fn<void()> open,
  34. Fn<bool()> videoPaused,
  35. Fn<void(Ui::Menu::MenuCallback)> menuFiller,
  36. const style::ShortInfoBox *stOverride = nullptr);
  37. [[nodiscard]] object_ptr<Ui::BoxContent> PrepareShortInfoBox(
  38. not_null<PeerData*> peer,
  39. std::shared_ptr<ChatHelpers::Show> show,
  40. const style::ShortInfoBox *stOverride = nullptr);
  41. [[nodiscard]] object_ptr<Ui::BoxContent> PrepareShortInfoBox(
  42. not_null<PeerData*> peer,
  43. not_null<Window::SessionNavigation*> navigation,
  44. const style::ShortInfoBox *stOverride = nullptr);
  45. [[nodiscard]] rpl::producer<QString> PrepareShortInfoStatus(
  46. not_null<PeerData*> peer);
  47. [[nodiscard]] PreparedShortInfoUserpic PrepareShortInfoUserpic(
  48. not_null<PeerData*> peer,
  49. const style::ShortInfoCover &st);
  50. [[nodiscard]] PreparedShortInfoUserpic PrepareShortInfoFallbackUserpic(
  51. not_null<PeerData*> peer,
  52. const style::ShortInfoCover &st);