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

59 lines
1.3 KiB
C
Raw Normal View History

2017-11-10 15:45:10 +00:00
/*
This file is part of Telegram Desktop,
the official desktop application for the Telegram messaging service.
2017-11-10 15:45:10 +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
#include "ui/layers/box_content.h"
namespace Settings {
struct IconDescriptor;
} // namespace Settings
namespace style {
struct SettingsCountButton;
} // namespace style
2019-07-25 18:55:11 +00:00
namespace Window {
class SessionNavigation;
} // namespace Window
namespace Ui {
class VerticalLayout;
class SettingsButton;
} // 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({});
}
static bool Available(not_null<PeerData*> peer);
[[nodiscard]] static object_ptr<Ui::SettingsButton> CreateButton(
not_null<QWidget*> parent,
rpl::producer<QString> &&text,
rpl::producer<QString> &&count,
Fn<void()> callback,
const style::SettingsCountButton &st,
Settings::IconDescriptor &&descriptor);
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;
not_null<PeerData*> _peer;
2017-11-10 15:45:10 +00:00
};