tdesktop/Telegram/SourceFiles/boxes/peers/edit_peer_type_box.h

63 lines
1.3 KiB
C
Raw Normal View History

2019-03-16 16:58:32 +00:00
/*
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 "boxes/abstract_box.h"
#include "base/timer.h"
namespace style {
struct InfoProfileCountButton;
} // namespace style
namespace Ui {
class VerticalLayout;
} // namespace Ui
namespace Info {
namespace Profile {
class Button;
} // namespace Profile
} // namespace Info
enum class Privacy {
Public,
Private,
};
enum class UsernameState {
Normal,
TooMany,
NotAvailable,
};
class EditPeerTypeBox : public BoxContent {
2019-03-16 16:58:32 +00:00
public:
EditPeerTypeBox(
2019-03-16 16:58:32 +00:00
QWidget*,
not_null<PeerData*> p,
std::optional<FnMut<void(Privacy, QString)>> savedCallback = {},
std::optional<Privacy> privacySaved = {},
std::optional<QString> usernameSaved = {},
2019-06-18 12:16:43 +00:00
std::optional<rpl::producer<QString>> usernameError = {});
2019-03-16 16:58:32 +00:00
protected:
void prepare() override;
void setInnerFocus() override;
2019-03-16 16:58:32 +00:00
private:
not_null<PeerData*> _peer;
std::optional<FnMut<void(Privacy, QString)>> _savedCallback;
2019-03-16 16:58:32 +00:00
2019-03-19 15:45:46 +00:00
std::optional<Privacy> _privacySavedValue;
std::optional<QString> _usernameSavedValue;
2019-06-18 12:16:43 +00:00
std::optional<rpl::producer<QString>> _usernameError;
2019-03-16 16:58:32 +00:00
rpl::event_stream<> _focusRequests;
};