2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-24 03:07:20 +00:00
tdesktop/Telegram/SourceFiles/boxes/peers/edit_peer_info_box.h

70 lines
1.6 KiB
C
Raw Permalink Normal View History

2017-11-10 19:45:10 +04:00
/*
This file is part of Telegram Desktop,
the official desktop application for the Telegram messaging service.
2017-11-10 19:45:10 +04:00
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
2017-11-10 19:45:10 +04:00
*/
#pragma once
#include "ui/layers/box_content.h"
namespace Settings {
struct IconDescriptor;
} // namespace Settings
namespace style {
struct SettingsCountButton;
} // namespace style
2019-07-25 20:55:11 +02:00
namespace Window {
class SessionNavigation;
} // namespace Window
namespace Ui {
class VerticalLayout;
class SettingsButton;
} // namespace Ui
2019-09-18 14:19:05 +03:00
class EditPeerInfoBox : public Ui::BoxContent {
2017-11-10 19:45:10 +04:00
public:
2019-07-25 20:55:11 +02:00
EditPeerInfoBox(
QWidget*,
not_null<Window::SessionNavigation*> navigation,
not_null<PeerData*> peer);
2017-11-10 19:45:10 +04: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);
[[nodiscard]] static object_ptr<Ui::SettingsButton> CreateButton(
not_null<QWidget*> parent,
rpl::producer<QString> &&text,
rpl::producer<TextWithEntities> &&labelText,
Fn<void()> callback,
const style::SettingsCountButton &st,
Settings::IconDescriptor &&descriptor);
2017-11-10 19:45:10 +04:00
protected:
void prepare() override;
private:
rpl::event_stream<> _focusRequests;
2019-07-25 20:55:11 +02:00
not_null<Window::SessionNavigation*> _navigation;
not_null<PeerData*> _peer;
2017-11-10 19:45:10 +04:00
};
void ShowEditChatPermissions(
not_null<Window::SessionNavigation*> navigation,
not_null<PeerData*> peer);