|
1 /* |
|
2 * Copyright (c) 2005 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: Definition of dm constants/exported methods |
|
15 * This is part of remotemgmt_plat. |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef __SMLDMADAPTER_H__ |
|
20 #define __SMLDMADAPTER_H__ |
|
21 |
|
22 #include <e32base.h> |
|
23 #include <ecom/ecom.h> |
|
24 |
|
25 class MSmlDmDDFObject; |
|
26 class MSmlDmCallback; |
|
27 class RWriteStream; |
|
28 |
|
29 /** ECOM interface uid for DM plugin adapters */ |
|
30 #define KSmlDMInterfaceUid 0x102018B4 |
|
31 |
|
32 /** Maximum length of a URI segment supported by the DM framework */ |
|
33 #define KSmlMaxURISegLen 32 |
|
34 |
|
35 struct TSmlDmMappingInfo |
|
36 /** |
|
37 The struct combines an URI segment to a LUID in a device. |
|
38 @publishedPartner |
|
39 @prototype |
|
40 */ |
|
41 { |
|
42 /** The URI segment. When using this structure, a path of the URI segment must be known */ |
|
43 TBufC8<KSmlMaxURISegLen> iURISeg; |
|
44 |
|
45 /** Local UID in the device */ |
|
46 TPtrC8 iURISegLUID; |
|
47 }; |
|
48 |
|
49 class MSmlDmAdapter |
|
50 /** |
|
51 Abstract Device Management adapter. Implementations of this interface are able to map settings |
|
52 in device stores to portions of the Device Management Tree. |
|
53 @publishedPartner |
|
54 @prototype |
|
55 */ |
|
56 { |
|
57 public: //enums |
|
58 |
|
59 /** An enumeration of the error codes which may be returned by DM adapters. |
|
60 @publishedPartner |
|
61 @prototype |
|
62 */ |
|
63 enum TError |
|
64 { |
|
65 /** The command was successful */ |
|
66 EOk = 0, |
|
67 /** The command failed because no setting exists in the store which corresponds to the |
|
68 URI or LUID passed to the adapter */ |
|
69 ENotFound, |
|
70 /** The command failed because the setting can't take the value being passed to the adapter */ |
|
71 EInvalidObject, |
|
72 /** The command failed because the setting already exists in the store */ |
|
73 EAlreadyExists, |
|
74 /** The command failed because the setting value is too large to be accommodated in the store */ |
|
75 ETooLargeObject, |
|
76 /** The command failed because the disk on which the device store resides is full */ |
|
77 EDiskFull, |
|
78 /** The command failed for an unspecified reason */ |
|
79 EError, |
|
80 /** The command could not be rolled back successfully */ |
|
81 ERollbackFailed, |
|
82 /** The command failed because the setting is being used by another client */ |
|
83 EObjectInUse, |
|
84 /** The command failed because no memory could be allocated */ |
|
85 ENoMemory, |
|
86 /** The command succesfully committed */ |
|
87 ECommitOK, |
|
88 /** The command rolled back succesfully */ |
|
89 ERollbackOK, |
|
90 /** The commit of command failed */ |
|
91 ECommitFailed, |
|
92 ENotAllowed, |
|
93 EAcceptedForProcessing, |
|
94 |
|
95 EExecSuccess, |
|
96 EExecClientError, |
|
97 EExecUserCancelled, |
|
98 EExecDownloadFailed, |
|
99 EExecAltDwnldAuthFail, |
|
100 EExecDownFailOOM, |
|
101 EExecInstallFailed, |
|
102 EExecInstallOOM, |
|
103 EExecPkgValidationFail, |
|
104 EExecRemoveFailed, |
|
105 EExecActivateFailed, |
|
106 EExecDeactivateFailed, |
|
107 EExecNotImplemented, |
|
108 EExecUndefError, |
|
109 EExecOperationReject, |
|
110 EExecAltDwnldSrvError, |
|
111 EExecAltDwnldSrvUnavailable |
|
112 |
|
113 }; |
|
114 |
|
115 public: |
|
116 /** |
|
117 The function returns current version of the DDF. |
|
118 By asking current DDF versions from adapters DM Module can control |
|
119 possible changes in the data structure and send the changed DDF |
|
120 description to a management server. |
|
121 This function is always called after DDFStructureL. |
|
122 @param aVersion DDF version of the adapter. (filled by the adapter) |
|
123 @publishedPartner |
|
124 @prototype |
|
125 */ |
|
126 virtual void DDFVersionL( CBufBase& aVersion ) = 0; |
|
127 |
|
128 /** |
|
129 The function for filling the DDF structure of the adapter |
|
130 This function is only called once, immediately after the adapter is created. |
|
131 @param aDDFObject Reference to root object. A DM adapter starts filling |
|
132 the data structure by calling AddChildObjectL to the root object and |
|
133 so describes the DDF of the adapter. |
|
134 @publishedPartner |
|
135 @prototype |
|
136 */ |
|
137 virtual void DDFStructureL( MSmlDmDDFObject& aDDF ) = 0; |
|
138 |
|
139 /** |
|
140 The function creates new leaf objects, or replaces data in existing leaf |
|
141 objects. The information about the success of the command should be |
|
142 returned by calling SetStatusL function of MSmlDmCallback callback |
|
143 interface. This makes it possible to buffer the commands. However, all |
|
144 the status codes for buffered commands must be returned at the latest when |
|
145 the adapter's CompleteOutstandingCmdsL() is called. |
|
146 @param aURI URI of the object |
|
147 @param aLUID LUID of the object (if the adapter has earlier returned a |
|
148 LUID to the DM Module). For new objects, this is the LUID |
|
149 inherited through the parent node. |
|
150 @param aObject Data of the object. |
|
151 @param aType MIME type of the object |
|
152 @param aStatusRef Reference to correct command, i.e. this reference |
|
153 must be used when calling the SetStatusL of this command |
|
154 @publishedPartner |
|
155 @prototype |
|
156 */ |
|
157 virtual void UpdateLeafObjectL( const TDesC8& aURI, const TDesC8& aLUID, |
|
158 const TDesC8& aObject, const TDesC8& aType, |
|
159 TInt aStatusRef ) = 0; |
|
160 |
|
161 /** |
|
162 The function creates new leaf objects, or replaces data in existing leaf |
|
163 objects, in the case where data is large enough to be streamed. The |
|
164 information about the success of the command should be returned by calling |
|
165 SetStatusL function of MSmlDmCallback callback interface. This makes it |
|
166 possible to buffer the commands. However, all the status codes for buffered |
|
167 commands must be returned at the latest when the CompleteOutstandingCmdsL() |
|
168 of adapter is called. |
|
169 @param aURI URI of the object |
|
170 @param aLUID LUID of the object (if the adapter has earlier returned a |
|
171 LUID to the DM Module). For new objects, this is the LUID |
|
172 inherited through the parent node. |
|
173 @param aStream Data of the object. Adapter should create write stream |
|
174 and return, when data is written to stream by DM agent, |
|
175 StreamCommittedL() is called by DM engine |
|
176 @param aType MIME type of the object |
|
177 @param aStatusRef Reference to correct command, i.e. this reference |
|
178 must be used when calling the SetStatusL of this |
|
179 command. |
|
180 @publishedPartner |
|
181 @prototype |
|
182 */ |
|
183 virtual void UpdateLeafObjectL( const TDesC8& aURI, const TDesC8& aLUID, |
|
184 RWriteStream*& aStream, const TDesC8& aType, |
|
185 TInt aStatusRef ) = 0; |
|
186 |
|
187 /** |
|
188 The function deletes an object and its child objects. The SetStatusL |
|
189 should be used as described in UpdateLeafObjectL() |
|
190 @param aURI URI of the object |
|
191 @param aLUID LUID of the object (if the adapter have earlier returned |
|
192 LUID to the DM Module). |
|
193 @param aStatusRef Reference to correct command, i.e. this reference must |
|
194 be used when calling the SetStatusL of this command. |
|
195 @publishedPartner |
|
196 @prototype |
|
197 */ |
|
198 virtual void DeleteObjectL( const TDesC8& aURI, const TDesC8& aLUID, |
|
199 TInt aStatusRef ) = 0; |
|
200 |
|
201 /** |
|
202 The function fetches data of a leaf object. The SetStatusL should be used |
|
203 as described in UpdateLeafObjectL(). The data is returned by using the |
|
204 SetResultsL function of MSmlCallback callback interface, and may be streamed. |
|
205 @param aURI URI of the object |
|
206 @param aLUID LUID of the object (if the adapter have earlier |
|
207 returned LUID to the DM Module). |
|
208 @param aType MIME type of the object |
|
209 @param aResultsRef Reference to correct results, i.e. this reference |
|
210 must be used when returning the result by calling |
|
211 the SetResultsL. |
|
212 @param aStatusRef Reference to correct command, i.e. this reference |
|
213 must be used when calling the SetStatusL of this |
|
214 command. |
|
215 @publishedPartner |
|
216 @prototype |
|
217 */ |
|
218 virtual void FetchLeafObjectL( const TDesC8& aURI, const TDesC8& aLUID, |
|
219 const TDesC8& aType, TInt aResultsRef, |
|
220 TInt aStatusRef ) = 0; |
|
221 |
|
222 /** |
|
223 The function fetches the size of the data of a leaf object. The size is |
|
224 in bytes, and must reflect the number of bytes that will be transferred |
|
225 when the framework calls FetchLeafObjectL. The SetStatusL should be used |
|
226 as described in FetchLeafObjectL(). The size value is returned by using |
|
227 the SetResultsL function of MSmlCallback callback interface, and must be |
|
228 a decimal integer expressed as a string, eg. "1234". |
|
229 Results from this call MUST NOT be streamed. |
|
230 @param aURI URI of the object |
|
231 @param aLUID LUID of the object (if the adapter have earlier |
|
232 returned LUID to the DM Module). |
|
233 @param aType MIME type of the object |
|
234 @param aResultsRef Reference to correct results, i.e. this reference |
|
235 must be used when returning the result by calling |
|
236 the SetResultsL. |
|
237 @param aStatusRef Reference to correct command, i.e. this reference |
|
238 must be used when calling the SetStatusL of this |
|
239 command. |
|
240 @publishedPartner |
|
241 @prototype |
|
242 */ |
|
243 virtual void FetchLeafObjectSizeL( const TDesC8& aURI, const TDesC8& aLUID, |
|
244 const TDesC8& aType, TInt aResultsRef, |
|
245 TInt aStatusRef ) = 0; |
|
246 /** |
|
247 The function fetches URI list. An adapter returns the list of URI segments |
|
248 under the given URI be separated by slash ("/"). The URI segment names for |
|
249 new objects must be given by the adapter. |
|
250 The list is returned by calling the SetResultsL function of MSmlCallback |
|
251 callback interface. Results from this call MUST NOT be streamed. |
|
252 @param aParentURI URI of the parent object |
|
253 @param aParentLUID LUID of the parent object (if the |
|
254 adapter have earlier returned LUID to |
|
255 the DM Module). |
|
256 @param aPreviousURISegmentList URI list with mapping LUID information, |
|
257 which is known by DM engine. An adapter |
|
258 can use this information when verifying |
|
259 if old objects still exists. An adapter |
|
260 also knows what objects are new to DM |
|
261 engine and can provide LUID mapping for |
|
262 them. aPreviousURISegmentList parameter |
|
263 (see above) helps to recognise new |
|
264 objects. |
|
265 @param aResultsRef Reference to correct results, i.e. this |
|
266 reference must be used when returning |
|
267 the result by calling the SetResultsL. |
|
268 @param aStatusRef Reference to correct command, i.e. this |
|
269 reference must be used when calling the |
|
270 SetStatusL of this command. |
|
271 @publishedPartner |
|
272 @prototype |
|
273 */ |
|
274 virtual void ChildURIListL( const TDesC8& aURI, const TDesC8& aLUID, |
|
275 const CArrayFix<TSmlDmMappingInfo>& aPreviousURISegmentList, |
|
276 TInt aResultsRef, TInt aStatusRef ) = 0; |
|
277 |
|
278 /** |
|
279 The function adds node object. In some cases an implementation of the |
|
280 function may be empty function, if the node object does not need concrete |
|
281 database update. Still this function may be helpful to an adapter, i.e. in |
|
282 passing mapping LUID of the node to DM Module. The SetStatusL should be |
|
283 used as described in UpdateLeafObjectL() |
|
284 @param aURI URI of the object |
|
285 @param aParentLUID LUID of the parent object (if the adapter have |
|
286 earlier returned LUID to the DM Module). |
|
287 @param aStatusRef Reference to correct command, i.e. this reference |
|
288 must be used when calling the SetStatusL of this |
|
289 command. |
|
290 @publishedPartner |
|
291 @prototype |
|
292 */ |
|
293 virtual void AddNodeObjectL( const TDesC8& aURI, const TDesC8& aParentLUID, |
|
294 TInt aStatusRef )=0; |
|
295 |
|
296 /** |
|
297 The function implements execute command. The information about the success |
|
298 of the command should be returned by calling SetStatusL function of |
|
299 MSmlDmCallback callback interface. This makes it possible to buffer the |
|
300 commands. |
|
301 However, all the status codes for buffered commands must be returned at |
|
302 the latest when the CompleteOutstandingCmdsL() of adapter is called. |
|
303 @param aURI URI of the command |
|
304 @param aLUID LUID of the object (if the adapter have earlier |
|
305 returned LUID to the DM Module). |
|
306 @param aArgument Argument for the command |
|
307 @param aType MIME type of the object |
|
308 @param aStatusRef Reference to correct command, i.e. this reference |
|
309 must be used when calling the SetStatusL of this |
|
310 command. |
|
311 @publishedPartner |
|
312 @prototype |
|
313 */ |
|
314 virtual void ExecuteCommandL( const TDesC8& aURI, const TDesC8& aLUID, |
|
315 const TDesC8& aArgument, const TDesC8& aType, |
|
316 TInt aStatusRef ) = 0; |
|
317 |
|
318 /** |
|
319 The function implements execute command. The information about the |
|
320 success of the command should be returned by calling SetStatusL function |
|
321 of MSmlDmCallback callback interface. This makes it possible to buffer the |
|
322 commands. |
|
323 However, all the status codes for buffered commands must be returned at |
|
324 the latest when the CompleteOutstandingCmdsL() of adapter is called. |
|
325 @param aURI URI of the command |
|
326 @param aLUID LUID of the object (if the adapter have earlier |
|
327 returned LUID to the DM Module). |
|
328 @param aStream Argument for the command. Adapter should create |
|
329 write stream and return, when data is written to |
|
330 stream by DM agent, StreamCommittedL() is called by |
|
331 DM engine |
|
332 @param aType MIME type of the object |
|
333 @param aStatusRef Reference to correct command, i.e. this reference |
|
334 must be used when calling the SetStatusL of this |
|
335 command. |
|
336 @publishedPartner |
|
337 @prototype |
|
338 */ |
|
339 virtual void ExecuteCommandL( const TDesC8& aURI, const TDesC8& aLUID, |
|
340 RWriteStream*& aStream, const TDesC8& aType, |
|
341 TInt aStatusRef ) = 0; |
|
342 |
|
343 /** |
|
344 The function implements copy command. The information about the success of |
|
345 the command should be returned by calling SetStatusL function of |
|
346 MSmlDmCallback callback interface. This makes it possible to buffer the |
|
347 commands. |
|
348 However, all the status codes for buffered commands must be returned at |
|
349 the latest when the CompleteOutstandingCmdsL() of adapter is called. |
|
350 @param aTargetURI Target URI for the command |
|
351 @param aSourceLUID LUID of the target object (if one exists, and if the adapter |
|
352 has earlier returned a LUID to the DM Module). |
|
353 @param aSourceURI Source URI for the command |
|
354 @param aSourceLUID LUID of the source object (if the adapter has |
|
355 earlier returned a LUID to the DM Module). |
|
356 @param aType MIME type of the objects |
|
357 @param aStatusRef Reference to correct command, i.e. this reference |
|
358 must be used when calling the SetStatusL of this |
|
359 command. |
|
360 @publishedPartner |
|
361 @prototype |
|
362 */ |
|
363 virtual void CopyCommandL( const TDesC8& aTargetURI, const TDesC8& aTargetLUID, |
|
364 const TDesC8& aSourceURI, const TDesC8& aSourceLUID, |
|
365 const TDesC8& aType, TInt aStatusRef ) = 0; |
|
366 |
|
367 /** |
|
368 The function indicates start of Atomic command. |
|
369 @publishedPartner |
|
370 @prototype |
|
371 */ |
|
372 virtual void StartAtomicL() = 0; |
|
373 |
|
374 /** |
|
375 The function indicates successful end of Atomic command. The adapter |
|
376 should commit all changes issued between StartAtomicL() and |
|
377 CommitAtomicL() |
|
378 @publishedPartner |
|
379 @prototype |
|
380 */ |
|
381 virtual void CommitAtomicL() = 0; |
|
382 |
|
383 /** |
|
384 The function indicates unsuccessful end of Atomic command. The adapter |
|
385 should rollback all changes issued between StartAtomicL() and |
|
386 RollbackAtomicL(). If rollback fails for a command, adapter should use |
|
387 SetStatusL() to indicate it. |
|
388 @publishedPartner |
|
389 @prototype |
|
390 */ |
|
391 virtual void RollbackAtomicL() = 0; |
|
392 |
|
393 /** |
|
394 Returns ETrue if adapter supports streaming otherwise EFalse. |
|
395 @param aItemSize size limit for stream usage |
|
396 @return TBool ETrue for streaming support |
|
397 @publishedPartner |
|
398 @prototype |
|
399 */ |
|
400 virtual TBool StreamingSupport( TInt& aItemSize ) = 0; |
|
401 |
|
402 /** |
|
403 Called when stream returned from UpdateLeafObjectL or ExecuteCommandL has |
|
404 been written to and committed. Not called when fetching item. |
|
405 @publishedPartner |
|
406 @prototype |
|
407 */ |
|
408 virtual void StreamCommittedL() = 0; |
|
409 |
|
410 /** |
|
411 The function tells the adapter that all the commands of the message that |
|
412 can be passed to the adapter have now been passed. This indciates that |
|
413 the adapter must supply status codes and results to any buffered commands. |
|
414 This must be done at latest by the time this function returns. |
|
415 This function is used at the end of SyncML messages, and during processing |
|
416 of Atomic. In the case of Atomic processing, the function will be |
|
417 followed by a call to CommitAtomicL or RollbackAtomicL. |
|
418 @publishedPartner |
|
419 @prototype |
|
420 */ |
|
421 virtual void CompleteOutstandingCmdsL() = 0; |
|
422 }; |
|
423 |
|
424 |
|
425 class TSmlDmAccessTypes |
|
426 /** |
|
427 This class sets the access types which are allowed for a DM object. |
|
428 @publishedPartner |
|
429 @prototype |
|
430 */ |
|
431 { |
|
432 public: |
|
433 enum |
|
434 /** |
|
435 This enumeration describes the possible access types for a DM object |
|
436 @publishedPartner |
|
437 @prototype |
|
438 */ |
|
439 { |
|
440 /** The DM Command Add is permitted on this DM object */ |
|
441 EAccessType_Add = 0x01, |
|
442 /** The DM Command Copy is permitted on this DM object */ |
|
443 EAccessType_Copy = 0x02, |
|
444 /** The DM Command Delete is permitted on this DM object */ |
|
445 EAccessType_Delete = 0x04, |
|
446 /** The DM Command Exec is permitted on this DM object */ |
|
447 EAccessType_Exec = 0x08, |
|
448 /** The DM Command Get is permitted on this DM object */ |
|
449 EAccessType_Get = 0x10, |
|
450 /** The DM Command Replace is permitted on this DM object */ |
|
451 EAccessType_Replace = 0x20 |
|
452 }; |
|
453 public: |
|
454 inline TSmlDmAccessTypes(); |
|
455 inline void SetAdd(); |
|
456 inline void SetCopy(); |
|
457 inline void SetDelete(); |
|
458 inline void SetExec(); |
|
459 inline void SetGet(); |
|
460 inline void SetReplace(); |
|
461 inline TUint8 GetACL(); |
|
462 inline void Reset(); |
|
463 |
|
464 private: |
|
465 TUint8 iACL; |
|
466 }; |
|
467 |
|
468 |
|
469 |
|
470 class CSmlDmAdapter : public CBase, public MSmlDmAdapter |
|
471 /** |
|
472 The class CSmlDmAdapter is an ECOM interface for Device Management adapter plugins. |
|
473 This interface which must be implemented by every DM plugin adapter |
|
474 @publishedPartner |
|
475 @prototype |
|
476 */ |
|
477 |
|
478 { |
|
479 public: |
|
480 inline static CSmlDmAdapter* NewL( const TUid& aImplementationUid, |
|
481 MSmlDmCallback& aDmCallback ); |
|
482 inline virtual ~CSmlDmAdapter(); |
|
483 |
|
484 protected: |
|
485 inline CSmlDmAdapter(TAny* aEcomArguments); |
|
486 inline MSmlDmCallback& Callback(); |
|
487 |
|
488 private: |
|
489 /** ECOM framework requires this ID in object destructor |
|
490 @internalTechnology |
|
491 @prototype |
|
492 */ |
|
493 TUid iDtor_ID_Key; |
|
494 |
|
495 /** The DM Framework's callback for returning command results and data |
|
496 @internalTechnology |
|
497 @prototype |
|
498 */ |
|
499 MSmlDmCallback& iCallback; |
|
500 }; |
|
501 |
|
502 class MSmlDmCallback |
|
503 /** |
|
504 This class is callback interface which is implemented in DM Module. An |
|
505 instance is passed by reference as an argument to the CSmlDmAdapter::NewL() |
|
506 function. This interface is mostly used for returning results and status |
|
507 codes for completed commands to the DM framework. The interface also has |
|
508 functionality for mapping LUIDs and fetching from other parts of the DM Tree. |
|
509 The adapter does not necessarily need to use any other functions but the |
|
510 SetStatusL and SetResultsL, if it handles the LUID mapping itself. |
|
511 @publishedPartner |
|
512 @prototype |
|
513 */ |
|
514 { |
|
515 public: |
|
516 /** |
|
517 The function is used to return the data in case of FetchLeafObjectL(), |
|
518 FetchLeafObjectSizeL() and ChildURIListL() functions. It should not be |
|
519 called where the DM command has failed, i.e. the error code returned in |
|
520 SetStatusL is something other than EOk. |
|
521 @param aResultsRef Reference to correct command |
|
522 @param aObject The data which should be returned |
|
523 @param aType MIME type of the object |
|
524 @publishedPartner |
|
525 @prototype |
|
526 */ |
|
527 virtual void SetResultsL( TInt aResultsRef, CBufBase& aObject, |
|
528 const TDesC8& aType ) = 0; |
|
529 |
|
530 /** |
|
531 The function is used to return the data in case of FetchLeafObjectL() and |
|
532 ChildURIListL() functions, where the size of the data being returned is |
|
533 large enough for the Adapter to stream it. This function should not be |
|
534 called when command was failed, i.e. the error code returned in SetStatusL |
|
535 is something other than EOk. |
|
536 @param aResultsRef Reference to correct command |
|
537 @param aStream Large data which should be returned, DM engine |
|
538 closes stream when it has read all the data |
|
539 @param aType MIME type of the object |
|
540 @publishedPartner |
|
541 @prototype |
|
542 */ |
|
543 virtual void SetResultsL( TInt aResultsRef, RReadStream*& aStream, |
|
544 const TDesC8& aType ) = 0; |
|
545 |
|
546 /** |
|
547 The function returns information about the Add,Update,Delete and Fetch |
|
548 commands success to DM engine. The reference to correct command must be |
|
549 used when calling the SetStatusL function, the reference is got from the |
|
550 argument of the command functions. The SetStatusL function must be called |
|
551 separately for every single command. |
|
552 @param aStatusRef Reference to correct command |
|
553 @param aErrorCode Information about the command success |
|
554 @publishedPartner |
|
555 @prototype |
|
556 */ |
|
557 virtual void SetStatusL( TInt aStatusRef, |
|
558 MSmlDmAdapter::TError aErrorCode ) = 0; |
|
559 |
|
560 /** |
|
561 The function passes map information to DM Module. This function is called |
|
562 for a new management object, both for node objects and for leaf objects. |
|
563 In addition if ChildURIListL() function has returned new objects a mapping |
|
564 information of the new objects must be passed. A mapping is treated as |
|
565 inheritable. If the mapping is not set with this function, the mapping |
|
566 LUID of the parent object is passed in following commands to the object. |
|
567 @param aURI URI of the object. |
|
568 @param aLUID LUID of the object. LUID must contain the all information, |
|
569 which is needed for retrieve the invidual object from the |
|
570 database. Typically it is ID for the database table. In |
|
571 more complicated structures it can be combination of IDs, |
|
572 which represent path to the object. |
|
573 @publishedPartner |
|
574 @prototype |
|
575 */ |
|
576 virtual void SetMappingL( const TDesC8& aURI, const TDesC8& aLUID ) = 0; |
|
577 |
|
578 /** |
|
579 The function is used to make a fetch to other adapters. The most common |
|
580 use is to make a fetch to the AP adapter, because when managing the access |
|
581 points, the data comes as URI. For example, there are ToNAPId field in |
|
582 some adapters, and data to it can be something like AP/IAPidx, and then |
|
583 the link to AP adapter is needed. |
|
584 Using FetchLinkL causes the DM Framework to make a Get request to the |
|
585 appropriate DM adapter. The receiving adapter MUST complete the Get |
|
586 request synchronously. |
|
587 @param aURI URI of the object. |
|
588 @param aData Reference to data, i.e. data is returned here |
|
589 @param aStatus The status of fetch command is returned here |
|
590 @publishedPartner |
|
591 @prototype |
|
592 */ |
|
593 virtual void FetchLinkL( const TDesC8& aURI, CBufBase& aData, |
|
594 MSmlDmAdapter::TError& aStatus ) = 0; |
|
595 |
|
596 /** |
|
597 The function returns the LUID which is mapped to aURI. If LUID is not |
|
598 found, the function allocates a null length string, i.e. the function |
|
599 allocates memory in every case. |
|
600 @param aURI URI of the object. |
|
601 @publishedPartner |
|
602 @prototype |
|
603 */ |
|
604 virtual HBufC8* GetLuidAllocL( const TDesC8& aURI ) = 0; |
|
605 |
|
606 /** |
|
607 The function is used to remove a mapped URI. Returns the error code about mapping removal. |
|
608 @param aAdapterId Settings Adapter id |
|
609 @param aURI Mapped Uri |
|
610 @param aChildAlso Indicates the child nodes removal |
|
611 @publishedPartner |
|
612 @prototype |
|
613 */ |
|
614 virtual TInt RemoveMappingL( TUint32 aAdapterId, const TDesC8& aURI, TBool aChildAlso ) = 0; |
|
615 }; |
|
616 |
|
617 |
|
618 class MSmlDmDDFObject |
|
619 /** |
|
620 This class structure includes DDF description. When used as an argument in DM |
|
621 Adapters Interface each adapter fills its own branch of DDF Tree to the data |
|
622 structure. |
|
623 @publishedPartner |
|
624 @prototype |
|
625 */ |
|
626 { |
|
627 public: |
|
628 |
|
629 enum TDFFormat |
|
630 /** |
|
631 The possible formats of a node. |
|
632 @publishedPartner |
|
633 @prototype |
|
634 */ |
|
635 { |
|
636 /** Base64 encoded */ |
|
637 EB64, |
|
638 /** Boolean */ |
|
639 EBool, |
|
640 /** Character data */ |
|
641 EChr, |
|
642 /** Integer */ |
|
643 EInt, |
|
644 /** A DM Tree interior node */ |
|
645 ENode, |
|
646 /** No data */ |
|
647 ENull, |
|
648 /** XML character data*/ |
|
649 EXml, |
|
650 /** Binary data */ |
|
651 EBin, |
|
652 /** Date data */ |
|
653 EDate, |
|
654 /** Time data */ |
|
655 ETime, |
|
656 /** Float */ |
|
657 EFloat |
|
658 }; |
|
659 |
|
660 enum TOccurence |
|
661 /** |
|
662 The possible occurrences of a node. |
|
663 @publishedPartner |
|
664 @prototype |
|
665 */ |
|
666 { |
|
667 /** The node appears exactly once */ |
|
668 EOne, |
|
669 /** The node is optional and may appear zero or once */ |
|
670 EZeroOrOne, |
|
671 /** The node is optional and may appear zero or more times */ |
|
672 EZeroOrMore, |
|
673 /** The node is mandatory and may appear once or more times */ |
|
674 EOneOrMore, |
|
675 /** The node is optional and may appear between once and 'N' times */ |
|
676 EZeroOrN, |
|
677 /** The node is mandatory and may appear between once and 'N' times */ |
|
678 EOneOrN |
|
679 }; |
|
680 |
|
681 enum TScope |
|
682 /** |
|
683 The possible scopes of a node. |
|
684 @publishedPartner |
|
685 @prototype |
|
686 */ |
|
687 { |
|
688 /** The node is permanent in the DM Tree */ |
|
689 EPermanent, |
|
690 /** The node is created at run-time in the DM Tree */ |
|
691 EDynamic |
|
692 }; |
|
693 |
|
694 /** |
|
695 The function sets permitted access types property to the object. Access |
|
696 types property is a mandatory element. If this function is not called all |
|
697 accesses are denied. |
|
698 @param aAccessTypes Access types property. |
|
699 @publishedPartner |
|
700 @prototype |
|
701 */ |
|
702 virtual void SetAccessTypesL( TSmlDmAccessTypes aAccessTypes )=0; |
|
703 |
|
704 /** |
|
705 The function sets a default value property to the object. Default value |
|
706 is not a mandatory element. If this function is not called, it means that |
|
707 the default value property is not set at all. |
|
708 @param aDefaultValue Default value property. |
|
709 @publishedPartner |
|
710 @prototype |
|
711 */ |
|
712 virtual void SetDefaultValueL( const TDesC8& aDefaultValue )=0; |
|
713 |
|
714 /** |
|
715 The function sets a description property to the object. Description is |
|
716 not a mandatory element. If this function is not called, it means that the |
|
717 description property value is not set at all. |
|
718 @param aDescription Description property. |
|
719 @publishedPartner |
|
720 @prototype |
|
721 */ |
|
722 virtual void SetDescriptionL( const TDesC8& aDescription )=0; |
|
723 |
|
724 /** |
|
725 The function sets a format property to the object. Format is a mandatory |
|
726 element. If this function is not called for node element, Format is set as |
|
727 'node'. For leaf elements this function must be called. |
|
728 @param aFormat Format property. |
|
729 @publishedPartner |
|
730 @prototype |
|
731 */ |
|
732 virtual void SetDFFormatL( TDFFormat aFormat )= 0; |
|
733 |
|
734 /** |
|
735 The function sets an occurence property to the object. If this function |
|
736 is not called, an occurence is set as TOccurence::EOne. |
|
737 @param aOccurence Occurence property. |
|
738 @publishedPartner |
|
739 @prototype |
|
740 */ |
|
741 virtual void SetOccurenceL( TOccurence aOccurence ) =0; |
|
742 |
|
743 /** |
|
744 The function sets a scope property to the object. If this function is not |
|
745 called, the scope is set as TScope::EDynamic. |
|
746 @param aScope Scope property. |
|
747 @publishedPartner |
|
748 @prototype |
|
749 */ |
|
750 virtual void SetScopeL( TScope aScope ) = 0; |
|
751 |
|
752 /** |
|
753 The function sets a title property to the object. Title is not a mandatory |
|
754 element. If this function is not called, it means that a Title property |
|
755 value is not set at all. |
|
756 @param aTitle DFTitle property. |
|
757 @publishedPartner |
|
758 @prototype |
|
759 */ |
|
760 virtual void SetDFTitleL( const TDesC8& aTitle ) = 0; |
|
761 |
|
762 /** |
|
763 The function sets a MIME type property to the object. MIME Type is a |
|
764 mandatory element for leaf objects. If this function is not called (for |
|
765 node elements), it means that the MIME type property value is not set at |
|
766 all. |
|
767 @param aMimeType MIME type property. |
|
768 @publishedPartner |
|
769 @prototype |
|
770 */ |
|
771 virtual void AddDFTypeMimeTypeL( const TDesC8& aMimeType ) = 0; |
|
772 |
|
773 /** |
|
774 The function sets an object as an object group. If this function is not |
|
775 called, it means that the object is not an object group. Object group is a |
|
776 term used with for the node in the management tree that is used as a |
|
777 container for other object groups, container for management objects or a |
|
778 container for both object groups and management objects. The term 'object |
|
779 group' is not used when talked about the nodes which are part of |
|
780 the management object itself. |
|
781 @publishedPartner |
|
782 @withdrawn - This is not supported. MSmlDmDDFObject::AddChildObjectGroupL |
|
783 * must be used instead of AddChildObjectL,SetAsObjectGroup. |
|
784 */ |
|
785 virtual void SetAsObjectGroup() = 0; |
|
786 |
|
787 /** |
|
788 The function adds a child object and sets name of the URI segment, which |
|
789 is used by the DM server. The highest object must be directly under root. |
|
790 An adapter is not able to set properties of the root object. The aNodeName |
|
791 argument should be an empty string, when the name is not fixed in DDF, |
|
792 i.e. in case of dynamic nodes. |
|
793 @param aNodeName The name of the node |
|
794 @publishedPartner |
|
795 @prototype |
|
796 */ |
|
797 virtual MSmlDmDDFObject& AddChildObjectL(const TDesC8& aNodeName) = 0; |
|
798 |
|
799 /** |
|
800 The function adds a child object, to be used as an object group. As an |
|
801 object group, there is no node name (these nodes are 'unnamed' in the DDF). |
|
802 Object group is a term used with for nodes in the management tree that are |
|
803 used as a container for other object groups, container for management |
|
804 objects or a container for both object groups and management objects. The |
|
805 term 'object group' is not used when referring to nodes which are part |
|
806 of the management object itself. |
|
807 @publishedPartner |
|
808 @prototype |
|
809 */ |
|
810 virtual MSmlDmDDFObject& AddChildObjectGroupL() = 0; |
|
811 }; |
|
812 |
|
813 #include "smldmadapter.inl" |
|
814 |
|
815 #endif // __SMLDMADAPTER_H__ |