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