mtptransports/mtpusbtransport/usbdatatypes/inc/tmtpusbparameterpayloadblock.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 TMTPUSBPARAMETERPAYLOADBLOCK_H
       
    22 #define TMTPUSBPARAMETERPAYLOADBLOCK_H
       
    23 
       
    24 #include <mtp/tmtptypeflatbase.h> 
       
    25 
       
    26 /**
       
    27 Defines the MTP USB device class parameter block dataset. This dataset is used
       
    28 as the variable length Command and Response type bulk container payload.
       
    29 @internalComponent
       
    30  
       
    31 */
       
    32 class TMTPUsbParameterPayloadBlock : public TMTPTypeFlatBase
       
    33     {
       
    34 public:
       
    35 
       
    36     /**
       
    37     MTP operation request dataset element identifiers.
       
    38     */      
       
    39     enum TElements
       
    40         {
       
    41         EParameter1,
       
    42         EParameter2,
       
    43         EParameter3,
       
    44         EParameter4,
       
    45         EParameter5,
       
    46         ENumElements, 
       
    47         };  
       
    48         
       
    49 public:
       
    50 
       
    51     IMPORT_C TMTPUsbParameterPayloadBlock();
       
    52     
       
    53     IMPORT_C TUint NumParameters() const;
       
    54     IMPORT_C void CopyIn(const TMTPTypeFlatBase& aFrom, TUint aParamStartOffset, TUint aParamEndOffSet, TBool aIsNullParamValid, TUint aNumOfNullParam);
       
    55     IMPORT_C void CopyOut(TMTPTypeFlatBase& aTo, TUint aParamStartOffset, TUint aParamEndOffset);
       
    56     
       
    57 public: // From TMTPTypeFlatBase
       
    58     
       
    59     IMPORT_C void Reset();
       
    60     IMPORT_C void SetUint32(TInt aElementId, TUint32 aData); 
       
    61     IMPORT_C TUint32 Uint32(TInt aElementId) const;
       
    62     IMPORT_C TInt FirstReadChunk(TPtrC8& aChunk) const;
       
    63     IMPORT_C TUint64 Size() const;
       
    64     IMPORT_C TUint Type() const;
       
    65     IMPORT_C TBool CommitRequired() const;
       
    66     IMPORT_C MMTPType* CommitChunkL(TPtr8& aChunk);
       
    67     
       
    68 private: // From TMTPTypeFlatBase
       
    69     
       
    70     IMPORT_C const TMTPTypeFlatBase::TElementInfo& ElementInfo(TInt aElementId) const; 
       
    71 
       
    72 private: 
       
    73    
       
    74     /**
       
    75     The maximum dataset size in bytes.
       
    76     */
       
    77     static const TInt                               KMaxSize = 20;
       
    78     
       
    79     /**
       
    80     The dataset element metadata table content.
       
    81     */
       
    82     static const TMTPTypeFlatBase::TElementInfo     iElementMetaData[];
       
    83     
       
    84     /**
       
    85     The dataset element metadata table.
       
    86     */
       
    87     const TFixedArray<TElementInfo, ENumElements>   iElementInfo;
       
    88     
       
    89     /**
       
    90     The data buffer.
       
    91     */
       
    92     TBuf8<KMaxSize>                                 iBuffer;
       
    93     
       
    94     /**
       
    95     The number of parameters in the block which are set.
       
    96     */
       
    97     TUint                                           iNumParameters;
       
    98     };
       
    99 
       
   100 #endif // TMTPUSBPARAMETERPAYLOADBLOCK_H
       
   101