|
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 |
|
23 #ifndef CMTPTYPESERVICECAPABILITYLIST_H_ |
|
24 #define CMTPTYPESERVICECAPABILITYLIST_H_ |
|
25 |
|
26 #include <e32std.h> |
|
27 #include <mtp/rmtptype.h> |
|
28 #include <mtp/cmtptypecompoundbase.h> |
|
29 #include <mtp/cmtptypelist.h> |
|
30 |
|
31 class CMTPTypeList; |
|
32 class CMTPTypeObjectPropDesc; |
|
33 class CMTPTypeInterdependentPropDesc; |
|
34 class CMTPTypeFormatCapability; |
|
35 |
|
36 class CMTPTypeServiceCapabilityList : public CMTPTypeList |
|
37 { |
|
38 public: |
|
39 |
|
40 IMPORT_C static CMTPTypeServiceCapabilityList* NewL(); |
|
41 IMPORT_C static CMTPTypeServiceCapabilityList* NewLC(); |
|
42 |
|
43 IMPORT_C virtual ~CMTPTypeServiceCapabilityList(); |
|
44 IMPORT_C void AppendL(CMTPTypeFormatCapability* aFormatCapability); |
|
45 IMPORT_C CMTPTypeFormatCapability& ElementL(TUint aIndex) const; |
|
46 |
|
47 private: |
|
48 |
|
49 CMTPTypeServiceCapabilityList(); |
|
50 void ConstructL(); |
|
51 }; |
|
52 |
|
53 |
|
54 |
|
55 class CMTPTypeFormatCapability : public CMTPTypeCompoundBase |
|
56 { |
|
57 public: |
|
58 |
|
59 enum TMTPFormatCapabilityElement |
|
60 { |
|
61 EFormatCode, |
|
62 ENumElements, |
|
63 }; |
|
64 public: |
|
65 |
|
66 IMPORT_C static CMTPTypeFormatCapability* NewL(); |
|
67 IMPORT_C static CMTPTypeFormatCapability* NewLC(); |
|
68 IMPORT_C static CMTPTypeFormatCapability* NewL( const TUint16 aFormatCode, CMTPTypeInterdependentPropDesc* aInterDependentPropDesc ); |
|
69 IMPORT_C static CMTPTypeFormatCapability* NewLC( const TUint16 aFormatCode, CMTPTypeInterdependentPropDesc* aInterDependentPropDesc ); |
|
70 |
|
71 IMPORT_C void AppendL(CMTPTypeObjectPropDesc* aElement); |
|
72 IMPORT_C TUint32 NumberOfPropDescs() const; |
|
73 IMPORT_C CMTPTypeObjectPropDesc& ObjectPropDescL(TUint aIndex) const; |
|
74 |
|
75 IMPORT_C CMTPTypeInterdependentPropDesc& InterdependentPropDesc() const; |
|
76 IMPORT_C virtual ~CMTPTypeFormatCapability(); |
|
77 |
|
78 public: |
|
79 IMPORT_C TUint Type() const; |
|
80 |
|
81 |
|
82 private: // From CMTPTypeCompoundBase |
|
83 const TElementInfo& ElementInfo(TInt aElementId) const; |
|
84 |
|
85 protected:// From CMTPTypeCompoundBase |
|
86 TBool ReadableElementL(TInt aElementId) const; |
|
87 TBool WriteableElementL(TInt aElementId ) const; |
|
88 |
|
89 private: |
|
90 CMTPTypeFormatCapability( CMTPTypeInterdependentPropDesc* aInterDependentPropDesc ); |
|
91 void ConstructL(); |
|
92 void ConstructL( const TUint16 aFormatCode ); |
|
93 MMTPType* NewFlatChunkL(); |
|
94 |
|
95 private: |
|
96 |
|
97 /** |
|
98 Data chunk identifiers. |
|
99 */ |
|
100 enum TChunkIds |
|
101 { |
|
102 /** |
|
103 The flat data chunk ID. |
|
104 */ |
|
105 EIdFlatChunk, |
|
106 |
|
107 /* |
|
108 * The CMTPTypeObjectPropDescList dataset. |
|
109 */ |
|
110 EIdObjPropDescListChunk, |
|
111 |
|
112 /* |
|
113 The CMTPTypeInterdependentPropDesc dataset. |
|
114 */ |
|
115 EIdInterDependentPropDescChunk, |
|
116 /** |
|
117 The number of data chunks. |
|
118 */ |
|
119 EIdNumChunks |
|
120 }; |
|
121 /** |
|
122 The dataset element metadata table content. |
|
123 */ |
|
124 static const CMTPTypeCompoundBase::TElementInfo iElementMetaData[]; |
|
125 |
|
126 /** |
|
127 The dataset element metadata table. |
|
128 */ |
|
129 const TFixedArray<TElementInfo, ENumElements> iElementInfo; |
|
130 |
|
131 /** |
|
132 The flat data chunk comprising elements EStorageType to EFreeSpaceInObjects. |
|
133 */ |
|
134 RMTPTypeCompoundFlatChunk iChunkFlat; |
|
135 |
|
136 private: |
|
137 |
|
138 CMTPTypeList* iObjectPropDescList; |
|
139 CMTPTypeInterdependentPropDesc* iInterdependentPropDesc; |
|
140 |
|
141 }; |
|
142 |
|
143 #endif /*CMTPTYPESERVICECAPABILITYLIST_H_*/ |