/* 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 "data/data_chat_participant_status.h" namespace Ui { class GenericBox; class RoundButton; class RpWidget; class VerticalLayout; } // namespace Ui template class object_ptr; namespace Window { class SessionController; class SessionNavigation; } // namespace Window struct EditPeerPermissionsBoxResult final { ChatRestrictions rights; int slowmodeSeconds = 0; }; void ShowEditPeerPermissionsBox( not_null box, not_null navigation, not_null channelOrGroup, Fn done); [[nodiscard]] Fn AboutGigagroupCallback( not_null channel, not_null controller); struct RestrictionLabel { ChatRestrictions flags; QString label; }; [[nodiscard]] std::vector RestrictionLabels( Data::RestrictionsSetOptions options); struct AdminRightLabel { ChatAdminRights flags; QString label; }; [[nodiscard]] std::vector AdminRightLabels( Data::AdminRightsSetOptions options); template struct EditFlagsControl { object_ptr widget; Fn value; rpl::producer changes; }; [[nodiscard]] auto CreateEditRestrictions( QWidget *parent, rpl::producer header, ChatRestrictions restrictions, std::map disabledMessages, Data::RestrictionsSetOptions options) -> EditFlagsControl; [[nodiscard]] auto CreateEditAdminRights( QWidget *parent, rpl::producer header, ChatAdminRights rights, std::map disabledMessages, Data::AdminRightsSetOptions options) -> EditFlagsControl; [[nodiscard]] ChatAdminRights DisabledByDefaultRestrictions( not_null peer); [[nodiscard]] ChatRestrictions FixDependentRestrictions( ChatRestrictions restrictions); [[nodiscard]] ChatAdminRights AdminRightsForOwnershipTransfer( Data::AdminRightsSetOptions options);