tdesktop/Telegram/SourceFiles/info/profile/info_profile_inner_widget.h

89 lines
2.0 KiB
C
Raw Normal View History

/*
This file is part of Telegram Desktop,
the official desktop application for the Telegram messaging service.
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#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;
class PhotoMedia;
2022-09-27 12:05:47 +00:00
} // namespace Data
namespace Window {
class SessionController;
} // namespace Window
2017-09-21 10:28:34 +00:00
namespace Ui {
class VerticalLayout;
template <typename Widget>
class SlideWrap;
struct ScrollToRequest;
2017-11-07 11:53:05 +00:00
class MultiSlideTracker;
2017-09-21 10:28:34 +00:00
} // namespace Ui
namespace Info {
2017-09-25 16:06:53 +00:00
enum class Wrap;
class Controller;
2017-09-25 16:06:53 +00:00
namespace Profile {
class Memento;
class Members;
class Cover;
class InnerWidget final : public Ui::RpWidget {
public:
InnerWidget(
QWidget *parent,
not_null<Controller*> controller);
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;
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);
int countDesiredHeight() const;
2017-11-16 07:45:55 +00:00
void updateDesiredHeight() {
_desiredHeight.fire(countDesiredHeight());
}
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;
std::shared_ptr<Data::PhotoMedia> _nonPersonalView;
Members *_members = nullptr;
Cover *_cover = nullptr;
Ui::SlideWrap<RpWidget> *_sharedMediaWrap = nullptr;
object_ptr<RpWidget> _content;
2017-11-16 07:45:55 +00:00
bool _inResize = false;
rpl::event_stream<Ui::ScrollToRequest> _scrollToRequests;
rpl::event_stream<int> _desiredHeight;
};
} // namespace Profile
} // namespace Info