2017-11-10 15:45:10 +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-11-10 15:45:10 +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-11-10 15:45:10 +00:00
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
2022-04-23 22:03:04 +00:00
|
|
|
#include "ui/layers/box_content.h"
|
|
|
|
|
|
|
|
namespace Settings {
|
|
|
|
struct IconDescriptor;
|
|
|
|
} // namespace Settings
|
2019-03-17 10:06:00 +00:00
|
|
|
|
|
|
|
namespace style {
|
2019-11-02 17:06:47 +00:00
|
|
|
struct SettingsCountButton;
|
2019-03-17 10:06:00 +00:00
|
|
|
} // namespace style
|
|
|
|
|
2019-07-25 18:55:11 +00:00
|
|
|
namespace Window {
|
|
|
|
class SessionNavigation;
|
|
|
|
} // namespace Window
|
|
|
|
|
2019-03-17 10:06:00 +00:00
|
|
|
namespace Ui {
|
|
|
|
class VerticalLayout;
|
2019-11-02 17:06:47 +00:00
|
|
|
class SettingsButton;
|
2019-03-17 10:06:00 +00:00
|
|
|
} // namespace Ui
|
|
|
|
|
2019-09-18 11:19:05 +00:00
|
|
|
class EditPeerInfoBox : public Ui::BoxContent {
|
2017-11-10 15:45:10 +00:00
|
|
|
public:
|
2019-07-25 18:55:11 +00:00
|
|
|
EditPeerInfoBox(
|
|
|
|
QWidget*,
|
|
|
|
not_null<Window::SessionNavigation*> navigation,
|
|
|
|
not_null<PeerData*> peer);
|
2017-11-10 15:45:10 +00:00
|
|
|
|
|
|
|
void setInnerFocus() override {
|
|
|
|
_focusRequests.fire({});
|
|
|
|
}
|
|
|
|
|
2019-03-17 10:06:00 +00:00
|
|
|
static bool Available(not_null<PeerData*> peer);
|
|
|
|
|
2019-11-02 17:06:47 +00:00
|
|
|
[[nodiscard]] static object_ptr<Ui::SettingsButton> CreateButton(
|
2019-05-23 21:38:49 +00:00
|
|
|
not_null<QWidget*> parent,
|
2019-03-17 10:06:00 +00:00
|
|
|
rpl::producer<QString> &&text,
|
|
|
|
rpl::producer<QString> &&count,
|
|
|
|
Fn<void()> callback,
|
2019-11-02 17:06:47 +00:00
|
|
|
const style::SettingsCountButton &st,
|
2022-04-23 22:03:04 +00:00
|
|
|
Settings::IconDescriptor &&descriptor);
|
2019-03-17 10:06:00 +00:00
|
|
|
|
2017-11-10 15:45:10 +00:00
|
|
|
protected:
|
|
|
|
void prepare() override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
rpl::event_stream<> _focusRequests;
|
2019-07-25 18:55:11 +00:00
|
|
|
not_null<Window::SessionNavigation*> _navigation;
|
2019-03-17 17:42:33 +00:00
|
|
|
not_null<PeerData*> _peer;
|
2017-11-10 15:45:10 +00:00
|
|
|
|
|
|
|
};
|