williamr@2: // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). williamr@2: // All rights reserved. williamr@2: // This component and the accompanying materials are made available williamr@4: // under the terms of "Eclipse Public License v1.0" williamr@2: // which accompanies this distribution, and is available williamr@4: // at the URL "http://www.eclipse.org/legal/epl-v10.html". williamr@2: // williamr@2: // Initial Contributors: williamr@2: // Nokia Corporation - initial contribution. williamr@2: // williamr@2: // Contributors: williamr@2: // williamr@2: // Description: williamr@2: // Constants for use in storing comms data via CommsDat williamr@2: // williamr@2: // williamr@2: williamr@2: /** williamr@2: @file williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: williamr@2: williamr@2: #if (!defined COMMSDAT_H) williamr@2: #define COMMSDAT_H williamr@2: williamr@2: #include williamr@2: #include williamr@2: williamr@2: williamr@2: namespace CommsDat williamr@2: { williamr@2: williamr@2: /** williamr@2: Use this constant for Debug panic calls williamr@2: williamr@2: @publishedAll williamr@4: @released williamr@2: */ williamr@2: _LIT(KCommsDatName,"CommsDat"); williamr@2: williamr@2: /** williamr@2: Use this constant for Debug panic calls williamr@2: williamr@2: @publishedAll williamr@4: @released williamr@2: */ williamr@2: enum williamr@2: { williamr@2: ECommitBeforeOpenTransaction = 1, williamr@2: ERollBackBeforeOpenTransaction = 2, williamr@2: ESessionClosed = 3, williamr@4: ENotifierNotCreated = 4, williamr@4: EWrongAPPrioritySelPolRecord = 5, williamr@4: EWrongIAPServiceType = 6, williamr@4: EInvalidIAP = 7 williamr@2: }; williamr@2: williamr@2: using namespace Meta; williamr@2: williamr@4: // williamr@2: // VERSION INFO williamr@2: // williamr@4: /* Please note: williamr@4: * ------------ williamr@4: * Concrete schema version should be used in the client applicaiton (curently available williamr@4: * KCDVersion1_1 or KCDVersion1_2). williamr@4: * williamr@4: * Until the 9.5 release there was only one schema version, KCDVersion1_1, which was williamr@4: * available. From the 9.5 relase there is a possibility to use other schema version, williamr@4: * KCDVersion1_2. Important that it's still possible to use the KCVersion1_1 williamr@4: * constant, and use the deprecated records/tables, - CommsDat will invoke it's williamr@4: * mapping functionality in this case to be backward compatible. williamr@4: * williamr@4: * For backward compatibility reason the KCDLatestVersion and KCDCurrentVersion williamr@4: * constants are mapped to the KCDVersion1_1 constant. These constants are williamr@4: * deprecated. williamr@4: * williamr@4: * ! PLEASE USE EXPLICIT SCHEMA VERSION WHEN CREATING A COMMSDAT SESSION OBJECT ! williamr@4: */ williamr@2: williamr@2: /** williamr@2: Versions of the dataset in use williamr@2: williamr@2: Initial Version williamr@2: @publishedAll williamr@4: @released williamr@2: */ williamr@2: williamr@2: #define KCDVersion1_1 TVersion(1,1,1) williamr@2: williamr@2: #ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY williamr@2: /** williamr@2: Some elements in Version KCDVersion1_1 now deprecated williamr@2: These elements will be mapped if the client starts a session with KCDVersion1_1 williamr@2: They will be ignored or rejected as not supported if client starts a session with williamr@4: KCDVersion1_2 williamr@2: williamr@2: @publishedAll williamr@4: @released williamr@2: */ williamr@2: #define KCDVersion1_2 TVersion(1,2,1) williamr@2: #endif williamr@4: williamr@2: /** williamr@4: For BC reasons this constant maps to the KCDVersion1_1 dataschema version. williamr@2: williamr@2: @publishedAll williamr@4: @deprecated williamr@2: */ williamr@4: #define KCDLatestVersion KCDVersion1_1 williamr@2: williamr@4: /** williamr@4: For BC reasons this constant maps to the KCDVersion1_1 dataschema version. williamr@2: williamr@4: @publishedAll williamr@4: @deprecated williamr@4: */ williamr@2: #define KCDCurrentVersion KCDVersion1_1 williamr@2: williamr@2: williamr@4: // williamr@2: // Attribute Flags williamr@2: // williamr@2: williamr@2: /** williamr@2: Access control attribute flags. williamr@2: When these are SET in the mask the attribute is obeyed williamr@2: When they are CLEARED from the mask, the attribute is ignored williamr@2: By default attributes are obeyed. williamr@2: williamr@2: @publishedAll williamr@4: @released williamr@2: */ williamr@2: typedef enum williamr@2: { williamr@2: ECDNoWriteButDelete = 0x0000010, // R/W Read Only but deleteable Caller should explicitly choose to modify williamr@2: // Enforced by convention only, not with Platform Security williamr@2: ECDHidden = 0x0000020, // R/W Read-Write Hidden data Not policed - hides public utility info such as default values williamr@2: // Enforced by convention only, not with Platform Security williamr@2: ECDPrivate = 0x0000040, // R/W Read-Write Private data For sensitive user data such as passwords williamr@2: // Policed at storage server API with platsec capability williamr@2: ECDProtectedWrite = 0x0000080, // W Write-Protected data To allow data to be read only to most clients but modifiable by a few privileged clients williamr@2: // Policed at storage server API with platsec capability williamr@2: } TCDAttributeFlags; williamr@2: williamr@2: // williamr@2: // Masks for Element Type info williamr@2: // williamr@2: williamr@2: williamr@2: /** williamr@2: Mask to use to hide attribute reserved bits williamr@2: williamr@2: @publishedAll williamr@4: @released williamr@2: */ williamr@2: #define KCDMaskHideAttrAndRes 0xffffff00 williamr@2: williamr@2: williamr@2: /** williamr@2: Mask to use to show reserved bits williamr@2: williamr@2: @publishedAll williamr@4: @released williamr@2: */ williamr@2: #define KCDMaskShowRes 0x8000000f williamr@2: williamr@2: williamr@2: /** williamr@2: Mask to use to hide reserved bits williamr@2: williamr@2: @publishedAll williamr@4: @released williamr@2: */ williamr@2: #define KCDMaskHideRes 0x7ffffff0 williamr@2: williamr@2: williamr@2: /** williamr@2: T x x Mask to show Table Type info williamr@2: williamr@2: @publishedAll williamr@4: @released williamr@2: */ williamr@2: #define KCDMaskShowRecordType 0x7f800000 williamr@2: williamr@2: williamr@2: /** williamr@2: x C x Mask to show Column Type williamr@2: williamr@2: @publishedAll williamr@4: @released williamr@2: */ williamr@2: #define KCDMaskShowFieldType 0x007f0000 williamr@2: williamr@2: williamr@2: /** williamr@2: T C x Mask to show Table and Column Type williamr@2: williamr@2: @publishedAll williamr@4: @released williamr@2: */ williamr@2: #define KCDMaskShowType 0x7fff0000 williamr@2: williamr@2: williamr@2: /** williamr@2: T x R Mask to show Record id williamr@2: williamr@2: @publishedAll - don't use this. Replace with KCDMaskShowRecordId williamr@4: @deprecated williamr@2: */ williamr@2: #define KCDMaskShowInstance 0x0000ff00 williamr@2: williamr@2: williamr@2: /** williamr@2: T x R Mask to show Record id williamr@2: Use in place of KCDMaskShowInstance williamr@2: @publishedAll williamr@4: @released williamr@2: */ williamr@2: #define KCDMaskShowRecordId 0x0000ff00 williamr@2: williamr@2: williamr@2: /** williamr@2: T C R Mask to show Field instance without attributes or reserved bits williamr@2: williamr@2: @publishedAll williamr@4: @released williamr@2: */ williamr@2: #define KCDMaskShowField 0x7fffff00 williamr@2: williamr@2: williamr@2: /** williamr@2: T x R Mask to show Record Type and Record Id without column type, attributes or reserved bits williamr@2: williamr@2: @publishedAll williamr@4: @released williamr@2: */ williamr@2: #define KCDMaskShowRecordTypeAndId (KCDMaskShowRecordType | KCDMaskShowRecordId) williamr@2: williamr@2: /** williamr@2: x C R Mask to show Column Type and Record Id without Record type, attributes or reserved bits williamr@2: williamr@2: @publishedAll williamr@4: @released williamr@2: */ williamr@2: #define KCDMaskShowColumnTypeAndRecordId (KCDMaskShowFieldType | KCDMaskShowRecordId) williamr@2: williamr@2: williamr@2: /** williamr@2: Mask to show Attributes williamr@2: williamr@2: @publishedAll williamr@4: @released williamr@2: */ williamr@2: #define KCDMaskShowAttributes 0x000000f0 williamr@2: williamr@2: /** williamr@2: Mask to use to show attributes and reserved bits williamr@2: williamr@2: @publishedAll williamr@4: @released williamr@2: */ williamr@2: #define KCDMaskShowAttrAndRes 0x000000ff williamr@2: williamr@2: williamr@2: /** williamr@2: Id for the Initial record in a record set williamr@2: williamr@2: @publishedAll williamr@4: @released williamr@2: */ williamr@2: #define KCDInitialRecordId 0x00000100 williamr@2: williamr@2: williamr@2: /** williamr@2: Id for the Initial table in the database williamr@2: williamr@2: @publishedAll williamr@4: @released williamr@2: */ williamr@2: #define KCDInitialTableId 0x00800000 williamr@2: williamr@2: williamr@2: /** williamr@2: Id for the Initial User defined table in the database williamr@2: clients have 64 table ids available to them williamr@2: williamr@2: @publishedAll williamr@4: @released williamr@2: */ williamr@2: #define KCDInitialUDefRecordType 0x5F800000 williamr@2: williamr@2: williamr@2: /** williamr@2: Id for the Last User defined table in the database. williamr@2: williamr@2: @publishedAll williamr@4: @released williamr@2: */ williamr@2: #define KCDLastUDefRecordType 0x7F800000 williamr@2: williamr@2: williamr@2: /** williamr@2: Id for the Initial column in a record set williamr@2: williamr@2: @publishedAll williamr@4: @released williamr@2: */ williamr@2: #define KCDInitialColumnId 0x00010000 williamr@2: williamr@2: williamr@2: /** williamr@2: T C 0 location for default field values williamr@2: williamr@2: @publishedAll williamr@4: @released williamr@2: */ williamr@2: #define KCDDefaultRecord 0x00000000 williamr@2: williamr@2: williamr@2: /** williamr@2: Combine with table id and Column id to give the location of column type info williamr@2: williamr@2: @publishedAll williamr@4: @released williamr@2: */ williamr@2: #define KCDColumnTypeInfo 0x0000ff00 williamr@2: williamr@2: williamr@2: williamr@2: /** williamr@2: Combine with table id to give request for a new record in a table. williamr@2: The table must already exist. williamr@2: williamr@2: @publishedAll williamr@4: @released williamr@2: */ williamr@2: #define KCDNewRecordRequest 0x807f0001 williamr@2: williamr@2: williamr@2: /** williamr@2: Combined with CMDBField, it finds the TableId given the table name williamr@2: williamr@2: @publishedAll williamr@4: @released williamr@2: */ williamr@4: #define KCDMaskGenericTableName 0x007fff00 williamr@2: williamr@2: williamr@2: williamr@2: /** williamr@2: Maximum number of tables that can be created in one repository williamr@2: williamr@2: @publishedAll williamr@4: @released williamr@2: */ williamr@2: #define KCDMaxTables 254 williamr@2: williamr@2: williamr@2: /** williamr@2: Maximum number of User defined tables that can be created in one repository williamr@2: williamr@2: @publishedAll williamr@4: @released williamr@2: */ williamr@2: #define KCDMaxUserDefTables 64 williamr@2: williamr@2: williamr@2: /** williamr@2: Maximum number of columns that can be created in one table williamr@2: williamr@2: @publishedAll williamr@4: @released williamr@2: */ williamr@2: #define KCDMaxColumns 126 williamr@2: williamr@2: williamr@2: /** williamr@2: Maximum number of records that can be stored in one table williamr@2: williamr@2: @publishedAll williamr@4: @released williamr@2: */ williamr@2: #define KCDMaxRecords 254 williamr@2: williamr@2: williamr@2: /** williamr@2: Maximum number of characters in a field name williamr@2: williamr@2: @publishedAll williamr@4: @released williamr@2: */ williamr@2: #define KCDMaxFieldNameLength 64 williamr@2: williamr@2: williamr@2: /** williamr@2: Macro for interaction with netmeta williamr@2: @publishedAll williamr@4: @released williamr@2: */ williamr@2: #define X_REGISTER_ATTRIBUTE( thisMetaClass, var, metaType ) \ williamr@2: { _FOFF( thisMetaClass, var ), Meta::metaType##VisitorFactoryL }, williamr@2: williamr@2: williamr@2: #define EXP_DATA_VTABLE \ williamr@2: IMPORT_C virtual Meta::SVDataTableEntry const* GetVDataTable() const; \ williamr@2: IMPORT_C virtual TUint8* GetAttribPtr(const TInt aOffset) const; \ williamr@2: IMPORT_C static Meta::SVDataTableEntry const* GetVDataTableStatic(); \ williamr@2: static const Meta::SVDataTableEntry iVDataTable[]; williamr@2: williamr@2: williamr@2: /** williamr@2: Macros used to implement virtual functions from MMetaData interface and construct the v data table williamr@2: @publishedAll williamr@4: @released williamr@2: */ williamr@2: #define EXP_START_ATTRIBUTE_TABLE( thisMetaClass, uid, typeId ) \ williamr@2: EXPORT_C Meta::SVDataTableEntry const* thisMetaClass::GetVDataTable() const { return &iVDataTable[0]; }; \ williamr@2: EXPORT_C TUint8* thisMetaClass::GetAttribPtr(const TInt aOffset) const { return (TUint8*)this + aOffset; }; \ williamr@2: EXPORT_C Meta::SVDataTableEntry const* thisMetaClass::GetVDataTableStatic() { return &iVDataTable[0]; }; \ williamr@2: const Meta::SVDataTableEntry thisMetaClass::iVDataTable[] = { \ williamr@2: { uid, reinterpret_cast(typeId) }, williamr@2: williamr@2: williamr@4: /** williamr@4: @publishedAll williamr@4: @released williamr@4: */ williamr@4: typedef enum williamr@4: { williamr@4: EText, //< Text field - descriptor with a maximum length of 50 unicode characters. williamr@4: EDesC8, //< Buffer of TUInt8. Maximum length is 1024 * 8. williamr@4: EUint32, //< Unsigned 32 bit integer field. williamr@4: EInt, //< Signed integer field williamr@4: EBool, //< Boolean field williamr@4: EMedText, //< Text field - descriptor with a maximum length of 256 unicode characters. williamr@4: ELongText, //< Text field - descriptor with a maximum length of 1024 unicode characters. williamr@4: ELink //< This field is an integer that identifies a record in another table. williamr@2: williamr@4: } TCDFieldValueTypes; williamr@2: williamr@4: /** williamr@4: Flag to indicate change in field williamr@4: Not for use in database. Just with fields williamr@4: williamr@4: @publishedAll williamr@4: */ williamr@4: #define KCDChangedFlag 0x00000001 williamr@4: williamr@2: } //end namespace CommsDat williamr@4: williamr@4: #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS williamr@4: #include williamr@4: #include williamr@2: #endif williamr@4: williamr@4: #endif