|
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 view plugin handler implementation |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef CMPXVIEWPLUGINHANDLER_H |
|
21 #define CMPXVIEWPLUGINHANDLER_H |
|
22 |
|
23 |
|
24 // INCLUDES |
|
25 #include <e32base.h> |
|
26 #include <ecom/ecom.h> |
|
27 #include <mpxpluginhandlerbase.h> |
|
28 #include <mpxviewplugin.h> |
|
29 #include "mpxviewpluginmanager.h" |
|
30 |
|
31 |
|
32 // FORWARD DECLARATIONS |
|
33 class MMPXCustomCommandObserver; |
|
34 |
|
35 |
|
36 // CLASS DECLARATION |
|
37 |
|
38 /** |
|
39 * MPX view plugin handler. |
|
40 * |
|
41 * @lib mpxviewutility.lib |
|
42 * @since S60 v3.1 |
|
43 */ |
|
44 NONSHARABLE_CLASS( CMPXViewPluginHandler ) : public CMPXPluginHandlerBase, |
|
45 public MMPXViewPluginManager |
|
46 { |
|
47 public: |
|
48 |
|
49 /** |
|
50 * Two-phased constructor. |
|
51 * |
|
52 * @since 3.1 |
|
53 * |
|
54 * @param aCommandObserver Observer to handle commands from the plugins |
|
55 * @return Pointer to newly created object. |
|
56 */ |
|
57 static CMPXViewPluginHandler* NewL( |
|
58 MMPXCustomCommandObserver* aCommandObserver, |
|
59 MMPXPluginHandlerObserver& aObserver ); |
|
60 |
|
61 /** |
|
62 * Destructor. |
|
63 */ |
|
64 virtual ~CMPXViewPluginHandler(); |
|
65 |
|
66 /** |
|
67 * Wraper function to resolve view plugin |
|
68 * Resolve view plugin based on the criteria passed in parameter. |
|
69 * |
|
70 * @since 3.0 |
|
71 * @param aUid Specific view plugin uid or plugin type uid. |
|
72 * @param aResolvedPluginType On return, stores the plugin type of |
|
73 * the returned pointer |
|
74 * @param aResolvedPluginImplementationUid On return, stores the implementation |
|
75 * Uid of the resolved plugin |
|
76 * @return Pointer to a view plugin object. Leave if not found. |
|
77 */ |
|
78 CMPXViewPlugin* ResolvePluginL( |
|
79 const TUid& aUid, TUid& aResolvedPluginType, |
|
80 TUid& aResolvedPluginImplementationUid ); |
|
81 |
|
82 /** |
|
83 * Wraper function to resolve view plugin |
|
84 * Resolve view plugin based on the criteria passed in parameter. |
|
85 * |
|
86 * @since 3.0 |
|
87 * @param aUids List of Uids, including specific view plugin uid and/or |
|
88 * plugin type uid. |
|
89 * @param aResolvedPluginType On return, stores the plugin type of |
|
90 * the returned pointer |
|
91 * @param aResolvedPluginImplementationUid On return, stores the implementation |
|
92 * Uid of the resolved plugin |
|
93 * @return Pointer to a view plugin object. Leave if not found. |
|
94 */ |
|
95 CMPXViewPlugin* ResolvePluginL( |
|
96 const RArray<TUid>& aUids, TUid& aResolvedPluginType, |
|
97 TUid& aResolvedPluginImplementationUid ); |
|
98 |
|
99 /** |
|
100 * Wraper function to get a list of plugins that need to be pre-loaded. |
|
101 * |
|
102 * @since 3.0 |
|
103 * @param aUids On return, a list of plugins' uids that match the criteria. |
|
104 * @param aUid of specific application |
|
105 */ |
|
106 void GetPreLoadPluginsL( |
|
107 RArray<TUid>& aUids, const TUid& aUid ); |
|
108 |
|
109 // from base class MMPXViewPluginManager |
|
110 |
|
111 /** |
|
112 * From MMPXViewPluginManager |
|
113 * Return view plugin with specific view plugin uid. |
|
114 * |
|
115 * @since 3.0 |
|
116 * @param aUid Specific view plugin uid. |
|
117 * @return Pointer to a view plugin object. Leave if not found. |
|
118 */ |
|
119 CMPXViewPlugin* PluginL( |
|
120 const TUid& aUid ); |
|
121 |
|
122 /** |
|
123 * From MMPXViewPluginManager |
|
124 * Wraper function to resolve view plugin |
|
125 * Resolve view plugin based on the criteria passed in parameter. |
|
126 * |
|
127 * @since 3.0 |
|
128 * @param aUid Specific view plugin uid or plugin type uid. |
|
129 * @param aResolvedPluginType On return, stores the plugin type of |
|
130 * the returned pointer |
|
131 * @return Pointer to a view plugin object. Leave if not found. |
|
132 */ |
|
133 CMPXViewPlugin* ResolvePluginL( |
|
134 const TUid& aUid, TUid& aResolvedPluginType ); |
|
135 |
|
136 /** |
|
137 * From MMPXViewPluginManager |
|
138 * Wraper function to resolve view plugin |
|
139 * Resolve view plugin based on the criteria passed in parameter. |
|
140 * |
|
141 * @since 3.0 |
|
142 * @param aUids List of Uids, including specific view plugin uid and/or |
|
143 * plugin type uid. |
|
144 * @param aResolvedPluginType On return, stores the plugin type of |
|
145 * the returned pointer |
|
146 * @return Pointer to a view plugin object. Leave if not found. |
|
147 */ |
|
148 CMPXViewPlugin* ResolvePluginL( |
|
149 const RArray<TUid>& aUids, TUid& aResolvedPluginType ); |
|
150 |
|
151 private: |
|
152 |
|
153 /** |
|
154 * C++ default constructor. |
|
155 * |
|
156 * @param aCommandObserver Observer to handle commands from the plugins |
|
157 * @param aObserver handler observer |
|
158 */ |
|
159 CMPXViewPluginHandler( MMPXCustomCommandObserver* aCommandObserver, |
|
160 MMPXPluginHandlerObserver& aObserver ); |
|
161 |
|
162 /** |
|
163 * By default Symbian 2nd phase constructor is private. |
|
164 */ |
|
165 void ConstructL(); |
|
166 |
|
167 /** |
|
168 * From Base CMPXPluginHandlerBase |
|
169 * |
|
170 * Not used, use ResolvePluginL( const RArray/Uid, TUid ) instead |
|
171 */ |
|
172 void ResolvePluginL(); |
|
173 |
|
174 /** |
|
175 * @see CMPXPluginHandlerBase |
|
176 */ |
|
177 TBool IsPluginLoaded(const TUid& aPluginUid); |
|
178 |
|
179 /** |
|
180 * @see CMPXPluginHandlerBase |
|
181 */ |
|
182 void LoadPluginL(const TUid& aPluginUid); |
|
183 |
|
184 /** |
|
185 * @see CMPXPluginHandlerBase |
|
186 */ |
|
187 void UnloadPlugin(const TUid& aPluginUid); |
|
188 |
|
189 private: // data |
|
190 |
|
191 /** |
|
192 * Loaded plugins. The index must correspond in these arrays. |
|
193 */ |
|
194 RPointerArray<CMPXViewPlugin> iLoadedPlugins; |
|
195 RArray<TUid> iLoadPluginUids; |
|
196 |
|
197 MMPXCustomCommandObserver* iCommandObserver; // not owned |
|
198 }; |
|
199 |
|
200 #endif // CMPXVIEWPLUGINHANDLER_H |
|
201 |
|
202 // End of File |