|
1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * |
|
5 * This program is free software: you can redistribute it and/or modify |
|
6 * it under the terms of the GNU Lesser General Public License as published by |
|
7 * the Free Software Foundation, version 2.1 of the License. |
|
8 * |
|
9 * This program is distributed in the hope that it will be useful, |
|
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 * GNU Lesser General Public License for more details. |
|
13 * |
|
14 * You should have received a copy of the GNU Lesser General Public License |
|
15 * along with this program. If not, |
|
16 * see "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html/". |
|
17 * |
|
18 * Description: |
|
19 * |
|
20 */ |
|
21 |
|
22 #ifndef XQSETTINGSMANAGER_H |
|
23 #define XQSETTINGSMANAGER_H |
|
24 |
|
25 // INCLUDES |
|
26 #include <QObject> |
|
27 #include <QVariant> |
|
28 #include "xqsettingskey.h" |
|
29 #include "settingsmanager_global.h" |
|
30 |
|
31 // FORWARD DECLARATIONS |
|
32 class XQSettingsManagerPrivate; |
|
33 |
|
34 // CLASS DECLARATION |
|
35 class XQSETTINGSMANAGER_EXPORT XQSettingsManager : public QObject |
|
36 { |
|
37 Q_OBJECT |
|
38 Q_ENUMS(Error) |
|
39 Q_ENUMS(Type) |
|
40 |
|
41 public: |
|
42 |
|
43 enum Type |
|
44 { |
|
45 TypeVariant = 0, |
|
46 TypeInt, |
|
47 TypeDouble, |
|
48 TypeString, |
|
49 TypeByteArray |
|
50 }; |
|
51 |
|
52 enum Error |
|
53 { |
|
54 NoError = 0, |
|
55 OutOfMemoryError, |
|
56 NotFoundError, |
|
57 AlreadyExistsError, |
|
58 PermissionDeniedError, |
|
59 BadTypeError, |
|
60 NotSupportedError, |
|
61 UnknownError = -1 |
|
62 }; |
|
63 |
|
64 XQSettingsManager(QObject* parent = 0); |
|
65 ~XQSettingsManager(); |
|
66 |
|
67 QVariant readItemValue(const XQSettingsKey& key, XQSettingsManager::Type type = XQSettingsManager::TypeVariant); |
|
68 bool writeItemValue(const XQSettingsKey& key, const QVariant& value); |
|
69 bool startMonitoring(const XQSettingsKey& key, XQSettingsManager::Type type = XQSettingsManager::TypeVariant); |
|
70 bool stopMonitoring(const XQSettingsKey& key); |
|
71 |
|
72 XQSettingsManager::Error error() const; |
|
73 |
|
74 Q_SIGNALS: |
|
75 void valueChanged(const XQSettingsKey& key, const QVariant& value); |
|
76 void itemDeleted(const XQSettingsKey& key); |
|
77 |
|
78 private: |
|
79 friend class XQSettingsManagerPrivate; |
|
80 friend class XQCentralRepositoryUtilsPrivate; |
|
81 friend class XQPublishAndSubscribeUtilsPrivate; |
|
82 XQSettingsManagerPrivate* d; |
|
83 }; |
|
84 |
|
85 #endif // XQSETTINGSMANAGER_H |
|
86 |
|
87 // End of file |