mtpfws/mtpfw/datatypes/src/cmtptypeobjectpropdesc.cpp
changeset 0 d0791faffa3f
equal deleted inserted replaced
-1:000000000000 0:d0791faffa3f
       
     1 // Copyright (c) 2006-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".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 /**
       
    17  @file
       
    18  @publishedPartner
       
    19 */
       
    20 
       
    21 #include <mtp/cmtptypeobjectpropdesc.h>
       
    22 #include <mtp/mtpdatatypeconstants.h>
       
    23 #include <mtp/mtpprotocolconstants.h>
       
    24 #include <mtp/cmtptypeserviceobjpropextnform.h>
       
    25 #include <mtp/cmtptypeservicemethodparamextnform.h>
       
    26 
       
    27 #include "mtpdatatypespanic.h"
       
    28 
       
    29 // Dataset constants
       
    30 const TUint CMTPTypeObjectPropDesc::KFlat1ChunkSize(5);
       
    31 const TUint CMTPTypeObjectPropDesc::KFlat2ChunkSize(5);
       
    32 
       
    33 const TUint CMTPTypeObjectPropDesc::KNumChunksWithoutForm(EIdFlat2Chunk + 1);
       
    34 const TUint CMTPTypeObjectPropDesc::KNumChunksWithForm(EIdFormChunk + 1);
       
    35 
       
    36 const TUint CMTPTypeObjectPropDescEnumerationForm::KNumberOfValuesChunk(0);
       
    37 const TUint CMTPTypeObjectPropDescEnumerationForm::KValueChunks(1);
       
    38 
       
    39 // Dataset element metadata    
       
    40 const CMTPTypeCompoundBase::TElementInfo CMTPTypeObjectPropDesc::iElementMetaData[CMTPTypeObjectPropDesc::ENumElements] = 
       
    41     {
       
    42         {EIdFlat1Chunk,         EMTPTypeFlat,       {EMTPTypeUINT16,    0,                  KMTPTypeUINT16Size}},   // EPropertyCode
       
    43         {EIdFlat1Chunk,         EMTPTypeFlat,       {EMTPTypeUINT16,    2,                  KMTPTypeUINT16Size}},   // EDatatype
       
    44         {EIdFlat1Chunk,         EMTPTypeFlat,       {EMTPTypeUINT8,     4,                  KMTPTypeUINT8Size}},    // EGetSet
       
    45         {EIdDefaultValueChunk,  EMTPTypeReference,  {EMTPTypeUndefined, KMTPNotApplicable,  KMTPNotApplicable}},    // EDefaultValue
       
    46         {EIdFlat2Chunk,         EMTPTypeFlat,       {EMTPTypeUINT32,    0,                  KMTPTypeUINT32Size}},   // EGroupCode
       
    47         {EIdFlat2Chunk,         EMTPTypeFlat,       {EMTPTypeUINT8,     4,                  KMTPTypeUINT8Size}},    // EFormFlag
       
    48         {EIdFormChunk,          EMTPTypeReference,  {EMTPTypeUndefined, KMTPNotApplicable,  KMTPNotApplicable}},    // EForm
       
    49     };
       
    50 
       
    51 
       
    52 EXPORT_C CMTPTypeObjectPropDesc* CMTPTypeObjectPropDesc::NewL()
       
    53     {
       
    54     CMTPTypeObjectPropDesc* self = NewLC();
       
    55     CleanupStack::Pop(self);
       
    56     return self;    
       
    57     }
       
    58 
       
    59 
       
    60 /**
       
    61 MTP ObjectPropDesc dataset factory method. This method is used to create an 
       
    62 empty MTP ObjectPropDesc dataset type with the default Datatype and Form Flag 
       
    63 defined for the specified PropertyCode. 
       
    64 @param aPropertyCode The ObjectPropertyCode of the property being described by 
       
    65 the ObjectPropDesc dataset.
       
    66 @return A pointer to the MTP ObjectPropDesc dataset type. Ownership IS 
       
    67 transfered.
       
    68 @leave One of the system wide error codes, if unsuccessful.
       
    69 */ 
       
    70 EXPORT_C CMTPTypeObjectPropDesc* CMTPTypeObjectPropDesc::NewL(TUint16 aPropertyCode)
       
    71     {
       
    72     CMTPTypeObjectPropDesc* self = NewLC(aPropertyCode);
       
    73     CleanupStack::Pop(self);
       
    74     return self;    
       
    75     }
       
    76 
       
    77 /**
       
    78 MTP ObjectPropDesc dataset factory method. This method is used to create an 
       
    79 empty MTP ObjectPropDesc dataset type with the default Datatype and Form Flag 
       
    80 defined for the specified PropertyCode. A pointer to the data type is placed on
       
    81 the cleanup stack.
       
    82 @param aPropertyCode The ObjectPropertyCode of the property being described by 
       
    83 the ObjectPropDesc dataset.
       
    84 @return A pointer to the MTP ObjectPropDesc dataset type. Ownership IS 
       
    85 transfered.
       
    86 @leave One of the system wide error codes, if unsuccessful.
       
    87 */ 
       
    88 EXPORT_C CMTPTypeObjectPropDesc* CMTPTypeObjectPropDesc::NewLC(TUint16 aPropertyCode)
       
    89     {    
       
    90     CMTPTypeObjectPropDesc* self = new (ELeave) CMTPTypeObjectPropDesc(); 
       
    91     CleanupStack::PushL(self); 
       
    92     self->ConstructL(aPropertyCode, NULL);
       
    93     return self;    
       
    94     }
       
    95 
       
    96 /**
       
    97 MTP ObjectPropDesc dataset factory method. This method is used to create an 
       
    98 MTP ObjectPropDesc dataset type with the default Datatype and Form Flag 
       
    99 defined for the specified PropertyCode, and the specified FORM. 
       
   100 @param aPropertyCode The ObjectPropertyCode of the property being described by 
       
   101 the ObjectPropDesc dataset.
       
   102 @param aForm The optional ObjectPropDesc FORM dataset.
       
   103 @return A pointer to the MTP ObjectPropDesc dataset type. Ownership IS 
       
   104 transfered.
       
   105 @leave KMTPDataTypeInvalid, if a FORM dataset is not defined for the property.
       
   106 @leave One of the system wide error codes, if unsuccessful.
       
   107 */ 
       
   108 EXPORT_C CMTPTypeObjectPropDesc* CMTPTypeObjectPropDesc::NewL(TUint16 aPropertyCode, const MMTPType& aForm)
       
   109     {
       
   110     CMTPTypeObjectPropDesc* self = NewLC(aPropertyCode, aForm);
       
   111     CleanupStack::Pop(self);
       
   112     return self;    
       
   113     }
       
   114 
       
   115 /**
       
   116 MTP ObjectPropDesc dataset factory method. This method is used to create an 
       
   117 MTP ObjectPropDesc dataset type with the default Datatype and Form Flag 
       
   118 defined for the specified PropertyCode, and the specified FORM. A pointer 
       
   119 to the data type is placed on the cleanup stack.
       
   120 @param aPropertyCode The ObjectPropertyCode of the property being described by 
       
   121 the ObjectPropDesc dataset.
       
   122 @param aForm The optional ObjectPropDesc FORM dataset.
       
   123 @return A pointer to the MTP ObjectPropDesc dataset type. Ownership IS 
       
   124 transfered.
       
   125 @leave KMTPDataTypeInvalid, if a FORM dataset is not defined for the property.
       
   126 @leave One of the system wide error codes, if unsuccessful.
       
   127 */ 
       
   128 EXPORT_C CMTPTypeObjectPropDesc* CMTPTypeObjectPropDesc::NewLC(TUint16 aPropertyCode, const MMTPType& aForm)
       
   129     {    
       
   130     CMTPTypeObjectPropDesc* self = new (ELeave) CMTPTypeObjectPropDesc(); 
       
   131     CleanupStack::PushL(self); 
       
   132     self->ConstructL(aPropertyCode, &aForm);
       
   133     return self;    
       
   134     }
       
   135 
       
   136 /**
       
   137 MTP ObjectPropDesc dataset factory method. This method is used to create an 
       
   138 MTP ObjectPropDesc dataset type with the default Datatype defined for the 
       
   139 specified PropertyCode, and the specified Form Flag and FORM.  
       
   140 @param aPropertyCode The ObjectPropertyCode of the property being described by 
       
   141 the ObjectPropDesc dataset.
       
   142 @param aFormFlag The required Form Flag of the ObjectPropDesc.
       
   143 @param aForm The optional ObjectPropDesc FORM dataset.
       
   144 @return A pointer to the MTP ObjectPropDesc dataset type. Ownership IS 
       
   145 transfered.
       
   146 @leave KMTPDataTypeInvalid, if a FORM dataset is not defined for the property.
       
   147 @leave One of the system wide error codes, if unsuccessful.
       
   148 */ 
       
   149 EXPORT_C CMTPTypeObjectPropDesc* CMTPTypeObjectPropDesc::NewL(TUint16 aPropertyCode, TUint8 aFormFlag, const MMTPType* aForm)
       
   150     {
       
   151     CMTPTypeObjectPropDesc* self = NewLC(aPropertyCode, aFormFlag, aForm);
       
   152     CleanupStack::Pop(self);
       
   153     return self;    
       
   154     }
       
   155 
       
   156 /**
       
   157 MTP ObjectPropDesc dataset factory method. This method is used to create an 
       
   158 MTP ObjectPropDesc dataset type with the default Datatype defined for the 
       
   159 specified PropertyCode, and the specified Form Flag and FORM. A pointer 
       
   160 to the data type is placed on the cleanup stack.
       
   161 @param aPropertyCode The ObjectPropertyCode of the property being described by 
       
   162 the ObjectPropDesc dataset.
       
   163 @param aFormFlag The required Form Flag of the ObjectPropDesc.
       
   164 @param aForm The optional ObjectPropDesc FORM dataset.
       
   165 @return A pointer to the MTP ObjectPropDesc dataset type. Ownership IS 
       
   166 transfered.
       
   167 @leave KMTPDataTypeInvalid, if a FORM dataset is not defined for the property.
       
   168 @leave One of the system wide error codes, if unsuccessful.
       
   169 */ 
       
   170 EXPORT_C CMTPTypeObjectPropDesc* CMTPTypeObjectPropDesc::NewLC(TUint16 aPropertyCode, TUint8 aFormFlag, const MMTPType* aForm)
       
   171     {
       
   172     CMTPTypeObjectPropDesc* self = new (ELeave) CMTPTypeObjectPropDesc(); 
       
   173     CleanupStack::PushL(self); 
       
   174     TPropertyInfo info;
       
   175     PropertyInfoL(aPropertyCode, info);
       
   176     info.iFormFlag = aFormFlag;
       
   177     self->ConstructL(aPropertyCode, info, aForm);
       
   178     return self;    
       
   179     }
       
   180 
       
   181 /**
       
   182 MTP ObjectPropDesc dataset factory method. This method is used to create an  
       
   183 MTP ObjectPropDesc dataset type with the specified values.
       
   184 @param aPropertyCode The ObjectPropertyCode of the property being described by 
       
   185 the ObjectPropDesc dataset.
       
   186 @param aInfo The MTP ObjectPropDesc dataset characteristics (meta data).
       
   187 @param aForm The optional ObjectPropDesc FORM dataset.
       
   188 @return A pointer to the MTP ObjectPropDesc dataset type. Ownership IS 
       
   189 transfered.
       
   190 @leave KMTPDataTypeInvalid, if a FORM dataset is not defined for the property.
       
   191 @leave One of the system wide error codes, if unsuccessful.
       
   192 */    
       
   193 EXPORT_C CMTPTypeObjectPropDesc* CMTPTypeObjectPropDesc::NewL(TUint16 aPropertyCode, const TPropertyInfo& aInfo, const MMTPType* aForm)
       
   194     {
       
   195     CMTPTypeObjectPropDesc* self = CMTPTypeObjectPropDesc::NewLC(aPropertyCode, aInfo, aForm); 
       
   196     CleanupStack::Pop(self);
       
   197     return self; 
       
   198     }
       
   199 
       
   200 /**
       
   201 MTP ObjectPropDesc dataset factory method. This method is used to create an  
       
   202 MTP ObjectPropDesc dataset type with the specified values. A pointer to the 
       
   203 data type is placed on the cleanup stack.
       
   204 @param aPropertyCode The ObjectPropertyCode of the property being described by 
       
   205 the ObjectPropDesc dataset.
       
   206 @param aInfo The MTP ObjectPropDesc dataset characteristics (meta data).
       
   207 @param aForm The optional ObjectPropDesc FORM dataset.
       
   208 @return A pointer to the MTP ObjectPropDesc dataset type. Ownership IS 
       
   209 transfered.
       
   210 @leave KMTPDataTypeInvalid, if a FORM dataset is not defined for the property.
       
   211 @leave One of the system wide error codes, if unsuccessful.
       
   212 */ 
       
   213 EXPORT_C CMTPTypeObjectPropDesc* CMTPTypeObjectPropDesc::NewLC(TUint16 aPropertyCode, const TPropertyInfo& aInfo, const MMTPType* aForm)
       
   214     {
       
   215     CMTPTypeObjectPropDesc* self = new (ELeave) CMTPTypeObjectPropDesc(); 
       
   216     CleanupStack::PushL(self); 
       
   217     self->ConstructL(aPropertyCode, aInfo, aForm);
       
   218     return self;    
       
   219     }
       
   220 
       
   221 /**
       
   222 Destructor.
       
   223 */
       
   224 EXPORT_C CMTPTypeObjectPropDesc::~CMTPTypeObjectPropDesc()
       
   225     {
       
   226     iChunkFlat1.Close();
       
   227     iChunkDefaultValue.Close();
       
   228     iChunkFlat2.Close();
       
   229     iChunkForm.Close();
       
   230     }
       
   231 
       
   232 EXPORT_C TInt CMTPTypeObjectPropDesc::FirstWriteChunk(TPtr8& aChunk)
       
   233     {  
       
   234     /* 
       
   235     Reset the type in preparation for the data stream, by deleting all
       
   236     except the first chunk.
       
   237     */
       
   238     for (TUint i(ChunkCount() - 1); (i >= (EIdFlat1Chunk + 1)); i--)
       
   239         {
       
   240         ChunkRemove(i);
       
   241         }
       
   242         
       
   243     // Setup the write chunk pointer.
       
   244     TInt err(UpdateWriteSequenceErr(CMTPTypeCompoundBase::FirstWriteChunk(aChunk)));
       
   245     switch (err)
       
   246         {
       
   247     case KMTPChunkSequenceCompletion:
       
   248         err = KErrNone;
       
   249         // Don't break, fall through to set the write sequence state.
       
   250         
       
   251     case KErrNone:
       
   252         // Set the write sequence state.
       
   253         iWriteSequenceState = EFlat1Chunk; 
       
   254         
       
   255         /* 
       
   256         Set the write sequence completion state. Initially assume that the 
       
   257         ObjectPropDesc has a FORM field. If no FORM field is subsequently
       
   258         detected in the write data stream then the completion state is 
       
   259         adjusted accordingly.
       
   260         */
       
   261         iWriteSequenceCompletionState = EFormChunk;
       
   262         break;
       
   263         
       
   264     default:
       
   265         break;
       
   266         }
       
   267         
       
   268     return  err;
       
   269     }
       
   270     
       
   271 EXPORT_C TInt CMTPTypeObjectPropDesc::NextWriteChunk(TPtr8& aChunk)
       
   272     {
       
   273     TInt err(KMTPChunkSequenceCompletion);
       
   274     
       
   275     if (iWriteSequenceState != EIdle)
       
   276         {
       
   277         err = UpdateWriteSequenceErr(CMTPTypeCompoundBase::NextWriteChunk(aChunk));
       
   278         if ((iWriteSequenceErr == KMTPChunkSequenceCompletion) && (iWriteSequenceState != EIdle))
       
   279             {
       
   280             err = KErrNone;
       
   281             }   
       
   282         }    
       
   283     return err;
       
   284     }
       
   285  
       
   286 EXPORT_C TUint CMTPTypeObjectPropDesc::Type() const
       
   287     {
       
   288     return EMTPTypeObjectPropDescDataset;
       
   289     }
       
   290     
       
   291 EXPORT_C TBool CMTPTypeObjectPropDesc::CommitRequired() const
       
   292     {
       
   293     return ETrue;
       
   294     }
       
   295 
       
   296 EXPORT_C MMTPType* CMTPTypeObjectPropDesc::CommitChunkL(TPtr8& aChunk)
       
   297     {
       
   298     if (iWriteSequenceErr == KMTPChunkSequenceCompletion)
       
   299         {
       
   300         switch (iWriteSequenceState)
       
   301             {
       
   302         case EFlat1Chunk:     
       
   303             /* 
       
   304             Datatype is available, allocate sufficient chunk storage for 
       
   305             and append the DefaultValue chunk.
       
   306             */
       
   307             iChunkDefaultValue.Close();
       
   308             iChunkDefaultValue.OpenL(Uint16L(EDatatype));
       
   309             ChunkAppendL(iChunkDefaultValue);
       
   310             break;
       
   311             
       
   312         case EDefaultValueChunk:
       
   313             // Append the next chunk.
       
   314             ChunkAppendL(iChunkFlat2);
       
   315             break;
       
   316             
       
   317         case EFlat2Chunk: 
       
   318             /* 
       
   319             FormFlag and Datatype are available, allocate sufficient storage for 
       
   320             and append the FORM chunk.
       
   321             */
       
   322             {
       
   323             iChunkForm.Close();
       
   324             TUint8 flag(Uint8L(EFormFlag));
       
   325             iChunkForm.SetMeta(flag, Uint16L(EDatatype));
       
   326             if (HasFormField(flag))
       
   327                 {
       
   328                 iChunkForm.OpenL(iElementInfo[EIdFormChunk].iType);
       
   329                 ChunkAppendL(iChunkForm);
       
   330                 SetExpectedChunkCount(KNumChunksWithForm);
       
   331                 }
       
   332             else
       
   333                 {
       
   334                 // Adjust the write sequence completion state.            
       
   335                 iWriteSequenceCompletionState = EFlat2Chunk;
       
   336                 }   
       
   337             }
       
   338             break;
       
   339             
       
   340         case EFormChunk:
       
   341         case EIdle:
       
   342         default:
       
   343             break;
       
   344             }
       
   345     if ((iWriteSequenceState != EIdle ) && (iWriteSequenceState < iWriteSequenceCompletionState))
       
   346         {
       
   347         iWriteSequenceState++;
       
   348         }
       
   349     else
       
   350         {
       
   351         iWriteSequenceState = EIdle;
       
   352         }
       
   353     }
       
   354         
       
   355     if (CMTPTypeCompoundBase::CommitRequired())
       
   356         {
       
   357         CMTPTypeCompoundBase::CommitChunkL(aChunk);
       
   358         }
       
   359     return NULL;
       
   360     }
       
   361     
       
   362 void CMTPTypeObjectPropDesc::PropertyInfoL(TUint16 aPropertyCode, TPropertyInfo& aInfo)
       
   363     {    
       
   364     switch (aPropertyCode)
       
   365         {        
       
   366     case EMTPObjectPropCodeUndefined:
       
   367         aInfo.iDataType     = EMTPTypeUndefined;
       
   368         aInfo.iFormFlag     = ENone;
       
   369         aInfo.iGetSet       = EReadOnly;
       
   370         break;
       
   371          
       
   372     case EMTPObjectPropCodeStorageID:
       
   373         aInfo.iDataType     = EMTPTypeUINT32;
       
   374         aInfo.iFormFlag     = ENone;
       
   375         aInfo.iGetSet       = EReadOnly;
       
   376         break;
       
   377         
       
   378     case EMTPObjectPropCodeObjectFormat:
       
   379         aInfo.iDataType     = EMTPTypeUINT16;
       
   380         aInfo.iFormFlag     = ENone;
       
   381         aInfo.iGetSet       = EReadOnly;
       
   382         break;
       
   383         
       
   384     case EMTPObjectPropCodeProtectionStatus:
       
   385         aInfo.iDataType     = EMTPTypeUINT16;
       
   386         aInfo.iFormFlag     = EEnumerationForm;
       
   387         aInfo.iGetSet       = EReadOnly;
       
   388         break;
       
   389         
       
   390     case EMTPObjectPropCodeObjectSize:
       
   391         aInfo.iDataType     = EMTPTypeUINT64;
       
   392         aInfo.iFormFlag     = ENone;
       
   393         aInfo.iGetSet       = EReadOnly;
       
   394         break;
       
   395         
       
   396     case EMTPObjectPropCodeAssociationType:
       
   397         aInfo.iDataType     = EMTPTypeUINT16;
       
   398         aInfo.iFormFlag     = EEnumerationForm;
       
   399         aInfo.iGetSet       = EReadWrite;
       
   400         break;
       
   401         
       
   402     case EMTPObjectPropCodeAssociationDesc:
       
   403         aInfo.iDataType     = EMTPTypeUINT32;
       
   404         aInfo.iFormFlag     = ENone;
       
   405         aInfo.iGetSet       = EReadWrite;
       
   406         break;
       
   407         
       
   408     case EMTPObjectPropCodeObjectFileName:
       
   409         aInfo.iDataType     = EMTPTypeString;
       
   410         aInfo.iFormFlag     = ENone;
       
   411         aInfo.iGetSet       = EReadWrite;
       
   412         break;
       
   413         
       
   414     case EMTPObjectPropCodeDateCreated:
       
   415         aInfo.iDataType     = EMTPTypeString;
       
   416         aInfo.iFormFlag     = EDateTimeForm;
       
   417         aInfo.iGetSet       = EReadWrite;
       
   418         break;
       
   419         
       
   420     case EMTPObjectPropCodeDateModified:
       
   421         aInfo.iDataType     = EMTPTypeString;
       
   422         aInfo.iFormFlag     = EDateTimeForm;
       
   423         aInfo.iGetSet       = EReadWrite;
       
   424         break;
       
   425         
       
   426     case EMTPObjectPropCodeKeywords:
       
   427         aInfo.iDataType     = EMTPTypeString;
       
   428         aInfo.iFormFlag     = ENone;
       
   429         aInfo.iGetSet       = EReadWrite;
       
   430         break;
       
   431         
       
   432     case EMTPObjectPropCodeParentObject:
       
   433         aInfo.iDataType     = EMTPTypeUINT32;
       
   434         aInfo.iFormFlag     = ENone;
       
   435         aInfo.iGetSet       = EReadOnly;
       
   436         break;
       
   437         
       
   438     case EMTPObjectPropCodeAllowedFolderContents:
       
   439         aInfo.iDataType     = EMTPTypeAUINT16;
       
   440         aInfo.iFormFlag     = ENone;
       
   441         aInfo.iGetSet       = EReadOnly;
       
   442         break;
       
   443         
       
   444     case EMTPObjectPropCodeHidden:
       
   445         aInfo.iDataType     = EMTPTypeUINT16;
       
   446         aInfo.iFormFlag     = EEnumerationForm;
       
   447         aInfo.iGetSet       = EReadWrite;
       
   448         break;
       
   449         
       
   450     case EMTPObjectPropCodeSystemObject:
       
   451         aInfo.iDataType     = EMTPTypeUINT16;
       
   452         aInfo.iFormFlag     = EEnumerationForm;
       
   453         aInfo.iGetSet       = EReadWrite;
       
   454         break;
       
   455         
       
   456     case EMTPObjectPropCodePersistentUniqueObjectIdentifier:
       
   457         aInfo.iDataType     = EMTPTypeUINT128;
       
   458         aInfo.iFormFlag     = ENone;
       
   459         aInfo.iGetSet       = EReadOnly;
       
   460         break;
       
   461         
       
   462     case EMTPObjectPropCodeSyncID:
       
   463         aInfo.iDataType     = EMTPTypeString;
       
   464         aInfo.iFormFlag     = ENone;
       
   465         aInfo.iGetSet       = EReadWrite;
       
   466         break;
       
   467         
       
   468     case EMTPObjectPropCodePropertyBag:
       
   469         aInfo.iDataType     = EMTPTypeAUINT16;
       
   470         aInfo.iFormFlag     = ELongStringForm;
       
   471         aInfo.iGetSet       = EReadWrite;
       
   472         break;
       
   473         
       
   474     case EMTPObjectPropCodeName:
       
   475         aInfo.iDataType     = EMTPTypeString;
       
   476         aInfo.iFormFlag     = ENone;
       
   477         aInfo.iGetSet       = EReadWrite;
       
   478         break;
       
   479         
       
   480     case EMTPObjectPropCodeCreatedBy:
       
   481         aInfo.iDataType     = EMTPTypeString;
       
   482         aInfo.iFormFlag     = ENone;
       
   483         aInfo.iGetSet       = EReadWrite;
       
   484         break;
       
   485         
       
   486     case EMTPObjectPropCodeArtist:
       
   487         aInfo.iDataType     = EMTPTypeString;
       
   488         aInfo.iFormFlag     = ENone;
       
   489         aInfo.iGetSet       = EReadWrite;
       
   490         break;
       
   491         
       
   492     case EMTPObjectPropCodeDateAuthored:
       
   493         aInfo.iDataType     = EMTPTypeString;
       
   494         aInfo.iFormFlag     = EDateTimeForm;
       
   495         aInfo.iGetSet       = EReadWrite;
       
   496         break;
       
   497         
       
   498     case EMTPObjectPropCodeDescription:
       
   499         aInfo.iDataType     = EMTPTypeAUINT16;
       
   500         aInfo.iFormFlag     = ELongStringForm;
       
   501         aInfo.iGetSet       = EReadWrite;
       
   502         break;
       
   503         
       
   504     case EMTPObjectPropCodeURLReference:
       
   505         aInfo.iDataType     = EMTPTypeString;
       
   506         aInfo.iFormFlag     = ERegularExpressionForm;
       
   507         aInfo.iGetSet       = EReadWrite;
       
   508         break;
       
   509         
       
   510     case EMTPObjectPropCodeLanguageLocale:
       
   511         aInfo.iDataType     = EMTPTypeString;
       
   512         aInfo.iFormFlag     = ERegularExpressionForm;
       
   513         aInfo.iGetSet       = EReadOnly;
       
   514         break;
       
   515         
       
   516     case EMTPObjectPropCodeCopyrightInformation:
       
   517         aInfo.iDataType     = EMTPTypeAUINT16;
       
   518         aInfo.iFormFlag     = ELongStringForm;
       
   519         aInfo.iGetSet       = EReadWrite;
       
   520         break;
       
   521         
       
   522     case EMTPObjectPropCodeSource:
       
   523         aInfo.iDataType     = EMTPTypeString;
       
   524         aInfo.iFormFlag     = ENone;
       
   525         aInfo.iGetSet       = EReadWrite;
       
   526         break;
       
   527         
       
   528     case EMTPObjectPropCodeOriginLocation:
       
   529         aInfo.iDataType     = EMTPTypeString;
       
   530         aInfo.iFormFlag     = ERegularExpressionForm;
       
   531         aInfo.iGetSet       = EReadWrite;
       
   532         break;
       
   533         
       
   534     case EMTPObjectPropCodeDateAdded:
       
   535         aInfo.iDataType     = EMTPTypeString;
       
   536         aInfo.iFormFlag     = EDateTimeForm;
       
   537         aInfo.iGetSet       = EReadOnly;
       
   538         break;
       
   539         
       
   540     case EMTPObjectPropCodeNonConsumable:
       
   541         aInfo.iDataType     = EMTPTypeUINT8;
       
   542         aInfo.iFormFlag     = EEnumerationForm;
       
   543         aInfo.iGetSet       = EReadWrite;
       
   544         break;
       
   545         
       
   546     case EMTPObjectPropCodeCorruptUnplayable:
       
   547         aInfo.iDataType     = EMTPTypeUINT8;
       
   548         aInfo.iFormFlag     = EEnumerationForm;
       
   549         aInfo.iGetSet       = EReadOnly;
       
   550         break;
       
   551         
       
   552     case EMTPObjectPropCodeProducerSerialNumber:
       
   553         aInfo.iDataType     = EMTPTypeString;
       
   554         aInfo.iFormFlag     = ENone;
       
   555         aInfo.iGetSet       = EReadWrite;
       
   556         break;
       
   557         
       
   558     case EMTPObjectPropCodeRepresentativeSampleFormat:
       
   559         aInfo.iDataType     = EMTPTypeUINT16;
       
   560         aInfo.iFormFlag     = ENone;
       
   561         aInfo.iGetSet       = EReadOnly;
       
   562         break;
       
   563         
       
   564     case EMTPObjectPropCodeRepresentativeSampleSize:
       
   565         aInfo.iDataType     = EMTPTypeUINT16;
       
   566         aInfo.iFormFlag     = EEnumerationForm;
       
   567         aInfo.iGetSet       = EReadWrite;
       
   568         break;
       
   569         
       
   570     case EMTPObjectPropCodeRepresentativeSampleHeight:
       
   571         aInfo.iDataType     = EMTPTypeUINT32;
       
   572         aInfo.iFormFlag     = ERangeForm;
       
   573         aInfo.iGetSet       = EReadWrite;
       
   574         break;
       
   575         
       
   576     case EMTPObjectPropCodeRepresentativeSampleWidth:
       
   577         aInfo.iDataType     = EMTPTypeUINT32;
       
   578         aInfo.iFormFlag     = ERangeForm;
       
   579         aInfo.iGetSet       = EReadWrite;
       
   580         break;
       
   581         
       
   582     case EMTPObjectPropCodeRepresentativeSampleDuration:
       
   583         aInfo.iDataType     = EMTPTypeUINT32;
       
   584         aInfo.iFormFlag     = ERangeForm;
       
   585         aInfo.iGetSet       = EReadWrite;
       
   586         break;
       
   587         
       
   588     case EMTPObjectPropCodeRepresentativeSampleData:
       
   589         aInfo.iDataType     = EMTPTypeAUINT8;
       
   590         aInfo.iFormFlag     = EByteArrayForm;
       
   591         aInfo.iGetSet       = EReadWrite;
       
   592         break;
       
   593         
       
   594     case EMTPObjectPropCodeWidth:
       
   595         aInfo.iDataType     = EMTPTypeUINT32;
       
   596         aInfo.iFormFlag     = ERangeForm;
       
   597         aInfo.iGetSet       = EReadWrite;
       
   598         break;
       
   599         
       
   600     case EMTPObjectPropCodeHeight:
       
   601         aInfo.iDataType     = EMTPTypeUINT32;
       
   602         aInfo.iFormFlag     = ERangeForm;
       
   603         aInfo.iGetSet       = EReadWrite;
       
   604         break;
       
   605         
       
   606     case EMTPObjectPropCodeDuration:
       
   607         aInfo.iDataType     = EMTPTypeUINT32;
       
   608         aInfo.iFormFlag     = ERangeForm;
       
   609         aInfo.iGetSet       = EReadWrite;
       
   610         break;
       
   611         
       
   612     case EMTPObjectPropCodeRating:
       
   613         aInfo.iDataType     = EMTPTypeUINT16;
       
   614         aInfo.iFormFlag     = ERangeForm;
       
   615         aInfo.iGetSet       = EReadWrite;
       
   616         break;
       
   617         
       
   618     case EMTPObjectPropCodeTrack:
       
   619         aInfo.iDataType     = EMTPTypeUINT16;
       
   620         aInfo.iFormFlag     = ENone;
       
   621         aInfo.iGetSet       = EReadWrite;
       
   622         break;
       
   623         
       
   624     case EMTPObjectPropCodeGenre:
       
   625         aInfo.iDataType     = EMTPTypeString;
       
   626         aInfo.iFormFlag     = ENone;
       
   627         aInfo.iGetSet       = EReadWrite;
       
   628         break;
       
   629         
       
   630     case EMTPObjectPropCodeCredits:
       
   631         aInfo.iDataType     = EMTPTypeAUINT16;
       
   632         aInfo.iFormFlag     = ELongStringForm;
       
   633         aInfo.iGetSet       = EReadWrite;
       
   634         break;
       
   635         
       
   636     case EMTPObjectPropCodeLyrics:
       
   637         aInfo.iDataType     = EMTPTypeAUINT16;
       
   638         aInfo.iFormFlag     = ELongStringForm;
       
   639         aInfo.iGetSet       = EReadWrite;
       
   640         break;
       
   641         
       
   642     case EMTPObjectPropCodeSubscriptionContentID:
       
   643         aInfo.iDataType     = EMTPTypeString;
       
   644         aInfo.iFormFlag     = ERegularExpressionForm;
       
   645         aInfo.iGetSet       = EReadWrite;
       
   646         break;
       
   647         
       
   648     case EMTPObjectPropCodeProducedBy:
       
   649         aInfo.iDataType     = EMTPTypeString;
       
   650         aInfo.iFormFlag     = ENone;
       
   651         aInfo.iGetSet       = EReadWrite;
       
   652         break;
       
   653         
       
   654     case EMTPObjectPropCodeUseCount:
       
   655         aInfo.iDataType     = EMTPTypeUINT32;
       
   656         aInfo.iFormFlag     = ENone;
       
   657         aInfo.iGetSet       = EReadWrite;
       
   658         break;
       
   659         
       
   660     case EMTPObjectPropCodeSkipCount:
       
   661         aInfo.iDataType     = EMTPTypeUINT32;
       
   662         aInfo.iFormFlag     = ENone;
       
   663         aInfo.iGetSet       = EReadWrite;
       
   664         break;
       
   665         
       
   666     case EMTPObjectPropCodeLastAccessed:
       
   667         aInfo.iDataType     = EMTPTypeString;
       
   668         aInfo.iFormFlag     = EDateTimeForm;
       
   669         aInfo.iGetSet       = EReadWrite;
       
   670         break;
       
   671         
       
   672     case EMTPObjectPropCodeParentalRating:
       
   673         aInfo.iDataType     = EMTPTypeString;
       
   674         aInfo.iFormFlag     = ENone;
       
   675         aInfo.iGetSet       = EReadWrite;
       
   676         break;
       
   677         
       
   678     case EMTPObjectPropCodeMetaGenre:
       
   679         aInfo.iDataType     = EMTPTypeUINT16;
       
   680         aInfo.iFormFlag     = EEnumerationForm;
       
   681         aInfo.iGetSet       = EReadWrite;
       
   682         break;
       
   683         
       
   684     case EMTPObjectPropCodeComposer:
       
   685         aInfo.iDataType     = EMTPTypeString;
       
   686         aInfo.iFormFlag     = ENone;
       
   687         aInfo.iGetSet       = EReadWrite;
       
   688         break;
       
   689         
       
   690     case EMTPObjectPropCodeEffectiveRating:
       
   691         aInfo.iDataType     = EMTPTypeUINT16;
       
   692         aInfo.iFormFlag     = ENone;
       
   693         aInfo.iGetSet       = EReadWrite;
       
   694         break;
       
   695         
       
   696     case EMTPObjectPropCodeSubtitle:
       
   697         aInfo.iDataType     = EMTPTypeString;
       
   698         aInfo.iFormFlag     = ENone;
       
   699         aInfo.iGetSet       = EReadWrite;
       
   700         break;
       
   701         
       
   702     case EMTPObjectPropCodeOriginalReleaseDate:
       
   703         aInfo.iDataType     = EMTPTypeString;
       
   704         aInfo.iFormFlag     = EDateTimeForm;
       
   705         aInfo.iGetSet       = EReadWrite;
       
   706         break;
       
   707         
       
   708     case EMTPObjectPropCodeAlbumName:
       
   709         aInfo.iDataType     = EMTPTypeString;
       
   710         aInfo.iFormFlag     = ENone;
       
   711         aInfo.iGetSet       = EReadWrite;
       
   712         break;
       
   713         
       
   714     case EMTPObjectPropCodeAlbumArtist:
       
   715         aInfo.iDataType     = EMTPTypeString;
       
   716         aInfo.iFormFlag     = ENone;
       
   717         aInfo.iGetSet       = EReadWrite;
       
   718         break;
       
   719         
       
   720     case EMTPObjectPropCodeMood:
       
   721         aInfo.iDataType     = EMTPTypeString;
       
   722         aInfo.iFormFlag     = EEnumerationForm;
       
   723         aInfo.iGetSet       = EReadWrite;
       
   724         break;
       
   725         
       
   726     case EMTPObjectPropCodeDRMStatus:
       
   727         aInfo.iDataType     = EMTPTypeUINT16;
       
   728         aInfo.iFormFlag     = EEnumerationForm;
       
   729         aInfo.iGetSet       = EReadWrite;
       
   730         break;
       
   731         
       
   732     case EMTPObjectPropCodeSubDescription:
       
   733         aInfo.iDataType     = EMTPTypeAUINT16;
       
   734         aInfo.iFormFlag     = ELongStringForm;
       
   735         aInfo.iGetSet       = EReadWrite;
       
   736         break;
       
   737         
       
   738     case EMTPObjectPropCodeIsCropped:
       
   739         aInfo.iDataType     = EMTPTypeUINT16;
       
   740         aInfo.iFormFlag     = EEnumerationForm;
       
   741         aInfo.iGetSet       = EReadWrite;
       
   742         break;
       
   743         
       
   744     case EMTPObjectPropCodeIsColourCorrected:
       
   745         aInfo.iDataType     = EMTPTypeUINT16;
       
   746         aInfo.iFormFlag     = EEnumerationForm;
       
   747         aInfo.iGetSet       = EReadWrite;
       
   748         break;
       
   749         
       
   750     case EMTPObjectPropCodeImageBitDepth:
       
   751         aInfo.iDataType     = EMTPTypeUINT32;
       
   752         aInfo.iFormFlag     = EEnumerationForm;
       
   753         aInfo.iGetSet       = EReadWrite;
       
   754         break;
       
   755         
       
   756     case EMTPObjectPropCodeFnumber:
       
   757         aInfo.iDataType     = EMTPTypeUINT16;
       
   758         aInfo.iFormFlag     = EEnumerationForm;
       
   759         aInfo.iGetSet       = EReadWrite;
       
   760         break;
       
   761         
       
   762     case EMTPObjectPropCodeExposureTime:
       
   763         aInfo.iDataType     = EMTPTypeUINT32;
       
   764         aInfo.iFormFlag     = EEnumerationForm;
       
   765         aInfo.iGetSet       = EReadWrite;
       
   766         break;
       
   767         
       
   768     case EMTPObjectPropCodeExposureIndex:
       
   769         aInfo.iDataType     = EMTPTypeUINT16;
       
   770         aInfo.iFormFlag     = ERangeForm;
       
   771         aInfo.iGetSet       = EReadWrite;
       
   772         break;
       
   773         
       
   774     case EMTPObjectPropCodeTotalBitRate:
       
   775         aInfo.iDataType     = EMTPTypeUINT32;
       
   776         aInfo.iFormFlag     = ERangeForm;
       
   777         aInfo.iGetSet       = EReadWrite;
       
   778         break;
       
   779         
       
   780     case EMTPObjectPropCodeBitrateType:
       
   781         aInfo.iDataType     = EMTPTypeUINT16;
       
   782         aInfo.iFormFlag     = EEnumerationForm;
       
   783         aInfo.iGetSet       = EReadWrite;
       
   784         break;
       
   785         
       
   786     case EMTPObjectPropCodeSampleRate:
       
   787         aInfo.iDataType     = EMTPTypeUINT32;
       
   788         aInfo.iFormFlag     = ERangeForm;
       
   789         aInfo.iGetSet       = EReadWrite;
       
   790         break;
       
   791         
       
   792     case EMTPObjectPropCodeNumberOfChannels:
       
   793         aInfo.iDataType     = EMTPTypeUINT16;
       
   794         aInfo.iFormFlag     = EEnumerationForm;
       
   795         aInfo.iGetSet       = EReadWrite;
       
   796         break;
       
   797         
       
   798     case EMTPObjectPropCodeAudioBitDepth:
       
   799         aInfo.iDataType     = EMTPTypeUINT32;
       
   800         aInfo.iFormFlag     = EEnumerationForm;
       
   801         aInfo.iGetSet       = EReadWrite;
       
   802         break;
       
   803         
       
   804     case EMTPObjectPropCodeScanType:
       
   805         aInfo.iDataType     = EMTPTypeUINT16;
       
   806         aInfo.iFormFlag     = EEnumerationForm;
       
   807         aInfo.iGetSet       = EReadWrite;
       
   808         break;
       
   809         
       
   810     case EMTPObjectPropCodeAudioWAVECodec:
       
   811         aInfo.iDataType     = EMTPTypeUINT32;
       
   812         aInfo.iFormFlag     = EEnumerationForm;
       
   813         aInfo.iGetSet       = EReadWrite;
       
   814         break;
       
   815         
       
   816     case EMTPObjectPropCodeAudioBitRate:
       
   817         aInfo.iDataType     = EMTPTypeUINT32;
       
   818         aInfo.iFormFlag     = ERangeForm;
       
   819         aInfo.iGetSet       = EReadWrite;
       
   820         break;
       
   821         
       
   822     case EMTPObjectPropCodeVideoFourCCCodec:
       
   823         aInfo.iDataType     = EMTPTypeUINT32;
       
   824         aInfo.iFormFlag     = EEnumerationForm;
       
   825         aInfo.iGetSet       = EReadWrite;
       
   826         break;
       
   827         
       
   828     case EMTPObjectPropCodeVideoBitRate:
       
   829         aInfo.iDataType     = EMTPTypeUINT32;
       
   830         aInfo.iFormFlag     = ERangeForm;
       
   831         aInfo.iGetSet       = EReadWrite;
       
   832         break;
       
   833         
       
   834     case EMTPObjectPropCodeFramesPerThousandSeconds:
       
   835         aInfo.iDataType     = EMTPTypeUINT32;
       
   836         aInfo.iFormFlag     = ERangeForm;
       
   837         aInfo.iGetSet       = EReadWrite;
       
   838         break;
       
   839         
       
   840     case EMTPObjectPropCodeKeyFrameDistance:
       
   841         aInfo.iDataType     = EMTPTypeUINT32;
       
   842         aInfo.iFormFlag     = ERangeForm;
       
   843         aInfo.iGetSet       = EReadWrite;
       
   844         break;
       
   845         
       
   846     case EMTPObjectPropCodeBufferSize:
       
   847         aInfo.iDataType     = EMTPTypeUINT32;
       
   848         aInfo.iFormFlag     = ERangeForm;
       
   849         aInfo.iGetSet       = EReadWrite;
       
   850         break;
       
   851         
       
   852     case EMTPObjectPropCodeEncodingQuality:
       
   853         aInfo.iDataType     = EMTPTypeUINT32;
       
   854         aInfo.iFormFlag     = ERangeForm;
       
   855         aInfo.iGetSet       = EReadWrite;
       
   856         break;
       
   857         
       
   858     case EMTPObjectPropCodeEncodingProfile:
       
   859         aInfo.iDataType     = EMTPTypeString;
       
   860         aInfo.iFormFlag     = EEnumerationForm;
       
   861         aInfo.iGetSet       = EReadWrite;
       
   862         break;
       
   863         
       
   864     case EMTPObjectPropCodeDisplayName:
       
   865         aInfo.iDataType     = EMTPTypeString;
       
   866         aInfo.iFormFlag     = ERegularExpressionForm;
       
   867         aInfo.iGetSet       = EReadWrite;
       
   868         break;
       
   869         
       
   870     case EMTPObjectPropCodeBodyText:
       
   871         aInfo.iDataType     = EMTPTypeAUINT16;
       
   872         aInfo.iFormFlag     = ELongStringForm;
       
   873         aInfo.iGetSet       = EReadWrite;
       
   874         break;
       
   875         
       
   876     case EMTPObjectPropCodeSubject:
       
   877         aInfo.iDataType     = EMTPTypeString;
       
   878         aInfo.iFormFlag     = ENone;
       
   879         aInfo.iGetSet       = EReadWrite;
       
   880         break;
       
   881         
       
   882     case EMTPObjectPropCodePriority:
       
   883         aInfo.iDataType     = EMTPTypeUINT16;
       
   884         aInfo.iFormFlag     = EEnumerationForm;
       
   885         aInfo.iGetSet       = EReadWrite;
       
   886         break;
       
   887         
       
   888     case EMTPObjectPropCodeGivenName:
       
   889         aInfo.iDataType     = EMTPTypeString;
       
   890         aInfo.iFormFlag     = ERegularExpressionForm;
       
   891         aInfo.iGetSet       = EReadWrite;
       
   892         break;
       
   893         
       
   894     case EMTPObjectPropCodeMiddleNames:
       
   895         aInfo.iDataType     = EMTPTypeString;
       
   896         aInfo.iFormFlag     = ERegularExpressionForm;
       
   897         aInfo.iGetSet       = EReadWrite;
       
   898         break;
       
   899         
       
   900     case EMTPObjectPropCodeFamilyName:
       
   901         aInfo.iDataType     = EMTPTypeString;
       
   902         aInfo.iFormFlag     = ERegularExpressionForm;
       
   903         aInfo.iGetSet       = EReadWrite;
       
   904         break;
       
   905         
       
   906     case EMTPObjectPropCodePrefix:
       
   907         aInfo.iDataType     = EMTPTypeString;
       
   908         aInfo.iFormFlag     = EEnumerationForm;
       
   909         aInfo.iGetSet       = EReadWrite;
       
   910         break;
       
   911         
       
   912     case EMTPObjectPropCodeSuffix:
       
   913         aInfo.iDataType     = EMTPTypeString;
       
   914         aInfo.iFormFlag     = EEnumerationForm;
       
   915         aInfo.iGetSet       = EReadWrite;
       
   916         break;
       
   917         
       
   918     case EMTPObjectPropCodePhoneticGivenName:
       
   919         aInfo.iDataType     = EMTPTypeString;
       
   920         aInfo.iFormFlag     = ERegularExpressionForm;
       
   921         aInfo.iGetSet       = EReadWrite;
       
   922         break;
       
   923         
       
   924     case EMTPObjectPropCodePhoneticFamilyName:
       
   925         aInfo.iDataType     = EMTPTypeString;
       
   926         aInfo.iFormFlag     = ERegularExpressionForm;
       
   927         aInfo.iGetSet       = EReadWrite;
       
   928         break;
       
   929         
       
   930     case EMTPObjectPropCodeEmailPrimary:
       
   931         aInfo.iDataType     = EMTPTypeString;
       
   932         aInfo.iFormFlag     = ERegularExpressionForm;
       
   933         aInfo.iGetSet       = EReadWrite;
       
   934         break;
       
   935         
       
   936     case EMTPObjectPropCodeEmailPersonal1:
       
   937         aInfo.iDataType     = EMTPTypeString;
       
   938         aInfo.iFormFlag     = ERegularExpressionForm;
       
   939         aInfo.iGetSet       = EReadWrite;
       
   940         break;
       
   941         
       
   942     case EMTPObjectPropCodeEmailPersonal2:
       
   943         aInfo.iDataType     = EMTPTypeString;
       
   944         aInfo.iFormFlag     = ERegularExpressionForm;
       
   945         aInfo.iGetSet       = EReadWrite;
       
   946         break;
       
   947         
       
   948     case EMTPObjectPropCodeEmailBusiness1:
       
   949         aInfo.iDataType     = EMTPTypeString;
       
   950         aInfo.iFormFlag     = ERegularExpressionForm;
       
   951         aInfo.iGetSet       = EReadWrite;
       
   952         break;
       
   953         
       
   954     case EMTPObjectPropCodeEmailBusiness2:
       
   955         aInfo.iDataType     = EMTPTypeString;
       
   956         aInfo.iFormFlag     = ERegularExpressionForm;
       
   957         aInfo.iGetSet       = EReadWrite;
       
   958         break;
       
   959         
       
   960     case EMTPObjectPropCodeEmailOthers:
       
   961         aInfo.iDataType     = EMTPTypeAINT16;
       
   962         aInfo.iFormFlag     = ELongStringForm;
       
   963         aInfo.iGetSet       = EReadWrite;
       
   964         break;
       
   965         
       
   966     case EMTPObjectPropCodePhoneNumberPrimary:
       
   967         aInfo.iDataType     = EMTPTypeString;
       
   968         aInfo.iFormFlag     = ERegularExpressionForm;
       
   969         aInfo.iGetSet       = EReadWrite;
       
   970         break;
       
   971         
       
   972     case EMTPObjectPropCodePhoneNumberPersonal:
       
   973         aInfo.iDataType     = EMTPTypeString;
       
   974         aInfo.iFormFlag     = ERegularExpressionForm;
       
   975         aInfo.iGetSet       = EReadWrite;
       
   976         break;
       
   977         
       
   978     case EMTPObjectPropCodePhoneNumberPersonal2:
       
   979         aInfo.iDataType     = EMTPTypeString;
       
   980         aInfo.iFormFlag     = ERegularExpressionForm;
       
   981         aInfo.iGetSet       = EReadWrite;
       
   982         break;
       
   983         
       
   984     case EMTPObjectPropCodePhoneNumberBusiness:
       
   985         aInfo.iDataType     = EMTPTypeString;
       
   986         aInfo.iFormFlag     = ERegularExpressionForm;
       
   987         aInfo.iGetSet       = EReadWrite;
       
   988         break;
       
   989         
       
   990     case EMTPObjectPropCodePhoneNumberBusiness2:
       
   991         aInfo.iDataType     = EMTPTypeString;
       
   992         aInfo.iFormFlag     = ERegularExpressionForm;
       
   993         aInfo.iGetSet       = EReadWrite;
       
   994         break;
       
   995         
       
   996     case EMTPObjectPropCodePhoneNumberMobile:
       
   997         aInfo.iDataType     = EMTPTypeString;
       
   998         aInfo.iFormFlag     = ERegularExpressionForm;
       
   999         aInfo.iGetSet       = EReadWrite;
       
  1000         break;
       
  1001         
       
  1002     case EMTPObjectPropCodePhoneNumberMobile2:
       
  1003         aInfo.iDataType     = EMTPTypeString;
       
  1004         aInfo.iFormFlag     = ERegularExpressionForm;
       
  1005         aInfo.iGetSet       = EReadWrite;
       
  1006         break;
       
  1007         
       
  1008     case EMTPObjectPropCodeFaxNumberPrimary:
       
  1009         aInfo.iDataType     = EMTPTypeString;
       
  1010         aInfo.iFormFlag     = ERegularExpressionForm;
       
  1011         aInfo.iGetSet       = EReadWrite;
       
  1012         break;
       
  1013         
       
  1014     case EMTPObjectPropCodeFaxNumberPersonal:
       
  1015         aInfo.iDataType     = EMTPTypeString;
       
  1016         aInfo.iFormFlag     = ERegularExpressionForm;
       
  1017         aInfo.iGetSet       = EReadWrite;
       
  1018         break;
       
  1019         
       
  1020     case EMTPObjectPropCodeFaxNumberBusiness:
       
  1021         aInfo.iDataType     = EMTPTypeString;
       
  1022         aInfo.iFormFlag     = ERegularExpressionForm;
       
  1023         aInfo.iGetSet       = EReadWrite;
       
  1024         break;
       
  1025         
       
  1026     case EMTPObjectPropCodePagerNumber:
       
  1027         aInfo.iDataType     = EMTPTypeString;
       
  1028         aInfo.iFormFlag     = ERegularExpressionForm;
       
  1029         aInfo.iGetSet       = EReadWrite;
       
  1030         break;
       
  1031         
       
  1032     case EMTPObjectPropCodePhoneNumberOthers:
       
  1033         aInfo.iDataType     = EMTPTypeAUINT16;
       
  1034         aInfo.iFormFlag     = ELongStringForm;
       
  1035         aInfo.iGetSet       = EReadWrite;
       
  1036         break;
       
  1037         
       
  1038     case EMTPObjectPropCodePrimaryWebAddress:
       
  1039         aInfo.iDataType     = EMTPTypeString;
       
  1040         aInfo.iFormFlag     = ERegularExpressionForm;
       
  1041         aInfo.iGetSet       = EReadWrite;
       
  1042         break;
       
  1043         
       
  1044     case EMTPObjectPropCodePersonalWebAddress:
       
  1045         aInfo.iDataType     = EMTPTypeString;
       
  1046         aInfo.iFormFlag     = ERegularExpressionForm;
       
  1047         aInfo.iGetSet       = EReadWrite;
       
  1048         break;
       
  1049         
       
  1050     case EMTPObjectPropCodeBusinessWebAddress:
       
  1051         aInfo.iDataType     = EMTPTypeString;
       
  1052         aInfo.iFormFlag     = ERegularExpressionForm;
       
  1053         aInfo.iGetSet       = EReadWrite;
       
  1054         break;
       
  1055         
       
  1056     case EMTPObjectPropCodeInstantMessengerAddress:
       
  1057         aInfo.iDataType     = EMTPTypeString;
       
  1058         aInfo.iFormFlag     = ERegularExpressionForm;
       
  1059         aInfo.iGetSet       = EReadWrite;
       
  1060         break;
       
  1061         
       
  1062     case EMTPObjectPropCodeInstantMessengerAddress2:
       
  1063         aInfo.iDataType     = EMTPTypeString;
       
  1064         aInfo.iFormFlag     = ERegularExpressionForm;
       
  1065         aInfo.iGetSet       = EReadWrite;
       
  1066         break;
       
  1067         
       
  1068     case EMTPObjectPropCodeInstantMessengerAddress3:
       
  1069         aInfo.iDataType     = EMTPTypeString;
       
  1070         aInfo.iFormFlag     = ERegularExpressionForm;
       
  1071         aInfo.iGetSet       = EReadWrite;
       
  1072         break;
       
  1073         
       
  1074     case EMTPObjectPropCodePostalAddressPersonalFull:
       
  1075         aInfo.iDataType     = EMTPTypeAUINT16;
       
  1076         aInfo.iFormFlag     = ELongStringForm;
       
  1077         aInfo.iGetSet       = EReadWrite;
       
  1078         break;
       
  1079         
       
  1080     case EMTPObjectPropCodePostalAddressPersonalLine1:
       
  1081         aInfo.iDataType     = EMTPTypeString;
       
  1082         aInfo.iFormFlag     = ENone;
       
  1083         aInfo.iGetSet       = EReadWrite;
       
  1084         break;
       
  1085         
       
  1086     case EMTPObjectPropCodePostalAddressPersonalLine2:
       
  1087         aInfo.iDataType     = EMTPTypeString;
       
  1088         aInfo.iFormFlag     = ENone;
       
  1089         aInfo.iGetSet       = EReadWrite;
       
  1090         break;
       
  1091         
       
  1092     case EMTPObjectPropCodePostalAddressPersonalCity:
       
  1093         aInfo.iDataType     = EMTPTypeString;
       
  1094         aInfo.iFormFlag     = ENone;
       
  1095         aInfo.iGetSet       = EReadWrite;
       
  1096         break;
       
  1097         
       
  1098     case EMTPObjectPropCodePostalAddressPersonalRegion:
       
  1099         aInfo.iDataType     = EMTPTypeString;
       
  1100         aInfo.iFormFlag     = ENone;
       
  1101         aInfo.iGetSet       = EReadWrite;
       
  1102         break;
       
  1103         
       
  1104     case EMTPObjectPropCodePostalAddressPersonalPostalCode:
       
  1105         aInfo.iDataType     = EMTPTypeString;
       
  1106         aInfo.iFormFlag     = ENone;
       
  1107         aInfo.iGetSet       = EReadWrite;
       
  1108         break;
       
  1109         
       
  1110     case EMTPObjectPropCodePostalAddressPersonalCountry:
       
  1111         aInfo.iDataType     = EMTPTypeString;
       
  1112         aInfo.iFormFlag     = ENone;
       
  1113         aInfo.iGetSet       = EReadWrite;
       
  1114         break;
       
  1115         
       
  1116     case EMTPObjectPropCodePostalAddressBusinessFull:
       
  1117         aInfo.iDataType     = EMTPTypeAUINT16;
       
  1118         aInfo.iFormFlag     = ELongStringForm;
       
  1119         aInfo.iGetSet       = EReadWrite;
       
  1120         break;
       
  1121         
       
  1122     case EMTPObjectPropCodePostalAddressBusinessLine1:
       
  1123         aInfo.iDataType     = EMTPTypeString;
       
  1124         aInfo.iFormFlag     = ENone;
       
  1125         aInfo.iGetSet       = EReadWrite;
       
  1126         break;
       
  1127         
       
  1128     case EMTPObjectPropCodePostalAddressBusinessLine2:
       
  1129         aInfo.iDataType     = EMTPTypeString;
       
  1130         aInfo.iFormFlag     = ENone;
       
  1131         aInfo.iGetSet       = EReadWrite;
       
  1132         break;
       
  1133         
       
  1134     case EMTPObjectPropCodePostalAddressBusinessCity:
       
  1135         aInfo.iDataType     = EMTPTypeString;
       
  1136         aInfo.iFormFlag     = ENone;
       
  1137         aInfo.iGetSet       = EReadWrite;
       
  1138         break;
       
  1139         
       
  1140     case EMTPObjectPropCodePostalAddressBusinessRegion:
       
  1141         aInfo.iDataType     = EMTPTypeString;
       
  1142         aInfo.iFormFlag     = ENone;
       
  1143         aInfo.iGetSet       = EReadWrite;
       
  1144         break;
       
  1145         
       
  1146     case EMTPObjectPropCodePostalAddressBusinessPostalCode:
       
  1147         aInfo.iDataType     = EMTPTypeString;
       
  1148         aInfo.iFormFlag     = ENone;
       
  1149         aInfo.iGetSet       = EReadWrite;
       
  1150         break;
       
  1151         
       
  1152     case EMTPObjectPropCodePostalAddressBusinessCountry:
       
  1153         aInfo.iDataType     = EMTPTypeString;
       
  1154         aInfo.iFormFlag     = ENone;
       
  1155         aInfo.iGetSet       = EReadWrite;
       
  1156         break;
       
  1157         
       
  1158     case EMTPObjectPropCodePostalAddressOtherFull:
       
  1159         aInfo.iDataType     = EMTPTypeAUINT16;
       
  1160         aInfo.iFormFlag     = ELongStringForm;
       
  1161         aInfo.iGetSet       = EReadWrite;
       
  1162         break;
       
  1163         
       
  1164     case EMTPObjectPropCodePostalAddressOtherLine1:
       
  1165         aInfo.iDataType     = EMTPTypeString;
       
  1166         aInfo.iFormFlag     = ENone;
       
  1167         aInfo.iGetSet       = EReadWrite;
       
  1168         break;
       
  1169         
       
  1170     case EMTPObjectPropCodePostalAddressOtherLine2:
       
  1171         aInfo.iDataType     = EMTPTypeString;
       
  1172         aInfo.iFormFlag     = ENone;
       
  1173         aInfo.iGetSet       = EReadWrite;
       
  1174         break;
       
  1175         
       
  1176     case EMTPObjectPropCodePostalAddressOtherCity:
       
  1177         aInfo.iDataType     = EMTPTypeString;
       
  1178         aInfo.iFormFlag     = ENone;
       
  1179         aInfo.iGetSet       = EReadWrite;
       
  1180         break;
       
  1181         
       
  1182     case EMTPObjectPropCodePostalAddressOtherRegion:
       
  1183         aInfo.iDataType     = EMTPTypeString;
       
  1184         aInfo.iFormFlag     = ENone;
       
  1185         aInfo.iGetSet       = EReadWrite;
       
  1186         break;
       
  1187         
       
  1188     case EMTPObjectPropCodePostalAddressOtherPostalCode:
       
  1189         aInfo.iDataType     = EMTPTypeString;
       
  1190         aInfo.iFormFlag     = ENone;
       
  1191         aInfo.iGetSet       = EReadWrite;
       
  1192         break;
       
  1193         
       
  1194     case EMTPObjectPropCodePostalAddressOtherCountry:
       
  1195         aInfo.iDataType     = EMTPTypeString;
       
  1196         aInfo.iFormFlag     = ENone;
       
  1197         aInfo.iGetSet       = EReadWrite;
       
  1198         break;
       
  1199         
       
  1200     case EMTPObjectPropCodeOrganizationName:
       
  1201         aInfo.iDataType     = EMTPTypeString;
       
  1202         aInfo.iFormFlag     = ENone;
       
  1203         aInfo.iGetSet       = EReadWrite;
       
  1204         break;
       
  1205         
       
  1206     case EMTPObjectPropCodePhoneticOrganizationName:
       
  1207         aInfo.iDataType     = EMTPTypeString;
       
  1208         aInfo.iFormFlag     = ENone;
       
  1209         aInfo.iGetSet       = EReadWrite;
       
  1210         break;
       
  1211         
       
  1212     case EMTPObjectPropCodeRole:
       
  1213         aInfo.iDataType     = EMTPTypeString;
       
  1214         aInfo.iFormFlag     = ENone;
       
  1215         aInfo.iGetSet       = EReadWrite;
       
  1216         break;
       
  1217         
       
  1218     case EMTPObjectPropCodeBirthdate:
       
  1219         aInfo.iDataType     = EMTPTypeString;
       
  1220         aInfo.iFormFlag     = EDateTimeForm;
       
  1221         aInfo.iGetSet       = EReadWrite;
       
  1222         break;
       
  1223         
       
  1224     case EMTPObjectPropCodeMessageTo:
       
  1225         aInfo.iDataType     = EMTPTypeAUINT16;
       
  1226         aInfo.iFormFlag     = ELongStringForm;
       
  1227         aInfo.iGetSet       = EReadWrite;
       
  1228         break;
       
  1229         
       
  1230     case EMTPObjectPropCodeMessageCC:
       
  1231         aInfo.iDataType     = EMTPTypeAUINT16;
       
  1232         aInfo.iFormFlag     = ELongStringForm;
       
  1233         aInfo.iGetSet       = EReadWrite;
       
  1234         break;
       
  1235         
       
  1236     case EMTPObjectPropCodeMessageBCC:
       
  1237         aInfo.iDataType     = EMTPTypeAUINT16;
       
  1238         aInfo.iFormFlag     = ELongStringForm;
       
  1239         aInfo.iGetSet       = EReadWrite;
       
  1240         break;
       
  1241         
       
  1242     case EMTPObjectPropCodeMessageRead:
       
  1243         aInfo.iDataType     = EMTPTypeUINT16;
       
  1244         aInfo.iFormFlag     = EEnumerationForm;
       
  1245         aInfo.iGetSet       = EReadWrite;
       
  1246         break;
       
  1247         
       
  1248     case EMTPObjectPropCodeMessageReceivedTime:
       
  1249         aInfo.iDataType     = EMTPTypeString;
       
  1250         aInfo.iFormFlag     = EDateTimeForm;
       
  1251         aInfo.iGetSet       = EReadWrite;
       
  1252         break;
       
  1253         
       
  1254     case EMTPObjectPropCodeMessageSender:
       
  1255         aInfo.iDataType     = EMTPTypeString;
       
  1256         aInfo.iFormFlag     = ENone;
       
  1257         aInfo.iGetSet       = EReadWrite;
       
  1258         break;
       
  1259         
       
  1260     case EMTPObjectPropCodeActivityBeginTime:
       
  1261         aInfo.iDataType     = EMTPTypeString;
       
  1262         aInfo.iFormFlag     = EDateTimeForm;
       
  1263         aInfo.iGetSet       = EReadWrite;
       
  1264         break;
       
  1265         
       
  1266     case EMTPObjectPropCodeActivityEndTime:
       
  1267         aInfo.iDataType     = EMTPTypeString;
       
  1268         aInfo.iFormFlag     = EDateTimeForm;
       
  1269         aInfo.iGetSet       = EReadWrite;
       
  1270         break;
       
  1271         
       
  1272     case EMTPObjectPropCodeActivityLocation:
       
  1273         aInfo.iDataType     = EMTPTypeString;
       
  1274         aInfo.iFormFlag     = ENone;
       
  1275         aInfo.iGetSet       = EReadWrite;
       
  1276         break;
       
  1277         
       
  1278     case EMTPObjectPropCodeActivityRequiredAttendees:
       
  1279         aInfo.iDataType     = EMTPTypeAUINT16;
       
  1280         aInfo.iFormFlag     = ELongStringForm;
       
  1281         aInfo.iGetSet       = EReadWrite;
       
  1282         break;
       
  1283         
       
  1284     case EMTPObjectPropCodeActivityOptionalAttendees:
       
  1285         aInfo.iDataType     = EMTPTypeAUINT16;
       
  1286         aInfo.iFormFlag     = ELongStringForm;
       
  1287         aInfo.iGetSet       = EReadWrite;
       
  1288         break;
       
  1289         
       
  1290     case EMTPObjectPropCodeActivityResources:
       
  1291         aInfo.iDataType     = EMTPTypeAUINT16;
       
  1292         aInfo.iFormFlag     = ELongStringForm;
       
  1293         aInfo.iGetSet       = EReadWrite;
       
  1294         break;
       
  1295         
       
  1296     case EMTPObjectPropCodeActivityAccepted:
       
  1297         aInfo.iDataType     = EMTPTypeAUINT16;
       
  1298         aInfo.iFormFlag     = ELongStringForm;
       
  1299         aInfo.iGetSet       = EReadWrite;
       
  1300         break;	
       
  1301         
       
  1302     case EMTPObjectPropCodeActivityTentative:
       
  1303         aInfo.iDataType     = EMTPTypeAUINT16;
       
  1304         aInfo.iFormFlag     = ELongStringForm;
       
  1305         aInfo.iGetSet       = EReadWrite;
       
  1306         break;
       
  1307         
       
  1308     case EMTPObjectPropCodeActivityDeclined:
       
  1309         aInfo.iDataType     = EMTPTypeAUINT16;
       
  1310         aInfo.iFormFlag     = ELongStringForm;
       
  1311         aInfo.iGetSet       = EReadWrite;
       
  1312         break;
       
  1313         
       
  1314     case EMTPObjectPropCodeActivityReminderTime:
       
  1315         aInfo.iDataType     = EMTPTypeString;
       
  1316         aInfo.iFormFlag     = EDateTimeForm;
       
  1317         aInfo.iGetSet       = EReadWrite;
       
  1318         break;
       
  1319         
       
  1320     case EMTPObjectPropCodeActivityOwner:
       
  1321         aInfo.iDataType     = EMTPTypeString;
       
  1322         aInfo.iFormFlag     = ENone;
       
  1323         aInfo.iGetSet       = EReadWrite;
       
  1324         break;
       
  1325         
       
  1326     case EMTPObjectPropCodeActivityStatus:
       
  1327         aInfo.iDataType     = EMTPTypeString;
       
  1328         aInfo.iFormFlag     = ENone;
       
  1329         aInfo.iGetSet       = EReadWrite;
       
  1330         break;
       
  1331         
       
  1332     default:
       
  1333         if( aPropertyCode <= EMTPCodeUndefined1End )
       
  1334             {
       
  1335             aInfo.iDataType     = EMTPTypeUndefined;
       
  1336             aInfo.iFormFlag     = ENone;
       
  1337             aInfo.iGetSet       = EReadOnly;
       
  1338             }
       
  1339         else
       
  1340             {
       
  1341             User::Leave(KErrNotSupported);
       
  1342             }
       
  1343         break;
       
  1344         }
       
  1345     }
       
  1346     
       
  1347 const CMTPTypeCompoundBase::TElementInfo& CMTPTypeObjectPropDesc::ElementInfo(TInt aElementId) const
       
  1348     {
       
  1349     return iElementInfo[aElementId];
       
  1350     }
       
  1351     
       
  1352 TBool CMTPTypeObjectPropDesc::ReadableElementL(TInt aElementId) const
       
  1353     {
       
  1354     TBool ret(ETrue);
       
  1355     if (aElementId == EForm)
       
  1356         {
       
  1357         ret = HasFormField(Uint8L(EFormFlag));
       
  1358         }
       
  1359     return ret;
       
  1360     }
       
  1361     
       
  1362 TBool CMTPTypeObjectPropDesc::WriteableElementL(TInt aElementId) const
       
  1363     {
       
  1364     TBool ret(EFalse);
       
  1365 
       
  1366     if (!iInitialised)
       
  1367         {
       
  1368         ret = ETrue;    
       
  1369         }
       
  1370     else
       
  1371         {
       
  1372         switch (aElementId)
       
  1373             {
       
  1374         case EDefaultValue:
       
  1375         case EGroupCode:
       
  1376             ret = ETrue;
       
  1377             break;
       
  1378 
       
  1379         default:
       
  1380             break;
       
  1381             }   
       
  1382         }
       
  1383         
       
  1384     return ret;
       
  1385     }
       
  1386 
       
  1387 /*
       
  1388 MTP ObjectPropDesc dataset "pre-production" factory method for datasets
       
  1389 which will be populated from an MTP write data stream. This method is used to 
       
  1390 create a partially constructed MTP ObjectPropDesc element dataset type prior to
       
  1391 the construction characteristics being known. Construction of the element 
       
  1392 dataset is completed on-the-fly as it is written to from an MTP write data 
       
  1393 stream. A pointer to the data type is placed on the cleanup stack.
       
  1394 @return A pointer to the ObjectPropList element dataset type. 
       
  1395 Ownership IS transfered.
       
  1396 @leave One of the system wide error codes, if unsuccessful.
       
  1397 */
       
  1398 CMTPTypeObjectPropDesc* CMTPTypeObjectPropDesc::NewLC()
       
  1399     {
       
  1400     CMTPTypeObjectPropDesc* self = new(ELeave) CMTPTypeObjectPropDesc();
       
  1401     CleanupStack::PushL(self);
       
  1402     self->ConstructL(EMTPObjectPropCodeUndefined, NULL); 
       
  1403     return self;
       
  1404     }
       
  1405 
       
  1406 CMTPTypeObjectPropDesc::CMTPTypeObjectPropDesc() :
       
  1407     CMTPTypeCompoundBase(KJustInTimeConstruction, KNumChunksWithoutForm),
       
  1408     iElementInfo(iElementMetaData, ENumElements),
       
  1409     iChunkFlat1(KFlat1ChunkSize, *this),
       
  1410     iChunkFlat2(KFlat2ChunkSize, *this)
       
  1411     {
       
  1412     
       
  1413     }
       
  1414     
       
  1415 void CMTPTypeObjectPropDesc::ConstructL(TUint16 aPropertyCode, const MMTPType* aForm)
       
  1416     { 
       
  1417     TPropertyInfo info;
       
  1418     PropertyInfoL(aPropertyCode, info);
       
  1419     ConstructL(aPropertyCode, info, aForm);
       
  1420     }
       
  1421     
       
  1422 void CMTPTypeObjectPropDesc::ConstructL(TUint16 aPropertyCode, const TPropertyInfo& aInfo, const MMTPType* aForm)
       
  1423     {    
       
  1424     // Construct the ObjectPropDesc chunk sequence.
       
  1425     for (TUint i(0); (i < ENumElements); i++)
       
  1426         {
       
  1427         const TElementInfo& element(iElementInfo[i]);
       
  1428         if (ChunkCount() <= element.iChunkId)
       
  1429             {
       
  1430             MMTPType* chunk(NULL);
       
  1431             switch (element.iChunkId)
       
  1432                 {
       
  1433             case EIdFlat1Chunk:
       
  1434                 iChunkFlat1.OpenL();
       
  1435                 chunk = &iChunkFlat1;
       
  1436                 break;
       
  1437                 
       
  1438             case EIdDefaultValueChunk:
       
  1439                 if (aInfo.iDataType != EMTPTypeUndefined)
       
  1440                     {
       
  1441                     iChunkDefaultValue.OpenL(aInfo.iDataType);
       
  1442                     }
       
  1443                 chunk = &iChunkDefaultValue;
       
  1444                 break;
       
  1445                 
       
  1446             case EIdFlat2Chunk:
       
  1447                 iChunkFlat2.OpenL();
       
  1448                 chunk = &iChunkFlat2;
       
  1449                 break;
       
  1450                 
       
  1451             case EIdFormChunk:
       
  1452                 iChunkForm.SetMeta(aInfo.iFormFlag, aInfo.iDataType);
       
  1453                 if (HasFormField(aInfo.iFormFlag))
       
  1454                     {
       
  1455                     iChunkForm.OpenL(element.iType);
       
  1456                     chunk = &iChunkForm;
       
  1457                     }
       
  1458                 break;
       
  1459                 
       
  1460             default:
       
  1461                 Panic(EMTPTypeBoundsError);
       
  1462                 break;
       
  1463                 }
       
  1464                     
       
  1465             // Some chunks (i.e. FORM) are optional.
       
  1466             if (chunk)
       
  1467                 {
       
  1468                 ChunkAppendL(*chunk);   
       
  1469                 }
       
  1470             }
       
  1471         }
       
  1472         
       
  1473     // Set the construction values.
       
  1474     SetUint16L(EPropertyCode, aPropertyCode);
       
  1475     SetUint16L(EDatatype, aInfo.iDataType);
       
  1476     SetUint8L(EGetSet, aInfo.iGetSet);
       
  1477     SetUint8L(EFormFlag, aInfo.iFormFlag);
       
  1478     
       
  1479     if (aForm)
       
  1480         {
       
  1481         if (!HasFormField(aInfo.iFormFlag))
       
  1482             { 
       
  1483             User::Leave(KMTPDataTypeInvalid);
       
  1484             } 
       
  1485         else
       
  1486             {
       
  1487             SetL(EForm, *aForm); 
       
  1488             }
       
  1489         }
       
  1490     
       
  1491     iInitialised = ETrue;
       
  1492     }    
       
  1493     
       
  1494 TBool CMTPTypeObjectPropDesc::HasFormField(TUint8 aFormFlag) const
       
  1495     {
       
  1496     return ((aFormFlag != EDateTimeForm) && (aFormFlag != ENone) && (aFormFlag != EObjectIDForm) );
       
  1497     }
       
  1498     
       
  1499 TInt CMTPTypeObjectPropDesc::UpdateWriteSequenceErr(TInt aErr)
       
  1500     {
       
  1501     iWriteSequenceErr = aErr;
       
  1502     return iWriteSequenceErr;        
       
  1503     }
       
  1504     
       
  1505 CMTPTypeObjectPropDesc::RMTPTypeObjectPropDescForm::RMTPTypeObjectPropDescForm() : 
       
  1506     RMTPType()
       
  1507     {
       
  1508 
       
  1509     }
       
  1510 
       
  1511 void CMTPTypeObjectPropDesc::RMTPTypeObjectPropDescForm::SetMeta(TUint8 aFormFlag, TUint aDataType)
       
  1512     {
       
  1513     iFormFlag = aFormFlag;
       
  1514     iDataType = aDataType;
       
  1515     }
       
  1516 
       
  1517 MMTPType* CMTPTypeObjectPropDesc::RMTPTypeObjectPropDescForm::CreateL(TUint aDataType)
       
  1518     {
       
  1519     if (aDataType != EMTPTypeReference)
       
  1520         {
       
  1521         User::Leave(KMTPDataTypeInvalid);
       
  1522         }
       
  1523         
       
  1524     MMTPType* type(NULL);
       
  1525     switch (iFormFlag)
       
  1526         {
       
  1527     case ERangeForm:
       
  1528         type = CMTPTypeObjectPropDescRangeForm::NewL(iDataType);
       
  1529         break;
       
  1530         
       
  1531     case EEnumerationForm:
       
  1532         type = CMTPTypeObjectPropDescEnumerationForm::NewL(iDataType);
       
  1533         break;
       
  1534         
       
  1535     case EFixedLengthArrayForm:
       
  1536         type = RMTPType::CreateL(EMTPTypeUINT32);
       
  1537         break;
       
  1538         
       
  1539     case ERegularExpressionForm:
       
  1540         type = RMTPType::CreateL(EMTPTypeString);
       
  1541         break;
       
  1542         
       
  1543     case EByteArrayForm:
       
  1544     case ELongStringForm:
       
  1545         type = RMTPType::CreateL(EMTPTypeUINT32);
       
  1546         break;
       
  1547     case EServiceObjPropExtnForm:
       
  1548         {
       
  1549         type = CMTPTypeServiceObjPropExtnForm::NewL(iDataType);
       
  1550         }
       
  1551         break;
       
  1552     case EServiceMethodParamExtnForm:
       
  1553         {
       
  1554         type = CMTPTypeServiceMethodParamExtnForm::NewL(iDataType);
       
  1555         }
       
  1556         break;
       
  1557         
       
  1558     case EDateTimeForm:
       
  1559     default:
       
  1560         // Invalid Form Flag.
       
  1561         User::Leave(KErrNotSupported);
       
  1562         break;
       
  1563         }
       
  1564         
       
  1565     return type;
       
  1566     }
       
  1567 
       
  1568 void CMTPTypeObjectPropDesc::RMTPTypeObjectPropDescForm::Destroy(MMTPType* aType)
       
  1569     {
       
  1570     switch (iFormFlag)
       
  1571         {
       
  1572     case ERangeForm:
       
  1573         delete static_cast<CMTPTypeObjectPropDescRangeForm*>(aType);
       
  1574         break;
       
  1575         
       
  1576     case EEnumerationForm:
       
  1577         delete static_cast<CMTPTypeObjectPropDescEnumerationForm*>(aType);
       
  1578         break;
       
  1579         
       
  1580     case EServiceObjPropExtnForm:
       
  1581         delete static_cast<CMTPTypeServiceObjPropExtnForm*>(aType);
       
  1582         break;
       
  1583         
       
  1584     case EServiceMethodParamExtnForm:
       
  1585         delete static_cast<CMTPTypeServiceMethodParamExtnForm*>(aType);
       
  1586         break;
       
  1587         
       
  1588     default:
       
  1589         // All other FORM types are managed by the base class.
       
  1590         RMTPType::Destroy(aType);
       
  1591         break;
       
  1592         }
       
  1593     }
       
  1594 
       
  1595 /**
       
  1596 MTP ObjectPropDesc Enumeration FORM dataset factory method. This method is used to 
       
  1597 create an empty MTP ObjectPropDesc FORM dataset of the specified Datatype. 
       
  1598 @param aDataType The data type identifier datacode of the dataset.
       
  1599 @return A pointer to the MTP ObjectPropDesc dataset type. Ownership IS 
       
  1600 transfered.
       
  1601 @leave One of the system wide error codes, if unsuccessful.
       
  1602 */     
       
  1603 EXPORT_C CMTPTypeObjectPropDescEnumerationForm* CMTPTypeObjectPropDescEnumerationForm::NewL(TUint aDataType)
       
  1604     {
       
  1605     CMTPTypeObjectPropDescEnumerationForm* self = CMTPTypeObjectPropDescEnumerationForm::NewLC(aDataType);
       
  1606     CleanupStack::Pop(self);
       
  1607     return self;   
       
  1608     }
       
  1609 
       
  1610 /**
       
  1611 MTP ObjectPropDesc Enumeration FORM dataset factory method. This method is used to 
       
  1612 create an empty MTP ObjectPropDesc FORM dataset of the specified Datatype. A 
       
  1613 pointer to the data type is placed on the cleanup stack.
       
  1614 @param aDataType The data type identifier datacode of the dataset.
       
  1615 @return A pointer to the MTP ObjectPropDesc dataset type. Ownership IS 
       
  1616 transfered.
       
  1617 @leave One of the system wide error codes, if unsuccessful.
       
  1618 */   
       
  1619 EXPORT_C CMTPTypeObjectPropDescEnumerationForm* CMTPTypeObjectPropDescEnumerationForm::NewLC(TUint aDataType)
       
  1620     {
       
  1621     CMTPTypeObjectPropDescEnumerationForm* self = new(ELeave) CMTPTypeObjectPropDescEnumerationForm(aDataType);
       
  1622     CleanupStack::PushL(self);
       
  1623     self->ConstructL();
       
  1624     return self;
       
  1625     }
       
  1626 
       
  1627 /**
       
  1628 Destructor.
       
  1629 */
       
  1630 EXPORT_C CMTPTypeObjectPropDescEnumerationForm::~CMTPTypeObjectPropDescEnumerationForm()
       
  1631     {
       
  1632     TInt count(iChunksValue.Count());
       
  1633     while (count--)
       
  1634         {
       
  1635         iChunksValue[count].Close();
       
  1636         }
       
  1637     iChunksValue.Close();
       
  1638     }
       
  1639 
       
  1640 /**
       
  1641 Appends the specified value to the set of supported enumeration values.
       
  1642 @param aValue The enumeration value to append.
       
  1643 @leave One of the system wide error codes, if unsuccessful.
       
  1644 @panic MTPDataTypes 3, if the source value type does not match the property 
       
  1645 data type.
       
  1646 */
       
  1647 EXPORT_C void CMTPTypeObjectPropDescEnumerationForm::AppendSupportedValueL(const MMTPType& aValue)
       
  1648     {
       
  1649     __ASSERT_ALWAYS(aValue.Type() == iInfoValue.iType, Panic(EMTPTypeIdMismatch));
       
  1650     
       
  1651     // Increment NumberOfValues.
       
  1652     const TUint index(iChunkNumberOfValues.Value());
       
  1653     iChunkNumberOfValues.Set(index + 1);
       
  1654     
       
  1655     // Create and populate the SupportedValue chunk.
       
  1656     AppendValueChunkL();
       
  1657     SetL((KValueChunks + index), aValue);
       
  1658     }
       
  1659 
       
  1660 /**
       
  1661 Provides the NumberOfValues element value.
       
  1662 */
       
  1663 EXPORT_C TUint16 CMTPTypeObjectPropDescEnumerationForm::NumberOfValues() const
       
  1664     {
       
  1665     return iChunkNumberOfValues.Value();
       
  1666     }
       
  1667 
       
  1668 /**
       
  1669 Provides the SupportedValue element at the specified index.
       
  1670 @param aIndex The index of the required value.
       
  1671 @param aValue On successful completion, the requested value.
       
  1672 @leave One of the system wide error codes, if unsuccessful.
       
  1673 @panic MTPDataTypes 3, if the target value type does not match the property 
       
  1674 data type.
       
  1675 */
       
  1676 EXPORT_C void CMTPTypeObjectPropDescEnumerationForm::SupportedValueL(TUint aIndex, MMTPType& aValue) const
       
  1677     {
       
  1678     __ASSERT_ALWAYS(aValue.Type() == iInfoValue.iType, Panic(EMTPTypeIdMismatch));
       
  1679     GetL((KValueChunks + aIndex), aValue);
       
  1680     }
       
  1681     
       
  1682 EXPORT_C TInt CMTPTypeObjectPropDescEnumerationForm::FirstWriteChunk(TPtr8& aChunk)
       
  1683     {
       
  1684     /* 
       
  1685     Reset the type in preparation for the data stream, by deleting all
       
  1686     except the first chunk.
       
  1687     */
       
  1688     for (TUint i(ChunkCount() - 1); (i >= (KNumberOfValuesChunk + 1)); i--)
       
  1689         {
       
  1690         ChunkRemove(i);
       
  1691         }
       
  1692     iChunksValue.Close();
       
  1693     
       
  1694     // Setup the write chunk pointer.
       
  1695     TInt err(CMTPTypeCompoundBase::FirstWriteChunk(aChunk));
       
  1696     switch (err)
       
  1697         {
       
  1698     case KMTPChunkSequenceCompletion:
       
  1699         err = KErrNone;
       
  1700         // Don't break, fall through to set the write sequence state.
       
  1701         
       
  1702     case KErrNone:
       
  1703         // Set the write sequence state.
       
  1704         iWriteSequenceState = EInProgress;
       
  1705         break;
       
  1706         
       
  1707     default:
       
  1708         break;
       
  1709         }
       
  1710         
       
  1711     return  err;
       
  1712     }
       
  1713     
       
  1714 EXPORT_C TInt CMTPTypeObjectPropDescEnumerationForm::NextWriteChunk(TPtr8& aChunk)
       
  1715     {
       
  1716     TInt err(CMTPTypeCompoundBase::NextWriteChunk(aChunk));
       
  1717     if ((err == KMTPChunkSequenceCompletion) &&
       
  1718         (iChunksValue.Count() < iChunkNumberOfValues.Value()))
       
  1719         {
       
  1720         err = KErrNone; 
       
  1721         }
       
  1722     return err;
       
  1723     }
       
  1724  
       
  1725 EXPORT_C TUint CMTPTypeObjectPropDescEnumerationForm::Type() const
       
  1726     {
       
  1727     return EMTPTypeObjectPropDescEnumerationFormDataset;
       
  1728     }
       
  1729     
       
  1730 EXPORT_C TBool CMTPTypeObjectPropDescEnumerationForm::CommitRequired() const
       
  1731     {
       
  1732     return ETrue;
       
  1733     }
       
  1734 
       
  1735 EXPORT_C MMTPType* CMTPTypeObjectPropDescEnumerationForm::CommitChunkL(TPtr8& aChunk)
       
  1736     {
       
  1737     switch (iWriteSequenceState)
       
  1738         {
       
  1739     case EInProgress:
       
  1740         if (iChunksValue.Count() < iChunkNumberOfValues.Value())
       
  1741             {
       
  1742             AppendValueChunkL(); 
       
  1743             }
       
  1744         else
       
  1745             {
       
  1746             iWriteSequenceState = EIdle;
       
  1747             }
       
  1748         break;
       
  1749         
       
  1750     case EIdle:
       
  1751         // Completing the last element in the write sequence.
       
  1752         break;
       
  1753         
       
  1754     default:
       
  1755         Panic(EMTPTypeBadStorage);
       
  1756         break;
       
  1757         }
       
  1758         
       
  1759     if (CMTPTypeCompoundBase::CommitRequired())
       
  1760         {
       
  1761         CMTPTypeCompoundBase::CommitChunkL(aChunk);
       
  1762         }     
       
  1763     return NULL;
       
  1764     }
       
  1765  
       
  1766 const CMTPTypeCompoundBase::TElementInfo& CMTPTypeObjectPropDescEnumerationForm::ElementInfo(TInt aElementId) const
       
  1767     {
       
  1768     if (aElementId == KNumberOfValuesChunk)
       
  1769         {
       
  1770         return iInfoNumberOfValues;
       
  1771         }
       
  1772     else
       
  1773         {
       
  1774         __ASSERT_ALWAYS(((aElementId - KValueChunks) < iChunkNumberOfValues.Value()), Panic(EMTPTypeBoundsError));
       
  1775         iInfoValue.iChunkId = aElementId;
       
  1776         return iInfoValue; 
       
  1777         }
       
  1778     }
       
  1779 
       
  1780 TInt CMTPTypeObjectPropDescEnumerationForm::ValidateChunkCount() const
       
  1781     {
       
  1782     TInt ret(KErrNone);
       
  1783     if (NumberOfValues() != (ChunkCount() - 1))
       
  1784         {
       
  1785         ret = KMTPDataTypeInvalid;
       
  1786         }
       
  1787     return ret;
       
  1788     }
       
  1789 
       
  1790 CMTPTypeObjectPropDescEnumerationForm::CMTPTypeObjectPropDescEnumerationForm(TUint aDataType) :
       
  1791     CMTPTypeCompoundBase(KJustInTimeConstruction, KVariableChunkCount)
       
  1792     {
       
  1793     const CMTPTypeCompoundBase::TElementInfo KDefaultInfo = {0, EMTPTypeUndefined, {EMTPTypeUndefined, KMTPNotApplicable,  KMTPNotApplicable}};
       
  1794     iInfoNumberOfValues         = KDefaultInfo; 
       
  1795     iInfoNumberOfValues.iType   = EMTPTypeUINT16;
       
  1796     iInfoValue                  = KDefaultInfo; 
       
  1797     iInfoValue.iType            = aDataType;
       
  1798     }
       
  1799 
       
  1800 void CMTPTypeObjectPropDescEnumerationForm::ConstructL()
       
  1801     {
       
  1802     ChunkAppendL(iChunkNumberOfValues);
       
  1803     }
       
  1804     
       
  1805 void CMTPTypeObjectPropDescEnumerationForm::AppendValueChunkL()
       
  1806     {
       
  1807     iChunksValue.AppendL(RMTPType());
       
  1808     
       
  1809     RMTPType& chunk(iChunksValue[iChunksValue.Count() - 1]);
       
  1810     chunk.OpenL(iInfoValue.iType);
       
  1811     ChunkAppendL(chunk);
       
  1812     }
       
  1813 
       
  1814 /**
       
  1815 MTP ObjectPropDesc Range FORM dataset factory method. This method is used to 
       
  1816 create an empty MTP ObjectPropDesc FORM dataset of the specified Datatype. 
       
  1817 @param aDataType The data type identifier datacode of the dataset.
       
  1818 @return A pointer to the MTP ObjectPropDesc dataset type. Ownership IS 
       
  1819 transfered.
       
  1820 @leave One of the system wide error codes, if unsuccessful.
       
  1821 */   
       
  1822 EXPORT_C CMTPTypeObjectPropDescRangeForm* CMTPTypeObjectPropDescRangeForm::NewL(TUint aDataType)
       
  1823     {
       
  1824     CMTPTypeObjectPropDescRangeForm* self = CMTPTypeObjectPropDescRangeForm::NewLC(aDataType);
       
  1825     CleanupStack::Pop(self); 
       
  1826     return self;
       
  1827     }
       
  1828 
       
  1829 /**
       
  1830 MTP ObjectPropDesc Range FORM dataset factory method. This method is used to 
       
  1831 create an empty MTP ObjectPropDesc FORM dataset of the specified Datatype. A 
       
  1832 pointer to the data type is placed on the cleanup stack.
       
  1833 @param aDataType The data type identifier datacode of the dataset.
       
  1834 @return A pointer to the MTP ObjectPropDesc dataset type. Ownership IS 
       
  1835 transfered.
       
  1836 @leave One of the system wide error codes, if unsuccessful.
       
  1837 */   
       
  1838 EXPORT_C CMTPTypeObjectPropDescRangeForm* CMTPTypeObjectPropDescRangeForm::NewLC(TUint aDataType)
       
  1839     {
       
  1840     CMTPTypeObjectPropDescRangeForm* self = new(ELeave) CMTPTypeObjectPropDescRangeForm(aDataType);
       
  1841     CleanupStack::PushL(self);
       
  1842     self->ConstructL();
       
  1843     return self;
       
  1844     }
       
  1845 
       
  1846 /**
       
  1847 Destructor.
       
  1848 */
       
  1849 EXPORT_C CMTPTypeObjectPropDescRangeForm::~CMTPTypeObjectPropDescRangeForm()
       
  1850     {
       
  1851     TInt count(iChunks.Count());
       
  1852     while (count--)
       
  1853     	{
       
  1854     	iChunks[count].Close();    	
       
  1855     	}
       
  1856     iChunks.Close();
       
  1857     }
       
  1858 
       
  1859 EXPORT_C TUint CMTPTypeObjectPropDescRangeForm::Type() const
       
  1860     {
       
  1861     return EMTPTypeObjectPropDescRangeFormDataset;
       
  1862     } 
       
  1863 
       
  1864 const CMTPTypeCompoundBase::TElementInfo& CMTPTypeObjectPropDescRangeForm::ElementInfo(TInt aElementId) const
       
  1865     {
       
  1866     __ASSERT_ALWAYS((aElementId < ENumElements), Panic(EMTPTypeBoundsError));
       
  1867     iInfoBuf.iChunkId = aElementId;
       
  1868     return iInfoBuf;    
       
  1869     }
       
  1870 
       
  1871 CMTPTypeObjectPropDescRangeForm::CMTPTypeObjectPropDescRangeForm(TUint aDataType) : 
       
  1872     CMTPTypeCompoundBase((!KJustInTimeConstruction), ENumElements), 
       
  1873     iDataType(aDataType)
       
  1874     {
       
  1875     const CMTPTypeCompoundBase::TElementInfo KDefaultInfo = {0, EMTPTypeReference, {EMTPTypeUndefined, KMTPNotApplicable,  KMTPNotApplicable}};
       
  1876     iInfoBuf = KDefaultInfo;
       
  1877     }
       
  1878 
       
  1879 void CMTPTypeObjectPropDescRangeForm::ConstructL()
       
  1880     {
       
  1881     for (TUint i(0); (i < ENumElements); i++)   
       
  1882         {
       
  1883         iChunks.AppendL(RMTPType());
       
  1884         iChunks[i].OpenL(iDataType);
       
  1885         ChunkAppendL(iChunks[i]);
       
  1886         }
       
  1887     }