|
1 /* |
|
2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: MPX plugin implementation info |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef C_CMPXPLUGININFO_H |
|
21 #define C_CMPXPLUGININFO_H |
|
22 |
|
23 |
|
24 // INCLUDES |
|
25 #include <e32base.h> |
|
26 #include <ecom/ecom.h> |
|
27 #include <mpxplugin.hrh> |
|
28 |
|
29 // CONSTANTS |
|
30 const TInt KMPXArrayGranularity = 4; |
|
31 |
|
32 // FORWARD DECLARATIONS |
|
33 |
|
34 |
|
35 // CLASS DECLARATION |
|
36 |
|
37 /** |
|
38 * InternalComponent. |
|
39 * Interface to be implemented by customers of the class TaggedDataParser. |
|
40 * |
|
41 * @lib mpxcommon.lib |
|
42 */ |
|
43 NONSHARABLE_CLASS(MTaggedDataParserClient) |
|
44 { |
|
45 public: |
|
46 /** |
|
47 * Process a tagged data. |
|
48 * |
|
49 * @since S60 3.2.3 |
|
50 * @param aTag xml-styled tag |
|
51 * @param aData data in the xml-styled tag |
|
52 */ |
|
53 virtual void ProcessTaggedDataL(const TDesC8& aTag, const TDesC8& aData)=0; |
|
54 }; |
|
55 |
|
56 /** |
|
57 * MPX plugin info. |
|
58 * |
|
59 * @lib mpxcommon.lib |
|
60 */ |
|
61 class CMPXPluginInfo : public CBase, |
|
62 public MTaggedDataParserClient |
|
63 { |
|
64 public: |
|
65 |
|
66 /** |
|
67 * Two-phased constructor. |
|
68 * |
|
69 * @since S60 3.2.3 |
|
70 * @param aData Plugin's implementation information. |
|
71 * @return Pointer to newly created object. |
|
72 */ |
|
73 static CMPXPluginInfo* NewL(const CImplementationInformation& aData ); |
|
74 |
|
75 /** |
|
76 * Two-phased constructor. |
|
77 * |
|
78 * @since S60 3.2.3 |
|
79 * @param aData Plugin's implementation information. |
|
80 * @return Pointer to newly created object. |
|
81 */ |
|
82 static CMPXPluginInfo* NewLC(const CImplementationInformation& aData ); |
|
83 |
|
84 /** |
|
85 * Destructor. |
|
86 * |
|
87 * @since S60 3.2.3 |
|
88 */ |
|
89 IMPORT_C virtual ~CMPXPluginInfo(); |
|
90 |
|
91 protected: // From base class |
|
92 |
|
93 /** |
|
94 * Process a tagged data. |
|
95 * |
|
96 * @since S60 3.2.3 |
|
97 * @param aTag xml-styled tag |
|
98 * @param aData data in the xml-styled tag |
|
99 */ |
|
100 IMPORT_C void ProcessTaggedDataL(const TDesC8& aTag, const TDesC8& aData); |
|
101 |
|
102 /** |
|
103 * Process a extended tagged data which derived class may support. |
|
104 * Default implementation in this class just ignore the data. |
|
105 * |
|
106 * @since S60 3.2.3 |
|
107 * @param aTag xml-styled tag |
|
108 * @param aData data in the xml-styled tag |
|
109 */ |
|
110 IMPORT_C virtual void ProcessTaggedDataExL(const TDesC8& aTag, const TDesC8& aData); |
|
111 |
|
112 public: // new functions |
|
113 /** |
|
114 * Returns plugin's display name. |
|
115 * |
|
116 * @since S60 3.2.3 |
|
117 * @return Plugin's display name. |
|
118 */ |
|
119 const TDesC& DisplayName() const; |
|
120 |
|
121 /** |
|
122 * Returns plugin's implementation uid. |
|
123 * |
|
124 * @since S60 3.2.3 |
|
125 * @return Plugin's implementation uid. |
|
126 */ |
|
127 IMPORT_C const TUid& ImplementationUid() const; |
|
128 |
|
129 /** |
|
130 * Returns plugin's supported uids. |
|
131 * |
|
132 * @since S60 3.2.3 |
|
133 * @return Plugin's supported uids. |
|
134 */ |
|
135 const TArray<TUid> SupportedUids() const; |
|
136 |
|
137 /** |
|
138 * Returns plugin's plugin type. |
|
139 * |
|
140 * @since S60 3.2.3 |
|
141 * @return Plugin's plugin type. |
|
142 */ |
|
143 const TUid& PluginType() const; |
|
144 |
|
145 /** |
|
146 * Returns plugin's supported App Uid. |
|
147 * |
|
148 * @return Plugin's supported App Uid.. |
|
149 */ |
|
150 const TUid& SupportedAppUid() const; |
|
151 |
|
152 /** |
|
153 * Returns plugin's priority. |
|
154 * |
|
155 * @since S60 3.2.3 |
|
156 * @return Plugin's priority. |
|
157 */ |
|
158 TInt Priority() const; |
|
159 |
|
160 /** |
|
161 * Returns supported mime types. |
|
162 * |
|
163 * @since S60 3.2.3 |
|
164 * @return supported mime types |
|
165 */ |
|
166 const CDesCArray& SupportedMimeTypes() const; |
|
167 |
|
168 /** |
|
169 * Returns supported extensions. |
|
170 * |
|
171 * @since S60 3.2.3 |
|
172 * @return supported extensions |
|
173 */ |
|
174 const CDesCArray& SupportedExtensions() const; |
|
175 |
|
176 /** |
|
177 * Returns supported schemas. |
|
178 * |
|
179 * @since 3.0 |
|
180 * @return supported schemas |
|
181 */ |
|
182 const CDesCArray& SupportedSchemas() const; |
|
183 |
|
184 /** |
|
185 * Check if the plugin supports the array of uids. |
|
186 * |
|
187 * @since S60 3.2.3 |
|
188 * @param aUids contains plugin uids |
|
189 * @return ETrue if plugin supports all uids |
|
190 */ |
|
191 TBool SupportUids(const TArray<TUid>& aUids) const; |
|
192 |
|
193 /** |
|
194 * Returns the flags bit array. |
|
195 * |
|
196 * @since S60 3.2.3 |
|
197 * @return flags value |
|
198 */ |
|
199 IMPORT_C TUint Flags() const; |
|
200 |
|
201 /** |
|
202 * Returns a reference to the reference count. |
|
203 * |
|
204 * @since S60 3.2.3 |
|
205 * @return reference count |
|
206 */ |
|
207 TInt& ReferenceCount(); |
|
208 |
|
209 /** |
|
210 * Returns the plugin version. |
|
211 * |
|
212 * @since S60 3.2.3 |
|
213 * @return version as integer. |
|
214 */ |
|
215 TInt Version() const; |
|
216 |
|
217 /** |
|
218 * Compare two plugin info by prioritiy. |
|
219 * |
|
220 * @since S60 3.2.3 |
|
221 * @param aPluginInfo1 the first plugin info object |
|
222 * @param aPluginInfo2 the second plugin info object |
|
223 * @return zero if two plugins have same priority |
|
224 * a negative value(-1), if the priority of the first is higher than |
|
225 * the second's. That is to say, plugins with higher priority is |
|
226 * listed before plugins with lower priority |
|
227 * a positive value(1), if the priority of the first is lower than |
|
228 * the second's. |
|
229 */ |
|
230 static TInt ComparePluginInfoByPriority(const CMPXPluginInfo& aPluginInfo1, |
|
231 const CMPXPluginInfo& aPluginInfo2); |
|
232 |
|
233 protected: |
|
234 |
|
235 /** |
|
236 * C++ default constructor. |
|
237 * |
|
238 * @since S60 3.2.3 |
|
239 */ |
|
240 IMPORT_C CMPXPluginInfo(); |
|
241 |
|
242 /** |
|
243 * By default Symbian 2nd phase constructor is private. |
|
244 * |
|
245 * @since S60 3.2.3 |
|
246 * @param aData Plugin's implementation information. |
|
247 * @leave The function leaves with one of the system wide error codes, |
|
248 */ |
|
249 IMPORT_C void ConstructL(const CImplementationInformation& aData ); |
|
250 |
|
251 /** |
|
252 * Extracts plugin supported Uids from data. |
|
253 * |
|
254 * @since S60 3.2.3 |
|
255 * @param aData Supported uids descriptor separated by comma. |
|
256 */ |
|
257 void ExtractSupportedUidsL(const TDesC8& aData); |
|
258 |
|
259 /** |
|
260 * Extracts a list of UIDs from a text string. |
|
261 * |
|
262 * @since S60 3.2.3 |
|
263 * @param aData Supported uids descriptor separated by comma. |
|
264 * @param aArray array to insert the data into |
|
265 * @leave The function leaves with one of the system wide error codes, |
|
266 */ |
|
267 IMPORT_C void ExtractUidsFromTextL( const TDesC8& aData, |
|
268 RArray<TUid>& aArray ); |
|
269 |
|
270 /** |
|
271 * Extracts elemements separated by semicolon into array descriptor |
|
272 * |
|
273 * @param aText original content to extract elements from |
|
274 * @param aArray the array to add the extracted elements to |
|
275 */ |
|
276 IMPORT_C void ExtractIntoArrayL(const TDesC8& aText, CDesCArray*& aArray); |
|
277 |
|
278 protected: // data |
|
279 /** |
|
280 * List of supported Uids. Sorted by TUid.iUid |
|
281 */ |
|
282 RArray<TUid> iSupportedUids; |
|
283 |
|
284 /** |
|
285 * Plugin's display name. |
|
286 * Own. |
|
287 */ |
|
288 HBufC* iPluginName; |
|
289 |
|
290 /** |
|
291 * Plugin's implementation Uid. |
|
292 */ |
|
293 TUid iPluginUid; |
|
294 |
|
295 /** |
|
296 * Plugin's plugin type Uid. |
|
297 */ |
|
298 TUid iPluginTypeUid; |
|
299 |
|
300 /** |
|
301 * Plugin's supported App Uid. |
|
302 */ |
|
303 TUid iSupportedAppUid; |
|
304 /** |
|
305 * Plugin feature flags. |
|
306 */ |
|
307 TUint iFlags; |
|
308 |
|
309 /** |
|
310 * Plugin priority. |
|
311 */ |
|
312 TInt iPriority; |
|
313 |
|
314 /** |
|
315 The version number of this plugin. |
|
316 */ |
|
317 TInt iVersion; |
|
318 |
|
319 /** |
|
320 * Loaded plugin reference count. |
|
321 */ |
|
322 TInt iReferenceCount; |
|
323 |
|
324 // Note: move the following staff into derived plugin info class, |
|
325 // so that the plugin info class can be base class for all plugins in mpx |
|
326 CDesCArray* iSupportedSchemas; |
|
327 CDesCArray* iSupportedMimeTypes; |
|
328 CDesCArray* iSupportedExtensions; |
|
329 }; |
|
330 |
|
331 #endif // C_CMPXPLUGININFO_H |
|
332 |
|
333 // End of File |