mtpfws/mtpfw/datatypes/interface/cmtptypeserviceobjpropextnform.h
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 @released
       
    20 */
       
    21 
       
    22 #ifndef CMTPTYPESERVICEOBJPROPEXTNFORM_H_
       
    23 #define CMTPTYPESERVICEOBJPROPEXTNFORM_H_
       
    24 
       
    25 
       
    26 #include <e32std.h>
       
    27 #include <mtp/rmtptype.h>
       
    28 #include <mtp/cmtptypecompoundbase.h>
       
    29 #include <mtp/cmtptypeobjectpropdesc.h>
       
    30 
       
    31 
       
    32 class CMTPTypeString;
       
    33 
       
    34 /** 
       
    35 Defines the MTP ObjectPropDesc Service Object Property Extension FORM dataset. The dataset is a 
       
    36 component element of the ObjectPropDesc dataset.
       
    37 @see CMTPTypeObjectPropDesc
       
    38 @publishedPartner
       
    39 @released
       
    40 */ 
       
    41 class CMTPTypeServiceObjPropExtnForm : public CMTPTypeCompoundBase
       
    42     {
       
    43 public:
       
    44 
       
    45     /**
       
    46     MTP ObjectPropDesc Service Object Property Extension FORM element dataset identifiers.
       
    47     */
       
    48     enum TMTPObjectPropDescElement
       
    49         {
       
    50         /**
       
    51         Object Property PKeyNamespace.
       
    52         */
       
    53         EPKeyNamespace,
       
    54         
       
    55         /**
       
    56         Object Property PKeyID
       
    57         */
       
    58         EPKeyID,
       
    59         
       
    60         /**
       
    61         PropertyName
       
    62         */
       
    63         EPropertyName,
       
    64         
       
    65         /**
       
    66         Form Flag .
       
    67         */
       
    68         EFormFlag,
       
    69         
       
    70         /**
       
    71         FORM element. This element depends EFormFlag and is absent if EFormFlag 
       
    72         is ENone.
       
    73         */
       
    74         EForm,         
       
    75 
       
    76         /**
       
    77         The number of dataset elements.
       
    78         */
       
    79         ENumElements,
       
    80         };
       
    81     
       
    82 public:
       
    83     IMPORT_C static CMTPTypeServiceObjPropExtnForm* NewL( const TUint aDataType );
       
    84     IMPORT_C static CMTPTypeServiceObjPropExtnForm* NewLC( const TUint aDataType );
       
    85     IMPORT_C static CMTPTypeServiceObjPropExtnForm* NewL( const TUint aDataType, const TMTPTypeGuid  aPKNamespace, const TUint aPKID, const TDesC& aName, const TUint8 aFormFlag, const MMTPType* aForm);
       
    86     IMPORT_C static CMTPTypeServiceObjPropExtnForm* NewLC( const TUint aDataType, const TMTPTypeGuid  aPKNamespace, const TUint aPKID, const TDesC& aName, const TUint8 aFormFlag, const MMTPType* aForm);
       
    87     
       
    88     IMPORT_C virtual ~CMTPTypeServiceObjPropExtnForm();  
       
    89      
       
    90 public: // From CMTPTypeCompoundBase
       
    91 
       
    92     IMPORT_C TInt FirstWriteChunk(TPtr8& aChunk);
       
    93     IMPORT_C TInt NextWriteChunk(TPtr8& aChunk);
       
    94     IMPORT_C TUint Type() const;
       
    95     IMPORT_C TBool CommitRequired() const;
       
    96     IMPORT_C MMTPType* CommitChunkL(TPtr8& aChunk);
       
    97     
       
    98 private: // From CMTPTypeCompoundBase
       
    99     
       
   100     const TElementInfo& ElementInfo(TInt aElementId) const;
       
   101     
       
   102     
       
   103 private:
       
   104 
       
   105     CMTPTypeServiceObjPropExtnForm( const TUint aDataType );
       
   106 
       
   107     void ConstructL( const TMTPTypeGuid  aPKNamespace, const TUint aPKID, const TDesC& aName, const TUint8 aFormFlag, const MMTPType* aForm );
       
   108     
       
   109     TBool HasFormField(TUint8 aFormFlag) const;
       
   110     TInt UpdateWriteSequenceErr(TInt aErr);
       
   111     TBool ReadableElementL(TInt aElementId) const;
       
   112     TBool WriteableElementL(TInt aElementId) const;
       
   113 private:
       
   114 
       
   115     /**
       
   116     The write data stream states.
       
   117     */
       
   118     enum TWriteSequenceState
       
   119       {
       
   120       /**
       
   121       Data stream is inactive.
       
   122       */
       
   123       EIdle,
       
   124       
       
   125       /**
       
   126       Streaming the first flat data chunk.
       
   127       */
       
   128       EFlat1Chunk,
       
   129       
       
   130       /**
       
   131       Streaming the EDefaultValue data chunk..
       
   132       */
       
   133       ENameChunk,
       
   134       
       
   135       /**
       
   136       Streaming the second flat data chunk.
       
   137       */
       
   138       EFlat2Chunk,
       
   139       
       
   140       /**
       
   141       Streaming the EForm data chunk.
       
   142       */
       
   143       EFormChunk   
       
   144       };
       
   145   
       
   146     /**
       
   147     Data chunk identifiers.
       
   148     */
       
   149     enum TChunkIds
       
   150        {
       
   151        /**
       
   152        The first flat data chunk ID.
       
   153        */
       
   154        EIdFlat1Chunk,
       
   155        
       
   156        /**
       
   157        The EPropertyName element data chunk ID.
       
   158        */
       
   159        EIdNameChunk,
       
   160        
       
   161        /**
       
   162        The second flat data chunk ID.
       
   163        */
       
   164        EIdFlat2Chunk,
       
   165        
       
   166        /**
       
   167        The EForm element data chunk ID.
       
   168        */
       
   169        EIdFormChunk,
       
   170        
       
   171        /**
       
   172        The number of data chunks.
       
   173        */
       
   174        EIdNumChunks
       
   175        };
       
   176 
       
   177 private:
       
   178 
       
   179     /**
       
   180     The data chunk count of ObjectPropDesc datasets with an EForm of other than 
       
   181     ENone.
       
   182     */
       
   183     static const TUint                              KNumChunksWithForm;
       
   184     
       
   185     /**
       
   186     The data chunk count of ObjectPropDesc datasets with an EForm of ENone.
       
   187     */
       
   188     static const TUint                              KNumChunksWithoutForm;
       
   189 
       
   190     /*
       
   191     The size in bytes of the first flat data chunk.
       
   192     */
       
   193     static const TUint                              KFlat1ChunkSize;
       
   194     
       
   195     /**
       
   196     The size in bytes of the second flat data chunk.
       
   197     */
       
   198     static const TUint                              KFlat2ChunkSize;
       
   199     
       
   200     /**
       
   201     The dataset element metadata table content.
       
   202     */
       
   203     static const CMTPTypeCompoundBase::TElementInfo iElementMetaData[];
       
   204     
       
   205     /**
       
   206     The dataset element metadata table.
       
   207     */
       
   208     const TFixedArray<TElementInfo, ENumElements>   iElementInfo;
       
   209    
       
   210     /**
       
   211     The write data stream error state. 
       
   212     */
       
   213     TUint                                           iWriteSequenceErr;
       
   214     
       
   215     /**
       
   216     The write data stream state variable. 
       
   217     */
       
   218     TUint                                           iWriteSequenceState;
       
   219     
       
   220     /**
       
   221     The write data stream completion state. This will be set to EFlat2Chunk for 
       
   222     ObjectPropDesc datasets with an EForm of ENone, otherwise this will be 
       
   223     EFormChunk.
       
   224     */
       
   225     TUint                                           iWriteSequenceCompletionState;
       
   226     
       
   227     /**
       
   228     The flat data chunk comprising elements EPKeyNamespace and EPKeyID.
       
   229     */    
       
   230     RMTPTypeCompoundFlatChunk                       iChunkFlat1;
       
   231     
       
   232     /**
       
   233     The EPropertyName element data chunk.
       
   234     */
       
   235     CMTPTypeString*                                        iChunkName;
       
   236     
       
   237     /**
       
   238     The flat data chunk comprising elements EFormFlag.
       
   239     */
       
   240     RMTPTypeCompoundFlatChunk                       iChunkFlat2;
       
   241     
       
   242     /**
       
   243     The EForm element data chunk.
       
   244     */
       
   245     CMTPTypeObjectPropDesc::RMTPTypeObjectPropDescForm      iChunkForm;
       
   246     
       
   247     /**
       
   248     The property's MTP data type identifier datacode.
       
   249     */
       
   250     TUint                                       iDataType;
       
   251     
       
   252     /**
       
   253     The initialised flag indicating if construction is completeand that 
       
   254     read-only elements can no longer be modified.
       
   255     */
       
   256     TBool                                           iInitialised;
       
   257     };
       
   258 
       
   259 
       
   260 
       
   261 #endif /* CMTPTYPESERVICEOBJPROPEXTNFORM_H_ */
       
   262