info_section_widget.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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 <rpl/event_stream.h>
  9. #include "window/section_widget.h"
  10. namespace Window {
  11. class ConnectionState;
  12. } // namespace Window
  13. namespace Info {
  14. class Memento;
  15. class MoveMemento;
  16. class Controller;
  17. class WrapWidget;
  18. enum class Wrap;
  19. class SectionWidget final : public Window::SectionWidget {
  20. public:
  21. SectionWidget(
  22. QWidget *parent,
  23. not_null<Window::SessionController*> window,
  24. Wrap wrap,
  25. not_null<Memento*> memento);
  26. SectionWidget(
  27. QWidget *parent,
  28. not_null<Window::SessionController*> window,
  29. Wrap wrap,
  30. not_null<MoveMemento*> memento);
  31. Dialogs::RowDescriptor activeChat() const override;
  32. bool hasTopBarShadow() const override;
  33. QPixmap grabForShowAnimation(
  34. const Window::SectionSlideParams &params) override;
  35. bool showInternal(
  36. not_null<Window::SectionMemento*> memento,
  37. const Window::SectionShow &params) override;
  38. std::shared_ptr<Window::SectionMemento> createMemento() override;
  39. object_ptr<Ui::LayerWidget> moveContentToLayer(
  40. QRect bodyGeometry) override;
  41. rpl::producer<> removeRequests() const override;
  42. // Float player interface.
  43. bool floatPlayerHandleWheelEvent(QEvent *e) override;
  44. QRect floatPlayerAvailableRect() override;
  45. protected:
  46. void doSetInnerFocus() override;
  47. void showFinishedHook() override;
  48. void showAnimatedHook(
  49. const Window::SectionSlideParams &params) override;
  50. void paintEvent(QPaintEvent *e) override;
  51. private:
  52. void init();
  53. object_ptr<WrapWidget> _content;
  54. object_ptr<Ui::RpWidget> _topBarSurrogate = { nullptr };
  55. std::unique_ptr<Window::ConnectionState> _connecting;
  56. };
  57. } // namespace Info