27 #include <aifwdefs.h> |
27 #include <aifwdefs.h> |
28 #include "aistateobserver.h" |
28 #include "aistateobserver.h" |
29 |
29 |
30 // Forward declarations |
30 // Forward declarations |
31 class CAiPluginFactory; |
31 class CAiPluginFactory; |
32 class CAiCpsCommandBuffer; |
32 class TAiFwPublisherInfo; |
33 class CHsContentPublisher; |
33 class CHsContentPublisher; |
34 class THsPublisherInfo; |
34 class THsPublisherInfo; |
35 |
35 |
36 /** |
36 /** |
37 * State Manager |
37 * State Manager |
38 * |
38 * |
39 * @ingroup group_aifw |
39 * @ingroup group_aifw |
40 * @lib aifw.lib |
40 * @lib aifw.lib |
41 * @since S60 5.0 |
41 * @since S60 5.2 |
42 */ |
42 */ |
43 NONSHARABLE_CLASS( CAiStateManager ) : public CBase, |
43 NONSHARABLE_CLASS( CAiStateManager ) : public CBase, |
44 public MAiStateObserver |
44 public MAiStateObserver |
45 { |
45 { |
46 private: |
46 private: |
100 TAiFwState aReason ); |
100 TAiFwState aReason ); |
101 |
101 |
102 /** |
102 /** |
103 * @see MAiStateObserver |
103 * @see MAiStateObserver |
104 */ |
104 */ |
105 TInt NotifyLoadPlugin( const THsPublisherInfo& aInfo, |
105 void NotifyLoadPlugin( const TAiFwPublisherInfo& aInfo ); |
106 TAiFwLoadReason aReason ); |
106 |
107 |
107 /** |
108 /** |
108 * @see MAiStateObserver |
109 * @see MAiStateObserver |
109 */ |
110 */ |
110 void NotifyDestroyPlugin( const TAiFwPublisherInfo& aInfo ); |
111 void NotifyDestroyPlugin( const THsPublisherInfo& aInfo, |
|
112 TAiFwDestroyReason aReason ); |
|
113 |
111 |
114 /** |
112 /** |
115 * @see MAiStateObserver |
113 * @see MAiStateObserver |
116 */ |
114 */ |
117 void NotifyReloadPlugins(); |
115 void NotifyReloadPlugins(); |
120 /** |
118 /** |
121 * @see MAiStateObserver |
119 * @see MAiStateObserver |
122 */ |
120 */ |
123 void NotifyReleasePlugins( const RArray<TUid>& aUidList ); |
121 void NotifyReleasePlugins( const RArray<TUid>& aUidList ); |
124 |
122 |
|
123 public: |
|
124 // new functions |
|
125 |
|
126 /** |
|
127 * Runs plugin startup sequence |
|
128 * |
|
129 * @since S60 5.2 |
|
130 * @param aPlugin Plugin to start |
|
131 * @param aReason Start reason |
|
132 */ |
|
133 void StartPlugin( CHsContentPublisher& aPlugin, TInt aReason ); |
|
134 |
|
135 /** |
|
136 * Runs plugin shutdown sequence |
|
137 * |
|
138 * @since S60 5.2 |
|
139 * @param aPlugin Plugin to stop |
|
140 * @param aReason Stop reason |
|
141 */ |
|
142 void StopPlugin( CHsContentPublisher& aPlugin, TInt aReason ); |
|
143 |
125 private: |
144 private: |
126 // new functions |
145 // new functions |
127 |
146 |
128 /** |
147 /** |
129 * Evaluates next state |
148 * Evaluates next state |
160 * Process online / offline state change for all plugins |
179 * Process online / offline state change for all plugins |
161 * |
180 * |
162 * @since S60 5.2 |
181 * @since S60 5.2 |
163 */ |
182 */ |
164 void ProcessOnlineStateChange(); |
183 void ProcessOnlineStateChange(); |
165 |
184 |
166 /** |
|
167 * Runs plugin startup sequence |
|
168 * |
|
169 * @since S60 5.2 |
|
170 * @param aPlugin Plugin to start |
|
171 * @param aReason Start reason |
|
172 */ |
|
173 void StartPlugin( CHsContentPublisher& aPlugin, |
|
174 CHsContentPublisher::TStartReason aReason ); |
|
175 |
|
176 /** |
|
177 * Runs plugin shutdown sequence |
|
178 * |
|
179 * @since S60 5.2 |
|
180 * @param aPlugin Plugin to stop |
|
181 * @param aReason Stop reason |
|
182 */ |
|
183 void StopPlugin( CHsContentPublisher& aPlugin, |
|
184 CHsContentPublisher::TStopReason aReason ); |
|
185 |
|
186 /** |
|
187 * Destroys all plugins from plugin factory |
|
188 * |
|
189 * @since S60 5.2 |
|
190 */ |
|
191 void DestroyPlugins(); |
|
192 |
|
193 /** |
|
194 * Flushes cps command buffer |
|
195 * |
|
196 * @since S60 5.2 |
|
197 */ |
|
198 void FlushCommandBuffer(); |
|
199 |
|
200 private: |
185 private: |
201 // data |
186 // data |
202 |
187 |
203 /** Plugin Factory, Not owned */ |
188 /** Plugin Factory, Not owned */ |
204 CAiPluginFactory& iFactory; |
189 CAiPluginFactory& iFactory; |
205 /** CPS Command buffer, Owned */ |
|
206 CAiCpsCommandBuffer* iCommandBuffer; |
|
207 /** Current state */ |
190 /** Current state */ |
208 TState iCurrentState; |
191 TState iCurrentState; |
209 /** Flags */ |
192 /** Flags */ |
210 TBitFlags32 iFlags; |
193 TBitFlags32 iFlags; |
211 /** Halted flag */ |
194 /** Halted flag */ |
212 TBool iHalt; |
195 TBool iHalt; |
213 /** List of plugins which should be reloaded */ |
196 /** List of plugins which should be reloaded */ |
214 RArray<THsPublisherInfo> iReloadPlugins; |
197 RArray<THsPublisherInfo> iReloadPlugins; |
215 |
198 |
216 private: |
199 private: |
217 // friend classes |
200 // friend classes |
218 |
201 |
219 #ifdef _AIFW_UNIT_TEST |
202 #ifdef _AIFW_UNIT_TEST |
220 friend class UT_AiStateManager; |
203 friend class UT_AiStateManager; |