/* 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" #include "base/object_ptr.h" namespace Main { class Session; } // namespace Main namespace Ui { class VerticalLayout; class FlatLabel; class SettingsButton; } // namespace Ui namespace Window { class SessionController; } // namespace Window namespace style { struct SettingsButton; } // namespace style namespace Settings { enum class Type { Main, Information, Notifications, PrivacySecurity, Advanced, Chat, Calls, }; using Button = Ui::SettingsButton; class Section : public Ui::RpWidget { public: using RpWidget::RpWidget; virtual rpl::producer sectionShowOther() { return nullptr; } virtual rpl::producer sectionCanSaveChanges() { return rpl::single(false); } virtual void sectionSaveChanges(FnMut done) { done(); } }; object_ptr
CreateSection( Type type, not_null parent, not_null controller); 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, rpl::producer text, const style::SettingsButton &st, const style::icon *leftIcon = nullptr, int iconLeft = 0); not_null AddButtonWithLabel( not_null container, rpl::producer text, rpl::producer label, const style::SettingsButton &st, const style::icon *leftIcon = nullptr, int iconLeft = 0); void CreateRightLabel( not_null button, rpl::producer label, const style::SettingsButton &st, rpl::producer buttonText); not_null AddSubsectionTitle( not_null container, rpl::producer text); using MenuCallback = Fn handler)>; void FillMenu( not_null controller, Type type, Fn showOther, MenuCallback addAction); } // namespace Settings