File indexing completed on 2024-05-19 04:54:22

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 "abstractmodel/abstracttreemodel.hpp"
0009 #include "assets/assetlist/model/assettreemodel.hpp"
0010 
0011 /** @brief This class represents an effect hierarchy to be displayed as a tree
0012  */
0013 class TreeItem;
0014 
0015 class EffectTreeModel : public AssetTreeModel
0016 {
0017 
0018 protected:
0019     explicit EffectTreeModel(QObject *parent = nullptr);
0020 
0021 public:
0022     static std::shared_ptr<EffectTreeModel> construct(const QString &categoryFile, QObject *parent);
0023     void reloadEffect(const QString &path);
0024     void reloadTemplates();
0025     void reloadEffectFromIndex(const QModelIndex &index);
0026     void reloadAssetMenu(QMenu *effectsMenu, KActionCategory *effectActions) override;
0027     void setFavorite(const QModelIndex &index, bool favorite, bool isEffect) override;
0028     void deleteEffect(const QModelIndex &index) override;
0029     void editCustomAsset(const QString &newName, const QString &newDescription, const QModelIndex &index) override;
0030     QMimeData *mimeData(const QModelIndexList &indexes) const override;
0031 
0032 protected:
0033     std::shared_ptr<TreeItem> m_customCategory;
0034     std::shared_ptr<TreeItem> m_templateCategory;
0035 };