/* 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/object_ptr.h" #include "data/data_user.h" namespace Ui { class AbstractButton; class RoundButton; class VerticalLayout; class BoxContent; class RpWidget; } // namespace Ui namespace style { struct RoundButton; } // namespace style namespace Info::BotStarRef { struct ConnectedBotState { StarRefProgram program; QString link; TimeId date = 0; int users = 0; bool revoked = false; }; struct ConnectedBot { not_null bot; ConnectedBotState state; }; using ConnectedBots = std::vector; [[nodiscard]] QString FormatStarRefCommission(ushort commission); [[nodiscard]] rpl::producer FormatProgramDuration( StarRefProgram program); [[nodiscard]] not_null AddViewListButton( not_null parent, rpl::producer title, rpl::producer subtitle); [[nodiscard]] not_null AddFullWidthButton( not_null box, rpl::producer text, Fn callback = nullptr, const style::RoundButton *stOverride = nullptr); void AddFullWidthButtonFooter( not_null box, not_null button, rpl::producer text); [[nodiscard]] object_ptr StarRefLinkBox( ConnectedBot row, not_null peer); [[nodiscard]] object_ptr JoinStarRefBox( ConnectedBot row, not_null peer); std::unique_ptr MakePeerBubbleButton( not_null parent, not_null peer, Ui::RpWidget *right = nullptr); [[nodiscard]] ConnectedBots Parse( not_null session, const MTPpayments_ConnectedStarRefBots &bots); } // namespace Info::BotStarRef