stickers_panel_controller.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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/unique_qptr.h"
  9. namespace ChatHelpers {
  10. class TabbedPanel;
  11. class Show;
  12. } // namespace ChatHelpers
  13. namespace Ui {
  14. class RpWidget;
  15. } // namespace Ui
  16. namespace Editor {
  17. class StickersPanelController final {
  18. public:
  19. enum class ShowRequest {
  20. ToggleAnimated,
  21. ShowAnimated,
  22. HideAnimated,
  23. HideFast,
  24. };
  25. StickersPanelController(
  26. not_null<Ui::RpWidget*> panelContainer,
  27. std::shared_ptr<ChatHelpers::Show> show);
  28. [[nodiscard]] auto stickerChosen() const
  29. -> rpl::producer<not_null<DocumentData*>>;
  30. [[nodiscard]] rpl::producer<bool> panelShown() const;
  31. void setShowRequestChanges(rpl::producer<ShowRequest> &&showRequest);
  32. // Middle x and plain y position.
  33. void setMoveRequestChanges(rpl::producer<QPoint> &&moveRequest);
  34. private:
  35. const base::unique_qptr<ChatHelpers::TabbedPanel> _stickersPanel;
  36. };
  37. } // namespace Editor