mtpfws/mtpfw/datatypes/interface/cmtptypeservicepropdesclist.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 CMTPTYPESERVICEPROPDESCLIST_H_
       
    23 
       
    24 #define CMTPTYPESERVICEPROPDESCLIST_H_
       
    25 
       
    26 
       
    27 
       
    28 #include <e32std.h>
       
    29 #include <mtp/rmtptype.h>
       
    30 #include <mtp/cmtptypecompoundbase.h>
       
    31 #include <mtp/cmtptypeobjectpropdesc.h>
       
    32 #include <mtp/cmtptypelist.h>
       
    33 
       
    34 class CMTPTypeServicePropDesc;
       
    35 
       
    36 /** 
       
    37 Defines the MTP Service Property Description list dataset. 
       
    38 @see CMTPTypeObjectPropDesc
       
    39 @publishedPartner
       
    40 @released
       
    41 */ 
       
    42 class CMTPTypeServicePropDescList : public CMTPTypeList
       
    43     {
       
    44 public:
       
    45     
       
    46     IMPORT_C static CMTPTypeServicePropDescList* NewL();
       
    47     IMPORT_C static CMTPTypeServicePropDescList* NewLC();
       
    48 
       
    49     IMPORT_C virtual ~CMTPTypeServicePropDescList();  
       
    50     IMPORT_C void AppendL(CMTPTypeServicePropDesc* aServicePropDesc);
       
    51     IMPORT_C CMTPTypeServicePropDesc& ElementL(TUint aIndex) const; 
       
    52     
       
    53 private:
       
    54     CMTPTypeServicePropDescList();
       
    55     void ConstructL();   
       
    56 
       
    57     };
       
    58 
       
    59 
       
    60 /** 
       
    61 Defines the MTP Service Property Description dataset. The dataset is a 
       
    62 component element of the CMTPTypeServicePropDescList.
       
    63 @see CMTPTypeObjectPropDesc
       
    64 @publishedPartner
       
    65 @released
       
    66 */ 
       
    67 class CMTPTypeServicePropDesc : public CMTPTypeCompoundBase
       
    68     {
       
    69 public:
       
    70 
       
    71     /**
       
    72     MTP ObjectPropDesc Service Property Description dataset element  identifiers.
       
    73     */
       
    74     enum TMTPObjectPropDescElement
       
    75         {
       
    76         /**
       
    77         Service Property code.
       
    78         */
       
    79         EServicePropertyCode,
       
    80         
       
    81         /**
       
    82         Data-type code
       
    83         */
       
    84         EDataType1,
       
    85         
       
    86         /**
       
    87         Get/Set.
       
    88         */
       
    89         EGetSet1,
       
    90         
       
    91         /**
       
    92         Form Flag .
       
    93         */
       
    94         EFormFlag,
       
    95         
       
    96         /**
       
    97         FORM element. This element depends EFormFlag and is absent if EFormFlag 
       
    98         is ENone.
       
    99         */
       
   100         EForm,         
       
   101 
       
   102         /**
       
   103         The number of dataset elements.
       
   104         */
       
   105         ENumElements,
       
   106         };
       
   107     
       
   108     /**
       
   109     MTP ServicePropDesc dataset Get/Set element values.
       
   110     */
       
   111     enum TMTPServicePropDescGetSet
       
   112         {
       
   113 
       
   114         /** 
       
   115         Get.
       
   116         */
       
   117         EReadOnly       = 0x00,
       
   118 
       
   119         /** 
       
   120         Get/Set.
       
   121         */
       
   122         EReadWrite      = 0x01
       
   123         };
       
   124     
       
   125 public:
       
   126     IMPORT_C static CMTPTypeServicePropDesc* NewL();
       
   127     IMPORT_C static CMTPTypeServicePropDesc* NewLC();
       
   128     IMPORT_C static CMTPTypeServicePropDesc* NewL( const TUint16  aServicePropCode, const TUint16 aDataType, const TUint8 aGetSet, const TUint8 aFormFlag, const MMTPType* aForm );
       
   129     IMPORT_C static CMTPTypeServicePropDesc* NewLC( const TUint16  aServicePropCode, const TUint16 aDataType, const TUint8 aGetSet, const TUint8 aFormFlag, const MMTPType* aForm);
       
   130     
       
   131     IMPORT_C virtual ~CMTPTypeServicePropDesc();  
       
   132      
       
   133 public: // From CMTPTypeCompoundBase
       
   134 
       
   135     IMPORT_C TInt FirstWriteChunk(TPtr8& aChunk);
       
   136     IMPORT_C TInt NextWriteChunk(TPtr8& aChunk);
       
   137     IMPORT_C TUint Type() const;
       
   138     IMPORT_C TBool CommitRequired() const;
       
   139     IMPORT_C MMTPType* CommitChunkL(TPtr8& aChunk);
       
   140     
       
   141 private: // From CMTPTypeCompoundBase
       
   142     
       
   143     const TElementInfo& ElementInfo(TInt aElementId) const;
       
   144     
       
   145     
       
   146 private:
       
   147 
       
   148     CMTPTypeServicePropDesc();
       
   149     void ConstructL( const TUint16  aServicePropCode, const TUint16 aDataType, const TUint8 aGetSet, const TUint8 aFormFlag, const MMTPType* aForm );
       
   150     
       
   151     TBool HasFormField(TUint8 aFormFlag) const;
       
   152 
       
   153 private:
       
   154 
       
   155 /**
       
   156 The write data stream states.
       
   157 */
       
   158 enum TReadWriteSequenceState
       
   159     {
       
   160     
       
   161     /**
       
   162     Data stream is inactive.
       
   163     */
       
   164     EIdle,
       
   165     
       
   166     /**
       
   167     Streaming the EForm data chunk.
       
   168     */
       
   169     EFormChunk           
       
   170     };
       
   171   
       
   172     /**
       
   173     Data chunk identifiers.
       
   174     */
       
   175     enum TChunkIds
       
   176        {
       
   177        /**
       
   178        The first flat data chunk ID.
       
   179        */
       
   180        EIdFlat1Chunk,
       
   181        
       
   182        /**
       
   183        The EForm element data chunk ID.
       
   184        */
       
   185        EIdFormChunk,
       
   186        
       
   187        /**
       
   188        The number of data chunks.
       
   189        */
       
   190        EIdNumChunks
       
   191        };
       
   192 
       
   193 private:
       
   194 
       
   195     /**
       
   196     The data chunk count of ObjectPropDesc datasets with an EForm of other than 
       
   197     ENone.
       
   198     */
       
   199     static const TUint                              KNumChunksWithForm;
       
   200     
       
   201     /**
       
   202     The data chunk count of ObjectPropDesc datasets with an EForm of ENone.
       
   203     */
       
   204     static const TUint                              KNumChunksWithoutForm;
       
   205 
       
   206     /*
       
   207     The size in bytes of the first flat data chunk.
       
   208     */
       
   209     static const TUint                              KFlat1ChunkSize;
       
   210     
       
   211     /**
       
   212     The dataset element metadata table content.
       
   213     */
       
   214     static const CMTPTypeCompoundBase::TElementInfo iElementMetaData[];
       
   215     
       
   216     /**
       
   217     The dataset element metadata table.
       
   218     */
       
   219     const TFixedArray<TElementInfo, ENumElements>   iElementInfo;
       
   220     
       
   221     /**
       
   222     The write data stream completion state. This will be set to EFlat2Chunk for 
       
   223     ObjectPropDesc datasets with an EForm of ENone, otherwise this will be 
       
   224     EFormChunk.
       
   225     */
       
   226     TUint                                           iWriteSequenceCompletionState;
       
   227     TUint 											iWriteSequenceState;
       
   228     
       
   229     
       
   230     /**
       
   231     The flat data chunk comprising elements EPKeyNamespace and EPKeyID.
       
   232     */    
       
   233     RMTPTypeCompoundFlatChunk                       iChunkFlat1;
       
   234     
       
   235     /**
       
   236     The EForm element data chunk.
       
   237     */
       
   238     CMTPTypeObjectPropDesc::RMTPTypeObjectPropDescForm      iChunkForm;
       
   239     };
       
   240 
       
   241 
       
   242 
       
   243 
       
   244 #endif /* CMTPTYPESERVICEPROPDESCLIST_H_ */