mtptransports/mtpptpiptransport/ptpipdatatypes/inc/cptpipinitcmdreq.h
changeset 0 d0791faffa3f
equal deleted inserted replaced
-1:000000000000 0:d0791faffa3f
       
     1 // Copyright (c) 2008-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 #ifndef CPTPIPINITCMDREQ_H_
       
    17 #define CPTPIPINITCMDREQ_H_
       
    18 #include <mtp/cmtptypecompoundbase.h>
       
    19 
       
    20 
       
    21 #include <mtp/cmtptypestring.h>
       
    22 class CPTPIPInitCmdRequest : public CMTPTypeCompoundBase
       
    23     {
       
    24 public:
       
    25 
       
    26     /**
       
    27     MTP USB generic bulk container dataset element identifiers.
       
    28     */
       
    29     enum TElements
       
    30         {
       
    31 		ELength,
       
    32 		EPktType,
       
    33 		EInitiatorGUID,
       
    34 
       
    35 		EVersion,
       
    36         
       
    37         /**
       
    38         The number of elements.
       
    39         */
       
    40         ENumElements        
       
    41  		}; 
       
    42 public:
       
    43     
       
    44      IMPORT_C static CPTPIPInitCmdRequest* NewL();
       
    45      IMPORT_C ~CPTPIPInitCmdRequest();
       
    46     
       
    47 
       
    48      
       
    49 public: // From MMTPType
       
    50 
       
    51      IMPORT_C TUint Type() const;
       
    52      IMPORT_C TDes16& HostFriendlyName();
       
    53      IMPORT_C TInt FirstWriteChunk(TPtr8& aChunk);
       
    54 	 IMPORT_C TInt NextWriteChunk(TPtr8& aChunk);
       
    55 	 IMPORT_C MMTPType* CommitChunkL(TPtr8& aChunk);	
       
    56 	 
       
    57 private: // From CMTPTypeCompoundBase
       
    58     
       
    59     const TElementInfo& ElementInfo(TInt aElementId) const;
       
    60 
       
    61    
       
    62 
       
    63 private:
       
    64 
       
    65     CPTPIPInitCmdRequest();        
       
    66     void ConstructL();   
       
    67     
       
    68 private: // Owned
       
    69         
       
    70     /**
       
    71     Data chunk identifiers.
       
    72     */
       
    73     enum TChunkIds
       
    74         {
       
    75         /**
       
    76         The flat data chunk ID.
       
    77         */
       
    78         EIdFlatChunk,
       
    79         
       
    80         /**
       
    81         The EMTPExtensions element data chunk ID.
       
    82         */
       
    83    //     EIdNameChunk,
       
    84         /**
       
    85         
       
    86         */
       
    87         EIdVersionChunk,        
       
    88         /**
       
    89         The number of data chunks.
       
    90         */
       
    91         EIdNumChunks
       
    92         };
       
    93     
       
    94     /**
       
    95     The flat data chunk comprising the header elements EContainerLength to 
       
    96     ETransactionId.
       
    97     */
       
    98     RMTPTypeCompoundFlatChunk                       iChunkHeader;
       
    99     
       
   100     /**
       
   101     The dataset element metadata table content.
       
   102     */
       
   103     static const CMTPTypeCompoundBase::TElementInfo iElementMetaData[];
       
   104     
       
   105     /**
       
   106     The dataset element metadata table.
       
   107     */
       
   108     const TFixedArray<TElementInfo, ENumElements>   iElementInfo;
       
   109     
       
   110     /**
       
   111     The size in bytes of the header data chunk.
       
   112     */
       
   113     static const TUint                              KFlatChunkSize;
       
   114     
       
   115 private: // Not owned
       
   116 
       
   117     CMTPTypeString*                                    iString; 
       
   118     TMTPTypeUint32									iVersion;
       
   119     TInt 									iChunkCount;
       
   120     RBuf16   iBuffer;
       
   121     };
       
   122 
       
   123 #endif /*CPTPIPINITCMDREQ_H_*/