|
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: AI2 main class |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_AIFW_H |
|
20 #define C_AIFW_H |
|
21 |
|
22 #include <e32base.h> |
|
23 #include <aicontentpublisher.h> |
|
24 #include <centralrepository.h> |
|
25 #include <cenrepnotifyhandler.h> |
|
26 |
|
27 #include "aifwdefs.h" |
|
28 #include "aicontentmodel.h" |
|
29 #include "aifweventhandler.h" |
|
30 |
|
31 class CAiUiControllerManager; |
|
32 class CAiContentPluginManager; |
|
33 class CAiWsPluginManager; |
|
34 class CAiPluginStateManager; |
|
35 class RConeResourceLoader; |
|
36 class CAiContentPublisher; |
|
37 class MAiPSPropertyObserver; |
|
38 class CAiNetworkListener; |
|
39 |
|
40 /** |
|
41 * @ingroup group_aifw |
|
42 * |
|
43 * Active Idle Framework main class. |
|
44 */ |
|
45 NONSHARABLE_CLASS( CAiFw ) : |
|
46 public CBase, |
|
47 public MAiFwEventHandler, |
|
48 public MCenRepNotifyHandlerCallback |
|
49 { |
|
50 public: // Constructors and destructors |
|
51 |
|
52 /** |
|
53 * Creates and returns a new Active Idle Framework object. |
|
54 * |
|
55 * @return new Active Idle Framework object. The object is also left |
|
56 * on the cleanup stack. |
|
57 * @exception Any of the system-wide error codes if framework creation |
|
58 * fails due to an unrecoverable error. |
|
59 */ |
|
60 IMPORT_C static CAiFw* NewLC(); |
|
61 |
|
62 ~CAiFw(); |
|
63 |
|
64 public: // New functions |
|
65 |
|
66 /** |
|
67 * Runs the Active Idle Framework. This function returns when the |
|
68 * framework is shut down. |
|
69 * |
|
70 * @exception Any of the system-wide error codes if the framework |
|
71 * encounters a fatal initialization or run-time error. |
|
72 */ |
|
73 IMPORT_C void RunL(); |
|
74 |
|
75 private: // Constructors |
|
76 CAiFw(); |
|
77 void ConstructL(); |
|
78 |
|
79 private: // From MAiFwEventHandler |
|
80 |
|
81 /** |
|
82 * @see MAiFwEventHandler |
|
83 */ |
|
84 void AppEnvReadyL(); |
|
85 |
|
86 /** |
|
87 * @see MAiFwEventHandler |
|
88 */ |
|
89 void HandleUiReadyEventL( CAiUiController& aUiController ); |
|
90 |
|
91 /** |
|
92 * @see MAiFwEventHandler |
|
93 */ |
|
94 void HandleActivateUI(); |
|
95 |
|
96 /** |
|
97 * @see MAiFwEventHandler |
|
98 */ |
|
99 void HandleUiShutdown( CAiUiController& aUiController ); |
|
100 |
|
101 /** |
|
102 * @see MAiFwEventHandler |
|
103 */ |
|
104 void HandleLoadPluginL( const TAiPublisherInfo& aPublisherInfo ); |
|
105 |
|
106 /** |
|
107 * @see MAiFwEventHandler |
|
108 */ |
|
109 void HandleDestroyPluginL( const TAiPublisherInfo& aPublisherInfo ); |
|
110 |
|
111 /** |
|
112 * @see MAiFwEventHandler |
|
113 */ |
|
114 void HandlePluginEvent( const TDesC& aParam ); |
|
115 |
|
116 /** |
|
117 * @see MAiFwEventHandler |
|
118 */ |
|
119 void HandlePluginEventL( const TAiPublisherInfo& aPublisherInfo, const TDesC& aParam ); |
|
120 |
|
121 /** |
|
122 * @see MAiFwEventHandler |
|
123 */ |
|
124 TBool HasMenuItemL( const TAiPublisherInfo& aPublisherInfo, const TDesC& aMenuItem ); |
|
125 |
|
126 /** |
|
127 * @see MAiFwEventHandler |
|
128 */ |
|
129 TBool RefreshContent( const TDesC& aContentCid ); |
|
130 |
|
131 /** |
|
132 * @see MAiFwEventHandler |
|
133 */ |
|
134 TBool QueryIsMenuOpen(); |
|
135 |
|
136 /** |
|
137 * @see MAiFwEventHandler |
|
138 */ |
|
139 void ProcessStateChange( TAifwStates aState ); |
|
140 |
|
141 private: // From MCenRepNotifyHandlerCallback |
|
142 |
|
143 /** |
|
144 * @see MCenRepNotifyHandlerCallback |
|
145 */ |
|
146 void HandleNotifyInt( TUint32 aId, TInt aNewValue ); |
|
147 |
|
148 private: // New functions |
|
149 |
|
150 static TInt HandleFocusChangeEvent( TAny* aSelf ); |
|
151 static TInt HandleRestartEvent( TAny* aSelf ); |
|
152 void SwapUiControllerL( TBool aToExtHS ); |
|
153 |
|
154 private: // Data |
|
155 |
|
156 /** |
|
157 * UI Controller manager, Owned. |
|
158 */ |
|
159 CAiUiControllerManager* iUiControllerManager; |
|
160 |
|
161 /** |
|
162 * Content plugin manager, Owned. |
|
163 */ |
|
164 CAiContentPluginManager* iPluginManager; |
|
165 |
|
166 /** |
|
167 * Window server plug-in manager, Owned. |
|
168 */ |
|
169 CAiWsPluginManager* iWsPluginManager; |
|
170 |
|
171 /** |
|
172 * Notify handler for cenrep, Owned. |
|
173 */ |
|
174 CCenRepNotifyHandler* iNotifyHandler; |
|
175 |
|
176 /** |
|
177 * Notify handler for cenrep, Owned. |
|
178 */ |
|
179 CCenRepNotifyHandler* iNotifyHandlerESS; |
|
180 |
|
181 /** |
|
182 * Idle repository, Owned. |
|
183 */ |
|
184 CRepository* iAIRepository; |
|
185 |
|
186 /** |
|
187 * Idle restart PS observer, Owned. |
|
188 */ |
|
189 MAiPSPropertyObserver* iIdleRestartObserver; |
|
190 |
|
191 TBool iLibrariesLoaded; |
|
192 |
|
193 RLibrary iLibrary1; |
|
194 RLibrary iLibrary2; |
|
195 RLibrary iLibrary3; |
|
196 }; |
|
197 |
|
198 #endif // C_AIFW_H |
|
199 |