countries_manager.h 664 B

1234567891011121314151617181920212223242526272829303132333435363738
  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 "mtproto/sender.h"
  9. namespace Main {
  10. class Domain;
  11. } // namespace Main
  12. namespace Countries {
  13. class Manager final {
  14. public:
  15. Manager(not_null<Main::Domain*> domain);
  16. ~Manager();
  17. void read();
  18. void write() const;
  19. rpl::lifetime &lifetime();
  20. private:
  21. void request();
  22. std::optional<MTP::Sender> _api;
  23. const QString _path;
  24. int _hash = 0;
  25. rpl::lifetime _lifetime;
  26. };
  27. } // namespace Countries