epoc32/include/commsdat.h
branchSymbian3
changeset 4 837f303aceeb
parent 2 2fe1408b6811
equal deleted inserted replaced
3:e1b950c65cb4 4:837f303aceeb
     1 // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     3 // This component and the accompanying materials are made available
     4 // under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 //
     7 //
     8 // Initial Contributors:
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
     9 // Nokia Corporation - initial contribution.
    10 //
    10 //
    11 // Contributors:
    11 // Contributors:
    13 // Description:
    13 // Description:
    14 // Constants for use in storing comms data via CommsDat
    14 // Constants for use in storing comms data via CommsDat
    15 // 
    15 // 
    16 //
    16 //
    17 
    17 
    18 
       
    19 
       
    20 /**
    18 /**
    21  @file
    19  @file
    22  @publishedAll
    20  @publishedAll
    23  @released
    21  @released
    24 */
    22 */
    29 
    27 
    30 #include <comms-infras/metatype.h>
    28 #include <comms-infras/metatype.h>
    31 #include <e32property.h>
    29 #include <e32property.h>
    32 
    30 
    33 
    31 
    34 namespace Meta
       
    35     {
       
    36 
       
    37 	/**
       
    38 	Visitor factory functions
       
    39 	@internalComponent
       
    40 	*/
       
    41     MMetaType* TMDBNumBaseVisitorFactoryL(const TAny* mem, const TAny* data);
       
    42    	/**     
       
    43    	@internalComponent
       
    44    	*/
       
    45     MMetaType* TMDBTextBaseVisitorFactoryL(const TAny* mem, const TAny* data);
       
    46     /**     
       
    47    	@internalComponent
       
    48    	*/
       
    49     MMetaType* TMDBBinBaseVisitorFactoryL(const TAny* mem, const TAny* data);
       
    50     /**     
       
    51    	@internalComponent
       
    52    	*/
       
    53     MMetaType* TMDBDeprecatedVisitorFactoryL(const TAny* mem, const TAny* data);
       
    54 	/**
       
    55     @publishedPartner
       
    56     @released
       
    57     */
       
    58     IMPORT_C MMetaType* TMDBNumVisitorFactoryL(const TAny* mem, const TAny* data);
       
    59     /**
       
    60     @publishedPartner
       
    61     @released
       
    62     */
       
    63     IMPORT_C MMetaType* TMDBLinkNumVisitorFactoryL(const TAny* mem, const TAny* data);
       
    64     /**
       
    65     @publishedPartner
       
    66     @released
       
    67     */
       
    68     IMPORT_C MMetaType* TMDBTextVisitorFactoryL(const TAny* mem, const TAny* data);
       
    69     /**
       
    70     @publishedPartner
       
    71     @released
       
    72     */
       
    73     IMPORT_C MMetaType* TMDBMedTextVisitorFactoryL(const TAny* mem, const TAny* data);
       
    74     /**
       
    75     @publishedPartner
       
    76     @released
       
    77     */
       
    78     IMPORT_C MMetaType* TMDBLongTextVisitorFactoryL(const TAny* mem, const TAny* data);
       
    79     /**
       
    80     @publishedPartner
       
    81     @released
       
    82     */
       
    83     IMPORT_C MMetaType* TMDBBinVisitorFactoryL(const TAny* mem, const TAny* data);
       
    84     /**
       
    85     @publishedPartner
       
    86     @released
       
    87     */
       
    88     IMPORT_C MMetaType* TMDBLinkVisitorFactoryL(const TAny* mem, const TAny* data);
       
    89     /**
       
    90     @publishedPartner
       
    91     @released
       
    92     */
       
    93     IMPORT_C MMetaType* TMDBRecordSetVisitorFactoryL(const TAny* mem, const TAny* data);
       
    94     /**
       
    95     @publishedPartner
       
    96     @released
       
    97     */
       
    98     IMPORT_C MMetaType* TMDBGenericRecordVisitorFactoryL(const TAny* mem, const TAny* data);
       
    99 
       
   100     }
       
   101 
       
   102 
       
   103 namespace CommsDat
    32 namespace CommsDat
   104 {
    33 {
   105 
    34 
   106 /**
    35 /**
   107 Use this constant for Debug panic calls
    36 Use this constant for Debug panic calls
   108 
    37 
   109 @publishedAll
    38 @publishedAll
       
    39 @released
   110 */
    40 */
   111 _LIT(KCommsDatName,"CommsDat");
    41 _LIT(KCommsDatName,"CommsDat");
   112 
    42 
   113 /**
    43 /**
   114 Use this constant for Debug panic calls
    44 Use this constant for Debug panic calls
   115 
    45 
   116 @publishedAll
    46 @publishedAll
       
    47 @released
   117 */
    48 */
   118 enum
    49 enum
   119 	{
    50 	{
   120 	ECommitBeforeOpenTransaction = 1,
    51 	ECommitBeforeOpenTransaction = 1,
   121 	ERollBackBeforeOpenTransaction = 2,
    52 	ERollBackBeforeOpenTransaction = 2,
   122 	ESessionClosed = 3,
    53 	ESessionClosed = 3,
   123     EWrongAPPrioritySelPolRecord = 4,
    54 	ENotifierNotCreated = 4,
   124     EWrongIAPServiceType = 5
    55     EWrongAPPrioritySelPolRecord = 5,
       
    56     EWrongIAPServiceType = 6,
       
    57     EInvalidIAP = 7
   125 	};
    58 	};
   126 	
    59 	
   127 using namespace Meta;
    60 using namespace Meta;
   128 
    61 
   129 //////////////////////////////////////////////////
    62 //
   130 // VERSION INFO
    63 // VERSION INFO
   131 //
    64 //
   132 
    65 /* Please note:
   133 /**
    66  * ------------ 
   134 Use this constant when starting a session to ask to use the latest version of the data set
    67  * Concrete schema version should be used in the client applicaiton (curently available
   135 Do not use this constant if want option to keep using particular version after update
    68  * KCDVersion1_1 or KCDVersion1_2). 
   136 Using this constant will require the client to keep up to date with any changes in the current dataset
    69  * 
   137 Use specific version constants to avoid changing until a deprecated version is no longer supported.
    70  * Until the 9.5 release there was only one schema version, KCDVersion1_1, which was 
   138 
    71  * available. From the 9.5 relase there is a possibility to use other schema version,
   139 @publishedAll
    72  * KCDVersion1_2. Important that it's still possible to use the KCVersion1_1 
   140 */
    73  * constant, and use the deprecated records/tables, - CommsDat will invoke it's 
   141 #define KCDLatestVersion            TVersion(0,0,0)
    74  * mapping functionality in this case to be backward compatible. 
   142 
    75  * 
       
    76  * For backward compatibility reason the KCDLatestVersion and KCDCurrentVersion 
       
    77  * constants are mapped to the KCDVersion1_1 constant. These constants are 
       
    78  * deprecated.
       
    79  * 
       
    80  * ! PLEASE USE EXPLICIT SCHEMA VERSION WHEN CREATING A COMMSDAT SESSION OBJECT !
       
    81  */
   143 
    82 
   144 /**
    83 /**
   145 Versions of the dataset in use
    84 Versions of the dataset in use
   146 NB These versions will change as data set is updated
    85 
   147 All versions apart from the one defined as KCDCurrentVersion are deprecated
       
   148 */
       
   149 
       
   150 /*
       
   151 Initial Version 
    86 Initial Version 
   152 @publishedAll
    87 @publishedAll
       
    88 @released
   153 */
    89 */
   154 
    90 
   155 #define KCDVersion1_1               TVersion(1,1,1)
    91 #define KCDVersion1_1               TVersion(1,1,1)
   156 
    92 
   157 #ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
    93 #ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
   158 /**
    94 /**
   159 Some elements in Version KCDVersion1_1 now deprecated
    95 Some elements in Version KCDVersion1_1 now deprecated
   160 These elements will be mapped if the client starts a session with KCDVersion1_1
    96 These elements will be mapped if the client starts a session with KCDVersion1_1
   161 They will be ignored or rejected as not supported if client starts a session with 
    97 They will be ignored or rejected as not supported if client starts a session with 
   162 KCDVersion1_2 or KCDLatestVersion
    98 KCDVersion1_2
   163 
    99 
   164 @publishedAll
   100 @publishedAll
       
   101 @released
   165 */
   102 */
   166 #define KCDVersion1_2               TVersion(1,2,1)
   103 #define KCDVersion1_2               TVersion(1,2,1)
   167 #endif
   104 #endif
   168 /**
   105 
   169 The version of the dataset supported by default
   106 /**
   170 NB This version will change as data set is updated
   107 For BC reasons this constant maps to the KCDVersion1_1 dataschema version.
   171 
   108 
   172 @publishedAll
   109 @publishedAll
   173 */
   110 @deprecated
   174 #ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
   111 */
   175 
   112 #define KCDLatestVersion            KCDVersion1_1
   176 #define KCDCurrentVersion           KCDVersion1_2
   113 
   177 
   114 /**
   178 #else
   115 For BC reasons this constant maps to the KCDVersion1_1 dataschema version.
   179 
   116 
       
   117 @publishedAll
       
   118 @deprecated
       
   119 */
   180 #define KCDCurrentVersion           KCDVersion1_1
   120 #define KCDCurrentVersion           KCDVersion1_1
   181 
   121 
   182 #endif
   122 
   183 
   123 //
   184 
       
   185 
       
   186 
       
   187 ////////////////////////////////////////////////////
       
   188 //  Attribute Flags
   124 //  Attribute Flags
   189 //
   125 //
   190 
   126 
   191 /**
   127 /**
   192 Access control attribute flags.
   128 Access control attribute flags.
   193 When these are SET in the mask the attribute is obeyed
   129 When these are SET in the mask the attribute is obeyed
   194 When they are CLEARED from the mask, the attribute is ignored
   130 When they are CLEARED from the mask, the attribute is ignored
   195 By default attributes are obeyed.
   131 By default attributes are obeyed.
   196 
   132 
   197 @publishedAll
   133 @publishedAll
       
   134 @released
   198 */
   135 */
   199 typedef enum
   136 typedef enum
   200 {
   137 {
   201   ECDNoWriteButDelete = 0x0000010,     // R/W Read Only but deleteable      Caller should explicitly choose to modify
   138   ECDNoWriteButDelete = 0x0000010,     // R/W Read Only but deleteable      Caller should explicitly choose to modify
   202                                        //                                   Enforced by convention only, not with Platform Security
   139                                        //                                   Enforced by convention only, not with Platform Security
   206                                        //                                   Policed at storage server API with platsec capability
   143                                        //                                   Policed at storage server API with platsec capability
   207   ECDProtectedWrite   = 0x0000080,     // W   Write-Protected data          To allow data to be read only to most clients but modifiable by a few privileged clients
   144   ECDProtectedWrite   = 0x0000080,     // W   Write-Protected data          To allow data to be read only to most clients but modifiable by a few privileged clients
   208                                        //                                   Policed at storage server API with platsec capability
   145                                        //                                   Policed at storage server API with platsec capability
   209 } TCDAttributeFlags;
   146 } TCDAttributeFlags;
   210 
   147 
   211 
   148 //
   212 /////////////////////////////////////////////////////
       
   213 // Field types
       
   214 //
       
   215 /**
       
   216 @publishedPartner
       
   217 @released
       
   218 */
       
   219 typedef enum
       
   220 {
       
   221 	EText,          ///< Text field - descriptor with a maximum length of 50 unicode characters.
       
   222  	EDesC8,         ///< Buffer of TUInt8. Maximum length is 1024 * 8. 
       
   223  	EUint32,		///< Unsigned 32 bit integer field.
       
   224  	EInt,			///< Signed integer field
       
   225  	EBool,			///< Boolean field
       
   226  	EMedText,       ///< Text field - descriptor with a maximum length of 256 unicode characters.
       
   227  	ELongText, 		///< Text field - descriptor with a maximum length of 1024 unicode characters.
       
   228     ELink			///< This field is an integer that identifies a record in another table.
       
   229 
       
   230 } TCDFieldValueTypes;
       
   231 
       
   232 /**
       
   233 @publishedPartner
       
   234 @released
       
   235 */
       
   236 const TInt KMaxTextLength		= 50; 		///< Specifies the max length (characters) for short text.
       
   237 /**
       
   238 @publishedPartner
       
   239 @released
       
   240 */
       
   241 const TInt KMaxMedTextLength	= 255; 		///< Specifies the max length (characters) for medium text.
       
   242 /**
       
   243 @publishedPartner
       
   244 @released
       
   245 */
       
   246 const TInt KMaxLongTextLength	= 1024;		///< Specifies the max length (characters) for long text.
       
   247 /**
       
   248 @publishedPartner
       
   249 @released
       
   250 */
       
   251 const TInt KMaxNumLength		= 1;		///< Specifies the max length for an integer and a boolean.
       
   252 
       
   253 // Length override on a normal text field
       
   254 /**
       
   255 @publishedPartner
       
   256 @released
       
   257 */
       
   258 const TInt KShortTextLength		= 32;
       
   259 
       
   260 ////////////////////////////////////////////////////
       
   261 // Masks for Element Type info
   149 // Masks for Element Type info
   262 //
   150 //
   263 
   151 
   264 
   152 
   265 /**
   153 /**
   266 Mask to use to hide attribute reserved bits
   154 Mask to use to hide attribute reserved bits
   267 
   155 
   268 @publishedAll
   156 @publishedAll
       
   157 @released
   269 */
   158 */
   270 #define KCDMaskHideAttrAndRes       0xffffff00
   159 #define KCDMaskHideAttrAndRes       0xffffff00
   271 
   160 
   272 
   161 
   273 /**
   162 /**
   274 Mask to use to show reserved bits
   163 Mask to use to show reserved bits
   275 
   164 
   276 @publishedAll
   165 @publishedAll
       
   166 @released
   277 */
   167 */
   278 #define KCDMaskShowRes              0x8000000f
   168 #define KCDMaskShowRes              0x8000000f
   279 
   169 
   280 
   170 
   281 /**
   171 /**
   282 Mask to use to hide reserved bits
   172 Mask to use to hide reserved bits
   283 
   173 
   284 @publishedAll
   174 @publishedAll
       
   175 @released
   285 */
   176 */
   286 #define KCDMaskHideRes              0x7ffffff0
   177 #define KCDMaskHideRes              0x7ffffff0
   287 
   178 
   288 
   179 
   289 /**
   180 /**
   290 T x x   Mask to show Table Type info
   181 T x x   Mask to show Table Type info
   291 
   182 
   292 @publishedAll
   183 @publishedAll
       
   184 @released
   293 */
   185 */
   294 #define KCDMaskShowRecordType       0x7f800000
   186 #define KCDMaskShowRecordType       0x7f800000
   295 
   187 
   296 
   188 
   297 /**
   189 /**
   298 x C x   Mask to show Column Type 
   190 x C x   Mask to show Column Type 
   299 
   191 
   300 @publishedAll
   192 @publishedAll
       
   193 @released
   301 */
   194 */
   302 #define KCDMaskShowFieldType        0x007f0000
   195 #define KCDMaskShowFieldType        0x007f0000
   303 
   196 
   304 
   197 
   305 /**
   198 /**
   306 T C x   Mask to show Table and Column Type 
   199 T C x   Mask to show Table and Column Type 
   307 
   200 
   308 @publishedAll
   201 @publishedAll
       
   202 @released
   309 */
   203 */
   310 #define KCDMaskShowType             0x7fff0000
   204 #define KCDMaskShowType             0x7fff0000
   311 
   205 
   312 
   206 
   313 /**
   207 /**
   314 T x R   Mask to show Record id
   208 T x R   Mask to show Record id
   315 
   209 
   316 @publishedAll - don't use this.  Replace with KCDMaskShowRecordId
   210 @publishedAll - don't use this.  Replace with KCDMaskShowRecordId
       
   211 @deprecated
   317 */
   212 */
   318 #define KCDMaskShowInstance         0x0000ff00
   213 #define KCDMaskShowInstance         0x0000ff00
   319 
   214 
   320 
   215 
   321 /**
   216 /**
   322 T x R   Mask to show Record id
   217 T x R   Mask to show Record id
   323 Use in place of KCDMaskShowInstance
   218 Use in place of KCDMaskShowInstance
   324 @publishedAll
   219 @publishedAll
       
   220 @released
   325 */
   221 */
   326 #define KCDMaskShowRecordId         0x0000ff00
   222 #define KCDMaskShowRecordId         0x0000ff00
   327 
   223 
   328 
   224 
   329 /**
   225 /**
   330 T C R   Mask to show Field instance without attributes or reserved bits
   226 T C R   Mask to show Field instance without attributes or reserved bits
   331 
   227 
   332 @publishedAll
   228 @publishedAll
       
   229 @released
   333 */
   230 */
   334 #define KCDMaskShowField            0x7fffff00
   231 #define KCDMaskShowField            0x7fffff00
   335 
   232 
   336 
   233 
   337 /**
   234 /**
   338 T C R   Mask for Central Repository to find a single field
       
   339 
       
   340 @internalComponent
       
   341 */
       
   342 #define KCDMaskFindSingleField		0x7FFFFFFE
       
   343 
       
   344 /**
       
   345 T x R   Mask to show Record Type and Record Id without column type, attributes or reserved bits
   235 T x R   Mask to show Record Type and Record Id without column type, attributes or reserved bits
   346 
   236 
   347 @publishedAll
   237 @publishedAll
       
   238 @released
   348 */
   239 */
   349 #define KCDMaskShowRecordTypeAndId  (KCDMaskShowRecordType | KCDMaskShowRecordId)
   240 #define KCDMaskShowRecordTypeAndId  (KCDMaskShowRecordType | KCDMaskShowRecordId)
   350 
   241 
   351 /**
   242 /**
   352 x C R   Mask to show Column Type and Record Id without Record type, attributes or reserved bits
   243 x C R   Mask to show Column Type and Record Id without Record type, attributes or reserved bits
   353 
   244 
   354 @publishedAll
   245 @publishedAll
       
   246 @released
   355 */
   247 */
   356 #define KCDMaskShowColumnTypeAndRecordId  (KCDMaskShowFieldType |  KCDMaskShowRecordId)
   248 #define KCDMaskShowColumnTypeAndRecordId  (KCDMaskShowFieldType |  KCDMaskShowRecordId)
   357 
   249 
   358 
   250 
   359 /**
   251 /**
   360 Mask to show Attributes
   252 Mask to show Attributes
   361 
   253 
   362 @publishedAll
   254 @publishedAll
       
   255 @released
   363 */
   256 */
   364 #define KCDMaskShowAttributes       0x000000f0
   257 #define KCDMaskShowAttributes       0x000000f0
   365 
   258 
   366 
       
   367 /**
       
   368 Mask for all attribute settings that apply to read and write operations
       
   369 see TCDAttributeFlags
       
   370 
       
   371   ECDNoWriteButDelete = 0x0000010                             
       
   372   ECDHidden           = 0x0000020
       
   373   ECDPrivate          = 0x0000040
       
   374   ECDProtectedWrite   = 0x0000080
       
   375 
       
   376 @publishedPartner
       
   377 @released
       
   378 */
       
   379 #define KCDMaskShowReadWriteAttributes  (ECDNoWriteButDelete |ECDHidden | ECDPrivate | ECDProtectedWrite)
       
   380 
       
   381 /**
       
   382 Mask for all attribute settings that apply to read operations
       
   383 see TCDAttributeFlags
       
   384                           
       
   385   ECDHidden           = 0x0000020
       
   386   ECDPrivate          = 0x0000040
       
   387   
       
   388 @publishedPartner
       
   389 @released  
       
   390 */
       
   391 #define KCDMaskShowReadAttributes       (ECDHidden| ECDPrivate)     
       
   392 
       
   393 /**
   259 /**
   394 Mask to use to show attributes and reserved bits
   260 Mask to use to show attributes and reserved bits
   395 
   261 
   396 @publishedAll
   262 @publishedAll
       
   263 @released
   397 */
   264 */
   398 #define KCDMaskShowAttrAndRes       0x000000ff
   265 #define KCDMaskShowAttrAndRes       0x000000ff
   399 
   266 
   400 
   267 
   401 /**
   268 /**
   402 Id for the Initial record in a record set
   269 Id for the Initial record in a record set
   403 
   270 
   404 @publishedAll
   271 @publishedAll
       
   272 @released
   405 */
   273 */
   406 #define KCDInitialRecordId			0x00000100
   274 #define KCDInitialRecordId			0x00000100
   407 
   275 
   408 
   276 
   409 /**
   277 /**
   410 Id for the Initial table in the database
   278 Id for the Initial table in the database
   411 
   279 
   412 @publishedAll
   280 @publishedAll
       
   281 @released
   413 */
   282 */
   414 #define KCDInitialTableId			0x00800000
   283 #define KCDInitialTableId			0x00800000
   415 
   284 
   416 
   285 
   417 /**
   286 /**
   418 Id for the Initial User defined table in the database
   287 Id for the Initial User defined table in the database
   419 clients have 64 table ids available to them
   288 clients have 64 table ids available to them
   420 
   289 
   421 @publishedAll
   290 @publishedAll
       
   291 @released
   422 */
   292 */
   423 #define KCDInitialUDefRecordType   0x5F800000
   293 #define KCDInitialUDefRecordType   0x5F800000
   424 
   294 
   425 
   295 
   426 /**
   296 /**
   427 Id for the Last User defined table in the database.
   297 Id for the Last User defined table in the database.
   428 
   298 
   429 @publishedAll
   299 @publishedAll
       
   300 @released
   430 */
   301 */
   431 #define KCDLastUDefRecordType      0x7F800000
   302 #define KCDLastUDefRecordType      0x7F800000
   432 
   303 
   433 
   304 
   434 /**
   305 /**
   435 Id for the Initial column in a record set
   306 Id for the Initial column in a record set
   436 
   307 
   437 @publishedAll
   308 @publishedAll
       
   309 @released
   438 */
   310 */
   439 #define KCDInitialColumnId			0x00010000
   311 #define KCDInitialColumnId			0x00010000
   440 
   312 
   441 
   313 
   442 /**
   314 /**
   443 T C 0   location for default field values
   315 T C 0   location for default field values
   444 
   316 
   445 @publishedAll
   317 @publishedAll
       
   318 @released
   446 */
   319 */
   447 #define KCDDefaultRecord            0x00000000
   320 #define KCDDefaultRecord            0x00000000
   448 
   321 
   449 
   322 
   450 /**
   323 /**
   451 Combine with table id and Column id to give the location of column type info
   324 Combine with table id and Column id to give the location of column type info
   452 
   325 
   453 @publishedAll
   326 @publishedAll
       
   327 @released
   454 */
   328 */
   455 #define KCDColumnTypeInfo           0x0000ff00
   329 #define KCDColumnTypeInfo           0x0000ff00
   456 
       
   457 /**
       
   458 Combine with table id to give the location of table type info
       
   459 
       
   460 @publishedPartner
       
   461 @released
       
   462 */
       
   463 #define KCDTableTypeInfo            0x007fff00
       
   464 
       
   465 /*
       
   466 Combine with table id to give location of record type info
       
   467 */
       
   468 //#define KCDRecordTypeInfo			0x007f0000
       
   469 
       
   470 
       
   471 /**
       
   472 Use to request allocation of a new table id.
       
   473 Should only be called when creating a new user-defined table
       
   474 
       
   475 @publishedPartner
       
   476 @released
       
   477 */
       
   478 #define KCDNewTableRequest          0x007fff00
       
   479 
       
   480 
       
   481 /**
       
   482 Combine with table id to give request for a new column in a table.
       
   483 The table must already exist.  New columns should only normally be 
       
   484 requested when creating a new user-defined table
       
   485 
       
   486 @publishedPartner
       
   487 @released
       
   488 */
       
   489 #define KCDNewColumnRequest			0x0000ff01
       
   490 
   330 
   491 
   331 
   492 
   332 
   493 /**
   333 /**
   494 Combine with table id to give request for a new record in a table.
   334 Combine with table id to give request for a new record in a table.
   495 The table must already exist.
   335 The table must already exist.
   496 
   336 
   497 @publishedAll
   337 @publishedAll
       
   338 @released
   498 */
   339 */
   499 #define KCDNewRecordRequest			0x807f0001
   340 #define KCDNewRecordRequest			0x807f0001
   500 
   341 
   501 
   342 
   502 /**
   343 /**
   503 Combined with CMDBField, it finds the TableId given the table name
   344 Combined with CMDBField, it finds the TableId given the table name
   504 
   345 
   505 @publishedAll
   346 @publishedAll
   506 */
   347 @released
   507 #define KCDMaskGenericTableName			KCDNewTableRequest
   348 */
       
   349 #define KCDMaskGenericTableName			0x007fff00
   508 
   350 
   509 
   351 
   510 
   352 
   511 /**
   353 /**
   512 Maximum number of tables that can be created in one repository
   354 Maximum number of tables that can be created in one repository
   513 
   355 
   514 @publishedAll
   356 @publishedAll
       
   357 @released
   515 */
   358 */
   516 #define KCDMaxTables                254
   359 #define KCDMaxTables                254
   517 
   360 
   518 
   361 
   519 /**
   362 /**
   520 Maximum number of User defined tables that can be created in one repository
   363 Maximum number of User defined tables that can be created in one repository
   521 
   364 
   522 @publishedAll
   365 @publishedAll
       
   366 @released
   523 */
   367 */
   524 #define KCDMaxUserDefTables         64
   368 #define KCDMaxUserDefTables         64
   525 
   369 
   526 
   370 
   527 /**
   371 /**
   528 Maximum number of columns that can be created in one table
   372 Maximum number of columns that can be created in one table
   529 
   373 
   530 @publishedAll
   374 @publishedAll
       
   375 @released
   531 */
   376 */
   532 #define KCDMaxColumns               126  
   377 #define KCDMaxColumns               126  
   533 
   378 
   534 
   379 
   535 /**
   380 /**
   536 Maximum number of records that can be stored in one table
   381 Maximum number of records that can be stored in one table
   537 
   382 
   538 @publishedAll
   383 @publishedAll
       
   384 @released
   539 */
   385 */
   540 #define KCDMaxRecords               254
   386 #define KCDMaxRecords               254
   541 
   387 
   542 
   388 
   543 /**
   389 /**
   544 Maximum number of characters in a field name
   390 Maximum number of characters in a field name
   545 
   391 
   546 @publishedAll
   392 @publishedAll
       
   393 @released
   547 */
   394 */
   548 #define KCDMaxFieldNameLength        64
   395 #define KCDMaxFieldNameLength        64
   549 
   396 
   550 
   397 
   551 
       
   552 /**
       
   553 Flag to indicate change in field
       
   554 Not for use in database.  Just with fields
       
   555 
       
   556 @internalComponent
       
   557 */
       
   558 #define KCDChangedFlag      0x00000001
       
   559 
       
   560 /**
       
   561 @publishedPartner
       
   562 @released
       
   563 */
       
   564 #define KCDMaxRecordId     0x0000ff00
       
   565 /**
       
   566 @publishedPartner
       
   567 @released
       
   568 */
       
   569 #define KCDMaxColumnId     0x007f0000
       
   570 /**
       
   571 @publishedPartner
       
   572 @released
       
   573 */
       
   574 #define KCDMaxTableId      0x7f800000
       
   575 
       
   576 
       
   577 
       
   578 /*
       
   579 Mask to show only basic type info, 
       
   580 Masks out all info on links
       
   581 @internalComponent
       
   582 */
       
   583 #define KCDShowBasicTypeInfo  0x000000ff
       
   584 /**
       
   585 Typedefs for convenience in meta data definitions
       
   586 @internalComponent
       
   587 */
       
   588 using namespace Meta;
       
   589 
       
   590 template <class TYPE> class TMDBVisitor;
       
   591 class TMDBRecordLinkVisitor;
       
   592 class TMDBRecordSetVisitor;
       
   593 class TMDBGenericRecordVisitor;
       
   594 class CMDBElement;
       
   595 
       
   596 /*
       
   597 Visitors for field values
       
   598 */
       
   599 
       
   600 /**
       
   601 Typedefs for convenience in meta data definitions
       
   602 @internalComponent
       
   603 */
       
   604  typedef TMDBVisitor<TInt>                           TMDBNum;
       
   605 
       
   606 /**
       
   607 Typedefs for convenience in meta data definitions
       
   608 @internalComponent
       
   609 */	
       
   610  typedef TMDBVisitor<TInt>                           TMDBBool;
       
   611  
       
   612 /**
       
   613 Typedefs for convenience in meta data definitions
       
   614 @internalComponent
       
   615 */	
       
   616  typedef TMDBVisitor<TDesC>                          TMDBDes;	
       
   617  
       
   618 /**
       
   619 Typedefs for convenience in meta data definitions
       
   620 @internalComponent
       
   621 */
       
   622  typedef TMDBVisitor<TDesC8>                         TMDBDes8;	
       
   623 
       
   624 /*
       
   625 Visitors for containers
       
   626 */
       
   627 
       
   628 /**
       
   629 Typedefs for convenience in meta data definitions
       
   630 @internalComponent
       
   631 */
       
   632 typedef TMDBRecordLinkVisitor						TMDBLink;	
       
   633 
       
   634 /**
       
   635 Typedefs for convenience in meta data definitions
       
   636 @internalComponent
       
   637 */		
       
   638 typedef TMDBRecordSetVisitor                        TMDBRecordSet;
       
   639 
       
   640 /**
       
   641 Typedefs for convenience in meta data definitions
       
   642 @internalComponent
       
   643 */		
       
   644 typedef TMDBGenericRecordVisitor                    TMDBGenRecord;		
       
   645 
       
   646 /** UIDs for CommDB event notification */
       
   647 /**
       
   648 @publishedPartner
       
   649 @released
       
   650 */
       
   651 const TUid KUidCommDbNotificationEvent = {0x1020762E};
       
   652 /**
       
   653 @publishedPartner
       
   654 @released
       
   655 */
       
   656 const TUid KUidCommsDatStatusEvent = {KUidSystemCategoryValue};
       
   657 /**
       
   658 @publishedPartner
       
   659 @released
       
   660 */
       
   661 const TInt KCommsDatStatusEventCommitSeq = 0x1020762F;
       
   662 
       
   663 /**
       
   664 Metadatabase container type ids
       
   665 
       
   666 @internalComponent
       
   667 */
       
   668 #define KCDTIdMDBElement            123
       
   669 
       
   670 /**
       
   671 Metadatabase container type ids
       
   672 
       
   673 @internalComponent
       
   674 */
       
   675 #define KCDTIdMDBNumFieldBase       223
       
   676 
       
   677 /**
       
   678 Metadatabase container type ids
       
   679 
       
   680 @internalComponent
       
   681 */
       
   682 #define KCDTIdMDBTextFieldBase      224
       
   683 
       
   684 /**
       
   685 Metadatabase container type ids
       
   686 
       
   687 @internalComponent
       
   688 */
       
   689 #define KCDTIdMDBBinFieldBase       225
       
   690 
       
   691 /**
       
   692 Metadatabase container type ids
       
   693 
       
   694 @internalComponent
       
   695 */
       
   696 #define KCDTIdMDBRecordLinkBase     323
       
   697 
       
   698 /**
       
   699 Metadatabase container type ids
       
   700 
       
   701 @internalComponent
       
   702 */
       
   703 #define KCDTIdMDBRecordSetBase      523
       
   704 
       
   705 /**
       
   706 Metadatabase container type ids
       
   707 
       
   708 @internalComponent
       
   709 */
       
   710 #define KCDTIdMDBGenericRecord      585
       
   711 
       
   712 
       
   713 /**
   398 /**
   714 Macro for interaction with netmeta
   399 Macro for interaction with netmeta
   715 @publishedAll
   400 @publishedAll
       
   401 @released
   716 */
   402 */
   717 #define X_REGISTER_ATTRIBUTE( thisMetaClass, var, metaType ) \
   403 #define X_REGISTER_ATTRIBUTE( thisMetaClass, var, metaType ) \
   718  { _FOFF( thisMetaClass, var ), Meta::metaType##VisitorFactoryL },
   404  { _FOFF( thisMetaClass, var ), Meta::metaType##VisitorFactoryL },
   719 
   405 
   720 
   406 
   726 
   412 
   727 
   413 
   728 /**
   414 /**
   729 Macros used to implement virtual functions from MMetaData interface and construct the v data table
   415 Macros used to implement virtual functions from MMetaData interface and construct the v data table
   730 @publishedAll
   416 @publishedAll
       
   417 @released
   731 */
   418 */
   732 #define EXP_START_ATTRIBUTE_TABLE( thisMetaClass, uid, typeId ) \
   419 #define EXP_START_ATTRIBUTE_TABLE( thisMetaClass, uid, typeId ) \
   733  EXPORT_C Meta::SVDataTableEntry const* thisMetaClass::GetVDataTable() const { return &iVDataTable[0]; };	\
   420  EXPORT_C Meta::SVDataTableEntry const* thisMetaClass::GetVDataTable() const { return &iVDataTable[0]; };	\
   734  EXPORT_C TUint8* thisMetaClass::GetAttribPtr(const TInt aOffset) const { return (TUint8*)this + aOffset; };	\
   421  EXPORT_C TUint8* thisMetaClass::GetAttribPtr(const TInt aOffset) const { return (TUint8*)this + aOffset; };	\
   735  EXPORT_C Meta::SVDataTableEntry const* thisMetaClass::GetVDataTableStatic() { return &iVDataTable[0]; }; \
   422  EXPORT_C Meta::SVDataTableEntry const* thisMetaClass::GetVDataTableStatic() { return &iVDataTable[0]; }; \
   736  const Meta::SVDataTableEntry thisMetaClass::iVDataTable[] = { \
   423  const Meta::SVDataTableEntry thisMetaClass::iVDataTable[] = { \
   737  { uid, reinterpret_cast<Meta::TMetaTypeNewL>(typeId) },
   424  { uid, reinterpret_cast<Meta::TMetaTypeNewL>(typeId) },
   738 
   425 
   739 
   426 
   740 #define END_ATTRIBUTE_TABLE_BASE_N( baseMetaClass, baseId, entry ) \
   427 /**
   741  { (TInt)((TAny*)(baseMetaClass::GetVDataTableStatic() + entry)), NULL }};
   428 @publishedAll
   742 
   429 @released
   743 
   430 */
       
   431 typedef enum
       
   432 {
       
   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.
       
   441 
       
   442 } TCDFieldValueTypes;
       
   443 
       
   444 /**
       
   445 Flag to indicate change in field
       
   446 Not for use in database.  Just with fields
       
   447 
       
   448 @publishedAll
       
   449 */
       
   450 #define KCDChangedFlag      0x00000001
       
   451     
   744 } //end namespace CommsDat
   452 } //end namespace CommsDat
       
   453 
       
   454 #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
       
   455 #include <commsdat_internal.h>
       
   456 #include <commsdat_partner.h>
   745 #endif
   457 #endif
       
   458 
       
   459 #endif