mtptransports/mtpptpiptransport/ptpipdatatypes/inc/tptpipstartdatapayload.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 // ptpipstartdatapayload.h
       
    15 // 
       
    16 //
       
    17 
       
    18 /**
       
    19  @internalComponent
       
    20 */
       
    21 
       
    22 #ifndef CPTPIPPAYLOADSTARTDATA_H_
       
    23 #define CPTPIPPAYLOADSTARTDATA_H_
       
    24 
       
    25 #include "ptpipdatatypes.h"
       
    26 
       
    27 /**
       
    28  Defines the PTPIP dataset for the start data operation. This is used as the 
       
    29  payload in the generic container when the start data PTPIP operation is sent.
       
    30  */
       
    31 class TPTPIPTypeStartDataPayload : public TMTPTypeFlatBase
       
    32 	{
       
    33 public:
       
    34 
       
    35 	/**
       
    36 	 PTPIP operation startdata's dataset element identifiers.
       
    37 	 */
       
    38 	enum TElements
       
    39 		{
       
    40 		ETransactionId,
       
    41 		ETotalSize,
       
    42 		ENumElements
       
    43 		};
       
    44 
       
    45 public:
       
    46 	IMPORT_C TPTPIPTypeStartDataPayload();
       
    47 
       
    48 public:
       
    49 	// From TMTPTypeFlatBase
       
    50 	IMPORT_C void Reset();
       
    51 	IMPORT_C void SetUint32(TInt aElementId, TUint32 aData);
       
    52 	IMPORT_C TUint32 Uint32(TInt aElementId) const;
       
    53 	IMPORT_C void SetUint64(TInt aElementId, TUint64 aData);
       
    54 	IMPORT_C TUint64 Uint64(TInt aElementId) const;
       
    55 	IMPORT_C TInt FirstReadChunk(TPtrC8& aChunk) const;
       
    56 	IMPORT_C TUint64 Size() const;
       
    57 	IMPORT_C TUint Type() const;
       
    58 	IMPORT_C TBool CommitRequired() const;
       
    59 	IMPORT_C MMTPType* CommitChunkL(TPtr8& aChunk);
       
    60 
       
    61 private:
       
    62 	// From TMTPTypeFlatBase
       
    63 	IMPORT_C const TMTPTypeFlatBase::TElementInfo& ElementInfo(TInt aElementId) const;
       
    64 
       
    65 private:
       
    66 
       
    67 	/**
       
    68 	 The dataset size in bytes.
       
    69 	 */
       
    70 	static const TInt KSize = 12;
       
    71 
       
    72 	/**
       
    73 	 The dataset element metadata table content.
       
    74 	 */
       
    75 	static const TMTPTypeFlatBase::TElementInfo iElementMetaData[];
       
    76 
       
    77 	/**
       
    78 	 The dataset element metadata table.
       
    79 	 */
       
    80 	const TFixedArray<TElementInfo, ENumElements> iElementInfo;
       
    81 
       
    82 	/**
       
    83 	 The data buffer.
       
    84 	 */
       
    85 	TBuf8<KSize> iBuffer;
       
    86 	};
       
    87 
       
    88 #endif /*CPTPIPPAYLOADSTARTDATA_H_*/