File indexing completed on 2024-12-22 04:14:00

0001 /* This file is part of the KDE project
0002  * SPDX-FileCopyrightText: 2013 Martin Gräßlin <mgraesslin@kde.org>
0003  *
0004  * SPDX-License-Identifier: LGPL-2.0-or-later
0005  */
0006 #ifndef KCOLORSCHEMEMANAGER_P_H
0007 #define KCOLORSCHEMEMANAGER_P_H
0008 
0009 #include <QAbstractListModel>
0010 #include <QIcon>
0011 
0012 struct KColorSchemeModelData {
0013     QString name;
0014     QString path;
0015     QIcon preview;
0016 };
0017 
0018 class KColorSchemeModel : public QAbstractListModel
0019 {
0020     Q_OBJECT
0021 public:
0022     explicit KColorSchemeModel(QObject *parent = 0);
0023     ~KColorSchemeModel() override;
0024     QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
0025     int rowCount(const QModelIndex &parent = QModelIndex()) const override;
0026 
0027 private:
0028     void init();
0029     QIcon createPreview(const QString &path);
0030     QVector<KColorSchemeModelData> m_data;
0031 };
0032 
0033 class KColorSchemeManagerPrivate
0034 {
0035 public:
0036     KColorSchemeManagerPrivate();
0037 
0038     QScopedPointer<KColorSchemeModel> model;
0039 };
0040 
0041 #endif