2017-09-25 12:02:55 +03:00
|
|
|
/*
|
|
|
|
This file is part of Telegram Desktop,
|
2018-01-03 13:23:14 +03:00
|
|
|
the official desktop application for the Telegram messaging service.
|
2017-09-25 12:02:55 +03:00
|
|
|
|
2018-01-03 13:23:14 +03:00
|
|
|
For license and copyright information please follow this link:
|
|
|
|
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
2017-09-25 12:02:55 +03:00
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
2022-08-11 20:22:21 +03:00
|
|
|
#include "base/flags.h"
|
|
|
|
|
2017-09-25 12:02:55 +03:00
|
|
|
#include <rpl/producer.h>
|
|
|
|
#include <rpl/map.h>
|
|
|
|
|
2019-06-21 14:27:46 +02:00
|
|
|
struct ChannelLocation;
|
|
|
|
|
2022-09-27 16:05:47 +04:00
|
|
|
namespace Data {
|
|
|
|
class ForumTopic;
|
2022-10-13 21:34:04 +04:00
|
|
|
class Thread;
|
2024-03-22 14:52:10 +04:00
|
|
|
class Birthday;
|
2022-09-27 16:05:47 +04:00
|
|
|
} // namespace Data
|
|
|
|
|
2021-12-13 15:26:19 +04:00
|
|
|
namespace Main {
|
|
|
|
class Session;
|
|
|
|
} // namespace Main
|
|
|
|
|
2017-09-25 12:02:55 +03:00
|
|
|
namespace Ui {
|
|
|
|
class RpWidget;
|
|
|
|
template <typename Widget>
|
|
|
|
class SlideWrap;
|
|
|
|
} // namespace Ui
|
|
|
|
|
2018-01-11 22:33:26 +03:00
|
|
|
namespace Storage {
|
2018-03-09 21:48:47 +01:00
|
|
|
enum class SharedMediaType : signed char;
|
2018-01-11 22:33:26 +03:00
|
|
|
} // namespace Storage
|
|
|
|
|
2022-09-27 16:05:47 +04:00
|
|
|
namespace Info::Profile {
|
2017-09-25 12:02:55 +03:00
|
|
|
|
2017-11-07 11:21:48 +04:00
|
|
|
inline auto ToSingleLine() {
|
|
|
|
return rpl::map([](const QString &text) {
|
|
|
|
return TextUtilities::SingleLine(text);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2019-07-16 14:54:38 +02:00
|
|
|
rpl::producer<not_null<PeerData*>> MigratedOrMeValue(
|
|
|
|
not_null<PeerData*> peer);
|
|
|
|
|
2022-09-27 16:05:47 +04:00
|
|
|
[[nodiscard]] rpl::producer<QString> NameValue(not_null<PeerData*> peer);
|
|
|
|
[[nodiscard]] rpl::producer<QString> TitleValue(
|
|
|
|
not_null<Data::ForumTopic*> topic);
|
2022-10-14 20:53:06 +04:00
|
|
|
[[nodiscard]] rpl::producer<DocumentId> IconIdValue(
|
|
|
|
not_null<Data::ForumTopic*> topic);
|
2022-10-18 16:38:43 +04:00
|
|
|
[[nodiscard]] rpl::producer<int32> ColorIdValue(
|
|
|
|
not_null<Data::ForumTopic*> topic);
|
2022-03-15 15:12:49 +04:00
|
|
|
[[nodiscard]] rpl::producer<TextWithEntities> PhoneValue(
|
|
|
|
not_null<UserData*> user);
|
|
|
|
[[nodiscard]] rpl::producer<TextWithEntities> PhoneOrHiddenValue(
|
|
|
|
not_null<UserData*> user);
|
|
|
|
[[nodiscard]] rpl::producer<TextWithEntities> UsernameValue(
|
2022-10-13 01:24:03 +03:00
|
|
|
not_null<UserData*> user,
|
|
|
|
bool primary = false);
|
|
|
|
[[nodiscard]] rpl::producer<std::vector<TextWithEntities>> UsernamesValue(
|
|
|
|
not_null<PeerData*> peer);
|
2021-10-18 17:21:49 +04:00
|
|
|
[[nodiscard]] TextWithEntities AboutWithEntities(
|
|
|
|
not_null<PeerData*> peer,
|
|
|
|
const QString &value);
|
2022-03-15 15:12:49 +04:00
|
|
|
[[nodiscard]] rpl::producer<TextWithEntities> AboutValue(
|
|
|
|
not_null<PeerData*> peer);
|
2022-10-13 01:24:03 +03:00
|
|
|
[[nodiscard]] rpl::producer<QString> LinkValue(
|
|
|
|
not_null<PeerData*> peer,
|
|
|
|
bool primary = false);
|
2022-03-15 15:12:49 +04:00
|
|
|
[[nodiscard]] rpl::producer<const ChannelLocation*> LocationValue(
|
|
|
|
not_null<ChannelData*> channel);
|
|
|
|
[[nodiscard]] rpl::producer<bool> NotificationsEnabledValue(
|
|
|
|
not_null<PeerData*> peer);
|
2022-10-13 00:23:14 +04:00
|
|
|
[[nodiscard]] rpl::producer<bool> NotificationsEnabledValue(
|
2022-10-13 21:34:04 +04:00
|
|
|
not_null<Data::Thread*> thread);
|
2022-03-15 15:12:49 +04:00
|
|
|
[[nodiscard]] rpl::producer<bool> IsContactValue(not_null<UserData*> user);
|
2022-03-23 14:15:52 +04:00
|
|
|
[[nodiscard]] rpl::producer<QString> InviteToChatButton(
|
|
|
|
not_null<UserData*> user);
|
|
|
|
[[nodiscard]] rpl::producer<QString> InviteToChatAbout(
|
2022-03-15 15:12:49 +04:00
|
|
|
not_null<UserData*> user);
|
|
|
|
[[nodiscard]] rpl::producer<bool> CanShareContactValue(
|
|
|
|
not_null<UserData*> user);
|
|
|
|
[[nodiscard]] rpl::producer<bool> CanAddContactValue(
|
|
|
|
not_null<UserData*> user);
|
2024-03-22 14:52:10 +04:00
|
|
|
[[nodiscard]] rpl::producer<Data::Birthday> BirthdayValue(
|
|
|
|
not_null<UserData*> user);
|
2022-03-15 15:12:49 +04:00
|
|
|
[[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 14:27:46 +02:00
|
|
|
not_null<ChannelData*> channel);
|
2022-03-15 15:12:49 +04:00
|
|
|
[[nodiscard]] rpl::producer<int> SharedMediaCountValue(
|
2017-09-25 12:02:55 +03:00
|
|
|
not_null<PeerData*> peer,
|
2022-10-11 19:08:19 +04:00
|
|
|
MsgId topicRootId,
|
2017-10-31 22:25:22 +04:00
|
|
|
PeerData *migrated,
|
2017-09-25 12:02:55 +03:00
|
|
|
Storage::SharedMediaType type);
|
2022-03-15 15:12:49 +04:00
|
|
|
[[nodiscard]] rpl::producer<int> CommonGroupsCountValue(
|
|
|
|
not_null<UserData*> user);
|
2023-11-28 12:54:17 +04:00
|
|
|
[[nodiscard]] rpl::producer<int> SimilarChannelsCountValue(
|
|
|
|
not_null<ChannelData*> channel);
|
2023-12-28 14:52:13 +00:00
|
|
|
[[nodiscard]] rpl::producer<int> SavedSublistCountValue(
|
|
|
|
not_null<PeerData*> peer);
|
2022-03-15 15:12:49 +04:00
|
|
|
[[nodiscard]] rpl::producer<bool> CanAddMemberValue(
|
|
|
|
not_null<PeerData*> peer);
|
|
|
|
[[nodiscard]] rpl::producer<int> FullReactionsCountValue(
|
|
|
|
not_null<Main::Session*> peer);
|
2022-12-16 18:22:56 +04:00
|
|
|
[[nodiscard]] rpl::producer<bool> CanViewParticipantsValue(
|
|
|
|
not_null<ChannelData*> megagroup);
|
2021-01-21 16:39:40 +04:00
|
|
|
|
2022-09-06 20:53:42 +04:00
|
|
|
enum class BadgeType;
|
|
|
|
[[nodiscard]] rpl::producer<BadgeType> BadgeValue(not_null<PeerData*> peer);
|
2022-08-09 20:15:42 +03:00
|
|
|
[[nodiscard]] rpl::producer<DocumentId> EmojiStatusIdValue(
|
|
|
|
not_null<PeerData*> peer);
|
2017-09-25 12:02:55 +03:00
|
|
|
|
2022-09-27 16:05:47 +04:00
|
|
|
} // namespace Info::Profile
|