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