/* 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 "base/object_ptr.h" namespace Ui { class VerticalLayout; class FlatLabel; class RpWidget; } // namespace Ui namespace Info::Profile { struct Section { object_ptr widget = { nullptr }; rpl::producer shown; }; class SectionStack final { public: explicit SectionStack(not_null layout); void add(Section section); void addPlainSeparator(); void addTextSeparator( rpl::producer text, rpl::producer shown, Fn)> setup = nullptr); void finalize(); [[nodiscard]] not_null layout() const; private: enum class RowType { Block, PlainSeparator, TextSeparator, }; struct Row { RowType type = RowType::Block; object_ptr widget = { nullptr }; rpl::producer shown; rpl::producer text; Fn)> textSetup; }; [[nodiscard]] static std::vector ComputeVisibility( const std::vector &kinds, const std::vector &intrinsic); const not_null _layout; std::vector _rows; bool _finalized = false; }; } // namespace Info::Profile