|
1 /* |
|
2 * Copyright (c) 2010 Ixonos Plc. |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of the "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 * Ixonos Plc |
|
14 * |
|
15 * Description: |
|
16 * CPluginInfo class represents information about editor plug-in. |
|
17 * |
|
18 */ |
|
19 |
|
20 |
|
21 #ifndef PLUGININFO_H |
|
22 #define PLUGININFO_H |
|
23 |
|
24 #include <e32base.h> |
|
25 #include <badesca.h> |
|
26 #include <eikmenup.h> |
|
27 |
|
28 /** Array for menu items */ |
|
29 typedef CArrayFixSeg<CEikMenuPaneItem::SData> CMenuItemArray; |
|
30 |
|
31 |
|
32 class CFbsBitmap; |
|
33 class RReadStream; |
|
34 class RWriteStream; |
|
35 |
|
36 /** |
|
37 * Represents information about editor plug-in. |
|
38 * The class encapsulates the following info: |
|
39 * |
|
40 * PLUG-IN DLL INFO: |
|
41 * |
|
42 * plug-in DLL name |
|
43 * plug-in DLL UID 2 (API UID) |
|
44 * plug-in DLL UID 3 |
|
45 * plug-in UI type |
|
46 * plug-in filter type |
|
47 * |
|
48 * PLUG-IN UI INFO: |
|
49 * |
|
50 * plug-in run-time ID |
|
51 * plug-in name |
|
52 * icon file name |
|
53 * icon bitmap |
|
54 * icon mask bitmap |
|
55 * parameter array |
|
56 * softkey 1 items |
|
57 * softkey 2 items |
|
58 * menu items |
|
59 * |
|
60 * @code |
|
61 * ?good_class_usage_example(s) |
|
62 * @endcode |
|
63 * |
|
64 * @lib ImageEditorUtils.lib |
|
65 * @since S60 v5.0 |
|
66 */ |
|
67 class CPluginInfo : public CBase |
|
68 { |
|
69 |
|
70 public: |
|
71 |
|
72 /** |
|
73 * Comparison method for CPluginInfo instances based on RID |
|
74 * |
|
75 * @since S60 v5.0 |
|
76 * @param aItem1 - first item to be compared |
|
77 * @param aItem2 - second item to be compared |
|
78 * @return -1 if aItem1 < aItem2 |
|
79 * 1 if aItem1 > aItem2 |
|
80 * 0 otherwise |
|
81 */ |
|
82 IMPORT_C static TInt ComparePluginInfo ( |
|
83 const CPluginInfo & aItem1, |
|
84 const CPluginInfo & aItem2 |
|
85 ); |
|
86 |
|
87 /** |
|
88 * Comparison method for CPluginInfo instances based on plug-in order |
|
89 * |
|
90 * @since S60 v5.0 |
|
91 * @param aItem1 - first item to be compared |
|
92 * @param aItem2 - second item to be compared |
|
93 * @return -1 if aItem1 < aItem2 |
|
94 * 1 if aItem1 > aItem2 |
|
95 * 0 otherwise |
|
96 */ |
|
97 IMPORT_C static TInt ComparePluginOrder ( |
|
98 const CPluginInfo & aItem1, |
|
99 const CPluginInfo & aItem2 |
|
100 ); |
|
101 |
|
102 |
|
103 /** |
|
104 * Two-phased constructor. |
|
105 * @param - |
|
106 * @return pointer to created CPluginInfo object |
|
107 */ |
|
108 IMPORT_C static CPluginInfo * NewL (); |
|
109 |
|
110 /** |
|
111 * Two-phased constructor. |
|
112 * Leaves the object in cleanup stack. |
|
113 * @param - |
|
114 * @return pointer to created CPluginInfo object |
|
115 */ |
|
116 IMPORT_C static CPluginInfo * NewLC (); |
|
117 |
|
118 /** |
|
119 * Destructor. |
|
120 */ |
|
121 IMPORT_C ~CPluginInfo (); |
|
122 |
|
123 /** |
|
124 * Getter for plug-in DLL file name. |
|
125 * |
|
126 * @since S60 v5.0 |
|
127 * @param - |
|
128 * @return plug-in DLL name |
|
129 */ |
|
130 IMPORT_C HBufC *& PluginDll (); |
|
131 |
|
132 /** |
|
133 * Getter for plug-in DLL file name, const. |
|
134 * |
|
135 * @since S60 v5.0 |
|
136 * @param - |
|
137 * @return plug-in DLL name |
|
138 */ |
|
139 IMPORT_C const TDesC & PluginDll () const; |
|
140 |
|
141 /** |
|
142 * Getter for plug-in DLL UID2, non-const. |
|
143 * |
|
144 * @since S60 v5.0 |
|
145 * @param - |
|
146 * @return plug-in DLL UID2 |
|
147 */ |
|
148 IMPORT_C TUid & Uid2 (); |
|
149 |
|
150 /** |
|
151 * Getter for plug-in DLL UID2, const. |
|
152 * |
|
153 * @since S60 v5.0 |
|
154 * @param - |
|
155 * @return plug-in DLL UID2 |
|
156 */ |
|
157 IMPORT_C const TUid & Uid2 () const; |
|
158 |
|
159 /** |
|
160 * Getter for plug-in DLL UID3, non-const. |
|
161 * |
|
162 * @since S60 v5.0 |
|
163 * @param - |
|
164 * @return plug-in DLL UID3 |
|
165 */ |
|
166 IMPORT_C TUid & Uid3 (); |
|
167 |
|
168 /** |
|
169 * Getter for plug-in DLL UID3, const. |
|
170 * |
|
171 * @since S60 v5.0 |
|
172 * @param - |
|
173 * @return plug-in DLL UID3 |
|
174 */ |
|
175 IMPORT_C const TUid & Uid3 () const; |
|
176 |
|
177 /** |
|
178 * Getter for plug-in UI type, non-const. |
|
179 * |
|
180 * @since S60 v5.0 |
|
181 * @param - |
|
182 * @return plug-in UI type |
|
183 */ |
|
184 IMPORT_C TInt & PluginUiType(); |
|
185 |
|
186 /** |
|
187 * Getter for plug-in UI type, const. |
|
188 * |
|
189 * @since S60 v5.0 |
|
190 * @param - |
|
191 * @return plug-in UI type |
|
192 */ |
|
193 IMPORT_C const TInt & PluginUiType() const; |
|
194 |
|
195 /** |
|
196 * Getter for plug-in filter type, non-const. |
|
197 * |
|
198 * @since S60 v5.0 |
|
199 * @param - |
|
200 * @return plug-in filter type |
|
201 */ |
|
202 IMPORT_C TInt & PluginFilterType(); |
|
203 |
|
204 /** |
|
205 * Getter for plug-in filter type, const. |
|
206 * |
|
207 * @since S60 v5.0 |
|
208 * @param - |
|
209 * @return plug-in filter type |
|
210 */ |
|
211 IMPORT_C const TInt & PluginFilterType() const; |
|
212 |
|
213 /** |
|
214 * Getter for plug-in scope, non-const. |
|
215 * |
|
216 * @since S60 v5.0 |
|
217 * @param - |
|
218 * @return plug-in scope |
|
219 */ |
|
220 IMPORT_C TInt & PluginScope(); |
|
221 |
|
222 /** |
|
223 * Getter for plug-in scope, const. |
|
224 * |
|
225 * @since S60 v5.0 |
|
226 * @param - |
|
227 * @return plug-in scope |
|
228 */ |
|
229 IMPORT_C const TInt & PluginScope() const; |
|
230 |
|
231 /** |
|
232 * Getter for plug-in display order, non-const. |
|
233 * Determines the order in which the plugins are |
|
234 * displayed in the user interface. |
|
235 * |
|
236 * @since S60 v5.0 |
|
237 * @param - |
|
238 * @return plug-in order |
|
239 */ |
|
240 IMPORT_C TInt & PluginDisplayOrder(); |
|
241 |
|
242 /** |
|
243 * Getter for plug-in display order, const. |
|
244 * Determines the order in which the plugins are |
|
245 * displayed in the user interface. |
|
246 * |
|
247 * @since S60 v5.0 |
|
248 * @param - |
|
249 * @return plug-in order |
|
250 */ |
|
251 IMPORT_C const TInt & PluginDisplayOrder() const; |
|
252 |
|
253 /** |
|
254 * Getter for plug-in RID, non-const. |
|
255 * |
|
256 * @since S60 v5.0 |
|
257 * @param - |
|
258 * @return plug-in RID |
|
259 */ |
|
260 IMPORT_C TInt & PluginRID(); |
|
261 |
|
262 /** |
|
263 * Getter for plug-in RID, const. |
|
264 * |
|
265 * @since S60 v5.0 |
|
266 * @param - |
|
267 * @return plug-in RID |
|
268 */ |
|
269 IMPORT_C const TInt & PluginRID() const; |
|
270 |
|
271 /** |
|
272 * Getter for plug-in name, non-const. |
|
273 * |
|
274 * @param - |
|
275 * @return plug-in name |
|
276 */ |
|
277 IMPORT_C HBufC *& PluginName(); |
|
278 |
|
279 /** |
|
280 * Getter for plug-in name, const. |
|
281 * |
|
282 * @param - |
|
283 * @return plug-in name |
|
284 */ |
|
285 IMPORT_C const TDesC & PluginName() const; |
|
286 |
|
287 /** |
|
288 * Getter for plug-in group icon file name, non-const. |
|
289 * |
|
290 * @since S60 v5.0 |
|
291 * @param - |
|
292 * @return icon file name |
|
293 */ |
|
294 IMPORT_C HBufC *& IconFile(); |
|
295 |
|
296 /** |
|
297 * Getter for plug-in group icon file name, const. |
|
298 * |
|
299 * @since S60 v5.0 |
|
300 * @param - |
|
301 * @return icon file name |
|
302 */ |
|
303 IMPORT_C const TDesC & IconFile() const; |
|
304 |
|
305 /** |
|
306 * Getter for plug-in group icon bitmap, non-const. |
|
307 * |
|
308 * @since S60 v5.0 |
|
309 * @param - |
|
310 * @return icon bitmap |
|
311 */ |
|
312 IMPORT_C CFbsBitmap *& Icon(); |
|
313 |
|
314 /** |
|
315 * Getter for plug-in group icon bitmap, const. |
|
316 * |
|
317 * @since S60 v5.0 |
|
318 * @param - |
|
319 * @return icon bitmap |
|
320 */ |
|
321 IMPORT_C const CFbsBitmap * Icon() const; |
|
322 |
|
323 /** |
|
324 * Getter for plug-in mask bitmap, non-const. |
|
325 * |
|
326 * @since S60 v5.0 |
|
327 * @param - |
|
328 * @return mask bitmap |
|
329 */ |
|
330 IMPORT_C CFbsBitmap *& Mask(); |
|
331 |
|
332 /** |
|
333 * Getter for plug-in mask bitmap, const. |
|
334 * |
|
335 * @since S60 v5.0 |
|
336 * @param - |
|
337 * @return mask bitmap |
|
338 */ |
|
339 IMPORT_C const CFbsBitmap * Mask() const; |
|
340 |
|
341 /** |
|
342 * Getter for parameter descriptor array, non-const. |
|
343 * |
|
344 * @since S60 v5.0 |
|
345 * @param - |
|
346 * @return pointer to descriptor array |
|
347 */ |
|
348 IMPORT_C CDesCArray & Parameters(); |
|
349 |
|
350 /** |
|
351 * Getter for parameter descriptor array, const. |
|
352 * |
|
353 * @since S60 v5.0 |
|
354 * @param - |
|
355 * @return pointer to descriptor array |
|
356 */ |
|
357 IMPORT_C const CDesCArray & Parameters() const; |
|
358 |
|
359 /** |
|
360 * Getter for soft key 1 command ID, non-const. |
|
361 * |
|
362 * @since S60 v5.0 |
|
363 * @param - |
|
364 * @return command ID for soft key 1 |
|
365 */ |
|
366 IMPORT_C CArrayFix<TInt> & Sk1Cmds(); |
|
367 |
|
368 /** |
|
369 * Getter for soft key 1 command ID, const. |
|
370 * |
|
371 * @since S60 v5.0 |
|
372 * @param - |
|
373 * @return command ID for soft key 1 |
|
374 */ |
|
375 IMPORT_C const CArrayFix<TInt> & Sk1Cmds() const; |
|
376 |
|
377 /** |
|
378 * Getter for soft key 1 texts, non-const. |
|
379 * |
|
380 * @since S60 v5.0 |
|
381 * @param - |
|
382 * @return soft key texts |
|
383 */ |
|
384 IMPORT_C CDesCArray & Sk1Texts(); |
|
385 |
|
386 /** |
|
387 * Getter for soft key 1 texts, const. |
|
388 * |
|
389 * @since S60 v5.0 |
|
390 * @param - |
|
391 * @return soft key texts |
|
392 */ |
|
393 IMPORT_C const CDesCArray & Sk1Texts() const; |
|
394 |
|
395 /** |
|
396 * Getter for soft key 2 command ID, non-const. |
|
397 * |
|
398 * @since S60 v5.0 |
|
399 * @param - |
|
400 * @return command ID for soft key 2 |
|
401 */ |
|
402 IMPORT_C CArrayFix<TInt> & Sk2Cmds(); |
|
403 |
|
404 /** |
|
405 * Getter for soft key 2 command ID, const. |
|
406 * |
|
407 * @since S60 v5.0 |
|
408 * @param - |
|
409 * @return command ID for soft key 2 |
|
410 */ |
|
411 IMPORT_C const CArrayFix<TInt> & Sk2Cmds() const; |
|
412 |
|
413 /** |
|
414 * Getter for soft key 2 texts, non-const. |
|
415 * |
|
416 * @since S60 v5.0 |
|
417 * @param - |
|
418 * @return soft key texts |
|
419 */ |
|
420 IMPORT_C CDesCArray & Sk2Texts(); |
|
421 |
|
422 /** |
|
423 * Getter for soft key 1 texts, const. |
|
424 * |
|
425 * @since S60 v5.0 |
|
426 * @param - |
|
427 * @return soft key texts |
|
428 */ |
|
429 IMPORT_C const CDesCArray & Sk2Texts() const; |
|
430 |
|
431 /** |
|
432 * Getter for middle soft key command ID, non-const. |
|
433 * |
|
434 * @since S60 v5.0 |
|
435 * @param - |
|
436 * @return command ID for soft key 2 |
|
437 */ |
|
438 IMPORT_C CArrayFix<TInt> & MSKCmds(); |
|
439 |
|
440 /** |
|
441 * Getter for middle soft key command ID, const. |
|
442 * |
|
443 * @since S60 v5.0 |
|
444 * @param - |
|
445 * @return command ID for soft key 2 |
|
446 */ |
|
447 IMPORT_C const CArrayFix<TInt> & MSKCmds() const; |
|
448 |
|
449 /** |
|
450 * Getter for middle soft key texts, non-const. |
|
451 * |
|
452 * @since S60 v5.0 |
|
453 * @param - |
|
454 * @return soft key texts |
|
455 */ |
|
456 IMPORT_C CDesCArray & MSKTexts(); |
|
457 |
|
458 /** |
|
459 * Getter for middle soft key texts, const. |
|
460 * |
|
461 * @since S60 v5.0 |
|
462 * @param - |
|
463 * @return soft key texts |
|
464 */ |
|
465 IMPORT_C const CDesCArray & MSKTexts() const; |
|
466 |
|
467 /** |
|
468 * Getter for menu items, non-const. |
|
469 * |
|
470 * @since S60 v5.0 |
|
471 * @param - |
|
472 * @return reference to menu item array |
|
473 */ |
|
474 IMPORT_C CMenuItemArray & MenuItems(); |
|
475 |
|
476 /** |
|
477 * Getter for menu items, const. |
|
478 * |
|
479 * @since S60 v5.0 |
|
480 * @param - |
|
481 * @return reference to menu item array |
|
482 */ |
|
483 IMPORT_C const CMenuItemArray & MenuItems() const; |
|
484 |
|
485 /** |
|
486 * Externalises the object. |
|
487 * All the member variables are serialized into the stream, |
|
488 * except for the CFbsBitmap members iIcon and iMask. For those, |
|
489 * only file path is stored, and the icons need to be created |
|
490 * from file when internalizing the object. |
|
491 * |
|
492 * @since S60 v5.0 |
|
493 * @param aStream - write stream |
|
494 * @return - |
|
495 */ |
|
496 IMPORT_C void ExternalizeL(RWriteStream& aStream) const; |
|
497 |
|
498 /** InternalizeL |
|
499 * |
|
500 * Internalises the object. |
|
501 * All the member variables are serialized into the stream, |
|
502 * except for the CFbsBitmap members iIcon and iMask. For those, |
|
503 * only file path is stored, and the icons need to be created |
|
504 * from file when internalizing the object. |
|
505 * |
|
506 * @since S60 v5.0 |
|
507 * @param aStream - read stream |
|
508 * @return - |
|
509 */ |
|
510 IMPORT_C void InternalizeL(RReadStream& aStream); |
|
511 |
|
512 |
|
513 protected: |
|
514 private: |
|
515 |
|
516 CPluginInfo (); |
|
517 |
|
518 void ConstructL (); |
|
519 |
|
520 private: // data |
|
521 |
|
522 /** |
|
523 * Plug-in DLL name |
|
524 */ |
|
525 HBufC * iPluginDllName; |
|
526 |
|
527 /** |
|
528 * Plug-in DLL UID 2 |
|
529 */ |
|
530 TUid iUID2; |
|
531 |
|
532 /** |
|
533 * Plug-in DLL UID 3 |
|
534 */ |
|
535 TUid iUID3; |
|
536 |
|
537 /** |
|
538 * Plug-in UI type |
|
539 */ |
|
540 TInt iPluginUiType; |
|
541 |
|
542 /** |
|
543 * Plug-in filter type |
|
544 */ |
|
545 TInt iPluginFilterType; |
|
546 |
|
547 /** |
|
548 * Plug-in scope |
|
549 */ |
|
550 TInt iScope; |
|
551 |
|
552 /** |
|
553 * Plug-in run-time ID (RID) |
|
554 */ |
|
555 TInt iPluginRID; |
|
556 |
|
557 /** |
|
558 * Plug-in display order |
|
559 */ |
|
560 TInt iPluginDisplayOrder; |
|
561 |
|
562 /** |
|
563 * Plug-in name |
|
564 */ |
|
565 HBufC * iPluginName; |
|
566 |
|
567 /** |
|
568 * Icon name |
|
569 */ |
|
570 HBufC * iIconFileName; |
|
571 |
|
572 /** |
|
573 * Icon bitmap |
|
574 */ |
|
575 CFbsBitmap * iIcon; |
|
576 |
|
577 /** |
|
578 * Icon mask bitmap |
|
579 */ |
|
580 CFbsBitmap * iMask; |
|
581 |
|
582 /** |
|
583 * Parameter array |
|
584 */ |
|
585 CDesCArray * iParams; |
|
586 |
|
587 /** |
|
588 * Soft key 1 command ID |
|
589 */ |
|
590 CArrayFix<TInt> * iSk1Cmds; |
|
591 |
|
592 /** |
|
593 * Soft key 1 text |
|
594 */ |
|
595 CDesCArray * iSk1Texts; |
|
596 |
|
597 /** |
|
598 * Soft key 2 command ID |
|
599 */ |
|
600 CArrayFix<TInt> * iSk2Cmds; |
|
601 |
|
602 /** |
|
603 * Soft key 2 text |
|
604 */ |
|
605 CDesCArray * iSk2Texts; |
|
606 |
|
607 /** |
|
608 * Middle soft key command ID |
|
609 */ |
|
610 CArrayFix<TInt> * iMSKCmds; |
|
611 |
|
612 /** |
|
613 * Middle soft key text |
|
614 */ |
|
615 CDesCArray * iMSKTexts; |
|
616 |
|
617 |
|
618 /** |
|
619 * Menu items |
|
620 */ |
|
621 CMenuItemArray * iMenuItems; |
|
622 |
|
623 }; |
|
624 |
|
625 |
|
626 #endif // PLUGININFO_H |