|
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 PLUGINLOADER_HPP |
|
22 #define PLUGINLOADER_HPP |
|
23 |
|
24 // INCLUDES |
|
25 #include <e32base.h> |
|
26 |
|
27 #include "imageeditordebugutils.h" |
|
28 |
|
29 // PLUGIN TYPE DEFINITIONS |
|
30 #include "plugintypedef.h" |
|
31 |
|
32 |
|
33 /* CLASS: CPluginLoader |
|
34 * |
|
35 * CPluginLoader is a class loading a polymorphic DLL plug-in. |
|
36 */ |
|
37 class CPluginLoader : public CBase |
|
38 { |
|
39 |
|
40 public: |
|
41 |
|
42 /** @name Methods:*/ |
|
43 //@{ |
|
44 |
|
45 /** NewL factory method, pops cleanupstack |
|
46 * |
|
47 * @param aFileName - plug-in name |
|
48 * @param aUID2 - pointer to UID2, if NULL not checked |
|
49 * @param aUID3 - pointer to UID3, if NULL not checked |
|
50 * @return pointer to created object |
|
51 */ |
|
52 static CPluginLoader * NewL ( |
|
53 const TDesC & aFileName, |
|
54 const TUid * aUID2, |
|
55 const TUid * aUID3 |
|
56 ); |
|
57 |
|
58 /** NewL factory method, does not pop cleanupstack |
|
59 * |
|
60 * @param aFileName - plug-in name |
|
61 * @param aUID2 - pointer to UID2, if NULL not checked |
|
62 * @param aUID3 - pointer to UID3, if NULL not checked |
|
63 * @return pointer to created object |
|
64 */ |
|
65 static CPluginLoader * NewLC ( |
|
66 const TDesC & aFileName, |
|
67 const TUid * aUID2, |
|
68 const TUid * aUID3 |
|
69 ); |
|
70 |
|
71 /** Destructor |
|
72 * @param - |
|
73 * @return - |
|
74 */ |
|
75 virtual ~CPluginLoader (); |
|
76 |
|
77 /** GetPlugin |
|
78 * |
|
79 * Returns plug-in. |
|
80 * |
|
81 * @param - |
|
82 * @return - the loaded and created plug-in |
|
83 */ |
|
84 CPluginType * GetPlugin () const; |
|
85 |
|
86 /** GetPluginDll |
|
87 * |
|
88 * Returns reference to the RLibrary object that has loaded the plug-in. |
|
89 * |
|
90 * @param - |
|
91 * @return - RLibrary |
|
92 */ |
|
93 const RLibrary & GetPluginDll () const; |
|
94 |
|
95 |
|
96 //@} |
|
97 |
|
98 protected: |
|
99 |
|
100 /** @name Methods:*/ |
|
101 //@{ |
|
102 |
|
103 //@} |
|
104 |
|
105 /** @name Members:*/ |
|
106 //@{ |
|
107 |
|
108 //@} |
|
109 |
|
110 private: |
|
111 |
|
112 /** @name Methods:*/ |
|
113 //@{ |
|
114 |
|
115 /** Default constructor, cannot leave. |
|
116 * |
|
117 * @param - |
|
118 * @return - |
|
119 */ |
|
120 CPluginLoader (); |
|
121 |
|
122 /** Second phase constructor, may leave |
|
123 * |
|
124 * @param aFileName - plug-in name |
|
125 * @param aUID2 - pointer to UID2, if NULL not checked |
|
126 * @param aUID3 - pointer to UID3, if NULL not checked |
|
127 */ |
|
128 void ConstructL ( |
|
129 const TDesC & aFileName, |
|
130 const TUid * aUID2, |
|
131 const TUid * aUID3 |
|
132 ); |
|
133 |
|
134 /** Copy constructor, disabled |
|
135 */ |
|
136 CPluginLoader (const CPluginLoader & rhs); |
|
137 |
|
138 /** Assignment operator, disabled |
|
139 */ |
|
140 CPluginLoader & operator= (const CPluginLoader & rhs); |
|
141 |
|
142 //@} |
|
143 |
|
144 /** @name Members:*/ |
|
145 //@{ |
|
146 /// DLL loader |
|
147 RLibrary iLibrary; |
|
148 /// Plugin |
|
149 CPluginType * iPlugin; |
|
150 //@} |
|
151 |
|
152 }; |
|
153 |
|
154 |
|
155 #endif |