|
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 CMTPTYPESERVICEINFO_H_ |
|
23 #define CMTPTYPESERVICEINFO_H_ |
|
24 |
|
25 |
|
26 #include <e32std.h> |
|
27 #include <mtp/cmtptypecompoundbase.h> |
|
28 #include <mtp/rmtptype.h> |
|
29 #include <mtp/cmtptypearray.h> |
|
30 |
|
31 class CMTPTypeString; |
|
32 class CMTPTypeServiceInfo; |
|
33 class CMTPTypeServicePropertyList; |
|
34 class CMTPTypeServiceFormatList; |
|
35 class CMTPTypeServiceMethodList; |
|
36 class CMTPTypeServiceEventList; |
|
37 class TMTPTypeGuid; |
|
38 |
|
39 class CMTPTypeServiceInfo : public CMTPTypeCompoundBase |
|
40 { |
|
41 public: |
|
42 enum TMTPServiceInfoElement |
|
43 { |
|
44 EServiceID, |
|
45 EServiceStorageID, |
|
46 EServicePGUID, |
|
47 EServiceVersion, |
|
48 EServiceGUID, |
|
49 EServiceName, |
|
50 EServiceType, |
|
51 EBaseServiceID, |
|
52 |
|
53 /** |
|
54 The number of dataset elements. |
|
55 */ |
|
56 ENumElements |
|
57 }; |
|
58 |
|
59 public: |
|
60 |
|
61 IMPORT_C static CMTPTypeServiceInfo* NewL(); |
|
62 IMPORT_C static CMTPTypeServiceInfo* NewLC(); |
|
63 IMPORT_C virtual ~CMTPTypeServiceInfo(); |
|
64 |
|
65 IMPORT_C TUint32 NumberOfUsedServices() const; |
|
66 IMPORT_C void UsedServiceL( const TUint aIndex, TMTPTypeGuid& aUsedServiceGUID ) const; |
|
67 IMPORT_C void AppendUsedServiceL( const TMTPTypeGuid& aElement ); |
|
68 |
|
69 IMPORT_C TUint32 NumberOfServiceDataBlock() const; |
|
70 IMPORT_C void SerivceDataBlockL( const TUint aIndex, TMTPTypeGuid& aGUID ) const; |
|
71 IMPORT_C void AppendServiceDataBlockL(const TMTPTypeGuid& aElement ); |
|
72 public: |
|
73 IMPORT_C TUint Type() const; |
|
74 |
|
75 private: // From CMTPTypeCompoundBase |
|
76 |
|
77 const TElementInfo& ElementInfo(TInt aElementId) const; |
|
78 TBool WriteableElementL(TInt aElementId) const; |
|
79 TBool ReadableElementL(TInt aElementId) const; |
|
80 |
|
81 private: |
|
82 CMTPTypeServiceInfo(); |
|
83 void ConstructL(); |
|
84 TInt UpdateWriteSequenceErr(TInt aErr); |
|
85 MMTPType* NewFlatChunkL(const TElementInfo& aElementInfo); |
|
86 |
|
87 public: |
|
88 IMPORT_C CMTPTypeServicePropertyList& ServicePropList(); |
|
89 IMPORT_C CMTPTypeServiceFormatList& ServiceFormatList(); |
|
90 IMPORT_C CMTPTypeServiceMethodList& ServiceMethodList(); |
|
91 IMPORT_C CMTPTypeServiceEventList& ServiceEventList(); |
|
92 |
|
93 private: |
|
94 |
|
95 enum TChunkIds |
|
96 { |
|
97 /** |
|
98 The flat data chunk ID. |
|
99 */ |
|
100 EIdFlat1Chunk, |
|
101 /** |
|
102 The EServiceName element data chunk ID |
|
103 */ |
|
104 EIdServiceNameChunk, |
|
105 |
|
106 EIdFlat2Chunk, |
|
107 |
|
108 EIdUsedServiceGUIDChunk, |
|
109 |
|
110 EIdServicePropListChunk, |
|
111 |
|
112 EIdServicePropertyListChunk, |
|
113 |
|
114 EIdServiceFormatListChunk, |
|
115 |
|
116 EIdServiceEventListChunk, |
|
117 |
|
118 EIdServiceDataBlockChunk, |
|
119 |
|
120 /** |
|
121 The number of data chunks. |
|
122 */ |
|
123 EIdNumChunks |
|
124 }; |
|
125 |
|
126 |
|
127 private: |
|
128 |
|
129 /** |
|
130 The dataset element metadata table content. |
|
131 */ |
|
132 static const CMTPTypeCompoundBase::TElementInfo iElementMetaData[]; |
|
133 |
|
134 /** |
|
135 The dataset element metadata table. |
|
136 */ |
|
137 const TFixedArray<TElementInfo, ENumElements> iElementInfo; |
|
138 |
|
139 /** |
|
140 The flat data chunk comprising elements . |
|
141 */ |
|
142 RMTPTypeCompoundFlatChunk iChunkFlat1; |
|
143 |
|
144 RMTPTypeCompoundFlatChunk iChunkFlat2; |
|
145 |
|
146 /** |
|
147 The size in bytes of the first flat data chunk. |
|
148 */ |
|
149 static const TUint KFlat1ChunkSize; |
|
150 |
|
151 /** |
|
152 The size in bytes of the second flat data chunk. |
|
153 */ |
|
154 static const TUint KFlat2ChunkSize; |
|
155 |
|
156 /** |
|
157 The MTP string type data chunks (EServiceName).CMTPTypeString |
|
158 */ |
|
159 CMTPTypeString* iChunkString; |
|
160 |
|
161 /** |
|
162 The MTP array type data chunks .(EUsedServiceGUID) store the used services' GUIDs |
|
163 */ |
|
164 CMTPTypeArray* iChunkUsedServices; |
|
165 |
|
166 CMTPTypeArray* iChunkServiceDataBlock; |
|
167 |
|
168 CMTPTypeServicePropertyList* iServicePropList; |
|
169 CMTPTypeServiceFormatList* iServiceFormatList; |
|
170 CMTPTypeServiceMethodList* iServiceMethodList; |
|
171 CMTPTypeServiceEventList* iServiceEventList; |
|
172 |
|
173 }; |
|
174 |
|
175 #endif /*CMTPTYPESERVICEINFO_H_*/ |
|
176 |