File indexing completed on 2024-05-12 16:01:31

0001 /*
0002  * This file is part of Krita
0003  *
0004  * SPDX-FileCopyrightText: 2007 Cyrille Berger <cberger@cberger.net>
0005  *
0006  * SPDX-License-Identifier: GPL-2.0-or-later
0007  *
0008  */
0009 
0010 #ifndef _KIS_FILTERS_MODEL_H_
0011 #define _KIS_FILTERS_MODEL_H_
0012 
0013 #include <QAbstractItemModel>
0014 
0015 #include <kis_types.h>
0016 
0017 class KisFilter;
0018 
0019 /**
0020  *
0021  */
0022 class KisFiltersModel : public QAbstractItemModel
0023 {
0024     Q_OBJECT
0025 public:
0026     /**
0027      * @brief KisFiltersModel create a new filters model
0028      * @param showAll if true, show all filters, if false, do not show filters that don't work in adjustment layers
0029      * @param thumb the thumbnail image that is filtered
0030      */
0031     KisFiltersModel(bool showAll, KisPaintDeviceSP thumb);
0032     ~KisFiltersModel() override;
0033     QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override;
0034     QModelIndex parent(const QModelIndex &child) const override;
0035     QModelIndex indexForFilter(const QString& id);
0036     const KisFilter* indexToFilter(const QModelIndex& idx);
0037     int rowCount(const QModelIndex &parent = QModelIndex()) const override;
0038     int columnCount(const QModelIndex &parent = QModelIndex()) const override;
0039     QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
0040     Qt::ItemFlags flags(const QModelIndex & index) const override;
0041 private:
0042     struct Private;
0043     Private* const d;
0044 };
0045 
0046 #endif