File indexing completed on 2024-04-21 14:54:18

0001 /*
0002     This file is part of the KDE project
0003     SPDX-FileCopyrightText: 2013 Martin Gräßlin <mgraesslin@kde.org>
0004 
0005     SPDX-License-Identifier: LGPL-2.0-or-later
0006 */
0007 
0008 #ifndef KCOLORSCHEMEMODEL_H
0009 #define KCOLORSCHEMEMODEL_H
0010 
0011 #include <kconfigwidgets_export.h>
0012 
0013 #include <QAbstractListModel>
0014 #include <QObject>
0015 #include <memory>
0016 
0017 class QModelIndex;
0018 
0019 struct KColorSchemeModelPrivate;
0020 
0021 /**
0022  * A model listing the KColorSchemes available in the system.
0023  *
0024  * @since 5.84
0025  */
0026 class KColorSchemeModel : public QAbstractListModel
0027 {
0028     Q_OBJECT
0029 public:
0030     enum Roles {
0031         NameRole = Qt::DisplayRole,
0032         IconRole = Qt::DecorationRole,
0033         PathRole = Qt::UserRole,
0034         IdRole,
0035     };
0036 
0037     explicit KColorSchemeModel(QObject *parent = nullptr);
0038     ~KColorSchemeModel() override;
0039     QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
0040     int rowCount(const QModelIndex &parent = QModelIndex()) const override;
0041 
0042 private:
0043     std::unique_ptr<KColorSchemeModelPrivate> d;
0044 };
0045 
0046 #endif