/* 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" enum LangKey : int; namespace Ui { class VerticalLayout; } // namespace Ui namespace Window { class Controller; } // namespace Window namespace Info { namespace Profile { class Button; } // namespace Profile } // namespace Info namespace style { struct InfoProfileButton; } // namespace style namespace Settings { enum class Type { Main, Information, Notifications, PrivacySecurity, Advanced, Chat, }; using Button = Info::Profile::Button; class Section : public Ui::RpWidget { public: using RpWidget::RpWidget; virtual rpl::producer sectionShowOther() { return rpl::never(); } virtual rpl::producer sectionCanSaveChanges() { return rpl::single(false); } virtual void sectionSaveChanges(FnMut done) { done(); } }; object_ptr
CreateSection( Type type, not_null parent, Window::Controller *controller = nullptr, UserData *self = nullptr); void AddSkip(not_null container); void AddSkip(not_null container, int skip); void AddDivider(not_null container); void AddDividerText( not_null container, rpl::producer text); not_null AddButton( not_null container, LangKey text, const style::InfoProfileButton &st, const style::icon *leftIcon = nullptr); not_null AddButton( not_null container, rpl::producer text, const style::InfoProfileButton &st, const style::icon *leftIcon = nullptr); not_null AddButtonWithLabel( not_null container, LangKey text, rpl::producer label, const style::InfoProfileButton &st, const style::icon *leftIcon = nullptr); void CreateRightLabel( not_null button, rpl::producer label, const style::InfoProfileButton &st, LangKey buttonText); void AddSubsectionTitle( not_null conatiner, LangKey text); using MenuCallback = Fn handler)>; void FillMenu( Fn showOther, MenuCallback addAction); } // namespace Settings