/* 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/peer_list_controllers.h" #include "data/data_chat_filters.h" class History; namespace Ui { class GenericBox; } // namespace Ui namespace Window { class SessionController; } // namespace Window namespace Main { class Session; } // namespace Main class Painter; [[nodiscard]] QString FilterChatsTypeName(Data::ChatFilter::Flag flag); void PaintFilterChatsTypeIcon( Painter &p, Data::ChatFilter::Flag flag, int x, int y, int outerWidth, int size); [[nodiscard]] object_ptr CreatePeerListSectionSubtitle( not_null parent, rpl::producer text); class EditFilterChatsListController final : public ChatsListBoxController { public: using Flag = Data::ChatFilter::Flag; using Flags = Data::ChatFilter::Flags; EditFilterChatsListController( not_null session, rpl::producer title, Flags options, Flags selected, const base::flat_set> &peers); [[nodiscard]] Main::Session &session() const override; [[nodiscard]] Flags chosenOptions() const { return _selected; } void rowClicked(not_null row) override; void itemDeselectedHook(not_null peer) override; bool isForeignRow(PeerListRowId itemId) override; bool handleDeselectForeignRow(PeerListRowId itemId) override; private: int selectedTypesCount() const; void prepareViewHook() override; std::unique_ptr createRow(not_null history) override; [[nodiscard]] object_ptr prepareTypesList(); void updateTitle(); const not_null _session; rpl::producer _title; base::flat_set> _peers; Flags _options; Flags _selected; int _limit = 0; Fn _deselectOption; PeerListContentDelegate *_typesDelegate = nullptr; rpl::lifetime _lifetime; };