export_manager.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. class PeerData;
  9. namespace Ui {
  10. class BoxContent;
  11. } // namespace Ui
  12. namespace Main {
  13. class Session;
  14. } // namespace Main
  15. namespace Export {
  16. class Controller;
  17. namespace View {
  18. class PanelController;
  19. } // namespace View
  20. class Manager final {
  21. public:
  22. Manager();
  23. ~Manager();
  24. void start(not_null<PeerData*> peer);
  25. void start(
  26. not_null<Main::Session*> session,
  27. const MTPInputPeer &singlePeer = MTP_inputPeerEmpty());
  28. [[nodiscard]] rpl::producer<View::PanelController*> currentView() const;
  29. [[nodiscard]] bool inProgress() const;
  30. [[nodiscard]] bool inProgress(not_null<Main::Session*> session) const;
  31. void stopWithConfirmation(Fn<void()> callback);
  32. void stop();
  33. private:
  34. std::unique_ptr<Controller> _controller;
  35. std::unique_ptr<View::PanelController> _panel;
  36. rpl::event_stream<View::PanelController*> _viewChanges;
  37. };
  38. } // namespace Export