File indexing completed on 2024-05-12 04:54:25

0001 /*
0002     SPDX-FileCopyrightText: 2017 Nicolas Carion
0003     SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0004 */
0005 
0006 #pragma once
0007 
0008 #include "assets/assetlist/model/assetfilter.hpp"
0009 #include "transitions/transitionsrepository.hpp"
0010 #include <memory>
0011 
0012 /** @brief This class is used as a proxy model to filter the effect tree based on given criterion (name, type).
0013    It simply adds a filter of type
0014  */
0015 class TransitionFilter : public AssetFilter
0016 {
0017     Q_OBJECT
0018 
0019 public:
0020     TransitionFilter(QObject *parent = nullptr);
0021 
0022     /** @brief Manage the type filter
0023        @param enabled whether to enable this filter
0024        @param type Effect type to display
0025     */
0026     void setFilterType(bool enabled, AssetListType::AssetType type);
0027     void reloadFilterOnFavorite() override;
0028 
0029 protected:
0030     bool filterType(const std::shared_ptr<TreeItem> &item) const;
0031     bool applyAll(std::shared_ptr<TreeItem> item) const override;
0032 
0033     bool m_type_enabled;
0034     AssetListType::AssetType m_type_value;
0035 };