File indexing completed on 2024-05-12 16:02:03
0001 /* 0002 * SPDX-FileCopyrightText: 2013 Sven Langkamp <sven.langkamp@gmail.com> 0003 * SPDX-FileCopyrightText: 2018 Michael Zhou <simeirxh@gmail.com> 0004 * 0005 * SPDX-License-Identifier: GPL-2.0-or-later 0006 */ 0007 #ifndef KISPALETTELISTWIDGET_P_H 0008 #define KISPALETTELISTWIDGET_P_H 0009 0010 #include <QAbstractItemDelegate> 0011 #include <QListView> 0012 #include <QAbstractListModel> 0013 #include <QPointer> 0014 #include <QCheckBox> 0015 #include <QAction> 0016 #include <QPainter> 0017 0018 #include <KisPaletteChooser.h> 0019 #include <KisResourceItemView.h> 0020 #include <KisResourceItemChooser.h> 0021 #include <KoColorSet.h> 0022 0023 struct KisPaletteChooserPrivate 0024 { 0025 class View; 0026 class Delegate; 0027 class Model; 0028 KisPaletteChooserPrivate(KisPaletteChooser *); 0029 virtual ~KisPaletteChooserPrivate(); 0030 0031 QPointer<KisPaletteChooser> c; 0032 0033 QSharedPointer<KisResourceItemChooser> itemChooser; 0034 0035 QScopedPointer<Delegate> delegate; 0036 0037 QScopedPointer<QAction> actAdd; 0038 QScopedPointer<QAction> actImport; 0039 QScopedPointer<QAction> actExport; 0040 QScopedPointer<QAction> actModify; 0041 QScopedPointer<QAction> actRemove; 0042 }; 0043 0044 class KisPaletteChooserPrivate::Delegate : public QAbstractItemDelegate 0045 { 0046 public: 0047 Delegate(QObject *); 0048 virtual ~Delegate(); 0049 void paint(QPainter * painter, 0050 const QStyleOptionViewItem & option, 0051 const QModelIndex & index) const override; 0052 QSize sizeHint(const QStyleOptionViewItem & option, const QModelIndex &) const override; 0053 }; 0054 0055 #endif // KISPALETTELISTWIDGET_P_H