mtpfws/mtpfw/datatypes/interface/tmtptypedatapair.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 TMTPTYPEDATAPAIR_H_
       
    23 #define TMTPTYPEDATAPAIR_H_
       
    24 
       
    25 
       
    26 #include <mtp/tmtptypeflatbase.h> 
       
    27 
       
    28 
       
    29 /**
       
    30 Defines the ObjectHandle-PropertyCode pair or ServiceID-PropertyCode pair. This data pair is stored in a 
       
    31 contiguous flat buffer to optimise data transfer to/from the MTP transport 
       
    32 layer.
       
    33 @publishedPartner
       
    34 @released 
       
    35 */
       
    36 class TMTPTypeDataPair : public TMTPTypeFlatBase
       
    37     {
       
    38 public:
       
    39 
       
    40     /**
       
    41     MTP operation response dataset element identifiers.
       
    42     */      
       
    43     enum TElements
       
    44         {
       
    45         /**
       
    46         The identifier of owner: ObjectHandle or ServiceID.
       
    47         */
       
    48         EOwnerHandle, 
       
    49         
       
    50         /**
       
    51         data code: PropertyCode.
       
    52         */
       
    53         EDataCode,
       
    54         
       
    55         /**
       
    56         The number of dataset elements.
       
    57         */
       
    58         ENumElements, 
       
    59         }; 
       
    60     
       
    61 public:
       
    62 
       
    63     IMPORT_C TMTPTypeDataPair();
       
    64     IMPORT_C TMTPTypeDataPair( const TUint32 aHandle, const TUint16 aCode );
       
    65     IMPORT_C TMTPTypeDataPair(const TMTPTypeDataPair& aPair);    
       
    66     
       
    67 public: // From TMTPTypeFlatBase
       
    68 
       
    69     IMPORT_C TUint Type() const;
       
    70     
       
    71 private: // From TMTPTypeFlatBase
       
    72     
       
    73     const TMTPTypeFlatBase::TElementInfo& ElementInfo(TInt aElementId) const;
       
    74     
       
    75 private: 
       
    76    
       
    77     /**
       
    78     The data pair size in bytes.
       
    79     */
       
    80     static const TInt                               KSize = 6;
       
    81     
       
    82     /**
       
    83     The data pair element metadata table content.
       
    84     */
       
    85     static const TMTPTypeFlatBase::TElementInfo     iElementMetaData[];
       
    86     
       
    87     /**
       
    88     The data pair element metadata table.
       
    89     */
       
    90     const TFixedArray<TElementInfo, ENumElements>   iElementInfo;
       
    91     
       
    92     /**
       
    93     The data buffer.
       
    94     */
       
    95     TBuf8<KSize>                                    iBuffer; 
       
    96     };
       
    97 
       
    98 
       
    99 #endif /* TMTPTYPEDATAPAIR_H_ */