|
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 * |
|
17 */ |
|
18 |
|
19 |
|
20 |
|
21 #ifndef IMAGEEDITORPLUGINSTORAGE_H |
|
22 #define IMAGEEDITORPLUGINSTORAGE_H |
|
23 |
|
24 // INCLUDES |
|
25 #include <e32base.h> |
|
26 #include <e32std.h> |
|
27 |
|
28 #include "imageeditordebugutils.h" |
|
29 |
|
30 // FORWARD DECLARATIONS |
|
31 class CPluginInfo; |
|
32 class RReadStream; |
|
33 class RWriteStream; |
|
34 |
|
35 /* CLASS: CPluginStorage |
|
36 * |
|
37 * |
|
38 */ |
|
39 class CPluginStorage : public CBase |
|
40 { |
|
41 |
|
42 public: |
|
43 |
|
44 /** @name Typedefs:*/ |
|
45 //@{ |
|
46 /// Plug-in group array |
|
47 typedef RPointerArray<CPluginInfo> RPluginInfoArray; |
|
48 //@} |
|
49 |
|
50 /** @name Methods:*/ |
|
51 //@{ |
|
52 |
|
53 /** NewL factory method, pops cleanupstack |
|
54 * |
|
55 * @param - |
|
56 * @return pointer to created CPluginStorage object |
|
57 */ |
|
58 static CPluginStorage * NewL (); |
|
59 |
|
60 /** Destructor |
|
61 * |
|
62 * @param - |
|
63 * @return - |
|
64 */ |
|
65 virtual ~CPluginStorage (); |
|
66 |
|
67 /** CountPlugins |
|
68 * |
|
69 * Counts the number of found plug-ins. |
|
70 * |
|
71 * @param - |
|
72 * @return TInt - count of plug-ins |
|
73 */ |
|
74 TInt CountPlugins() const; |
|
75 |
|
76 /** ResetAndDestroy |
|
77 * |
|
78 * Empty the storage and free allocated resources. |
|
79 * |
|
80 * @param - |
|
81 * @return |
|
82 */ |
|
83 void ResetAndDestroy(); |
|
84 |
|
85 /** FindPluginDll |
|
86 * |
|
87 * Finds plug-in with DLL file name aPluginDll |
|
88 * |
|
89 * @param aPluginDll - plug-in run-time ID |
|
90 * @param aPos - index of the located element |
|
91 * @return Zero, if a matching descriptor is found. Non-zero otherwise. |
|
92 */ |
|
93 TInt FindPluginDll(const TDesC& aPluginDll, TInt& aPos ) const; |
|
94 |
|
95 /** GetPluginInfo |
|
96 * |
|
97 * Returns plug-in information in group aGroup at position aPlugin. |
|
98 * |
|
99 * @param aID - plug-in run-time ID |
|
100 * @return plug-in information class |
|
101 */ |
|
102 CPluginInfo * GetPluginInfo (const TInt aID); |
|
103 |
|
104 /** AddPluginInfoL |
|
105 * |
|
106 * Add a new CPluginInfo instance to the storage. |
|
107 * |
|
108 * @param aGroup - plug-in group index |
|
109 * @param aPlugin - plug-in index |
|
110 * @return - |
|
111 */ |
|
112 void AddPluginInfoL (const CPluginInfo * aPluginInfo); |
|
113 |
|
114 /** ExternalizeL |
|
115 * |
|
116 * Externalizes object. |
|
117 * |
|
118 * @param aStream - write stream |
|
119 * @return - |
|
120 */ |
|
121 void ExternalizeL(RWriteStream& aStream) const; |
|
122 |
|
123 /** InternalizeL |
|
124 * |
|
125 * Internalizes object. |
|
126 * |
|
127 * @param aStream - read stream |
|
128 * @return - |
|
129 */ |
|
130 void InternalizeL(RReadStream& aStream); |
|
131 |
|
132 //@} |
|
133 |
|
134 protected: |
|
135 |
|
136 /** @name Methods:*/ |
|
137 //@{ |
|
138 |
|
139 //@} |
|
140 |
|
141 /** @name Members:*/ |
|
142 //@{ |
|
143 |
|
144 //@} |
|
145 |
|
146 private: |
|
147 |
|
148 /** @name Methods:*/ |
|
149 //@{ |
|
150 |
|
151 /** Default constructor, cannot leave. |
|
152 * |
|
153 * @param - |
|
154 * @return - |
|
155 */ |
|
156 CPluginStorage (); |
|
157 |
|
158 /** Second phase constructor, may leave |
|
159 * |
|
160 * @param - |
|
161 * @return - |
|
162 */ |
|
163 void ConstructL (); |
|
164 |
|
165 /** Copy constructor, disabled |
|
166 */ |
|
167 CPluginStorage (const CPluginStorage & rhs); |
|
168 |
|
169 /** Assignment operator, disabled |
|
170 */ |
|
171 CPluginStorage & operator= (const CPluginStorage & rhs); |
|
172 |
|
173 //@} |
|
174 |
|
175 /** @name Members:*/ |
|
176 //@{ |
|
177 /// Plug-in array |
|
178 RPluginInfoArray iPlugins; |
|
179 //@} |
|
180 |
|
181 }; |
|
182 |
|
183 |
|
184 #endif |