mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-07-25 06:54:43 +00:00
31f3d6810d
- Move stats/gift/earn buttons to builder.addButton() with proper IDs - Use builder.add() for dynamic subscriptions/history lists - Have setupContent() call build(content, buildMethod) - Remove extern SectionBuildMethod from header - Extract BuildCurrencyWithdrawalSection helper function - Add forward declarations for builder functions Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
44 lines
946 B
C++
44 lines
946 B
C++
/*
|
|
This file is part of Telegram Desktop,
|
|
the official desktop application for the Telegram messaging service.
|
|
|
|
For license and copyright information please follow this link:
|
|
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|
*/
|
|
#pragma once
|
|
|
|
#include "base/weak_ptr.h"
|
|
#include "settings/settings_type.h"
|
|
|
|
namespace Api {
|
|
class CreditsTopupOptions;
|
|
} // namespace Api
|
|
|
|
namespace Main {
|
|
class SessionShow;
|
|
} // namespace Main
|
|
|
|
namespace Settings {
|
|
|
|
[[nodiscard]] Type CreditsId();
|
|
[[nodiscard]] Type CurrencyId();
|
|
|
|
class BuyStarsHandler final : public base::has_weak_ptr {
|
|
public:
|
|
BuyStarsHandler();
|
|
~BuyStarsHandler();
|
|
|
|
[[nodiscard]] Fn<void()> handler(
|
|
std::shared_ptr<::Main::SessionShow> show,
|
|
Fn<void()> paid = nullptr);
|
|
[[nodiscard]] rpl::producer<bool> loadingValue() const;
|
|
|
|
private:
|
|
std::unique_ptr<Api::CreditsTopupOptions> _api;
|
|
rpl::variable<bool> _loading;
|
|
rpl::lifetime _lifetime;
|
|
|
|
};
|
|
|
|
} // namespace Settings
|