mtptransports/mtpusbtransport/usbdatatypes/inc/cmtpusbcontainer.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  @internalComponent
       
    19 */
       
    20 
       
    21 #ifndef CMTPUSBCONTAINER_H
       
    22 #define CMTPUSBCONTAINER_H
       
    23 
       
    24 #include <mtp/cmtptypecompoundbase.h>
       
    25 
       
    26 /**
       
    27 Defines the MTP USB device class generic bulk container dataset.
       
    28 @internalComponent
       
    29  
       
    30 */
       
    31 class CMTPUsbContainer : public CMTPTypeCompoundBase
       
    32     {
       
    33 
       
    34 public:
       
    35 
       
    36     /**
       
    37     MTP USB generic bulk container dataset element identifiers.
       
    38     */
       
    39     enum TElements
       
    40         {
       
    41         /**
       
    42         The Container Length field element.
       
    43         */
       
    44         EContainerLength,
       
    45         
       
    46         /**
       
    47         The Container Type field element.
       
    48         */
       
    49         EContainerType,
       
    50         
       
    51         /**
       
    52         The Codeh field element.
       
    53         */
       
    54         ECode,
       
    55         
       
    56         /**
       
    57         The TransactionID field element.
       
    58         */
       
    59         ETransactionID,
       
    60         
       
    61         /**
       
    62         The Payload field element.
       
    63         */
       
    64         EPayload,
       
    65         
       
    66         /**
       
    67         The number of elements.
       
    68         */
       
    69         ENumElements
       
    70         };
       
    71      
       
    72 public:
       
    73     
       
    74     IMPORT_C static CMTPUsbContainer* NewL();
       
    75     IMPORT_C ~CMTPUsbContainer();
       
    76     
       
    77     IMPORT_C MMTPType* Payload() const;
       
    78     IMPORT_C void SetPayloadL(MMTPType* aPayload);
       
    79      
       
    80 public: // From MMTPType
       
    81 
       
    82     IMPORT_C TUint Type() const;
       
    83         
       
    84 private: // From CMTPTypeCompoundBase
       
    85     
       
    86     const TElementInfo& ElementInfo(TInt aElementId) const;
       
    87     
       
    88 private:
       
    89 
       
    90     CMTPUsbContainer();        
       
    91     void ConstructL();   
       
    92     
       
    93 private: // Owned
       
    94         
       
    95     /**
       
    96     Data chunk identifiers.
       
    97     */
       
    98     enum TChunkIds
       
    99         {
       
   100         /**
       
   101         The flat data chunk ID.
       
   102         */
       
   103         EIdFlatChunk,
       
   104         
       
   105         /**
       
   106         The EMTPExtensions element data chunk ID.
       
   107         */
       
   108         EIdPayloadChunk,
       
   109         
       
   110         /**
       
   111         The number of data chunks.
       
   112         */
       
   113         EIdNumChunks
       
   114         };
       
   115     
       
   116     /**
       
   117     The flat data chunk comprising the header elements EContainerLength to 
       
   118     ETransactionId.
       
   119     */
       
   120     RMTPTypeCompoundFlatChunk                       iChunkHeader;
       
   121     
       
   122     /**
       
   123     The dataset element metadata table content.
       
   124     */
       
   125     static const CMTPTypeCompoundBase::TElementInfo iElementMetaData[];
       
   126     
       
   127     /**
       
   128     The dataset element metadata table.
       
   129     */
       
   130     const TFixedArray<TElementInfo, ENumElements>   iElementInfo;
       
   131     
       
   132     /**
       
   133     The size in bytes of the header data chunk.
       
   134     */
       
   135     static const TUint                              KFlatChunkSize;
       
   136     
       
   137 private: // Not owned
       
   138 
       
   139     MMTPType*                                       iPayload;
       
   140     };
       
   141     
       
   142 #endif // CMTPUSBCONTAINER_H