/* 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 "info/info_content_widget.h" #include "ui/effects/animations.h" namespace Data { class ForumTopic; } // namespace Data namespace Info::Profile { class InnerWidget; class TabsHost; struct MembersState; struct GroupReactionOrigin { not_null group; MsgId messageId = 0; }; struct Origin { std::variant data; }; class Memento final : public ContentMemento { public: explicit Memento(not_null controller); Memento( not_null peer, PeerId migratedPeerId, Origin origin = { v::null }); explicit Memento(not_null topic); explicit Memento(not_null sublist); object_ptr createWidget( QWidget *parent, not_null controller, const QRect &geometry) override; Info::Section section() const override; [[nodiscard]] Origin origin() const { return _origin; } void setMembersState(std::unique_ptr state); [[nodiscard]] std::unique_ptr membersState(); void setActiveTab(const QString &id) { _activeTab = id; } [[nodiscard]] QString activeTab() const { return _activeTab; } ~Memento(); private: Memento( not_null peer, Data::ForumTopic *topic, Data::SavedSublist *sublist, PeerId migratedPeerId, Origin origin); std::unique_ptr _membersState; Origin _origin; QString _activeTab; }; class Widget final : public ContentWidget { public: Widget(QWidget *parent, not_null controller, Origin origin); bool showInternal( not_null memento) override; void setInternalState( const QRect &geometry, not_null memento); void setInnerFocus() override; void enableBackButton() override; void showFinished() override; rpl::producer title() override; rpl::producer titleStories() override; private: void saveState(not_null memento); void restoreState(not_null memento); void setupTabsStripFloat(); void updateTabsStripFloatGeometry(); [[nodiscard]] auto swipeTabsFinishData( Ui::Controls::SwipeHandlerInitData data) -> Ui::Controls::SwipeHandlerFinishData; std::shared_ptr doCreateMemento() override; FlexibleScrollData _flexibleScroll; InnerWidget *_inner = nullptr; base::weak_qptr _pinnedToTop; base::weak_qptr _pinnedToBottom; std::unique_ptr _flexibleScrollHelper; base::unique_qptr _tabsStripFloat; base::weak_qptr _tabsHost; base::weak_qptr _tabsStrip; }; } // namespace Info::Profile