File indexing completed on 2024-04-14 14:32:48

0001 /***************************************************************************
0002  *   Copyright (C) 2012-2016 by Daniel Nicoletti <dantti12@gmail.com>      *
0003  *   2022 by Han Young <hanyoung@protonmail.com>                           *
0004  *                                                                         *
0005  *   This program is free software; you can redistribute it and/or modify  *
0006  *   it under the terms of the GNU General Public License as published by  *
0007  *   the Free Software Foundation; either version 2 of the License, or     *
0008  *   (at your option) any later version.                                   *
0009  *                                                                         *
0010  *   This program is distributed in the hope that it will be useful,       *
0011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
0012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
0013  *   GNU General Public License for more details.                          *
0014  *                                                                         *
0015  *   You should have received a copy of the GNU General Public License     *
0016  *   along with this program; see the file COPYING. If not, write to       *
0017  *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
0018  *   Boston, MA 02110-1301, USA.                                           *
0019  ***************************************************************************/
0020 
0021 #ifndef PROFILEDESCRIPTION_H
0022 #define PROFILEDESCRIPTION_H
0023 #include <QDBusObjectPath>
0024 #include <QObject>
0025 
0026 class ProfileMetaDataModel;
0027 class ProfileNamedColorsModel;
0028 class ProfileDescription : public QObject
0029 {
0030     Q_OBJECT
0031     Q_PROPERTY(ProfileMetaDataModel *metaDataModel READ metaDataModel CONSTANT)
0032     Q_PROPERTY(ProfileNamedColorsModel *namedColorsModel READ namedColorsModel CONSTANT)
0033     Q_PROPERTY(QDBusObjectPath path MEMBER m_currentProfilePath NOTIFY dataChanged)
0034     Q_PROPERTY(QString kind MEMBER m_profileKind NOTIFY dataChanged)
0035     Q_PROPERTY(QString colorSpace MEMBER m_profileColorSpace NOTIFY dataChanged)
0036     Q_PROPERTY(QString version MEMBER m_profileVersion NOTIFY dataChanged)
0037     Q_PROPERTY(QString createdTime MEMBER m_profileCreatedTime NOTIFY dataChanged)
0038     Q_PROPERTY(QString license MEMBER m_profileLicense NOTIFY dataChanged)
0039     Q_PROPERTY(QString manufacturer MEMBER m_profileManufacturer NOTIFY dataChanged)
0040     Q_PROPERTY(QString model MEMBER m_profileModel NOTIFY dataChanged)
0041     Q_PROPERTY(QString size MEMBER m_profileSize NOTIFY dataChanged)
0042     Q_PROPERTY(QString filename MEMBER m_profileName NOTIFY dataChanged)
0043     Q_PROPERTY(QString whitePoint MEMBER m_profileWhitePoint NOTIFY dataChanged)
0044     Q_PROPERTY(bool canRemove MEMBER m_canRemoveProfile NOTIFY dataChanged)
0045     Q_PROPERTY(bool hasDisplayCorrection MEMBER m_profileHasDisplayCorrection NOTIFY dataChanged)
0046 
0047 public:
0048     explicit ProfileDescription(QObject *parent = nullptr);
0049 
0050     ProfileMetaDataModel *metaDataModel() const;
0051     ProfileNamedColorsModel *namedColorsModel() const;
0052 
0053     Q_INVOKABLE void setProfile(const QDBusObjectPath &objectPath, bool canRemoveProfile);
0054     Q_INVOKABLE void installSystemWide();
0055 
0056 Q_SIGNALS:
0057     void dataChanged();
0058 
0059 private:
0060     QDBusObjectPath m_currentProfilePath;
0061     QString m_profileKind;
0062     QString m_profileColorSpace;
0063     QString m_profileVersion;
0064     QString m_profileCreatedTime;
0065     QString m_profileLicense;
0066     QString m_profileManufacturer;
0067     QString m_profileModel;
0068     QString m_profileSize;
0069     QString m_profileName;
0070     QString m_profileWhitePoint;
0071     bool m_canRemoveProfile;
0072     bool m_profileHasDisplayCorrection;
0073 
0074     ProfileMetaDataModel *const m_metadataModel;
0075     ProfileNamedColorsModel *const m_namedColorsModel;
0076 };
0077 
0078 #endif // PROFILEDESCRIPTION_H