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 "ui/rp_widget.h"
|
2019-09-13 12:22:54 +00:00
|
|
|
#include "base/object_ptr.h"
|
|
|
|
|
2022-09-27 12:05:47 +00:00
|
|
|
namespace Data {
|
|
|
|
class ForumTopic;
|
2022-12-20 13:12:32 +00:00
|
|
|
class PhotoMedia;
|
2022-09-27 12:05:47 +00:00
|
|
|
} // namespace Data
|
2017-09-13 17:01:23 +00:00
|
|
|
|
2017-09-15 17:34:41 +00:00
|
|
|
namespace Window {
|
2019-06-06 10:21:40 +00:00
|
|
|
class SessionController;
|
2017-09-15 17:34:41 +00:00
|
|
|
} // namespace Window
|
|
|
|
|
2017-09-21 10:28:34 +00:00
|
|
|
namespace Ui {
|
|
|
|
class VerticalLayout;
|
|
|
|
template <typename Widget>
|
|
|
|
class SlideWrap;
|
2017-09-26 17:57:01 +00:00
|
|
|
struct ScrollToRequest;
|
2017-11-07 11:53:05 +00:00
|
|
|
class MultiSlideTracker;
|
2017-09-21 10:28:34 +00:00
|
|
|
} // namespace Ui
|
|
|
|
|
2017-09-13 17:01:23 +00:00
|
|
|
namespace Info {
|
2017-09-25 16:06:53 +00:00
|
|
|
|
|
|
|
enum class Wrap;
|
2017-10-31 18:25:22 +00:00
|
|
|
class Controller;
|
2017-09-25 16:06:53 +00:00
|
|
|
|
2017-09-13 17:01:23 +00:00
|
|
|
namespace Profile {
|
|
|
|
|
|
|
|
class Memento;
|
2017-09-26 17:57:01 +00:00
|
|
|
class Members;
|
2017-10-03 17:41:44 +00:00
|
|
|
class Cover;
|
2017-09-13 17:01:23 +00:00
|
|
|
|
|
|
|
class InnerWidget final : public Ui::RpWidget {
|
|
|
|
public:
|
2017-09-15 17:34:41 +00:00
|
|
|
InnerWidget(
|
|
|
|
QWidget *parent,
|
2017-10-31 18:25:22 +00:00
|
|
|
not_null<Controller*> controller);
|
2017-09-13 17:01:23 +00:00
|
|
|
|
|
|
|
void saveState(not_null<Memento*> memento);
|
|
|
|
void restoreState(not_null<Memento*> memento);
|
|
|
|
|
2017-11-21 09:20:56 +00:00
|
|
|
rpl::producer<Ui::ScrollToRequest> scrollToRequests() const;
|
|
|
|
rpl::producer<int> desiredHeightValue() const override;
|
2017-09-26 17:57:01 +00:00
|
|
|
|
2017-09-13 17:01:23 +00:00
|
|
|
protected:
|
|
|
|
int resizeGetHeight(int newWidth) override;
|
|
|
|
void visibleTopBottomUpdated(
|
|
|
|
int visibleTop,
|
|
|
|
int visibleBottom) override;
|
|
|
|
|
|
|
|
private:
|
2017-11-07 11:53:05 +00:00
|
|
|
object_ptr<RpWidget> setupContent(not_null<RpWidget*> parent);
|
|
|
|
object_ptr<RpWidget> setupSharedMedia(not_null<RpWidget*> parent);
|
2022-12-16 14:22:56 +00:00
|
|
|
void setupMembers(not_null<Ui::VerticalLayout*> container);
|
2017-09-13 17:01:23 +00:00
|
|
|
|
2017-09-26 17:57:01 +00:00
|
|
|
int countDesiredHeight() const;
|
2017-11-16 07:45:55 +00:00
|
|
|
void updateDesiredHeight() {
|
|
|
|
_desiredHeight.fire(countDesiredHeight());
|
|
|
|
}
|
2017-09-26 17:57:01 +00:00
|
|
|
|
2017-10-31 18:25:22 +00:00
|
|
|
const not_null<Controller*> _controller;
|
|
|
|
const not_null<PeerData*> _peer;
|
|
|
|
PeerData * const _migrated = nullptr;
|
2022-09-27 12:05:47 +00:00
|
|
|
Data::ForumTopic * const _topic = nullptr;
|
2017-09-13 17:01:23 +00:00
|
|
|
|
2022-12-20 13:12:32 +00:00
|
|
|
std::shared_ptr<Data::PhotoMedia> _nonPersonalView;
|
|
|
|
|
2017-09-26 17:57:01 +00:00
|
|
|
Members *_members = nullptr;
|
2017-10-03 17:41:44 +00:00
|
|
|
Cover *_cover = nullptr;
|
|
|
|
Ui::SlideWrap<RpWidget> *_sharedMediaWrap = nullptr;
|
2017-09-25 09:02:55 +00:00
|
|
|
object_ptr<RpWidget> _content;
|
2017-09-13 17:01:23 +00:00
|
|
|
|
2017-11-16 07:45:55 +00:00
|
|
|
bool _inResize = false;
|
2017-09-26 17:57:01 +00:00
|
|
|
rpl::event_stream<Ui::ScrollToRequest> _scrollToRequests;
|
|
|
|
rpl::event_stream<int> _desiredHeight;
|
|
|
|
|
2017-09-13 17:01:23 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace Profile
|
|
|
|
} // namespace Info
|