|
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: DB capabilities header. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef __NSMLDBCAPS_H__ |
|
20 #define __NSMLDBCAPS_H__ |
|
21 |
|
22 // ------------------------------------------------------------------------------------------------ |
|
23 // Includes |
|
24 // ------------------------------------------------------------------------------------------------ |
|
25 #include <e32base.h> |
|
26 #include <badesca.h> |
|
27 |
|
28 // ------------------------------------------------------------------------------------------------ |
|
29 // TNSmlCtCapData |
|
30 // ------------------------------------------------------------------------------------------------ |
|
31 struct TNSmlCtCapData |
|
32 { |
|
33 public: |
|
34 |
|
35 // 1.2 CHANGES: New elements added. |
|
36 enum TNSmlCtCapTag |
|
37 { |
|
38 ECtType, |
|
39 EVerCt, |
|
40 EFieldLevel, |
|
41 EPropName, |
|
42 EPropDataType, |
|
43 EPropMaxOccur, |
|
44 EPropMaxSize, |
|
45 EPropNoTruncate, |
|
46 EPropValEnum, |
|
47 EPropDisplayName, |
|
48 EParamName, |
|
49 EParamValEnum, |
|
50 EParamDataType, |
|
51 EParamDisplayName |
|
52 }; |
|
53 // changes end |
|
54 |
|
55 /** |
|
56 * C++ constructor. |
|
57 * @param aTag Element type. |
|
58 * @param aValue Value of the element. |
|
59 */ |
|
60 IMPORT_C TNSmlCtCapData( TNSmlCtCapTag aTag, const TDesC8& aValue ); |
|
61 |
|
62 /** |
|
63 * Static compare routine for two TNSmlCtCapData instances. Instances are kept in order |
|
64 * in array for faster searching. |
|
65 * @param aFirst First compare instance. |
|
66 * @param aSecond Second compare instance. |
|
67 * @return TInt Returns greater than 0 if aFirst is greater than aSecond, less than 0 if aFirst |
|
68 * is less than aSecond and 0 if aFirst is equal to aSecond. |
|
69 */ |
|
70 IMPORT_C static TInt Compare( const TNSmlCtCapData& aFirst, const TNSmlCtCapData& aSecond ); |
|
71 |
|
72 public: |
|
73 TNSmlCtCapTag iTag; |
|
74 const TBuf8<64> iValue; |
|
75 }; |
|
76 |
|
77 // 1.2 CHANGES: FilterCap |
|
78 // ------------------------------------------------------------------------------------------------ |
|
79 // TNSmlFilterCapData |
|
80 // ------------------------------------------------------------------------------------------------ |
|
81 struct TNSmlFilterCapData |
|
82 { |
|
83 public: |
|
84 |
|
85 enum TNSmlFilterCapTag |
|
86 { |
|
87 ECtType, |
|
88 EVerCt, |
|
89 EFilterKeyword, |
|
90 EPropName |
|
91 }; |
|
92 |
|
93 /** |
|
94 * C++ constructor. |
|
95 * @param aTag Element type. |
|
96 * @param aValue Value of the element. |
|
97 */ |
|
98 IMPORT_C TNSmlFilterCapData( TNSmlFilterCapTag aTag, const TDesC8& aValue ); |
|
99 |
|
100 /** |
|
101 * Static compare routine for two TNSmlFilterCapData instances. Instances are kept in order |
|
102 * in array for faster searching. |
|
103 * @param aFirst First compare instance. |
|
104 * @param aSecond Second compare instance. |
|
105 * @return TInt Returns greater than 0 if aFirst is greater than aSecond, less than 0 if aFirst |
|
106 * is less than aSecond and 0 if aFirst is equal to aSecond. |
|
107 */ |
|
108 IMPORT_C static TInt Compare( const TNSmlFilterCapData& aFirst, const TNSmlFilterCapData& aSecond ); |
|
109 |
|
110 public: |
|
111 TNSmlFilterCapTag iTag; |
|
112 const TBuf8<64> iValue; |
|
113 }; |
|
114 |
|
115 // changes end |
|
116 |
|
117 // 1.2 CHANGES: New class (replaces CNSmlCtParam). |
|
118 // ------------------------------------------------------------------------------------------------ |
|
119 // CNSmlPropParam |
|
120 // ------------------------------------------------------------------------------------------------ |
|
121 struct sml_devinf_propparam_s; |
|
122 class CNSmlPropParam : public CBase |
|
123 { |
|
124 public: |
|
125 /** |
|
126 * C++ constructor. |
|
127 * @param aParamPtr Pointer to device info property parameter structure. |
|
128 */ |
|
129 IMPORT_C CNSmlPropParam( sml_devinf_propparam_s* aParamPtr ); |
|
130 |
|
131 /** |
|
132 * Sets parameter's displayable name. |
|
133 * @param aDispName Displayable name as descriptor. |
|
134 */ |
|
135 IMPORT_C void SetDisplayNameL( const TDesC8& aDispName ); |
|
136 |
|
137 /** |
|
138 * Adds new valenum. |
|
139 * @param aValEnum Value of valenum as descriptor. |
|
140 */ |
|
141 IMPORT_C void AddValEnumL( const TDesC8& aValEnum ); |
|
142 |
|
143 /** |
|
144 * Sets datatype. |
|
145 * @param aDataType Value of datatype as descriptor. |
|
146 */ |
|
147 IMPORT_C void SetDataTypeL( const TDesC8& aDataType ); |
|
148 |
|
149 private: |
|
150 sml_devinf_propparam_s* iParamPtr; |
|
151 }; |
|
152 // changes end |
|
153 |
|
154 |
|
155 // 1.2 CHANGES: New class (replaces CNSmlCtProp). |
|
156 // ------------------------------------------------------------------------------------------------ |
|
157 // CNSmlDevInfProp |
|
158 // ------------------------------------------------------------------------------------------------ |
|
159 struct sml_devinf_property_s; |
|
160 class CNSmlDevInfProp : public CBase |
|
161 { |
|
162 public: |
|
163 |
|
164 /** |
|
165 * C++ constructor. |
|
166 * @param aParamPtr Pointer to device info property structure. |
|
167 */ |
|
168 IMPORT_C CNSmlDevInfProp( sml_devinf_property_s* aPropPtr ); |
|
169 |
|
170 /** |
|
171 * C++ destructor. |
|
172 */ |
|
173 IMPORT_C ~CNSmlDevInfProp(); |
|
174 |
|
175 /** |
|
176 * Adds new parameter to this property. Also leaves newly created instance into cleanupstack. |
|
177 * @param aParam Name of the parameter as descriptor. |
|
178 * @return CNSmlPropParam* Pointer to newly created instance. |
|
179 */ |
|
180 IMPORT_C CNSmlPropParam* AddParamLC( const TDesC8& aParam ); |
|
181 |
|
182 /** |
|
183 * Sets property's maximum occurrence value. |
|
184 * @param aMaxOccur Maximum occurrence value as descriptor. |
|
185 */ |
|
186 IMPORT_C void SetMaxOccurL( const TDesC8& aMaxOccur ); |
|
187 |
|
188 /** |
|
189 * Sets the maximum size of a property. |
|
190 * @param aMaxSize Maximum size of a property as descriptor. |
|
191 */ |
|
192 IMPORT_C void SetMaxSizeL( const TDesC8& aMaxSize ); |
|
193 |
|
194 /** |
|
195 * Sets NoTruncate element. |
|
196 * Secifies if truncation is permitted. |
|
197 */ |
|
198 IMPORT_C void SetNoTruncateL(); |
|
199 |
|
200 /** |
|
201 * Sets property's displayable name. |
|
202 * @param aDispName Displayable name as descriptor. |
|
203 */ |
|
204 IMPORT_C void SetDisplayNameL( const TDesC8& aDispName ); |
|
205 |
|
206 /** |
|
207 * Adds new valenum. |
|
208 * @param aValEnum Value of valenum as descriptor. |
|
209 */ |
|
210 IMPORT_C void AddValEnumL( const TDesC8& aValEnum ); |
|
211 |
|
212 /** |
|
213 * Sets datatype. |
|
214 * @param aDataType Value of datatype as descriptor. |
|
215 */ |
|
216 IMPORT_C void SetDataTypeL( const TDesC8& aDataType ); |
|
217 private: |
|
218 sml_devinf_property_s* iPropPtr; |
|
219 }; |
|
220 // changes end |
|
221 |
|
222 // ------------------------------------------------------------------------------------------------ |
|
223 // CNSmlCtCap |
|
224 // ------------------------------------------------------------------------------------------------ |
|
225 struct sml_devinf_ctcap_s; |
|
226 class CNSmlCtCap : public CBase |
|
227 { |
|
228 public: |
|
229 CNSmlCtCap( sml_devinf_ctcap_s* aCtCapPtr ); |
|
230 ~CNSmlCtCap(); |
|
231 |
|
232 /** |
|
233 * Sets value of CtCtype. |
|
234 * @param aCtType Value of CtType as descriptor. |
|
235 */ |
|
236 IMPORT_C void SetCtTypeL( const TDesC8& aCtType ); |
|
237 |
|
238 // 1.2 CHANGES: Setting new elements in CtCap structure. |
|
239 /** |
|
240 * Sets value of VerCt. |
|
241 * @param aVerCt Value of VerCt as descriptor. |
|
242 */ |
|
243 IMPORT_C void SetVerCtL( const TDesC8& aVerCt ); |
|
244 |
|
245 /** |
|
246 * Sets FieldLevel element. |
|
247 */ |
|
248 IMPORT_C void SetFieldLevelL(); |
|
249 |
|
250 /** |
|
251 * Adds new property, also leaves newly created instance into cleanupstack. |
|
252 * @param aProp Property's name as descriptor. |
|
253 * @return CNSmlDevInfProp* Pointer to newly created instance. |
|
254 */ |
|
255 IMPORT_C CNSmlDevInfProp* AddDevInfPropLC( const TDesC8& aProp ); |
|
256 // changes end |
|
257 |
|
258 private: |
|
259 sml_devinf_ctcap_s* iCtCapPtr; |
|
260 }; |
|
261 |
|
262 // 1.2 CHANGES: New class for FilterCap params. |
|
263 // ------------------------------------------------------------------------------------------------ |
|
264 // CNSmlFilterCap |
|
265 // ------------------------------------------------------------------------------------------------ |
|
266 struct sml_devinf_filtercap_s; |
|
267 class CNSmlFilterCap : public CBase |
|
268 { |
|
269 public: |
|
270 CNSmlFilterCap( sml_devinf_filtercap_s* aFilterCapPtr ); |
|
271 ~CNSmlFilterCap(); |
|
272 |
|
273 /** |
|
274 * Adds new filter keyword to FilterCap. |
|
275 * @param aKeyword Value of filter keyword as descriptor. |
|
276 */ |
|
277 IMPORT_C void AddFilterKeywordL( const TDesC8& aKeyword ); |
|
278 |
|
279 /** |
|
280 * Adds new property name to FilterCap. |
|
281 * @param aPropName Value of property name as descriptor. |
|
282 */ |
|
283 IMPORT_C void AddPropNameL( const TDesC8& aPropName ); |
|
284 private: |
|
285 sml_devinf_filtercap_s* iFilterCapPtr; |
|
286 }; |
|
287 // changes end |
|
288 |
|
289 // ------------------------------------------------------------------------------------------------ |
|
290 // CNSmlCtCapHandler |
|
291 // ------------------------------------------------------------------------------------------------ |
|
292 struct sml_devinf_datastore_s; |
|
293 struct sml_devinf_ctcaplist_s; |
|
294 struct sml_devinf_filtercaplist_s; |
|
295 struct sml_pcdata_s; |
|
296 struct sml_devinf_xmit_s; |
|
297 struct sml_devinf_ctcap_s; |
|
298 struct sml_devinf_ctdataprop_s; |
|
299 |
|
300 class CNSmlCtCapsHandler : public CBase |
|
301 { |
|
302 public: |
|
303 /** |
|
304 * C++ constructor. |
|
305 * @param aCtCaps Pointer to CtCaps structure. |
|
306 */ |
|
307 IMPORT_C CNSmlCtCapsHandler( sml_devinf_ctcaplist_s* aCtCaps ); |
|
308 |
|
309 /** |
|
310 * Gets CtCaps as array of TNSmlCtCapData items. |
|
311 * @param aCtCaps On return contains CtCaps parsed into TNSmlCtCapData items. |
|
312 * @param aCtType If defined then CtCaps only for given CtType are returned otherwise all CtCaps |
|
313 * are parsed into array. |
|
314 */ |
|
315 IMPORT_C void GetCtCapsL( CArrayFix<TNSmlCtCapData>& aCtCaps, const TDesC8& aCtType = TPtrC8() ); |
|
316 |
|
317 protected: |
|
318 |
|
319 void AppendCtCapL( CArrayFix<TNSmlCtCapData>& aCtCaps, sml_devinf_ctcap_s* aCtCap ); |
|
320 |
|
321 // 1.2 CHANGES: New structures for version 1.2. |
|
322 void AppendDevInfPropL( CArrayFix<TNSmlCtCapData>& aCtCaps, sml_devinf_property_s* aCtCap ); |
|
323 void AppendPropParamL( CArrayFix<TNSmlCtCapData>& aCtCaps, sml_devinf_propparam_s* aCtCap, TNSmlCtCapData::TNSmlCtCapTag aTag ); |
|
324 // changes end |
|
325 private: |
|
326 sml_devinf_ctcaplist_s* iCtCaps; // does not own this! |
|
327 }; |
|
328 |
|
329 // 1.2 CHANGES: FilterCap Handler |
|
330 // ------------------------------------------------------------------------------------------------ |
|
331 // CNSmlFilterCapHandler |
|
332 // ------------------------------------------------------------------------------------------------ |
|
333 class CNSmlFilterCapsHandler : public CBase |
|
334 { |
|
335 public: |
|
336 /** |
|
337 * C++ constructor. |
|
338 * @param aFilterCaps Pointer to FilterCaps structure. |
|
339 */ |
|
340 IMPORT_C CNSmlFilterCapsHandler( sml_devinf_filtercaplist_s* aFilterCaps ); |
|
341 |
|
342 /** |
|
343 * Gets FilterCaps as array of TNSmlFilterCapData items. |
|
344 * @param aFilterCaps On return contains FilterCaps parsed into TNSmlFilterCapData items. |
|
345 * @param aCtType If defined then FilterCaps only for given CtType are returned otherwise all FilterCaps |
|
346 * are parsed into array. |
|
347 */ |
|
348 IMPORT_C void GetFilterCapsL( CArrayFix<TNSmlFilterCapData>& aFilterCaps, const TDesC8& aCtType = TPtrC8() ); |
|
349 |
|
350 protected: |
|
351 |
|
352 void AppendFilterCapL( CArrayFix<TNSmlFilterCapData>& aFilterCaps, sml_devinf_filtercap_s* aFilterCap ); |
|
353 |
|
354 private: |
|
355 sml_devinf_filtercaplist_s* iFilterCaps; // does not own this! |
|
356 }; |
|
357 |
|
358 // changes end |
|
359 |
|
360 // ------------------------------------------------------------------------------------------------ |
|
361 // CNSmlDbCaps |
|
362 // ------------------------------------------------------------------------------------------------ |
|
363 |
|
364 // 1.2 HYBRID CHANGES: |
|
365 struct sml_devinf_devinf_s; |
|
366 // changes end |
|
367 |
|
368 class CNSmlDbCaps : public CBase |
|
369 { |
|
370 public: |
|
371 enum ENSmlSyncTypes |
|
372 { |
|
373 EAllTypes = 0, |
|
374 ETwoWaySync = 1, |
|
375 ESlowTwoWaySync, |
|
376 EOneWaySyncFromClient, |
|
377 ERefreshSyncFromClient, |
|
378 EOneWaySyncFromServer, |
|
379 ERefreshSyncFromServer, |
|
380 EServerAlertedSync, |
|
381 ESyncTypeNone = 8 |
|
382 }; |
|
383 |
|
384 /** |
|
385 * Two-phase (leave safe) constructor. |
|
386 * @return CNSmlDbCaps* Pointer to newly created instance. |
|
387 */ |
|
388 IMPORT_C static CNSmlDbCaps* NewL(); |
|
389 |
|
390 /** |
|
391 * Two-phase (leave safe) constructor. Leaves instance into cleanupstack. |
|
392 * @return CNSmlDbCaps* Pointer to newly created instance. |
|
393 */ |
|
394 IMPORT_C static CNSmlDbCaps* NewLC(); |
|
395 |
|
396 /** |
|
397 * C++ destructor. |
|
398 */ |
|
399 IMPORT_C ~CNSmlDbCaps(); |
|
400 |
|
401 // These structs are used by sync agent |
|
402 |
|
403 /** |
|
404 * Returns pointer to datastore structure. |
|
405 * @return sml_devinf_datastore_s* Pointer to datastore structure. |
|
406 */ |
|
407 IMPORT_C sml_devinf_datastore_s* DatastoreL() const; |
|
408 |
|
409 /** |
|
410 * Returns pointer to ctcap structure. |
|
411 * @return sml_devinf_ctcaplist_s* Pointer to ctcap structure. |
|
412 */ |
|
413 IMPORT_C sml_devinf_ctcaplist_s* CtCaps() const; |
|
414 |
|
415 // 1.2 CHANGES: FilterCap |
|
416 /** |
|
417 * Returns pointer to filtercap structure. |
|
418 * @return sml_devinf_filtercaplist_s* Pointer to filtercap structure. |
|
419 */ |
|
420 IMPORT_C sml_devinf_filtercaplist_s* FilterCaps() const; |
|
421 // changes end |
|
422 |
|
423 /** |
|
424 * Checks whether given synctype is supported or not. |
|
425 * @param aType Synctype to check. |
|
426 * @return TBool ETrue if Synctype is supported, EFalse otherwise. |
|
427 */ |
|
428 IMPORT_C TBool SupportsSyncType( ENSmlSyncTypes aType ) const; |
|
429 |
|
430 /** |
|
431 * Creates instance of CtCaps handler. |
|
432 * @return CNSmlCtCapsHandler* Pointer to newly created CtCaps handler. |
|
433 */ |
|
434 IMPORT_C CNSmlCtCapsHandler* CreateHandlerL() const; |
|
435 // DataStore element |
|
436 |
|
437 /** |
|
438 * Sets RxPref element. |
|
439 * @param aCtType Value of CtType as descriptor. |
|
440 * @param aVerCt Value of VerCt as descriptor. |
|
441 */ |
|
442 IMPORT_C void SetRxPrefL( const TDesC8& aCtType, const TDesC8& aVerCt ); |
|
443 |
|
444 /** |
|
445 * Adds Rx element. |
|
446 * @param aCtType Value of CtType as descriptor. |
|
447 * @param aVerCt Value of VerCt as descriptor. |
|
448 */ |
|
449 IMPORT_C void AddRxL( const TDesC8& aCtType, const TDesC8& aVerCt ); |
|
450 |
|
451 /** |
|
452 * Sets TxPref element. |
|
453 * @param aCtType Value of CtType as descriptor. |
|
454 * @param aVerCt Value of VerCt as descriptor. |
|
455 */ |
|
456 IMPORT_C void SetTxPrefL( const TDesC8& aCtType, const TDesC8& aVerCt ); |
|
457 |
|
458 /** |
|
459 * Adds Tx element. |
|
460 * @param aCtType Value of CtType as descriptor. |
|
461 * @param aVerCt Value of VerCt as descriptor. |
|
462 */ |
|
463 IMPORT_C void AddTxL( const TDesC8& aCtType, const TDesC8& aVerCt ); |
|
464 |
|
465 /** |
|
466 * Enables synctype (does not clear other settings!). |
|
467 * @param aType Syntype to enable. |
|
468 */ |
|
469 IMPORT_C void SetSyncType( ENSmlSyncTypes aType ); |
|
470 |
|
471 // 1.2 CHANGES: Filter-Rx & FilterCap |
|
472 /** |
|
473 * Adds Filter-Rx element. |
|
474 * @param aCtType Value of CtType as descriptor. |
|
475 * @param aVerCt Value of VerCt as descriptor. |
|
476 */ |
|
477 IMPORT_C void AddFilterRxL( const TDesC8& aCtType, const TDesC8& aVerCt ); |
|
478 |
|
479 /** |
|
480 * Creates new FilterCap element instance, also leaves newly created instance into cleanupstack. |
|
481 * @param aCtType Value of CtType as descriptor. |
|
482 * @param aVerCt Value of VerCt as descriptor. |
|
483 * @return CNSmlFilterCap* Pointer to newly created instance. |
|
484 */ |
|
485 IMPORT_C CNSmlFilterCap* AddFilterCapLC( const TDesC8& aCtType, const TDesC8& aVerCt ); |
|
486 |
|
487 /** |
|
488 * Creates instance of FilterCaps handler. |
|
489 * @return CNSmlFilterCapsHandler* Pointer to newly created FilterCaps handler. |
|
490 */ |
|
491 IMPORT_C CNSmlFilterCapsHandler* CreateFilterCapsHandlerL() const; |
|
492 |
|
493 // changes end |
|
494 |
|
495 // 1.2 CHANGES: Setting SupportHierarchicalSync, SourceRef, DisplayName, MaxGuidSize |
|
496 /** |
|
497 * Sets SupportHierarchicalSync element. |
|
498 * Indicates if hierarchical synchronization is supported. |
|
499 */ |
|
500 IMPORT_C void SetSupportHierarchicalSyncL(); |
|
501 |
|
502 /** |
|
503 * Sets SourceRef element. |
|
504 * @param aSourceRef Value of SourceRef as descriptor. |
|
505 */ |
|
506 IMPORT_C void SetSourceRefL( const TDesC8& aSourceRef ); |
|
507 |
|
508 /** |
|
509 * Sets DisplayName element. |
|
510 * @param aDispName Value of DisplayName as descriptor. |
|
511 */ |
|
512 IMPORT_C void SetDisplayNameL( const TDesC8& aDispName ); |
|
513 |
|
514 /** |
|
515 * Sets MaxGuidSize element. |
|
516 * @param aMaxGuid Value of MaxGuidSize as descriptor. |
|
517 */ |
|
518 IMPORT_C void SetMaxGuidSizeL( const TDesC8& aMaxGuid ); |
|
519 |
|
520 // changes end |
|
521 // CTCap element |
|
522 /** |
|
523 * Creates new CtCap element instance, also leaves newly created instance into cleanupstack. |
|
524 * @return CNSmlCtCap* Pointer to newly created instance. |
|
525 */ |
|
526 IMPORT_C CNSmlCtCap* AddCtCapLC(); |
|
527 |
|
528 // 1.2 HYBRID CHANGES: Device info conversion |
|
529 /** |
|
530 * Creates version 1.1 CtCap element from version 1.2 Ctcap element |
|
531 * @return error code if conversion fails or is not possible |
|
532 */ |
|
533 |
|
534 IMPORT_C TInt ConvertDeviceInfoL( sml_devinf_devinf_s* aDeviceInfo); |
|
535 // changes end |
|
536 |
|
537 /** |
|
538 * sets maxitems element. Same as: iDatastore->dsmem->maxid |
|
539 * @param aMaxItems. Max items. Contains a number. |
|
540 */ |
|
541 void SetMaxItemsL( const TDesC8& aMaxItems ); |
|
542 |
|
543 /** |
|
544 * sets maxsize element. Same as: iDatastore->dsmem->maxmem |
|
545 * @param aMaxSize. Max size. Contains a number. |
|
546 */ |
|
547 void SetMaxSizeL( const TDesC8& aMaxSize ); |
|
548 |
|
549 /** |
|
550 * Returns pointer to datastore structure. No export needed, only needed inside the dll. |
|
551 * @return sml_devinf_datastore_s* Pointer to datastore structure. |
|
552 */ |
|
553 const sml_devinf_datastore_s* Datastore() const; |
|
554 |
|
555 // 1.2 CHANGES: FilterCap |
|
556 /** |
|
557 * Returns pointer to filtercap structure. No export needed, only needed inside the dll. |
|
558 * @return sml_devinf_filtercaplist_s* Pointer to filtercap structure. |
|
559 */ |
|
560 const sml_devinf_filtercaplist_s* FilterCapsList() const; |
|
561 // changes end |
|
562 |
|
563 protected: |
|
564 void ConstructL(); |
|
565 CNSmlDbCaps(); |
|
566 sml_pcdata_s* CreatePcdataL( const TDesC8& aData ); |
|
567 sml_devinf_xmit_s* CreateXmitL( const TDesC8& aCtType, const TDesC8& aVerCt ); |
|
568 |
|
569 private: |
|
570 TUint32 iSyncTypes; |
|
571 TInt32 iPublicId; |
|
572 mutable sml_devinf_datastore_s* iDatastore; |
|
573 mutable sml_devinf_ctcaplist_s* iCtCaps; |
|
574 mutable sml_devinf_filtercaplist_s* iFilterCaps; |
|
575 }; |
|
576 |
|
577 // ------------------------------------------------------------------------------------------------ |
|
578 // CNSmlDbMetaHandler |
|
579 // ------------------------------------------------------------------------------------------------ |
|
580 struct sml_metinf_metinf_s; |
|
581 |
|
582 class CNSmlDbMetaHandler : public CBase |
|
583 { |
|
584 public: |
|
585 /** |
|
586 * C++ constructor. |
|
587 */ |
|
588 IMPORT_C CNSmlDbMetaHandler(); |
|
589 |
|
590 /** |
|
591 * C++ constructor. |
|
592 * @param aMetInf Pointer to meta information structure. |
|
593 */ |
|
594 IMPORT_C CNSmlDbMetaHandler( sml_metinf_metinf_s* aMetInf ); |
|
595 |
|
596 /** |
|
597 * Returns value of Format element as 8-bit descriptor. |
|
598 * @return TPtrC8 Value of Format element. |
|
599 */ |
|
600 IMPORT_C TPtrC8 Format() const; |
|
601 |
|
602 /** |
|
603 * Returns value of Type element as 8-bit descriptor. |
|
604 * @return TPtrC8 Value of Type element. |
|
605 */ |
|
606 IMPORT_C TPtrC8 Type() const; |
|
607 |
|
608 /** |
|
609 * Returns value of Mark element as 8-bit descriptor. |
|
610 * @return TPtrC8 Value of Mark element. |
|
611 */ |
|
612 IMPORT_C TPtrC8 Mark() const; |
|
613 |
|
614 /** |
|
615 * Returns value of Size element as 8-bit descriptor. |
|
616 * @return TPtrC8 Value of Size element. |
|
617 */ |
|
618 IMPORT_C TPtrC8 Size() const; |
|
619 |
|
620 /** |
|
621 * Returns value of NextNonce element as 8-bit descriptor. |
|
622 * @return TPtrC8 Value of NextNonce element. |
|
623 */ |
|
624 IMPORT_C TPtrC8 NextNonce() const; |
|
625 |
|
626 /** |
|
627 * Returns value of Version element as 8-bit descriptor. |
|
628 * @return TPtrC8 Value of Version element. |
|
629 */ |
|
630 IMPORT_C TPtrC8 Version() const; |
|
631 |
|
632 /** |
|
633 * Returns value of MaxMsgSize element as 8-bit descriptor. |
|
634 * @return TPtrC8 Value of MaxMsgSize element. |
|
635 */ |
|
636 IMPORT_C TPtrC8 MaxMsgSize() const; |
|
637 |
|
638 /** |
|
639 * Returns value of MaxObjSize element as 8-bit descriptor. |
|
640 * @return TPtrC8 Value of MaxObjSize element. |
|
641 */ |
|
642 IMPORT_C TPtrC8 MaxObjSize() const; |
|
643 |
|
644 /** |
|
645 * Returns value of Mem/Shared element as 8-bit descriptor. |
|
646 * @return TPtrC8 Value of Mem/Shared element. |
|
647 */ |
|
648 IMPORT_C TPtrC8 MemShared() const; |
|
649 |
|
650 /** |
|
651 * Returns value of Mem/Free element as 8-bit descriptor. |
|
652 * @return TPtrC8 Value of Mem/Free element. |
|
653 */ |
|
654 IMPORT_C TPtrC8 MemFreeMem() const; |
|
655 |
|
656 /** |
|
657 * Returns value of Mem/FreeID element as 8-bit descriptor. |
|
658 * @return TPtrC8 Value of Mem/FreeID element. |
|
659 */ |
|
660 IMPORT_C TPtrC8 MemFreeID() const; |
|
661 |
|
662 /** |
|
663 * Returns value of Anchor/Next element as 8-bit descriptor. |
|
664 * @return TPtrC8 Value of Anchor/Next element. |
|
665 */ |
|
666 IMPORT_C TPtrC8 AnchorNext() const; |
|
667 |
|
668 /** |
|
669 * Returns value of Anchor/Last element as 8-bit descriptor. |
|
670 * @return TPtrC8 Value of Anchor/Last element. |
|
671 */ |
|
672 IMPORT_C TPtrC8 AnchorLast() const; |
|
673 |
|
674 /** |
|
675 * Returns values of EMI element as array. |
|
676 * @param aEMI On return contains values of EMI element. |
|
677 */ |
|
678 IMPORT_C void GetEmiL( CDesC8Array& aEMI ) const; |
|
679 |
|
680 private: |
|
681 sml_metinf_metinf_s* iMetInf; // does not own this! |
|
682 }; |
|
683 |
|
684 // ------------------------------------------------------------------------------------------------ |
|
685 // CNSmlDbMeta |
|
686 // ------------------------------------------------------------------------------------------------ |
|
687 class CNSmlDbMeta : public CBase |
|
688 { |
|
689 public: |
|
690 IMPORT_C static CNSmlDbMeta* NewL(); |
|
691 IMPORT_C static CNSmlDbMeta* NewLC(); |
|
692 IMPORT_C ~CNSmlDbMeta(); |
|
693 |
|
694 // These structs are used by sync agent |
|
695 IMPORT_C sml_metinf_metinf_s* MetInfL() const; |
|
696 IMPORT_C CNSmlDbMetaHandler* CreateHandlerL() const; |
|
697 IMPORT_C void Clear(); |
|
698 |
|
699 /** |
|
700 * Sets value of Format element. |
|
701 * @param aValue Value of Format element as 8-bit descriptor. |
|
702 */ |
|
703 IMPORT_C void SetFormatL( const TDesC8& aValue ); |
|
704 |
|
705 /** |
|
706 * Sets value of Type element. |
|
707 * @param aValue Value of Type element as 8-bit descriptor. |
|
708 */ |
|
709 IMPORT_C void SetTypeL( const TDesC8& aValue ); |
|
710 |
|
711 /** |
|
712 * Sets value of Mark element. |
|
713 * @param aValue Value of Mark element as 8-bit descriptor. |
|
714 */ |
|
715 IMPORT_C void SetMarkL( const TDesC8& aValue ); |
|
716 |
|
717 /** |
|
718 * Sets value of Size element. |
|
719 * @param aValue Value of Size element as 8-bit descriptor. |
|
720 */ |
|
721 IMPORT_C void SetSizeL( const TDesC8& aValue ); |
|
722 |
|
723 /** |
|
724 * Sets value of NextNonce element. |
|
725 * @param aValue Value of NextNonce element as 8-bit descriptor. |
|
726 */ |
|
727 IMPORT_C void SetNextNonceL( const TDesC8& aValue ); |
|
728 |
|
729 /** |
|
730 * Sets value of Version element. |
|
731 * @param aValue Value of Version element as 8-bit descriptor. |
|
732 */ |
|
733 IMPORT_C void SetVersionL( const TDesC8& aValue ); |
|
734 |
|
735 /** |
|
736 * Sets value of MaxMsgSize element. |
|
737 * @param aValue Value of MaxMsgSize element as 8-bit descriptor. |
|
738 */ |
|
739 IMPORT_C void SetMaxMsgSizeL( const TDesC8& aValue ); |
|
740 |
|
741 /** |
|
742 * Sets value of MaxObjSize element. |
|
743 * @param aValue Value of MaxObjSize element as 8-bit descriptor. |
|
744 */ |
|
745 IMPORT_C void SetMaxObjSizeL( const TDesC8& aValue ); |
|
746 |
|
747 /** |
|
748 * Sets value of Mem/Shared element. |
|
749 * @param aValue Value of Mem/Shared element as 8-bit descriptor. |
|
750 */ |
|
751 IMPORT_C void SetMemSharedL( const TDesC8& aValue ); |
|
752 |
|
753 /** |
|
754 * Sets value of Mem/FreeMem element. |
|
755 * @param aValue Value of Mem/FreeMem element as 8-bit descriptor. |
|
756 */ |
|
757 IMPORT_C void SetMemFreeMemL( const TDesC8& aValue ); |
|
758 |
|
759 /** |
|
760 * Sets value of Mem/FreeID element. |
|
761 * @param aValue Value of Mem/FreeID element as 8-bit descriptor. |
|
762 */ |
|
763 IMPORT_C void SetMemFreeIDL( const TDesC8& aValue ); |
|
764 |
|
765 /** |
|
766 * Sets value of Anchor/Next element. |
|
767 * @param aValue Value of Anchor/Next element as 8-bit descriptor. |
|
768 */ |
|
769 IMPORT_C void SetAnchorNextL( const TDesC8& aValue ); |
|
770 |
|
771 /** |
|
772 * Sets value of Anchor/Last element. |
|
773 * @param aValue Value of Anchor/Last element as 8-bit descriptor. |
|
774 */ |
|
775 IMPORT_C void SetAnchorLastL( const TDesC8& aValue ); |
|
776 |
|
777 /** |
|
778 * Adds EMI elements. |
|
779 * @param aValue Array of EMI element values. |
|
780 */ |
|
781 IMPORT_C void SetEmiL( const CDesC8Array& aValue ); |
|
782 |
|
783 protected: |
|
784 void MakeSureMetInfExistsL(); |
|
785 void ConstructL(); |
|
786 CNSmlDbMeta(); |
|
787 |
|
788 private: |
|
789 mutable sml_metinf_metinf_s* iMetInf; |
|
790 }; |
|
791 |
|
792 #endif // __NSMLDBCAPS_H__ |
|
793 |
|
794 // End of File |