1 // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // Constants for use in storing comms data via CommsDat
25 #if (!defined COMMSDAT_H)
28 #include <comms-infras/metatype.h>
29 #include <e32property.h>
36 Use this constant for Debug panic calls
41 _LIT(KCommsDatName,"CommsDat");
44 Use this constant for Debug panic calls
51 ECommitBeforeOpenTransaction = 1,
52 ERollBackBeforeOpenTransaction = 2,
54 ENotifierNotCreated = 4,
55 EWrongAPPrioritySelPolRecord = 5,
56 EWrongIAPServiceType = 6,
67 * Concrete schema version should be used in the client applicaiton (curently available
68 * KCDVersion1_1 or KCDVersion1_2).
70 * Until the 9.5 release there was only one schema version, KCDVersion1_1, which was
71 * available. From the 9.5 relase there is a possibility to use other schema version,
72 * KCDVersion1_2. Important that it's still possible to use the KCVersion1_1
73 * constant, and use the deprecated records/tables, - CommsDat will invoke it's
74 * mapping functionality in this case to be backward compatible.
76 * For backward compatibility reason the KCDLatestVersion and KCDCurrentVersion
77 * constants are mapped to the KCDVersion1_1 constant. These constants are
80 * ! PLEASE USE EXPLICIT SCHEMA VERSION WHEN CREATING A COMMSDAT SESSION OBJECT !
84 Versions of the dataset in use
91 #define KCDVersion1_1 TVersion(1,1,1)
93 #ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
95 Some elements in Version KCDVersion1_1 now deprecated
96 These elements will be mapped if the client starts a session with KCDVersion1_1
97 They will be ignored or rejected as not supported if client starts a session with
103 #define KCDVersion1_2 TVersion(1,2,1)
107 For BC reasons this constant maps to the KCDVersion1_1 dataschema version.
112 #define KCDLatestVersion KCDVersion1_1
115 For BC reasons this constant maps to the KCDVersion1_1 dataschema version.
120 #define KCDCurrentVersion KCDVersion1_1
128 Access control attribute flags.
129 When these are SET in the mask the attribute is obeyed
130 When they are CLEARED from the mask, the attribute is ignored
131 By default attributes are obeyed.
138 ECDNoWriteButDelete = 0x0000010, // R/W Read Only but deleteable Caller should explicitly choose to modify
139 // Enforced by convention only, not with Platform Security
140 ECDHidden = 0x0000020, // R/W Read-Write Hidden data Not policed - hides public utility info such as default values
141 // Enforced by convention only, not with Platform Security
142 ECDPrivate = 0x0000040, // R/W Read-Write Private data For sensitive user data such as passwords
143 // Policed at storage server API with platsec capability
144 ECDProtectedWrite = 0x0000080, // W Write-Protected data To allow data to be read only to most clients but modifiable by a few privileged clients
145 // Policed at storage server API with platsec capability
149 // Masks for Element Type info
154 Mask to use to hide attribute reserved bits
159 #define KCDMaskHideAttrAndRes 0xffffff00
163 Mask to use to show reserved bits
168 #define KCDMaskShowRes 0x8000000f
172 Mask to use to hide reserved bits
177 #define KCDMaskHideRes 0x7ffffff0
181 T x x Mask to show Table Type info
186 #define KCDMaskShowRecordType 0x7f800000
190 x C x Mask to show Column Type
195 #define KCDMaskShowFieldType 0x007f0000
199 T C x Mask to show Table and Column Type
204 #define KCDMaskShowType 0x7fff0000
208 T x R Mask to show Record id
210 @publishedAll - don't use this. Replace with KCDMaskShowRecordId
213 #define KCDMaskShowInstance 0x0000ff00
217 T x R Mask to show Record id
218 Use in place of KCDMaskShowInstance
222 #define KCDMaskShowRecordId 0x0000ff00
226 T C R Mask to show Field instance without attributes or reserved bits
231 #define KCDMaskShowField 0x7fffff00
235 T x R Mask to show Record Type and Record Id without column type, attributes or reserved bits
240 #define KCDMaskShowRecordTypeAndId (KCDMaskShowRecordType | KCDMaskShowRecordId)
243 x C R Mask to show Column Type and Record Id without Record type, attributes or reserved bits
248 #define KCDMaskShowColumnTypeAndRecordId (KCDMaskShowFieldType | KCDMaskShowRecordId)
252 Mask to show Attributes
257 #define KCDMaskShowAttributes 0x000000f0
260 Mask to use to show attributes and reserved bits
265 #define KCDMaskShowAttrAndRes 0x000000ff
269 Id for the Initial record in a record set
274 #define KCDInitialRecordId 0x00000100
278 Id for the Initial table in the database
283 #define KCDInitialTableId 0x00800000
287 Id for the Initial User defined table in the database
288 clients have 64 table ids available to them
293 #define KCDInitialUDefRecordType 0x5F800000
297 Id for the Last User defined table in the database.
302 #define KCDLastUDefRecordType 0x7F800000
306 Id for the Initial column in a record set
311 #define KCDInitialColumnId 0x00010000
315 T C 0 location for default field values
320 #define KCDDefaultRecord 0x00000000
324 Combine with table id and Column id to give the location of column type info
329 #define KCDColumnTypeInfo 0x0000ff00
334 Combine with table id to give request for a new record in a table.
335 The table must already exist.
340 #define KCDNewRecordRequest 0x807f0001
344 Combined with CMDBField, it finds the TableId given the table name
349 #define KCDMaskGenericTableName 0x007fff00
354 Maximum number of tables that can be created in one repository
359 #define KCDMaxTables 254
363 Maximum number of User defined tables that can be created in one repository
368 #define KCDMaxUserDefTables 64
372 Maximum number of columns that can be created in one table
377 #define KCDMaxColumns 126
381 Maximum number of records that can be stored in one table
386 #define KCDMaxRecords 254
390 Maximum number of characters in a field name
395 #define KCDMaxFieldNameLength 64
399 Macro for interaction with netmeta
403 #define X_REGISTER_ATTRIBUTE( thisMetaClass, var, metaType ) \
404 { _FOFF( thisMetaClass, var ), Meta::metaType##VisitorFactoryL },
407 #define EXP_DATA_VTABLE \
408 IMPORT_C virtual Meta::SVDataTableEntry const* GetVDataTable() const; \
409 IMPORT_C virtual TUint8* GetAttribPtr(const TInt aOffset) const; \
410 IMPORT_C static Meta::SVDataTableEntry const* GetVDataTableStatic(); \
411 static const Meta::SVDataTableEntry iVDataTable[];
415 Macros used to implement virtual functions from MMetaData interface and construct the v data table
419 #define EXP_START_ATTRIBUTE_TABLE( thisMetaClass, uid, typeId ) \
420 EXPORT_C Meta::SVDataTableEntry const* thisMetaClass::GetVDataTable() const { return &iVDataTable[0]; }; \
421 EXPORT_C TUint8* thisMetaClass::GetAttribPtr(const TInt aOffset) const { return (TUint8*)this + aOffset; }; \
422 EXPORT_C Meta::SVDataTableEntry const* thisMetaClass::GetVDataTableStatic() { return &iVDataTable[0]; }; \
423 const Meta::SVDataTableEntry thisMetaClass::iVDataTable[] = { \
424 { uid, reinterpret_cast<Meta::TMetaTypeNewL>(typeId) },
433 EText, //< Text field - descriptor with a maximum length of 50 unicode characters.
434 EDesC8, //< Buffer of TUInt8. Maximum length is 1024 * 8.
435 EUint32, //< Unsigned 32 bit integer field.
436 EInt, //< Signed integer field
437 EBool, //< Boolean field
438 EMedText, //< Text field - descriptor with a maximum length of 256 unicode characters.
439 ELongText, //< Text field - descriptor with a maximum length of 1024 unicode characters.
440 ELink //< This field is an integer that identifies a record in another table.
442 } TCDFieldValueTypes;
445 Flag to indicate change in field
446 Not for use in database. Just with fields
450 #define KCDChangedFlag 0x00000001
452 } //end namespace CommsDat
454 #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
455 #include <commsdat_internal.h>
456 #include <commsdat_partner.h>