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