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
|
|
|
|
|
|
|
|
#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 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
|
|
|
|
|
2017-09-25 09:02:55 +00:00
|
|
|
namespace Info {
|
|
|
|
namespace Profile {
|
|
|
|
|
2017-11-07 07:21:48 +00:00
|
|
|
inline auto ToSingleLine() {
|
|
|
|
return rpl::map([](const QString &text) {
|
|
|
|
return TextUtilities::SingleLine(text);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2017-09-25 09:02:55 +00: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();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2019-01-07 12:55:49 +00:00
|
|
|
rpl::producer<TextWithEntities> NameValue(not_null<PeerData*> peer);
|
|
|
|
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);
|
|
|
|
rpl::producer<QString> LinkValue(not_null<PeerData*> peer);
|
|
|
|
rpl::producer<bool> NotificationsEnabledValue(not_null<PeerData*> peer);
|
|
|
|
rpl::producer<bool> IsContactValue(not_null<UserData*> user);
|
|
|
|
rpl::producer<bool> CanInviteBotToGroupValue(not_null<UserData*> user);
|
|
|
|
rpl::producer<bool> CanShareContactValue(not_null<UserData*> user);
|
|
|
|
rpl::producer<bool> CanAddContactValue(not_null<UserData*> user);
|
|
|
|
rpl::producer<bool> AmInChannelValue(not_null<ChannelData*> channel);
|
|
|
|
rpl::producer<int> MembersCountValue(not_null<PeerData*> peer);
|
|
|
|
rpl::producer<int> AdminsCountValue(not_null<PeerData*> peer);
|
|
|
|
rpl::producer<int> RestrictedCountValue(not_null<ChannelData*> channel);
|
|
|
|
rpl::producer<int> KickedCountValue(not_null<ChannelData*> channel);
|
2017-09-25 09:02:55 +00:00
|
|
|
rpl::producer<int> SharedMediaCountValue(
|
|
|
|
not_null<PeerData*> peer,
|
2017-10-31 18:25:22 +00:00
|
|
|
PeerData *migrated,
|
2017-09-25 09:02:55 +00:00
|
|
|
Storage::SharedMediaType type);
|
2019-01-07 12:55:49 +00:00
|
|
|
rpl::producer<int> CommonGroupsCountValue(not_null<UserData*> user);
|
|
|
|
rpl::producer<bool> CanAddMemberValue(not_null<PeerData*> peer);
|
|
|
|
rpl::producer<bool> VerifiedValue(not_null<PeerData*> peer);
|
2017-09-25 09:02:55 +00:00
|
|
|
|
2019-01-07 12:55:49 +00:00
|
|
|
rpl::producer<int> FeedChannelsCountValue(not_null<Data::Feed*> feed);
|
2018-02-07 12:40:37 +00:00
|
|
|
|
2017-09-25 09:02:55 +00:00
|
|
|
} // namespace Profile
|
|
|
|
} // namespace Info
|