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
|
|
|
|
2017-11-03 18:26:14 +00:00
|
|
|
struct PeerListState;
|
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
class SearchFieldController;
|
|
|
|
} // namespace Ui
|
|
|
|
|
2017-09-13 17:01:23 +00:00
|
|
|
namespace Info {
|
|
|
|
namespace CommonGroups {
|
|
|
|
|
|
|
|
class InnerWidget;
|
|
|
|
|
|
|
|
class Memento final : public ContentMemento {
|
|
|
|
public:
|
2020-06-08 09:06:50 +00:00
|
|
|
explicit Memento(not_null<UserData*> user);
|
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-10-03 13:05:58 +00:00
|
|
|
|
2020-06-08 09:06:50 +00:00
|
|
|
not_null<UserData*> user() const;
|
2017-09-13 17:01:23 +00:00
|
|
|
|
2017-11-03 18:26:14 +00:00
|
|
|
void setListState(std::unique_ptr<PeerListState> state);
|
|
|
|
std::unique_ptr<PeerListState> listState();
|
|
|
|
|
|
|
|
~Memento();
|
|
|
|
|
2017-09-13 17:01:23 +00:00
|
|
|
private:
|
2017-11-03 18:26:14 +00:00
|
|
|
std::unique_ptr<PeerListState> _listState;
|
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
|
|
|
not_null<UserData*> user);
|
|
|
|
|
|
|
|
not_null<UserData*> user() const;
|
|
|
|
|
|
|
|
bool showInternal(
|
|
|
|
not_null<ContentMemento*> memento) override;
|
|
|
|
|
|
|
|
void setInternalState(
|
|
|
|
const QRect &geometry,
|
|
|
|
not_null<Memento*> memento);
|
|
|
|
|
|
|
|
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 CommonGroups
|
|
|
|
} // namespace Info
|
|
|
|
|