section_memento.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. namespace Ui {
  9. class LayerWidget;
  10. } // namespace Ui
  11. namespace Data {
  12. class ForumTopic;
  13. } // namespace Data
  14. namespace Window {
  15. class SessionController;
  16. class SectionWidget;
  17. enum class Column;
  18. class SectionMemento {
  19. public:
  20. [[nodiscard]] virtual object_ptr<SectionWidget> createWidget(
  21. QWidget *parent,
  22. not_null<SessionController*> controller,
  23. Column column,
  24. const QRect &geometry) = 0;
  25. [[nodiscard]] virtual object_ptr<Ui::LayerWidget> createLayer(
  26. not_null<SessionController*> controller,
  27. const QRect &geometry) {
  28. return nullptr;
  29. }
  30. [[nodiscard]] virtual bool instant() const {
  31. return false;
  32. }
  33. [[nodiscard]] virtual Data::ForumTopic *topicForRemoveRequests() const {
  34. return nullptr;
  35. }
  36. [[nodiscard]] virtual rpl::producer<> removeRequests() const {
  37. return rpl::never<>();
  38. }
  39. virtual ~SectionMemento() = default;
  40. };
  41. } // namespace Window