|
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 CMTPTYPESERVICEMETHOD_H_ |
|
23 #define CMTPTYPESERVICEMETHOD_H_ |
|
24 |
|
25 #include <e32std.h> |
|
26 #include <mtp/cmtptypecompoundbase.h> |
|
27 #include <mtp/cmtptypelist.h> |
|
28 |
|
29 class CMTPTypeArray; |
|
30 class CMTPTypeString; |
|
31 class CMTPTypeServiceMethodElement; |
|
32 |
|
33 class CMTPTypeServiceMethodList : public CMTPTypeList |
|
34 { |
|
35 public: |
|
36 |
|
37 IMPORT_C static CMTPTypeServiceMethodList* NewL(); |
|
38 IMPORT_C static CMTPTypeServiceMethodList* NewLC(); |
|
39 IMPORT_C virtual ~CMTPTypeServiceMethodList(); |
|
40 |
|
41 IMPORT_C void AppendL(CMTPTypeServiceMethodElement* aElement); |
|
42 IMPORT_C CMTPTypeServiceMethodElement& ElementL(TUint aIndex) const; |
|
43 |
|
44 private: |
|
45 |
|
46 CMTPTypeServiceMethodList(); |
|
47 void ConstructL(); |
|
48 |
|
49 }; |
|
50 |
|
51 |
|
52 class CMTPTypeServiceMethodElement : public CMTPTypeCompoundBase |
|
53 { |
|
54 public: |
|
55 |
|
56 enum TMTPServiceMethodElement |
|
57 { |
|
58 EMethodCode, |
|
59 EMethodGUID, |
|
60 EMethodName, |
|
61 EMethodAssociateFormate, |
|
62 ENumElements |
|
63 }; |
|
64 |
|
65 public: |
|
66 |
|
67 IMPORT_C static CMTPTypeServiceMethodElement* NewL(); |
|
68 IMPORT_C static CMTPTypeServiceMethodElement* NewLC(); |
|
69 IMPORT_C static CMTPTypeServiceMethodElement* NewL(const TUint16 aMethodCode,const TMTPTypeGuid& aMethodGUID,const TDesC& aMethodName,const TUint16 aMethodAssociateFormate); |
|
70 IMPORT_C static CMTPTypeServiceMethodElement* NewLC(const TUint16 aMethodCode,const TMTPTypeGuid& aMethodGUID,const TDesC& aMethodName,const TUint16 aMethodAssociateFormate); |
|
71 |
|
72 IMPORT_C virtual ~CMTPTypeServiceMethodElement(); |
|
73 |
|
74 public: // From CMTPTypeCompoundBase |
|
75 |
|
76 IMPORT_C TUint Type() const; |
|
77 |
|
78 private: // From CMTPTypeCompoundBase |
|
79 |
|
80 const TElementInfo& ElementInfo(TInt aElementId) const; |
|
81 |
|
82 private: |
|
83 |
|
84 CMTPTypeServiceMethodElement(); |
|
85 void ConstructL(); |
|
86 void ConstructL(const TUint16 aMethodCode,const TMTPTypeGuid& aMethodGUID,const TDesC& aMethodName,const TUint16 aMethodAssociateFormate); |
|
87 MMTPType* NewFlatChunkL(const TElementInfo& aElementInfo); |
|
88 |
|
89 private: |
|
90 |
|
91 /** |
|
92 Data chunk identifiers. |
|
93 */ |
|
94 enum TChunkIds |
|
95 { |
|
96 /** |
|
97 The flat data chunk ID. |
|
98 */ |
|
99 EIdFlat1Chunk, |
|
100 |
|
101 EIdServiceMethodNameChunk, |
|
102 |
|
103 EIdFlat2Chunk, |
|
104 |
|
105 /** |
|
106 The number of data chunks. |
|
107 */ |
|
108 EIdNumChunks |
|
109 }; |
|
110 |
|
111 |
|
112 /** |
|
113 The dataset element metadata table content. |
|
114 */ |
|
115 static const CMTPTypeCompoundBase::TElementInfo iElementMetaData[]; |
|
116 |
|
117 /** |
|
118 The dataset element metadata table. |
|
119 */ |
|
120 const TFixedArray<TElementInfo, ENumElements> iElementInfo; |
|
121 |
|
122 /** |
|
123 The flat data chunk comprising elements . |
|
124 */ |
|
125 RMTPTypeCompoundFlatChunk iChunkFlat1; |
|
126 |
|
127 RMTPTypeCompoundFlatChunk iChunkFlat2; |
|
128 |
|
129 /** |
|
130 The size in bytes of the first flat data chunk. |
|
131 */ |
|
132 static const TUint KFlat1ChunkSize; |
|
133 |
|
134 /** |
|
135 The size in bytes of the second flat data chunk. |
|
136 */ |
|
137 static const TUint KFlat2ChunkSize; |
|
138 |
|
139 /** |
|
140 The MTP string type data chunks (EStorageDescription, and EVolumeIdentifier). |
|
141 */ |
|
142 CMTPTypeString* iChunkString; |
|
143 |
|
144 }; |
|
145 |
|
146 #endif /*CMTPTYPESERVICEMETHOD_H_*/ |