tdesktop/Telegram/SourceFiles/info/profile/info_profile_values.h

101 lines
3.1 KiB
C
Raw Normal View History

/*
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 <rpl/producer.h>
#include <rpl/map.h>
2019-06-21 12:27:46 +00:00
struct ChannelLocation;
namespace Main {
class Session;
} // namespace Main
namespace Ui {
class RpWidget;
template <typename Widget>
class SlideWrap;
} // namespace Ui
namespace Storage {
enum class SharedMediaType : signed char;
} // namespace Storage
namespace Info {
namespace Profile {
inline auto ToSingleLine() {
return rpl::map([](const QString &text) {
return TextUtilities::SingleLine(text);
});
}
2019-07-16 12:54:38 +00:00
rpl::producer<not_null<PeerData*>> MigratedOrMeValue(
not_null<PeerData*> peer);
2022-03-15 11:12:49 +00:00
[[nodiscard]] rpl::producer<TextWithEntities> NameValue(
not_null<PeerData*> peer);
[[nodiscard]] rpl::producer<TextWithEntities> PhoneValue(
not_null<UserData*> user);
[[nodiscard]] rpl::producer<TextWithEntities> PhoneOrHiddenValue(
not_null<UserData*> user);
[[nodiscard]] rpl::producer<TextWithEntities> UsernameValue(
not_null<UserData*> user);
[[nodiscard]] TextWithEntities AboutWithEntities(
not_null<PeerData*> peer,
const QString &value);
2022-03-15 11:12:49 +00:00
[[nodiscard]] rpl::producer<TextWithEntities> AboutValue(
not_null<PeerData*> peer);
[[nodiscard]] rpl::producer<QString> LinkValue(not_null<PeerData*> peer);
[[nodiscard]] rpl::producer<const ChannelLocation*> LocationValue(
not_null<ChannelData*> channel);
[[nodiscard]] rpl::producer<bool> NotificationsEnabledValue(
not_null<PeerData*> peer);
[[nodiscard]] rpl::producer<bool> IsContactValue(not_null<UserData*> user);
[[nodiscard]] rpl::producer<bool> CanInviteBotToGroupValue(
not_null<UserData*> user);
[[nodiscard]] rpl::producer<bool> CanShareContactValue(
not_null<UserData*> user);
[[nodiscard]] rpl::producer<bool> CanAddContactValue(
not_null<UserData*> user);
[[nodiscard]] rpl::producer<bool> AmInChannelValue(
not_null<ChannelData*> channel);
[[nodiscard]] rpl::producer<int> MembersCountValue(not_null<PeerData*> peer);
[[nodiscard]] rpl::producer<int> PendingRequestsCountValue(
not_null<PeerData*> peer);
[[nodiscard]] rpl::producer<int> AdminsCountValue(not_null<PeerData*> peer);
[[nodiscard]] rpl::producer<int> RestrictionsCountValue(
not_null<PeerData*> peer);
[[nodiscard]] rpl::producer<int> RestrictedCountValue(
not_null<ChannelData*> channel);
[[nodiscard]] rpl::producer<int> KickedCountValue(
2019-06-21 12:27:46 +00:00
not_null<ChannelData*> channel);
2022-03-15 11:12:49 +00:00
[[nodiscard]] rpl::producer<int> SharedMediaCountValue(
not_null<PeerData*> peer,
PeerData *migrated,
Storage::SharedMediaType type);
2022-03-15 11:12:49 +00:00
[[nodiscard]] rpl::producer<int> CommonGroupsCountValue(
not_null<UserData*> user);
[[nodiscard]] rpl::producer<bool> CanAddMemberValue(
not_null<PeerData*> peer);
[[nodiscard]] rpl::producer<int> FullReactionsCountValue(
not_null<Main::Session*> peer);
[[nodiscard]] rpl::producer<int> AllowedReactionsCountValue(
not_null<PeerData*> peer);
2021-01-21 12:39:40 +00:00
enum class Badge {
None,
Verified,
Scam,
Fake,
};
2022-03-15 11:12:49 +00:00
[[nodiscard]] rpl::producer<Badge> BadgeValue(not_null<PeerData*> peer);
} // namespace Profile
} // namespace Info