|
1 /* |
|
2 * Copyright (c) 2006 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: The class manages snap data in Commsdat using CMManager |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef NSMLDMBMSETTINGSTORE_H |
|
22 #define NSMLDMBMSETTINGSTORE_H |
|
23 |
|
24 #include <cmmanagerext.h> |
|
25 |
|
26 #include "nsmldmbmadapter.h" |
|
27 |
|
28 const TInt KShift8 = 8; |
|
29 |
|
30 class CNSmlDmBmAdapter; |
|
31 class CSmlDmBmCommandElement; |
|
32 class CSmlDmBmSettingsElement; |
|
33 |
|
34 /** |
|
35 * Setting Store is used for managing settings in CommsDat |
|
36 * |
|
37 * The class provides functions for executing commands |
|
38 * and sets of commands that involve manipulation of |
|
39 * data in CommsDat. |
|
40 * |
|
41 * @lib nsmldmbmadapter |
|
42 * @since S60 v3.2 |
|
43 */ |
|
44 class CNSmlDmBmSettingStore : public CBase |
|
45 { |
|
46 |
|
47 public: |
|
48 |
|
49 /** |
|
50 * Two-phased constructor. |
|
51 */ |
|
52 static CNSmlDmBmSettingStore * NewL( CNSmlDmBmAdapter* aAdapter ); |
|
53 |
|
54 /** |
|
55 * Destructor. |
|
56 */ |
|
57 virtual ~CNSmlDmBmSettingStore(); |
|
58 |
|
59 |
|
60 /** |
|
61 * Executes all commands for the argument snap object. |
|
62 * Executed commands are set as executed and status is filled |
|
63 * in. For Get commands also fetched data is filled in the command. |
|
64 * |
|
65 * @since S60 v3.2 |
|
66 * @param aSettings Settings object for the SNAP, contains all |
|
67 * commands to be executed for the SNAP |
|
68 */ |
|
69 void StoreSnapL( CSmlDmBmSettingsElement& aSettings ); |
|
70 |
|
71 |
|
72 /** |
|
73 * Executes the argument command. Checks the node from |
|
74 * for which the command is intended and calls node specific functions. |
|
75 * |
|
76 * @since S60 v3.2 |
|
77 * @param aCmd Command to be executed |
|
78 * @param aLuid LUID of the SNAP which command is referring. |
|
79 */ |
|
80 void ExecuteCmdL( CSmlDmBmCommandElement& aCmd, TUint aLuid); |
|
81 |
|
82 /** |
|
83 * Fetches all SNAPs and inserts id of each SNAp into the argument array |
|
84 * |
|
85 * @since S60 v3.2 |
|
86 * @param aLUIDArray Array for SNAP ids |
|
87 */ |
|
88 void GetSnapsL( RArray<TUint32>& aLUIDArray ); |
|
89 |
|
90 private: |
|
91 |
|
92 CNSmlDmBmSettingStore( CNSmlDmBmAdapter * aAdapter ); |
|
93 |
|
94 void ConstructL(); |
|
95 |
|
96 //----------- Commands for managing leaf nodes -------------------// |
|
97 |
|
98 /** |
|
99 * Executes snap commands. The valid commands include |
|
100 * get and delete. With get commands the iData |
|
101 * memeber is used to pass fetched data back to caller. |
|
102 * After execution of command the function fills in the status |
|
103 * in aCmd.iStatus memeber and sets aCmd.iExecuted as True. The function |
|
104 * leaves if command can not be executed for some reason. |
|
105 * |
|
106 * @param aCmd The command to be executed |
|
107 * @param aLuid The id of the snap |
|
108 */ |
|
109 void ExecuteSnapCmdL( CSmlDmBmCommandElement& aCmd, TUint aLuid ); |
|
110 |
|
111 /** |
|
112 * Executes iap list commands. The valid commands include |
|
113 * update and get. With update commands data is read from the |
|
114 * iData memeber of the argument command. With get commands the iData |
|
115 * memeber is used to pass fetched data back to caller. |
|
116 * After execution of command the function fills in the status |
|
117 * in aCmd.iStatus memeber and sets aCmd.iExecuted as True. The function |
|
118 * leaves if command can not be executed for some reason. |
|
119 * |
|
120 * @param aCmd The command to be executed |
|
121 * @param aSnap The snap object |
|
122 */ |
|
123 void ExecuteIapsCmdL( CSmlDmBmCommandElement& aCmd, |
|
124 RCmDestinationExt& aSnap ); |
|
125 |
|
126 /** |
|
127 * Executes protection commands. The valid commands include |
|
128 * update and get. With update commands data is read from the |
|
129 * iData memeber of the argument command. With get commands the iData |
|
130 * memeber is used to pass fetched data back to caller. |
|
131 * After execution of command the function fills in the status |
|
132 * in aCmd.iStatus memeber and sets aCmd.iExecuted as True. The function |
|
133 * leaves if command can not be executed for some reason. |
|
134 * |
|
135 * @param aCmd The command to be executed |
|
136 * @param aSnap The snap object |
|
137 */ |
|
138 void ExecuteProtectionCmdL( CSmlDmBmCommandElement& aCmd, |
|
139 RCmDestinationExt& aSnap ); |
|
140 |
|
141 /** |
|
142 * Executes hidden commands. The valid commands include |
|
143 * update and get. With update commands data is read from the |
|
144 * iData memeber of the argument command. With get commands the iData |
|
145 * memeber is used to pass fetched data back to caller. |
|
146 * After execution of command the function fills in the status |
|
147 * in aCmd.iStatus memeber and sets aCmd.iExecuted as True. The function |
|
148 * leaves if command can not be executed for some reason. |
|
149 * |
|
150 * @param aCmd The command to be executed |
|
151 * @param aSnap The snap object |
|
152 */ |
|
153 void ExecuteHiddenCmdL( CSmlDmBmCommandElement& aCmd, |
|
154 RCmDestinationExt& aSnap ); |
|
155 |
|
156 /** |
|
157 * Executes metadata commands. The valid commands include |
|
158 * update and get. With update commands data is read from the |
|
159 * iData memeber of the argument command. With get commands the iData |
|
160 * memeber is used to pass fetched data back to caller. |
|
161 * After execution of command the function fills in the status |
|
162 * in aCmd.iStatus memeber and sets aCmd.iExecuted as True. The function |
|
163 * leaves if command can not be executed for some reason. |
|
164 * |
|
165 * @param aCmd The command to be executed |
|
166 * @param aSnap The snap object |
|
167 */ |
|
168 void ExecuteMetadataCmdL( CSmlDmBmCommandElement& aCmd, |
|
169 RCmDestinationExt& aSnap ); |
|
170 |
|
171 /** |
|
172 * Executes embedded snap commands. The valid commands include |
|
173 * update, get and delete. With update commands data is read from the |
|
174 * iData memeber of the argument command. With get commands the iData |
|
175 * memeber is used to pass fetched data back to caller. |
|
176 * After execution of command the function fills in the status |
|
177 * in aCmd.iStatus memeber and sets aCmd.iExecuted as True. The function |
|
178 * leaves if command can not be executed for some reason. |
|
179 * |
|
180 * @param aCmd The command to be executed |
|
181 * @param aLuid The id of the snap |
|
182 */ |
|
183 void ExecuteEmbeddedSnapCmdL( CSmlDmBmCommandElement& aCmd, |
|
184 RCmDestinationExt& aSnap ); |
|
185 /** |
|
186 * Executes name commands. The valid commands include |
|
187 * update and get. With update commands data is read from the |
|
188 * iData memeber of the argument command. With get commands the iData |
|
189 * memeber is used to pass fetched data back to caller. |
|
190 * After execution of command the function fills in the status |
|
191 * in aCmd.iStatus memeber and sets aCmd.iExecuted as True. The function |
|
192 * leaves if command can not be executed for some reason. |
|
193 * |
|
194 * @param aCmd The command to be executed |
|
195 * @param aSnap The snap object |
|
196 */ |
|
197 void ExecuteNameCmdL( CSmlDmBmCommandElement& aCmd, |
|
198 RCmDestinationExt& aSnap ); |
|
199 |
|
200 |
|
201 private: //data |
|
202 |
|
203 /** |
|
204 * CmManager is used for accessing CommsDat. |
|
205 */ |
|
206 RCmManagerExt iCmManagerExt; |
|
207 |
|
208 /** |
|
209 * Pointer to the adapter. This is used for |
|
210 * querying data from DM framework when necessary |
|
211 * and using helper functions. Not own. |
|
212 */ |
|
213 CNSmlDmBmAdapter* iAdapter; |
|
214 |
|
215 }; |
|
216 |
|
217 |
|
218 #endif // NSmlDmBmSettingStore_H |