File indexing completed on 2025-04-27 04:08:15
0001 /* 0002 * This file is part of the KDE project 0003 * SPDX-FileCopyrightText: 2014 Arjen Hiemstra <ahiemstra@heimr.nl> 0004 * 0005 * SPDX-License-Identifier: GPL-2.0-or-later 0006 */ 0007 0008 #ifndef COLORPROFILEMODEL_H 0009 #define COLORPROFILEMODEL_H 0010 0011 #include <QAbstractListModel> 0012 0013 class ColorProfileModel : public QAbstractListModel 0014 { 0015 Q_OBJECT 0016 Q_PROPERTY(QString colorModelId READ colorModelId WRITE setColorModelId NOTIFY colorModelIdChanged) 0017 Q_PROPERTY(QString colorDepthId READ colorDepthId WRITE setColorDepthId NOTIFY colorDepthIdChanged) 0018 Q_PROPERTY(int defaultProfile READ defaultProfile NOTIFY defaultProfileChanged) 0019 0020 public: 0021 enum Roles { 0022 TextRole = Qt::UserRole + 1, 0023 }; 0024 0025 explicit ColorProfileModel(QObject *parent = nullptr); 0026 ~ColorProfileModel() override; 0027 QHash<int, QByteArray> roleNames() const override; 0028 QVariant data(const QModelIndex &index, int role) const override; 0029 int rowCount(const QModelIndex &parent) const override; 0030 0031 QString colorModelId() const; 0032 QString colorDepthId() const; 0033 0034 int defaultProfile() const; 0035 0036 Q_INVOKABLE QString id(int index); 0037 0038 public Q_SLOTS: 0039 void setColorModelId(const QString& id); 0040 void setColorDepthId(const QString& id); 0041 0042 Q_SIGNALS: 0043 void colorModelIdChanged(); 0044 void colorDepthIdChanged(); 0045 void defaultProfileChanged(); 0046 0047 private: 0048 class Private; 0049 Private * const d; 0050 }; 0051 0052 #endif // COLORDEPTHMODEL_H