2017-09-13 17:01:23 +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-13 17:01:23 +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-13 17:01:23 +00:00
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <rpl/producer.h>
|
2017-09-30 18:26:45 +00:00
|
|
|
#include "info/info_content_widget.h"
|
2017-09-13 17:01:23 +00:00
|
|
|
|
|
|
|
namespace Info {
|
|
|
|
namespace Profile {
|
|
|
|
|
|
|
|
class InnerWidget;
|
2017-11-17 13:23:36 +00:00
|
|
|
struct MembersState;
|
2017-09-13 17:01:23 +00:00
|
|
|
|
|
|
|
class Memento final : public ContentMemento {
|
|
|
|
public:
|
2017-10-31 18:25:22 +00:00
|
|
|
Memento(not_null<Controller*> controller);
|
2020-06-08 09:06:50 +00:00
|
|
|
Memento(not_null<PeerData*> peer, PeerId migratedPeerId);
|
2017-09-13 17:01:23 +00:00
|
|
|
|
|
|
|
object_ptr<ContentWidget> createWidget(
|
|
|
|
QWidget *parent,
|
2017-10-31 18:25:22 +00:00
|
|
|
not_null<Controller*> controller,
|
2017-09-13 17:01:23 +00:00
|
|
|
const QRect &geometry) override;
|
|
|
|
|
2017-10-31 18:25:22 +00:00
|
|
|
Section section() const override;
|
2017-09-13 17:01:23 +00:00
|
|
|
|
2017-11-17 13:23:36 +00:00
|
|
|
void setMembersState(std::unique_ptr<MembersState> state);
|
|
|
|
std::unique_ptr<MembersState> membersState();
|
|
|
|
|
|
|
|
~Memento();
|
2017-09-13 17:01:23 +00:00
|
|
|
|
|
|
|
private:
|
2017-11-17 13:23:36 +00:00
|
|
|
std::unique_ptr<MembersState> _membersState;
|
2017-09-13 17:01:23 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
class Widget final : public ContentWidget {
|
|
|
|
public:
|
|
|
|
Widget(
|
|
|
|
QWidget *parent,
|
2017-10-31 18:25:22 +00:00
|
|
|
not_null<Controller*> controller);
|
2017-09-13 17:01:23 +00:00
|
|
|
|
|
|
|
bool showInternal(
|
|
|
|
not_null<ContentMemento*> memento) override;
|
|
|
|
|
|
|
|
void setInternalState(
|
|
|
|
const QRect &geometry,
|
|
|
|
not_null<Memento*> memento);
|
|
|
|
|
|
|
|
void setInnerFocus() override;
|
|
|
|
|
2022-04-04 06:36:45 +00:00
|
|
|
rpl::producer<QString> title() override;
|
|
|
|
|
2017-09-13 17:01:23 +00:00
|
|
|
private:
|
|
|
|
void saveState(not_null<Memento*> memento);
|
|
|
|
void restoreState(not_null<Memento*> memento);
|
|
|
|
|
2020-12-14 14:48:10 +00:00
|
|
|
std::shared_ptr<ContentMemento> doCreateMemento() override;
|
2017-11-03 18:26:14 +00:00
|
|
|
|
2017-09-13 17:01:23 +00:00
|
|
|
InnerWidget *_inner = nullptr;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace Profile
|
|
|
|
} // namespace Info
|