settings_blocked_peers.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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 "settings/settings_common_session.h"
  9. namespace Ui {
  10. class VerticalLayout;
  11. } // namespace Ui
  12. namespace Window {
  13. class Controller;
  14. } // namespace Window
  15. namespace Settings {
  16. class Blocked : public Section<Blocked> {
  17. public:
  18. Blocked(
  19. QWidget *parent,
  20. not_null<Window::SessionController*> controller);
  21. void showFinished() override;
  22. [[nodiscard]] rpl::producer<QString> title() override;
  23. [[nodiscard]] QPointer<Ui::RpWidget> createPinnedToTop(
  24. not_null<QWidget*> parent) override;
  25. private:
  26. void setupContent();
  27. void checkTotal(int total);
  28. void visibleTopBottomUpdated(int visibleTop, int visibleBottom) override;
  29. const not_null<Window::SessionController*> _controller;
  30. const not_null<Ui::VerticalLayout*> _container;
  31. base::unique_qptr<Ui::RpWidget> _loading;
  32. rpl::variable<int> _countBlocked;
  33. rpl::event_stream<> _showFinished;
  34. rpl::event_stream<bool> _emptinessChanges;
  35. };
  36. } // namespace Settings