|
1 /* |
|
2 * Copyright (c) 2008-2008 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: Plugin manager, responsible to load the plugins. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_PLUGINMANAGER_H |
|
20 #define C_PLUGINMANAGER_H |
|
21 |
|
22 #include <e32base.h> |
|
23 #include <e32hashtab.h> |
|
24 |
|
25 class REComSession; |
|
26 class CMusicContentPublisher; |
|
27 |
|
28 /** |
|
29 * Plugin manager. |
|
30 * Class used to manage the the ECOM plugins |
|
31 * @since S60 S60 v5.0 |
|
32 */ |
|
33 class CPluginManager : public CActive |
|
34 { |
|
35 public: |
|
36 |
|
37 /** |
|
38 * Standard Symbian 2 phase constructor |
|
39 */ |
|
40 static CPluginManager* NewL( TUid aUid, TAny *aParameter , CMusicContentPublisher* aContentPublisher ); |
|
41 |
|
42 /** |
|
43 * Standard Symbian 2 phase constructor |
|
44 */ |
|
45 static CPluginManager* NewLC( TUid aUid, TAny *aParameter , CMusicContentPublisher* aContentPublisher ); |
|
46 |
|
47 /** |
|
48 * Standard C++ destructor. |
|
49 */ |
|
50 ~CPluginManager(); |
|
51 |
|
52 /** |
|
53 * Gets plugin with provided UID |
|
54 * |
|
55 * @param aUid required plugin |
|
56 * @return pointer to plugin implementation |
|
57 */ |
|
58 TAny* GetImplementation( TUid aUid ); |
|
59 |
|
60 /** |
|
61 * Gets plugin with provided index |
|
62 * |
|
63 * @param aIndex index of plugin |
|
64 * @return pointer to plugin implementation |
|
65 */ |
|
66 TAny* GetImplementation( TInt aIndex ); |
|
67 |
|
68 /** |
|
69 * Gets number of plugins |
|
70 * |
|
71 * @return number of plugins |
|
72 */ |
|
73 TInt GetCount(); |
|
74 |
|
75 protected: |
|
76 |
|
77 /** |
|
78 * From CActive, RunL. |
|
79 * Handles the active object’s request completion event |
|
80 */ |
|
81 void RunL(); |
|
82 |
|
83 /** |
|
84 * From CActive, DoCancel. |
|
85 * Implements cancellation of an outstanding request. |
|
86 */ |
|
87 void DoCancel(); |
|
88 |
|
89 /** |
|
90 * From CActive, RunError. |
|
91 * Method called when leave occured in RunL |
|
92 */ |
|
93 TInt RunError( TInt aError ); |
|
94 |
|
95 private: |
|
96 |
|
97 /** |
|
98 * C++ default constructor. |
|
99 */ |
|
100 CPluginManager( TUid aUid, TAny *aParameter, CMusicContentPublisher* aContentPublisher ); |
|
101 |
|
102 /** |
|
103 * Perform the second phase construction of a CPluginManager object. |
|
104 */ |
|
105 void ConstructL(); |
|
106 |
|
107 /** |
|
108 * Loads ECOM plugins |
|
109 */ |
|
110 void LoadPluginsL(); |
|
111 |
|
112 /** |
|
113 * Cleans plugins table; |
|
114 */ |
|
115 void CleanPluginsTable(); |
|
116 |
|
117 private: //data |
|
118 |
|
119 /** |
|
120 * ECOM handler |
|
121 * Own. |
|
122 */ |
|
123 REComSession* iSession; |
|
124 |
|
125 /** |
|
126 * Map containing plugins |
|
127 * Own. |
|
128 */ |
|
129 RHashMap< TInt32, TAny*> iPluginMap; |
|
130 |
|
131 /** |
|
132 * UID of the interface |
|
133 */ |
|
134 const TUid iUid; |
|
135 |
|
136 /** |
|
137 * Parameter to pass to the object creation method. |
|
138 */ |
|
139 TAny* iParameter; |
|
140 |
|
141 /** |
|
142 * Content Publisher / Parent, not owned. |
|
143 */ |
|
144 CMusicContentPublisher* iContentPublisher; |
|
145 |
|
146 }; |
|
147 |
|
148 #endif // C_PLUGINMANAGER_H |
|
149 |
|
150 // End of File |