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
|
|
|
|
|
|
|
|
#include <rpl/producer.h>
|
|
|
|
#include <rpl/map.h>
|
|
|
|
#include "observer_peer.h"
|
|
|
|
|
|
|
|
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
|
|
|
|
|
2017-09-25 12:02:55 +03:00
|
|
|
namespace Info {
|
|
|
|
namespace Profile {
|
|
|
|
|
2017-11-07 11:21:48 +04:00
|
|
|
inline auto ToSingleLine() {
|
|
|
|
return rpl::map([](const QString &text) {
|
|
|
|
return TextUtilities::SingleLine(text);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2017-09-25 12:02:55 +03:00
|
|
|
inline auto WithEmptyEntities() {
|
|
|
|
return rpl::map([](QString &&text) {
|
|
|
|
return TextWithEntities{ std::move(text), {} };
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
inline auto ToUpperValue() {
|
|
|
|
return rpl::map([](QString &&text) {
|
|
|
|
return std::move(text).toUpper();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
rpl::producer<TextWithEntities> PhoneValue(
|
|
|
|
not_null<UserData*> user);
|
|
|
|
rpl::producer<TextWithEntities> BioValue(
|
|
|
|
not_null<UserData*> user);
|
|
|
|
rpl::producer<TextWithEntities> UsernameValue(
|
|
|
|
not_null<UserData*> user);
|
|
|
|
rpl::producer<TextWithEntities> AboutValue(
|
|
|
|
not_null<PeerData*> peer);
|
2017-11-10 21:51:59 +04:00
|
|
|
rpl::producer<QString> LinkValue(
|
2017-09-25 12:02:55 +03:00
|
|
|
not_null<PeerData*> peer);
|
|
|
|
rpl::producer<bool> NotificationsEnabledValue(
|
|
|
|
not_null<PeerData*> peer);
|
|
|
|
rpl::producer<bool> IsContactValue(
|
|
|
|
not_null<UserData*> user);
|
2017-11-07 15:53:05 +04:00
|
|
|
rpl::producer<bool> CanInviteBotToGroupValue(
|
|
|
|
not_null<UserData*> user);
|
2017-09-25 12:02:55 +03:00
|
|
|
rpl::producer<bool> CanShareContactValue(
|
|
|
|
not_null<UserData*> user);
|
|
|
|
rpl::producer<bool> CanAddContactValue(
|
|
|
|
not_null<UserData*> user);
|
2017-11-07 15:53:05 +04:00
|
|
|
rpl::producer<bool> AmInChannelValue(
|
|
|
|
not_null<ChannelData*> channel);
|
2017-09-25 12:02:55 +03:00
|
|
|
rpl::producer<int> MembersCountValue(
|
|
|
|
not_null<PeerData*> peer);
|
2017-11-08 20:45:30 +04:00
|
|
|
rpl::producer<int> AdminsCountValue(
|
|
|
|
not_null<ChannelData*> channel);
|
|
|
|
rpl::producer<int> RestrictedCountValue(
|
|
|
|
not_null<ChannelData*> channel);
|
|
|
|
rpl::producer<int> KickedCountValue(
|
|
|
|
not_null<ChannelData*> channel);
|
2017-09-25 12:02:55 +03:00
|
|
|
rpl::producer<int> SharedMediaCountValue(
|
|
|
|
not_null<PeerData*> peer,
|
2017-10-31 22:25:22 +04:00
|
|
|
PeerData *migrated,
|
2017-09-25 12:02:55 +03:00
|
|
|
Storage::SharedMediaType type);
|
|
|
|
rpl::producer<int> CommonGroupsCountValue(
|
|
|
|
not_null<UserData*> user);
|
2017-09-25 19:06:53 +03:00
|
|
|
rpl::producer<bool> CanAddMemberValue(
|
|
|
|
not_null<PeerData*> peer);
|
2017-11-06 18:13:56 +04:00
|
|
|
rpl::producer<bool> VerifiedValue(
|
|
|
|
not_null<PeerData*> peer);
|
2017-09-25 12:02:55 +03:00
|
|
|
|
2018-02-07 15:40:37 +03:00
|
|
|
rpl::producer<int> FeedChannelsCountValue(
|
|
|
|
not_null<Data::Feed*> feed);
|
|
|
|
|
2017-09-25 12:02:55 +03:00
|
|
|
} // namespace Profile
|
|
|
|
} // namespace Info
|