settings_credits.h 886 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  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_type.h"
  9. namespace Api {
  10. class CreditsTopupOptions;
  11. } // namespace Api
  12. namespace Main {
  13. class SessionShow;
  14. } // namespace Main
  15. namespace Settings {
  16. [[nodiscard]] Type CreditsId();
  17. class BuyStarsHandler final : public base::has_weak_ptr {
  18. public:
  19. BuyStarsHandler();
  20. ~BuyStarsHandler();
  21. [[nodiscard]] Fn<void()> handler(
  22. std::shared_ptr<::Main::SessionShow> show,
  23. Fn<void()> paid = nullptr);
  24. [[nodiscard]] rpl::producer<bool> loadingValue() const;
  25. private:
  26. std::unique_ptr<Api::CreditsTopupOptions> _api;
  27. rpl::variable<bool> _loading;
  28. rpl::lifetime _lifetime;
  29. };
  30. } // namespace Settings