ZaStoGram_desktop/Telegram/SourceFiles/info/profile/info_profile_share_theme.h
John Preston 6b3d996c16 Choose collectible gifts as the QR box appearance.
Task: 2026/10/15/choose-a-unique-gift-for-the-qr-box
2026-10-20 17:07:54 +04:00

57 lines
1.3 KiB
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 "ui/effects/peer_qr_colors_panel.h"
class PeerData;
namespace Data {
struct UniqueGift;
struct ShareThemeGift;
} // namespace Data
namespace Main {
class Session;
} // namespace Main
namespace Info::Profile {
struct QrServedTheme {
Ui::PeerQrSwatch swatch;
bool kept = false;
friend inline bool operator==(
const QrServedTheme &,
const QrServedTheme &) = default;
};
[[nodiscard]] auto QrThemeSwatchesValue(not_null<Main::Session*> session)
-> rpl::producer<std::vector<Ui::PeerQrSwatch>>;
[[nodiscard]] Ui::PeerQrSwatch QrGiftSwatch(const Data::UniqueGift &gift);
[[nodiscard]] rpl::producer<QrServedTheme> QrServedThemeValue(
not_null<PeerData*> peer);
[[nodiscard]] rpl::producer<bool> QrThemeCanSaveValue(
not_null<PeerData*> peer);
void SaveQrTheme(
not_null<PeerData*> peer,
Ui::PeerQrThemeKey key,
Fn<void()> done,
Fn<void(QString)> fail);
void SaveQrGiftTheme(
not_null<PeerData*> peer,
const Data::ShareThemeGift &theme,
Fn<void()> done,
Fn<void(QString)> fail);
} // namespace Info::Profile