|
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 */ |
|
20 |
|
21 #include <mtp/mtpdatatypeconstants.h> |
|
22 #include <mtp/tmtptypeevent.h> |
|
23 |
|
24 // Dataset element metadata. |
|
25 const TMTPTypeEvent::TElementInfo TMTPTypeEvent::iElementMetaData[ENumElements] = |
|
26 { |
|
27 {EMTPTypeUINT16, 0, KMTPTypeUINT16Size}, // EEventCode |
|
28 {EMTPTypeUINT32, 2, KMTPTypeUINT32Size}, // ESessionID |
|
29 {EMTPTypeUINT32, 6, KMTPTypeUINT32Size}, // ETransactionID |
|
30 {EMTPTypeUINT32, 10, KMTPTypeUINT32Size}, // EParameter1 |
|
31 {EMTPTypeUINT32, 14, KMTPTypeUINT32Size}, // EParameter2 |
|
32 {EMTPTypeUINT32, 18, KMTPTypeUINT32Size} // EParameter3 |
|
33 }; |
|
34 |
|
35 /** |
|
36 Constructor. |
|
37 */ |
|
38 EXPORT_C TMTPTypeEvent::TMTPTypeEvent() : |
|
39 iElementInfo(iElementMetaData, ENumElements), |
|
40 iBuffer(KSize) |
|
41 { |
|
42 SetBuffer(iBuffer); |
|
43 } |
|
44 |
|
45 EXPORT_C TMTPTypeEvent::TMTPTypeEvent(const TMTPTypeEvent& aEvent): |
|
46 iElementInfo(iElementMetaData, ENumElements), |
|
47 iBuffer(KSize) |
|
48 { |
|
49 iBuffer = aEvent.iBuffer; |
|
50 SetBuffer(iBuffer); |
|
51 } |
|
52 |
|
53 EXPORT_C TUint TMTPTypeEvent::Type() const |
|
54 { |
|
55 return EMTPTypeEventDataset; |
|
56 } |
|
57 |
|
58 EXPORT_C const TMTPTypeFlatBase::TElementInfo& TMTPTypeEvent::ElementInfo(TInt aElementId) const |
|
59 { |
|
60 return iElementInfo[aElementId]; |
|
61 } |
|
62 |