"Fossies" - the Fresh Open Source Software Archive

Member "tdesktop-2.6.1/Telegram/SourceFiles/boxes/filters/edit_filter_chats_list.h" (24 Feb 2021, 1858 Bytes) of package /linux/misc/tdesktop-2.6.1.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "edit_filter_chats_list.h" see the Fossies "Dox" file reference documentation.

    1 /*
    2 This file is part of Telegram Desktop,
    3 the official desktop application for the Telegram messaging service.
    4 
    5 For license and copyright information please follow this link:
    6 https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
    7 */
    8 #pragma once
    9 
   10 #include "boxes/peer_list_controllers.h"
   11 #include "data/data_chat_filters.h"
   12 
   13 class History;
   14 
   15 namespace Ui {
   16 class GenericBox;
   17 } // namespace Ui
   18 
   19 namespace Window {
   20 class SessionController;
   21 } // namespace Window
   22 
   23 namespace Main {
   24 class Session;
   25 } // namespace Main
   26 
   27 class Painter;
   28 
   29 [[nodiscard]] QString FilterChatsTypeName(Data::ChatFilter::Flag flag);
   30 void PaintFilterChatsTypeIcon(
   31     Painter &p,
   32     Data::ChatFilter::Flag flag,
   33     int x,
   34     int y,
   35     int outerWidth,
   36     int size);
   37 
   38 class EditFilterChatsListController final : public ChatsListBoxController {
   39 public:
   40     using Flag = Data::ChatFilter::Flag;
   41     using Flags = Data::ChatFilter::Flags;
   42 
   43     EditFilterChatsListController(
   44         not_null<Main::Session*> session,
   45         rpl::producer<QString> title,
   46         Flags options,
   47         Flags selected,
   48         const base::flat_set<not_null<History*>> &peers);
   49 
   50     [[nodiscard]] Main::Session &session() const override;
   51     [[nodiscard]] Flags chosenOptions() const {
   52         return _selected;
   53     }
   54 
   55     void rowClicked(not_null<PeerListRow*> row) override;
   56     void itemDeselectedHook(not_null<PeerData*> peer) override;
   57     bool isForeignRow(PeerListRowId itemId) override;
   58     bool handleDeselectForeignRow(PeerListRowId itemId) override;
   59 
   60 private:
   61     void prepareViewHook() override;
   62     std::unique_ptr<Row> createRow(not_null<History*> history) override;
   63     [[nodiscard]] object_ptr<Ui::RpWidget> prepareTypesList();
   64 
   65     void updateTitle();
   66 
   67     const not_null<Main::Session*> _session;
   68     rpl::producer<QString> _title;
   69     base::flat_set<not_null<History*>> _peers;
   70     Flags _options;
   71     Flags _selected;
   72 
   73     Fn<void(PeerListRowId)> _deselectOption;
   74 
   75     rpl::lifetime _lifetime;
   76 
   77 };