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);
|
|
|
|
Memento(PeerId peerId, PeerId migratedPeerId)
|
|
|
|
: ContentMemento(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-10-03 17:41:44 +00:00
|
|
|
void setInfoExpanded(bool expanded) {
|
|
|
|
_infoExpanded = expanded;
|
2017-09-13 17:01:23 +00:00
|
|
|
}
|
2017-10-03 17:41:44 +00:00
|
|
|
bool infoExpanded() const {
|
|
|
|
return _infoExpanded;
|
|
|
|
}
|
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-10 19:19:43 +00:00
|
|
|
bool _infoExpanded = true;
|
2017-10-24 17:11:35 +00:00
|
|
|
base::optional<QString> _membersSearch;
|
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
|
|
|
|
2017-10-20 17:54:51 +00:00
|
|
|
void setIsStackBottom(bool isStackBottom) override;
|
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;
|
|
|
|
|
|
|
|
private:
|
|
|
|
void saveState(not_null<Memento*> memento);
|
|
|
|
void restoreState(not_null<Memento*> memento);
|
|
|
|
|
2017-11-03 18:26:14 +00:00
|
|
|
std::unique_ptr<ContentMemento> doCreateMemento() override;
|
|
|
|
|
2017-09-13 17:01:23 +00:00
|
|
|
InnerWidget *_inner = nullptr;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace Profile
|
|
|
|
} // namespace Info
|