2
* Copyright 2013 Canonical Ltd.
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU Lesser General Public License as published by
6
* the Free Software Foundation; version 3.
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU Lesser General Public License for more details.
13
* You should have received a copy of the GNU Lesser General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17
#ifndef FAKE_GSETTINGS_H
18
#define FAKE_GSETTINGS_H
22
#include <QQmlParserStatus>
23
#include <QStringList>
26
class GSettingsSchemaQml: public QObject
30
Q_PROPERTY(QByteArray id READ id WRITE setId)
32
GSettingsSchemaQml(QObject *parent = nullptr);
34
QByteArray id() const;
35
void setId(const QByteArray &id);
37
QByteArray path() const;
38
void setPath(const QByteArray &path);
45
class GSettingsQml: public QObject, public QQmlParserStatus
48
Q_INTERFACES(QQmlParserStatus)
50
Q_PROPERTY(GSettingsSchemaQml* schema READ schema NOTIFY schemaChanged)
51
Q_PROPERTY(QVariantMap fingerprintNames
53
WRITE setFingerprintNames
54
NOTIFY fingerprintNamesChanged)
57
GSettingsQml(QObject *parent = nullptr);
59
void classBegin() override;
60
void componentComplete() override;
62
GSettingsSchemaQml * schema() const;
64
QVariantMap fingerprintNames() const;
65
void setFingerprintNames(const QVariantMap &map);
68
void fingerprintNamesChanged();
72
GSettingsSchemaQml* m_schema;
75
friend class GSettingsSchemaQml;
78
class GSettingsControllerQml: public QObject
83
static GSettingsControllerQml* instance();
84
~GSettingsControllerQml();
86
Q_INVOKABLE QVariantMap fingerprintNames() const;
87
Q_INVOKABLE void setFingerprintNames(QVariantMap map);
90
void fingerprintNamesChanged();
93
GSettingsControllerQml();
95
QVariantMap m_fingerprintNames;
97
static GSettingsControllerQml* s_controllerInstance;
98
QList<GSettingsQml *> m_registeredGSettings;
101
#endif // FAKE_GSETTINGS_H