|
1 /* |
|
2 * Copyright (c) 2005 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: AppUI for PhoneUI |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CPHONEAPPUI_H |
|
20 #define CPHONEAPPUI_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <aknappui.h> |
|
24 #include <eikbtgpc.h> |
|
25 #include <eikmenub.h> |
|
26 #include "mphonepubsubobserver.h" |
|
27 #include "cphonerecoverysystem.h" |
|
28 |
|
29 // FORWARD DECLARATIONS |
|
30 class CPhoneViewController; |
|
31 class CPhoneUIController; |
|
32 class CPhoneQwertyHandler; |
|
33 class CEnvironmentChangeNotifier; |
|
34 |
|
35 // CLASS DECLARATION |
|
36 |
|
37 /** |
|
38 * AppUI for the PhoneUI. |
|
39 * |
|
40 * @since 4.0 |
|
41 * |
|
42 */ |
|
43 class CPhoneAppUI : |
|
44 public CAknAppUi, |
|
45 public MCoeViewActivationObserver, |
|
46 public MAknAliasKeyCodeResolver, |
|
47 private MPhonePubSubObserver |
|
48 { |
|
49 public: // Constructors and destructor |
|
50 |
|
51 /** |
|
52 * C++ default constructor. |
|
53 */ |
|
54 CPhoneAppUI(); |
|
55 |
|
56 /** |
|
57 * Destructor. |
|
58 */ |
|
59 ~CPhoneAppUI(); |
|
60 |
|
61 /** |
|
62 * Symbian OS constructor. |
|
63 */ |
|
64 void ConstructL(); |
|
65 |
|
66 public: // Functions from base classes |
|
67 |
|
68 /** |
|
69 * From CAknAppUi, handles window server events. |
|
70 * @param aEvent event. |
|
71 * @param aDestination destination control. |
|
72 */ |
|
73 virtual void HandleWsEventL( |
|
74 const TWsEvent& aEvent, |
|
75 CCoeControl* aDestination ); |
|
76 |
|
77 /** |
|
78 * From CAknAppUi, handle key events. |
|
79 * @param aKeyEvent a key event |
|
80 * @param aType a key event type |
|
81 */ |
|
82 TKeyResponse HandleKeyEventL( |
|
83 const TKeyEvent& aKeyEvent, |
|
84 TEventCode aType ); |
|
85 |
|
86 /** |
|
87 * From CAknAppUi, handles command. |
|
88 * |
|
89 * This method is called first when command is to be performed. Then |
|
90 * control flow goes to HandleCommandL. |
|
91 * |
|
92 * @param aCommand command to be handled. |
|
93 */ |
|
94 void ProcessCommandL( TInt aCommand ); |
|
95 |
|
96 /** |
|
97 * From CAknAppUi, handles commands. |
|
98 * |
|
99 * @param aCommand It is the code of the command to be handled. |
|
100 */ |
|
101 void HandleCommandL( TInt aCommand ); |
|
102 |
|
103 /** |
|
104 * From CAknAppUi, initialise a menupane (dynamic). |
|
105 * |
|
106 * @param aResourceId It is the resource id for the pane. |
|
107 * @param aMenuPane It is the menu pane corresponding to the resource. |
|
108 */ |
|
109 void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ); |
|
110 |
|
111 /** |
|
112 * From CAknAppUi, initialise a menubar (dynamic). |
|
113 * |
|
114 * @param aResourceId It is the resource id for the bar. |
|
115 * @param aMenuBar It is the menu bar corresponding to the resource. |
|
116 */ |
|
117 void DynInitMenuBarL( TInt aResourceId, CEikMenuBar* aMenuBar ); |
|
118 |
|
119 /** |
|
120 * From CAknAppUi, indicates when app ui is on the foreground. |
|
121 * @param aForeground It is true if app is on the foreground. |
|
122 */ |
|
123 void HandleForegroundEventL( TBool aForeground ); |
|
124 |
|
125 /** |
|
126 * From CAknAppUi, handles status pane size change. |
|
127 */ |
|
128 void HandleStatusPaneSizeChange(); |
|
129 |
|
130 /** |
|
131 * From CAknAppUi. For idle state monitor |
|
132 */ |
|
133 void HandleApplicationSpecificEventL( |
|
134 TInt aType, |
|
135 const TWsEvent& aEvent ); |
|
136 |
|
137 /** |
|
138 * From CAknAppUi, handles resouce changes. |
|
139 */ |
|
140 void HandleResourceChangeL( TInt aType ); |
|
141 |
|
142 /** |
|
143 * From MCoeViewActivationObserver |
|
144 */ |
|
145 void HandleViewActivation( |
|
146 const TVwsViewId& aNewlyActivatedViewId, |
|
147 const TVwsViewId& aViewIdToBeDeactivated ); |
|
148 |
|
149 /** |
|
150 * From CAknAppUi |
|
151 * Handles view deactivation. |
|
152 * @param aViewIdToBeDeactivated:Id of view to be deactivated. |
|
153 * @param aNewlyActivatedViewId: Id of view to be activated. |
|
154 */ |
|
155 void HandleViewDeactivation( |
|
156 const TVwsViewId& aViewIdToBeDeactivated, |
|
157 const TVwsViewId& aNewlyActivatedViewId ); |
|
158 |
|
159 /** |
|
160 * From CCoeAppUi |
|
161 * Returns help context |
|
162 */ |
|
163 virtual CArrayFix<TCoeHelpContext>* HelpContextL() const; |
|
164 |
|
165 // STARTUP SIGNALLING |
|
166 |
|
167 /** |
|
168 * Performs startup signalling. |
|
169 * |
|
170 * Calls either idle or security signalling. |
|
171 */ |
|
172 static TInt DoStartupSignalL( TAny* aAny ); |
|
173 |
|
174 /** |
|
175 * Idle signalling. |
|
176 */ |
|
177 TInt DoStartupSignalIdleL(); |
|
178 |
|
179 /** |
|
180 * Security signalling. |
|
181 */ |
|
182 TInt DoStartupSignalSecurityL(); |
|
183 |
|
184 public: // From MPhonePubSubObserver |
|
185 |
|
186 /** |
|
187 * This function is called when there is property value change. |
|
188 * @param aCategory Category of the property |
|
189 * @param aKey Property key that is changed |
|
190 * @param aValue New property value |
|
191 */ |
|
192 IMPORT_C virtual void HandlePropertyChangedL( |
|
193 const TUid& aCategory, |
|
194 const TUint aKey, |
|
195 const TInt aValue ); |
|
196 |
|
197 public: // From MAknAliasKeyCodeResolver |
|
198 |
|
199 /** |
|
200 * @see MAknAliasKeyCodeResolver |
|
201 */ |
|
202 TInt GetAliasKeyCode( TUint& aCode, |
|
203 const TKeyEvent& aKeyEvent, |
|
204 TEventCode aType); |
|
205 |
|
206 private: |
|
207 |
|
208 /** |
|
209 * Handle enviroment changes |
|
210 */ |
|
211 void HandleEnvironmentChangeL( const TInt aChanges ); |
|
212 |
|
213 /** |
|
214 * Process Window server events. |
|
215 */ |
|
216 void ProcessWsEventL( |
|
217 const TWsEvent& aEvent, |
|
218 CCoeControl* aDestination ); |
|
219 |
|
220 void LayoutMainView(); |
|
221 |
|
222 /** |
|
223 * Called in callback |
|
224 */ |
|
225 static TInt HandleCallBackL( TAny* aAny ); |
|
226 |
|
227 /** |
|
228 * Callback pointed to specific instance |
|
229 */ |
|
230 void DoHandleCallBackL(); |
|
231 |
|
232 /** |
|
233 * NoKey specil handling |
|
234 */ |
|
235 void NoKeySpecialHandlingL( |
|
236 const TKeyEvent& aKeyEvent, |
|
237 TEventCode aType); |
|
238 |
|
239 private: // Data types |
|
240 |
|
241 // Startup states. |
|
242 // EPhoneStartupInitial - Initial state. |
|
243 // EPhoneStartedUp - Phone application is ready. |
|
244 // EPhoneIdleStartedUp - Idle application is ready. |
|
245 enum |
|
246 { |
|
247 EPhoneStartupInitial = 0x00000001, |
|
248 EPhoneStartedUp = 0x00000002, |
|
249 EPhoneIdleStartedUp = 0x00000004 |
|
250 }; |
|
251 |
|
252 private: // Data |
|
253 |
|
254 CPhoneViewController *iPhoneViewController; |
|
255 |
|
256 // Phone UI controller |
|
257 CPhoneUIController* iPhoneUIController; |
|
258 |
|
259 // Owned: Eikon server window group. |
|
260 TInt iEikonServerWgId; |
|
261 |
|
262 // STARTUP SIGNALLING |
|
263 |
|
264 // Application (Phone and Idle) startup status. |
|
265 TInt iAppsReady; |
|
266 |
|
267 // Recovery id for startup signalling. |
|
268 TRecoveryId iStartupSignalRecoveryId; |
|
269 |
|
270 // Boolean flag. ETrue iff we have reached light idle |
|
271 TBool iLightIdleReached; |
|
272 |
|
273 // Id of system event client - Idle started up. |
|
274 TInt iIdleReadyEventId; |
|
275 |
|
276 // Id of system event client - topmost application. |
|
277 TInt iTopmostAppId; |
|
278 |
|
279 // Id of system events from Starter states. |
|
280 TInt iStarterEventId; |
|
281 |
|
282 // System evenviroment notifier |
|
283 CEnvironmentChangeNotifier* iEnvChangeNotifier; |
|
284 |
|
285 //Indicates whether onscreen dialer is defined |
|
286 TBool iOnScreenDialer; |
|
287 |
|
288 |
|
289 }; |
|
290 |
|
291 #endif // CPHONEAPPUI_H |
|
292 |
|
293 // End of File |