/* 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 "boxes/abstract_box.h" #include "mtproto/sender.h" #include "apiwrap.h" enum LangKey : int; namespace Ui { class VerticalLayout; class FlatLabel; class LinkButton; template class RadioenumGroup; template class Radioenum; template class SlideWrap; } // namespace Ui class EditPrivacyBox : public BoxContent, private MTP::Sender { public: using Value = ApiWrap::Privacy; using Option = Value::Option; enum class Exception { Always, Never, }; class Controller { public: using Key = ApiWrap::Privacy::Key; [[nodiscard]] virtual Key key() = 0; [[nodiscard]] virtual MTPInputPrivacyKey apiKey() = 0; [[nodiscard]] virtual QString title() = 0; [[nodiscard]] virtual bool hasOption(Option option) { return true; } [[nodiscard]] virtual LangKey optionsTitleKey() = 0; [[nodiscard]] virtual LangKey optionLabelKey(Option option); [[nodiscard]] virtual rpl::producer warning() { return rpl::never(); } [[nodiscard]] virtual LangKey exceptionButtonTextKey( Exception exception) = 0; [[nodiscard]] virtual QString exceptionBoxTitle( Exception exception) = 0; [[nodiscard]] virtual auto exceptionsDescription() -> rpl::producer = 0; [[nodiscard]] virtual object_ptr setupAboveWidget( not_null parent, rpl::producer