|
1 /* |
|
2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef NMIPSSOSEXTENDEDSETTINGSMANAGER_H |
|
19 #define NMIPSSOSEXTENDEDSETTINGSMANAGER_H |
|
20 |
|
21 #include <qvariant.h> |
|
22 #include "nmipssettingitems.h" |
|
23 |
|
24 class NmId; |
|
25 class XQSettingsManager; |
|
26 class XQCentralRepositoryUtils; |
|
27 |
|
28 /** |
|
29 * class to handle settings stored in central repository |
|
30 */ |
|
31 NONSHARABLE_CLASS (NmIpsSosExtendedSettingsManager) |
|
32 { |
|
33 public: |
|
34 /** |
|
35 * constructor |
|
36 * @param mailbox who's settings we are handling |
|
37 */ |
|
38 NmIpsSosExtendedSettingsManager(const NmId &mailboxId); |
|
39 |
|
40 /** |
|
41 * destructor |
|
42 */ |
|
43 virtual ~NmIpsSosExtendedSettingsManager(); |
|
44 |
|
45 /** |
|
46 * reads a setting from cen rep |
|
47 * @param settingItem id of the setting |
|
48 * @param settingValue a return parameter |
|
49 * @return was read a success |
|
50 */ |
|
51 bool readSetting( |
|
52 IpsServices::SettingItem settingItem, |
|
53 QVariant &settingValue) const; |
|
54 |
|
55 /** |
|
56 * writes a setting into cen rep |
|
57 * @param settingItem id of the setting |
|
58 * @param settingValue value of the setting to be stored |
|
59 * @return was write a success |
|
60 */ |
|
61 bool writeSetting( |
|
62 IpsServices::SettingItem settingItem, |
|
63 const QVariant &settingValue); |
|
64 |
|
65 bool writeSetting( |
|
66 int profileMode, |
|
67 IpsServices::SettingItem settingItem, |
|
68 const QVariant &settingValue); |
|
69 |
|
70 /** |
|
71 * deletes settings |
|
72 */ |
|
73 void deleteSettings(); |
|
74 |
|
75 /** |
|
76 * creates a new key-value pair |
|
77 * @param settingItem id of the setting |
|
78 * @param settingValue value of the setting to be stored |
|
79 * @return was creation a success |
|
80 */ |
|
81 bool createKeyValuePair( |
|
82 const IpsServices::SettingItem settingItem, |
|
83 const QVariant &settingValue); |
|
84 |
|
85 private: |
|
86 bool writeSettingToCenRep( |
|
87 qint32 profileOffset, |
|
88 IpsServices::SettingItem settingItem, |
|
89 const QVariant &settingValue); |
|
90 |
|
91 QVariant readFromCenRep(quint32 key) const; |
|
92 bool writeToCenRep(quint32 key, const QVariant &value) const; |
|
93 void calculateMailboxOffset(); |
|
94 void calculateActiveProfileOffset(); |
|
95 qint32 convertToProfileOffset(int profile); |
|
96 |
|
97 private: // data |
|
98 const NmId &mMailboxId; |
|
99 qint32 mMailboxOffset; |
|
100 qint32 mActiveProfileOffset; |
|
101 XQSettingsManager* mSettingsManager; // Owned. |
|
102 }; |
|
103 |
|
104 #endif // NMIPSSOSEXTENDEDSETTINGSMANAGER_H |