/* 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 style { struct SettingsButton; } // namespace style namespace Ui { class GenericBox; class RoundButton; class RpWidget; class VerticalLayout; } // namespace Ui namespace PowerSaving { enum Flag : uint32; using Flags = base::flags; } // namespace PowerSaving 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); template struct EditFlagsLabel { Flags flags; QString label; const style::icon *icon = nullptr; }; template struct EditFlagsControl { object_ptr widget; Fn value; rpl::producer changes; }; template struct NestedEditFlagsLabels { std::optional> nestingLabel; std::vector> nested; }; template struct EditFlagsDescriptor { rpl::producer header; std::vector> labels; base::flat_map disabledMessages; const style::SettingsButton *st = nullptr; }; using RestrictionLabel = EditFlagsLabel; [[nodiscard]] std::vector RestrictionLabels( Data::RestrictionsSetOptions options); using AdminRightLabel = EditFlagsLabel; [[nodiscard]] std::vector AdminRightLabels( Data::AdminRightsSetOptions options); [[nodiscard]] auto CreateEditRestrictions( QWidget *parent, rpl::producer header, ChatRestrictions restrictions, base::flat_map disabledMessages, Data::RestrictionsSetOptions options) -> EditFlagsControl; [[nodiscard]] auto CreateEditAdminRights( QWidget *parent, rpl::producer header, ChatAdminRights rights, base::flat_map disabledMessages, Data::AdminRightsSetOptions options) -> EditFlagsControl; [[nodiscard]] ChatAdminRights DisabledByDefaultRestrictions( not_null peer); [[nodiscard]] ChatRestrictions FixDependentRestrictions( ChatRestrictions restrictions); [[nodiscard]] ChatAdminRights AdminRightsForOwnershipTransfer( Data::AdminRightsSetOptions options); [[nodiscard]] auto CreateEditPowerSaving( QWidget *parent, PowerSaving::Flags flags ) -> EditFlagsControl;