epoc32/include/commsdat.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
parent 2 2fe1408b6811
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
williamr@2
     1
// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
williamr@2
     2
// All rights reserved.
williamr@2
     3
// This component and the accompanying materials are made available
williamr@4
     4
// under the terms of "Eclipse Public License v1.0"
williamr@2
     5
// which accompanies this distribution, and is available
williamr@4
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
williamr@2
     7
//
williamr@2
     8
// Initial Contributors:
williamr@2
     9
// Nokia Corporation - initial contribution.
williamr@2
    10
//
williamr@2
    11
// Contributors:
williamr@2
    12
//
williamr@2
    13
// Description:
williamr@2
    14
// Constants for use in storing comms data via CommsDat
williamr@2
    15
// 
williamr@2
    16
//
williamr@2
    17
williamr@2
    18
/**
williamr@2
    19
 @file
williamr@2
    20
 @publishedAll
williamr@2
    21
 @released
williamr@2
    22
*/
williamr@2
    23
williamr@2
    24
williamr@2
    25
#if (!defined COMMSDAT_H)
williamr@2
    26
#define       COMMSDAT_H
williamr@2
    27
williamr@2
    28
#include <comms-infras/metatype.h>
williamr@2
    29
#include <e32property.h>
williamr@2
    30
williamr@2
    31
williamr@2
    32
namespace CommsDat
williamr@2
    33
{
williamr@2
    34
williamr@2
    35
/**
williamr@2
    36
Use this constant for Debug panic calls
williamr@2
    37
williamr@2
    38
@publishedAll
williamr@4
    39
@released
williamr@2
    40
*/
williamr@2
    41
_LIT(KCommsDatName,"CommsDat");
williamr@2
    42
williamr@2
    43
/**
williamr@2
    44
Use this constant for Debug panic calls
williamr@2
    45
williamr@2
    46
@publishedAll
williamr@4
    47
@released
williamr@2
    48
*/
williamr@2
    49
enum
williamr@2
    50
	{
williamr@2
    51
	ECommitBeforeOpenTransaction = 1,
williamr@2
    52
	ERollBackBeforeOpenTransaction = 2,
williamr@2
    53
	ESessionClosed = 3,
williamr@4
    54
	ENotifierNotCreated = 4,
williamr@4
    55
    EWrongAPPrioritySelPolRecord = 5,
williamr@4
    56
    EWrongIAPServiceType = 6,
williamr@4
    57
    EInvalidIAP = 7
williamr@2
    58
	};
williamr@2
    59
	
williamr@2
    60
using namespace Meta;
williamr@2
    61
williamr@4
    62
//
williamr@2
    63
// VERSION INFO
williamr@2
    64
//
williamr@4
    65
/* Please note:
williamr@4
    66
 * ------------ 
williamr@4
    67
 * Concrete schema version should be used in the client applicaiton (curently available
williamr@4
    68
 * KCDVersion1_1 or KCDVersion1_2). 
williamr@4
    69
 * 
williamr@4
    70
 * Until the 9.5 release there was only one schema version, KCDVersion1_1, which was 
williamr@4
    71
 * available. From the 9.5 relase there is a possibility to use other schema version,
williamr@4
    72
 * KCDVersion1_2. Important that it's still possible to use the KCVersion1_1 
williamr@4
    73
 * constant, and use the deprecated records/tables, - CommsDat will invoke it's 
williamr@4
    74
 * mapping functionality in this case to be backward compatible. 
williamr@4
    75
 * 
williamr@4
    76
 * For backward compatibility reason the KCDLatestVersion and KCDCurrentVersion 
williamr@4
    77
 * constants are mapped to the KCDVersion1_1 constant. These constants are 
williamr@4
    78
 * deprecated.
williamr@4
    79
 * 
williamr@4
    80
 * ! PLEASE USE EXPLICIT SCHEMA VERSION WHEN CREATING A COMMSDAT SESSION OBJECT !
williamr@4
    81
 */
williamr@2
    82
williamr@2
    83
/**
williamr@2
    84
Versions of the dataset in use
williamr@2
    85
williamr@2
    86
Initial Version 
williamr@2
    87
@publishedAll
williamr@4
    88
@released
williamr@2
    89
*/
williamr@2
    90
williamr@2
    91
#define KCDVersion1_1               TVersion(1,1,1)
williamr@2
    92
williamr@2
    93
#ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
williamr@2
    94
/**
williamr@2
    95
Some elements in Version KCDVersion1_1 now deprecated
williamr@2
    96
These elements will be mapped if the client starts a session with KCDVersion1_1
williamr@2
    97
They will be ignored or rejected as not supported if client starts a session with 
williamr@4
    98
KCDVersion1_2
williamr@2
    99
williamr@2
   100
@publishedAll
williamr@4
   101
@released
williamr@2
   102
*/
williamr@2
   103
#define KCDVersion1_2               TVersion(1,2,1)
williamr@2
   104
#endif
williamr@4
   105
williamr@2
   106
/**
williamr@4
   107
For BC reasons this constant maps to the KCDVersion1_1 dataschema version.
williamr@2
   108
williamr@2
   109
@publishedAll
williamr@4
   110
@deprecated
williamr@2
   111
*/
williamr@4
   112
#define KCDLatestVersion            KCDVersion1_1
williamr@2
   113
williamr@4
   114
/**
williamr@4
   115
For BC reasons this constant maps to the KCDVersion1_1 dataschema version.
williamr@2
   116
williamr@4
   117
@publishedAll
williamr@4
   118
@deprecated
williamr@4
   119
*/
williamr@2
   120
#define KCDCurrentVersion           KCDVersion1_1
williamr@2
   121
williamr@2
   122
williamr@4
   123
//
williamr@2
   124
//  Attribute Flags
williamr@2
   125
//
williamr@2
   126
williamr@2
   127
/**
williamr@2
   128
Access control attribute flags.
williamr@2
   129
When these are SET in the mask the attribute is obeyed
williamr@2
   130
When they are CLEARED from the mask, the attribute is ignored
williamr@2
   131
By default attributes are obeyed.
williamr@2
   132
williamr@2
   133
@publishedAll
williamr@4
   134
@released
williamr@2
   135
*/
williamr@2
   136
typedef enum
williamr@2
   137
{
williamr@2
   138
  ECDNoWriteButDelete = 0x0000010,     // R/W Read Only but deleteable      Caller should explicitly choose to modify
williamr@2
   139
                                       //                                   Enforced by convention only, not with Platform Security
williamr@2
   140
  ECDHidden           = 0x0000020,     // R/W Read-Write Hidden data        Not policed - hides public utility info such as default values
williamr@2
   141
                                       //                                   Enforced by convention only, not with Platform Security  
williamr@2
   142
  ECDPrivate          = 0x0000040,     // R/W Read-Write Private data       For sensitive user data such as passwords
williamr@2
   143
                                       //                                   Policed at storage server API with platsec capability
williamr@2
   144
  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
   145
                                       //                                   Policed at storage server API with platsec capability
williamr@2
   146
} TCDAttributeFlags;
williamr@2
   147
williamr@2
   148
//
williamr@2
   149
// Masks for Element Type info
williamr@2
   150
//
williamr@2
   151
williamr@2
   152
williamr@2
   153
/**
williamr@2
   154
Mask to use to hide attribute reserved bits
williamr@2
   155
williamr@2
   156
@publishedAll
williamr@4
   157
@released
williamr@2
   158
*/
williamr@2
   159
#define KCDMaskHideAttrAndRes       0xffffff00
williamr@2
   160
williamr@2
   161
williamr@2
   162
/**
williamr@2
   163
Mask to use to show reserved bits
williamr@2
   164
williamr@2
   165
@publishedAll
williamr@4
   166
@released
williamr@2
   167
*/
williamr@2
   168
#define KCDMaskShowRes              0x8000000f
williamr@2
   169
williamr@2
   170
williamr@2
   171
/**
williamr@2
   172
Mask to use to hide reserved bits
williamr@2
   173
williamr@2
   174
@publishedAll
williamr@4
   175
@released
williamr@2
   176
*/
williamr@2
   177
#define KCDMaskHideRes              0x7ffffff0
williamr@2
   178
williamr@2
   179
williamr@2
   180
/**
williamr@2
   181
T x x   Mask to show Table Type info
williamr@2
   182
williamr@2
   183
@publishedAll
williamr@4
   184
@released
williamr@2
   185
*/
williamr@2
   186
#define KCDMaskShowRecordType       0x7f800000
williamr@2
   187
williamr@2
   188
williamr@2
   189
/**
williamr@2
   190
x C x   Mask to show Column Type 
williamr@2
   191
williamr@2
   192
@publishedAll
williamr@4
   193
@released
williamr@2
   194
*/
williamr@2
   195
#define KCDMaskShowFieldType        0x007f0000
williamr@2
   196
williamr@2
   197
williamr@2
   198
/**
williamr@2
   199
T C x   Mask to show Table and Column Type 
williamr@2
   200
williamr@2
   201
@publishedAll
williamr@4
   202
@released
williamr@2
   203
*/
williamr@2
   204
#define KCDMaskShowType             0x7fff0000
williamr@2
   205
williamr@2
   206
williamr@2
   207
/**
williamr@2
   208
T x R   Mask to show Record id
williamr@2
   209
williamr@2
   210
@publishedAll - don't use this.  Replace with KCDMaskShowRecordId
williamr@4
   211
@deprecated
williamr@2
   212
*/
williamr@2
   213
#define KCDMaskShowInstance         0x0000ff00
williamr@2
   214
williamr@2
   215
williamr@2
   216
/**
williamr@2
   217
T x R   Mask to show Record id
williamr@2
   218
Use in place of KCDMaskShowInstance
williamr@2
   219
@publishedAll
williamr@4
   220
@released
williamr@2
   221
*/
williamr@2
   222
#define KCDMaskShowRecordId         0x0000ff00
williamr@2
   223
williamr@2
   224
williamr@2
   225
/**
williamr@2
   226
T C R   Mask to show Field instance without attributes or reserved bits
williamr@2
   227
williamr@2
   228
@publishedAll
williamr@4
   229
@released
williamr@2
   230
*/
williamr@2
   231
#define KCDMaskShowField            0x7fffff00
williamr@2
   232
williamr@2
   233
williamr@2
   234
/**
williamr@2
   235
T x R   Mask to show Record Type and Record Id without column type, attributes or reserved bits
williamr@2
   236
williamr@2
   237
@publishedAll
williamr@4
   238
@released
williamr@2
   239
*/
williamr@2
   240
#define KCDMaskShowRecordTypeAndId  (KCDMaskShowRecordType | KCDMaskShowRecordId)
williamr@2
   241
williamr@2
   242
/**
williamr@2
   243
x C R   Mask to show Column Type and Record Id without Record type, attributes or reserved bits
williamr@2
   244
williamr@2
   245
@publishedAll
williamr@4
   246
@released
williamr@2
   247
*/
williamr@2
   248
#define KCDMaskShowColumnTypeAndRecordId  (KCDMaskShowFieldType |  KCDMaskShowRecordId)
williamr@2
   249
williamr@2
   250
williamr@2
   251
/**
williamr@2
   252
Mask to show Attributes
williamr@2
   253
williamr@2
   254
@publishedAll
williamr@4
   255
@released
williamr@2
   256
*/
williamr@2
   257
#define KCDMaskShowAttributes       0x000000f0
williamr@2
   258
williamr@2
   259
/**
williamr@2
   260
Mask to use to show attributes and reserved bits
williamr@2
   261
williamr@2
   262
@publishedAll
williamr@4
   263
@released
williamr@2
   264
*/
williamr@2
   265
#define KCDMaskShowAttrAndRes       0x000000ff
williamr@2
   266
williamr@2
   267
williamr@2
   268
/**
williamr@2
   269
Id for the Initial record in a record set
williamr@2
   270
williamr@2
   271
@publishedAll
williamr@4
   272
@released
williamr@2
   273
*/
williamr@2
   274
#define KCDInitialRecordId			0x00000100
williamr@2
   275
williamr@2
   276
williamr@2
   277
/**
williamr@2
   278
Id for the Initial table in the database
williamr@2
   279
williamr@2
   280
@publishedAll
williamr@4
   281
@released
williamr@2
   282
*/
williamr@2
   283
#define KCDInitialTableId			0x00800000
williamr@2
   284
williamr@2
   285
williamr@2
   286
/**
williamr@2
   287
Id for the Initial User defined table in the database
williamr@2
   288
clients have 64 table ids available to them
williamr@2
   289
williamr@2
   290
@publishedAll
williamr@4
   291
@released
williamr@2
   292
*/
williamr@2
   293
#define KCDInitialUDefRecordType   0x5F800000
williamr@2
   294
williamr@2
   295
williamr@2
   296
/**
williamr@2
   297
Id for the Last User defined table in the database.
williamr@2
   298
williamr@2
   299
@publishedAll
williamr@4
   300
@released
williamr@2
   301
*/
williamr@2
   302
#define KCDLastUDefRecordType      0x7F800000
williamr@2
   303
williamr@2
   304
williamr@2
   305
/**
williamr@2
   306
Id for the Initial column in a record set
williamr@2
   307
williamr@2
   308
@publishedAll
williamr@4
   309
@released
williamr@2
   310
*/
williamr@2
   311
#define KCDInitialColumnId			0x00010000
williamr@2
   312
williamr@2
   313
williamr@2
   314
/**
williamr@2
   315
T C 0   location for default field values
williamr@2
   316
williamr@2
   317
@publishedAll
williamr@4
   318
@released
williamr@2
   319
*/
williamr@2
   320
#define KCDDefaultRecord            0x00000000
williamr@2
   321
williamr@2
   322
williamr@2
   323
/**
williamr@2
   324
Combine with table id and Column id to give the location of column type info
williamr@2
   325
williamr@2
   326
@publishedAll
williamr@4
   327
@released
williamr@2
   328
*/
williamr@2
   329
#define KCDColumnTypeInfo           0x0000ff00
williamr@2
   330
williamr@2
   331
williamr@2
   332
williamr@2
   333
/**
williamr@2
   334
Combine with table id to give request for a new record in a table.
williamr@2
   335
The table must already exist.
williamr@2
   336
williamr@2
   337
@publishedAll
williamr@4
   338
@released
williamr@2
   339
*/
williamr@2
   340
#define KCDNewRecordRequest			0x807f0001
williamr@2
   341
williamr@2
   342
williamr@2
   343
/**
williamr@2
   344
Combined with CMDBField, it finds the TableId given the table name
williamr@2
   345
williamr@2
   346
@publishedAll
williamr@4
   347
@released
williamr@2
   348
*/
williamr@4
   349
#define KCDMaskGenericTableName			0x007fff00
williamr@2
   350
williamr@2
   351
williamr@2
   352
williamr@2
   353
/**
williamr@2
   354
Maximum number of tables that can be created in one repository
williamr@2
   355
williamr@2
   356
@publishedAll
williamr@4
   357
@released
williamr@2
   358
*/
williamr@2
   359
#define KCDMaxTables                254
williamr@2
   360
williamr@2
   361
williamr@2
   362
/**
williamr@2
   363
Maximum number of User defined tables that can be created in one repository
williamr@2
   364
williamr@2
   365
@publishedAll
williamr@4
   366
@released
williamr@2
   367
*/
williamr@2
   368
#define KCDMaxUserDefTables         64
williamr@2
   369
williamr@2
   370
williamr@2
   371
/**
williamr@2
   372
Maximum number of columns that can be created in one table
williamr@2
   373
williamr@2
   374
@publishedAll
williamr@4
   375
@released
williamr@2
   376
*/
williamr@2
   377
#define KCDMaxColumns               126  
williamr@2
   378
williamr@2
   379
williamr@2
   380
/**
williamr@2
   381
Maximum number of records that can be stored in one table
williamr@2
   382
williamr@2
   383
@publishedAll
williamr@4
   384
@released
williamr@2
   385
*/
williamr@2
   386
#define KCDMaxRecords               254
williamr@2
   387
williamr@2
   388
williamr@2
   389
/**
williamr@2
   390
Maximum number of characters in a field name
williamr@2
   391
williamr@2
   392
@publishedAll
williamr@4
   393
@released
williamr@2
   394
*/
williamr@2
   395
#define KCDMaxFieldNameLength        64
williamr@2
   396
williamr@2
   397
williamr@2
   398
/**
williamr@2
   399
Macro for interaction with netmeta
williamr@2
   400
@publishedAll
williamr@4
   401
@released
williamr@2
   402
*/
williamr@2
   403
#define X_REGISTER_ATTRIBUTE( thisMetaClass, var, metaType ) \
williamr@2
   404
 { _FOFF( thisMetaClass, var ), Meta::metaType##VisitorFactoryL },
williamr@2
   405
williamr@2
   406
williamr@2
   407
#define EXP_DATA_VTABLE \
williamr@2
   408
 IMPORT_C virtual Meta::SVDataTableEntry const* GetVDataTable() const;	\
williamr@2
   409
 IMPORT_C virtual TUint8* GetAttribPtr(const TInt aOffset) const;	\
williamr@2
   410
 IMPORT_C static Meta::SVDataTableEntry const* GetVDataTableStatic(); \
williamr@2
   411
 static const Meta::SVDataTableEntry iVDataTable[];
williamr@2
   412
williamr@2
   413
williamr@2
   414
/**
williamr@2
   415
Macros used to implement virtual functions from MMetaData interface and construct the v data table
williamr@2
   416
@publishedAll
williamr@4
   417
@released
williamr@2
   418
*/
williamr@2
   419
#define EXP_START_ATTRIBUTE_TABLE( thisMetaClass, uid, typeId ) \
williamr@2
   420
 EXPORT_C Meta::SVDataTableEntry const* thisMetaClass::GetVDataTable() const { return &iVDataTable[0]; };	\
williamr@2
   421
 EXPORT_C TUint8* thisMetaClass::GetAttribPtr(const TInt aOffset) const { return (TUint8*)this + aOffset; };	\
williamr@2
   422
 EXPORT_C Meta::SVDataTableEntry const* thisMetaClass::GetVDataTableStatic() { return &iVDataTable[0]; }; \
williamr@2
   423
 const Meta::SVDataTableEntry thisMetaClass::iVDataTable[] = { \
williamr@2
   424
 { uid, reinterpret_cast<Meta::TMetaTypeNewL>(typeId) },
williamr@2
   425
williamr@2
   426
williamr@4
   427
/**
williamr@4
   428
@publishedAll
williamr@4
   429
@released
williamr@4
   430
*/
williamr@4
   431
typedef enum
williamr@4
   432
{
williamr@4
   433
	EText,          //< Text field - descriptor with a maximum length of 50 unicode characters.
williamr@4
   434
 	EDesC8,         //< Buffer of TUInt8. Maximum length is 1024 * 8. 
williamr@4
   435
 	EUint32,		//< Unsigned 32 bit integer field.
williamr@4
   436
 	EInt,			//< Signed integer field
williamr@4
   437
 	EBool,			//< Boolean field
williamr@4
   438
 	EMedText,       //< Text field - descriptor with a maximum length of 256 unicode characters.
williamr@4
   439
 	ELongText, 		//< Text field - descriptor with a maximum length of 1024 unicode characters.
williamr@4
   440
    ELink			//< This field is an integer that identifies a record in another table.
williamr@2
   441
williamr@4
   442
} TCDFieldValueTypes;
williamr@2
   443
williamr@4
   444
/**
williamr@4
   445
Flag to indicate change in field
williamr@4
   446
Not for use in database.  Just with fields
williamr@4
   447
williamr@4
   448
@publishedAll
williamr@4
   449
*/
williamr@4
   450
#define KCDChangedFlag      0x00000001
williamr@4
   451
    
williamr@2
   452
} //end namespace CommsDat
williamr@4
   453
williamr@4
   454
#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
williamr@4
   455
#include <commsdat_internal.h>
williamr@4
   456
#include <commsdat_partner.h>
williamr@2
   457
#endif
williamr@4
   458
williamr@4
   459
#endif