1 /* |
|
2 * Copyright (c) 2005-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: Loads plugins into plugin array. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_PSLNFWPLUGINHANDLER_H |
|
20 #define C_PSLNFWPLUGINHANDLER_H |
|
21 |
|
22 #include <e32base.h> |
|
23 |
|
24 #include "pslnfwplugininterface.h" |
|
25 |
|
26 class CAknViewAppUi; |
|
27 |
|
28 /** |
|
29 * Loads all found ECOM plugins into plugin array. |
|
30 * |
|
31 * @lib PslnFramework.lib |
|
32 * @since S60 3.1 |
|
33 */ |
|
34 NONSHARABLE_CLASS( CPslnFWPluginHandler ) : public CBase |
|
35 { |
|
36 |
|
37 public: |
|
38 |
|
39 /** |
|
40 * Creates plugin handler. |
|
41 * @param aAppUi pointer to application UI owning the plugin views. |
|
42 * @param aPluginArray array into which client expects to get the ECOM views. |
|
43 * @return new instance of CPslnFWPluginHandler. |
|
44 */ |
|
45 IMPORT_C static CPslnFWPluginHandler* NewL( |
|
46 CAknViewAppUi* aAppUi, |
|
47 CArrayPtrFlat<CPslnFWPluginInterface>* aPluginArray ); |
|
48 |
|
49 /** |
|
50 * Destructor. |
|
51 */ |
|
52 IMPORT_C ~CPslnFWPluginHandler(); |
|
53 |
|
54 /** |
|
55 * Loads all applicable plugins. |
|
56 * @param aPluginArray array into which the plugins should be loaded. |
|
57 */ |
|
58 IMPORT_C void LoadPluginsL( |
|
59 CArrayPtrFlat<CPslnFWPluginInterface>* aPluginArray ); |
|
60 |
|
61 /** |
|
62 * Loads single plugin. |
|
63 * @param aPluginId UID of plugin to load. |
|
64 * @return plugin interface, or NULL if the plugin is not found. |
|
65 */ |
|
66 IMPORT_C CPslnFWPluginInterface* LoadPluginL( const TUid aPluginId ); |
|
67 |
|
68 /** |
|
69 * Creates plugin handler with no array for plugins. |
|
70 * @param aAppUi pointer to application UI owning the plugin views. |
|
71 * @return new instance of CPslnFWPluginHandler. |
|
72 */ |
|
73 IMPORT_C static CPslnFWPluginHandler* NewL( CAknViewAppUi* aAppUi ); |
|
74 |
|
75 private: |
|
76 |
|
77 /* Default constructor. */ |
|
78 CPslnFWPluginHandler( |
|
79 CAknViewAppUi* aAppUi, |
|
80 CArrayPtrFlat<CPslnFWPluginInterface>* aPluginArray ); |
|
81 |
|
82 /** |
|
83 * Starts loading next plugin. |
|
84 */ |
|
85 void LoadNextPlugin(); |
|
86 |
|
87 /** |
|
88 * Creates the plugin interface and appends it to the plugin array. |
|
89 */ |
|
90 void AppendPluginL( const TUid& aImplUid ); |
|
91 |
|
92 /** |
|
93 * Checks that the plugin location is valid. |
|
94 * Invalid locations are those claimed by static views in Psln main view. |
|
95 */ |
|
96 TBool IsInvalidLocation( const TInt& aLoc ) const; |
|
97 |
|
98 private: // data |
|
99 |
|
100 /** |
|
101 * Pointer application UI. |
|
102 * Not own. |
|
103 */ |
|
104 CAknViewAppUi* iAppUi; |
|
105 |
|
106 /** |
|
107 * Personalisation application specific skinning plugins found. |
|
108 * Not own. |
|
109 */ |
|
110 CArrayPtrFlat<CPslnFWPluginInterface>* iPluginArray; |
|
111 |
|
112 /** |
|
113 * Pluginloader goes through this array and loads the plugins into |
|
114 * iPluginArray if they fulfill the criterias. |
|
115 */ |
|
116 RImplInfoPtrArray iImplInfoArray; |
|
117 |
|
118 /** |
|
119 * Used as an iterator to maintain location in iImplInfoArray. |
|
120 */ |
|
121 TInt iImplInfoArrayIterator; |
|
122 |
|
123 }; |
|
124 |
|
125 #endif // C_PSLNFWPLUGINHANDLER_H |
|
126 |
|
127 // End of File |
|