|
1 /* |
|
2 * Copyright (c) 2002 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: |
|
15 * Declares UI class for application. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef AUTOLOCKAPPUIPS_H |
|
21 #define AUTOLOCKAPPUIPS_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32std.h> |
|
25 #include <aknappui.h> |
|
26 #include <etelmm.h> |
|
27 #include <aknViewAppUi.h> |
|
28 #include <AknEcs.h> |
|
29 #include <aknnotedialog.h> |
|
30 #include <AknIncallBubbleNotify.h> |
|
31 #include <e32property.h> |
|
32 #include <rmmcustomapi.h> |
|
33 #include "AutolockWait.h" |
|
34 #include "AutoKeyguardObserver.h" |
|
35 |
|
36 #include "AutolockGripStatusObserver.h" |
|
37 #include "AutolockFpsStatusObserver.h" |
|
38 |
|
39 // FORWARD DECLARATIONS |
|
40 class CAutolockContainer; |
|
41 class CAutoLockModel; |
|
42 class CValueObserver; |
|
43 |
|
44 // CONSTANTS |
|
45 const TUid KAutoLockViewId = {101}; // CDMA StartUp needs this UID. |
|
46 |
|
47 // CLASS DECLARATIONS |
|
48 |
|
49 /** |
|
50 * part of emergency call handling when telephony+devicelock is active |
|
51 * this solution is meant only for 3.1 and 3.2 |
|
52 *CEcsNote |
|
53 *It defines security note used in security view. |
|
54 */ |
|
55 class CEcsNote : public CAknNoteDialog |
|
56 { |
|
57 public: // Constructors and destructors |
|
58 /** |
|
59 * C++ constructor. |
|
60 */ |
|
61 CEcsNote(); |
|
62 public: // new |
|
63 /** |
|
64 * Constructs sleeping note |
|
65 */ |
|
66 void ConstructSleepingNoteL(TInt aResourceId); |
|
67 /** |
|
68 * Shows slpeeping note |
|
69 */ |
|
70 TInt ShowNote(); |
|
71 /** |
|
72 * Hides sleeping note |
|
73 */ |
|
74 void SleepNote(); |
|
75 |
|
76 TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, |
|
77 TEventCode aType); |
|
78 |
|
79 /** |
|
80 * API to set the emergency number to be displayed |
|
81 * |
|
82 * aMatchedNumber text to display (e.g. "112" ) |
|
83 */ |
|
84 void SetEmergencyNumber( const TDesC& aMatchedNumber ); |
|
85 |
|
86 public: |
|
87 TBool iNoteOnScreen; |
|
88 }; |
|
89 |
|
90 |
|
91 /** |
|
92 * Application UI class. |
|
93 * Provides support for the following features: |
|
94 * - UIKON control architecture |
|
95 * |
|
96 */ |
|
97 class CAutolockAppUi : public CAknViewAppUi, public MAknEcsObserver, |
|
98 public MAutolockGripStatusObserver, |
|
99 public MAutolockFpsStatusObserver |
|
100 { |
|
101 public: // // Constructors and destructor |
|
102 |
|
103 /** |
|
104 * Symbian OS default constructor. |
|
105 */ |
|
106 void ConstructL(); |
|
107 |
|
108 /** |
|
109 * Destructor. |
|
110 */ |
|
111 ~CAutolockAppUi(); |
|
112 |
|
113 /** |
|
114 * From MAutolockGripStatusObserver |
|
115 */ |
|
116 TBool DeviceLockQueryStatus(); |
|
117 |
|
118 TBool DeviceLockStatus(); |
|
119 |
|
120 /** |
|
121 * From MAutolockFpsStatusObserver |
|
122 */ |
|
123 TBool DeviceFpsLock(TInt iStatus); |
|
124 |
|
125 public: // New functions |
|
126 /** |
|
127 * Activates previous app |
|
128 */ |
|
129 void SwitchToPreviousAppL(); |
|
130 /** |
|
131 * Activates device lock view |
|
132 */ |
|
133 void BringAppToForegroundL(); |
|
134 /** |
|
135 * Pointer to model |
|
136 * |
|
137 * @return CAutoLockModel* |
|
138 */ |
|
139 inline CAutoLockModel* Model() const; |
|
140 /** |
|
141 * Locks voice-key and app-key |
|
142 */ |
|
143 void LockKeysL(); |
|
144 /** |
|
145 * UnLocks voice-key and app-key |
|
146 */ |
|
147 void UnLockKeys(); |
|
148 /** |
|
149 * Locks voice-key |
|
150 */ |
|
151 void LockSideKeyL(); |
|
152 /** |
|
153 * UnLocks voice-key |
|
154 */ |
|
155 void UnLockSideKey(); |
|
156 /** |
|
157 * Returns ETrue if system is locked. |
|
158 */ |
|
159 inline TBool Locked() { return (iSideKey2 != 0); } |
|
160 /** |
|
161 * Checks whether PUK1 dialog is active. |
|
162 */ |
|
163 TBool IsPinBlocked(); |
|
164 /** |
|
165 * Checks whether the phone has done hidden reset. |
|
166 */ |
|
167 TBool HiddenReset(); |
|
168 void EnableWGListChangeEventListening(); |
|
169 void DisableWGListChangeEventListening(); |
|
170 |
|
171 protected: |
|
172 /** |
|
173 * From CEikAppUi, handles the TARM unlock message, other messages |
|
174 * are propagated to the superclass handler. |
|
175 * @param aClientHandleOfTargetWindowGroup The window group that the message was sent to. |
|
176 * @param aMessageUid The message UID. |
|
177 * @param aMessageParameters The message parameters |
|
178 * @return TMessageResponse EMessageHandled if the message was the TARM unlock message, |
|
179 * otherwise the return value from the superclass handler. |
|
180 */ |
|
181 MCoeMessageObserver::TMessageResponse HandleMessageL( |
|
182 TUint32 aClientHandleOfTargetWindowGroup, |
|
183 TUid aMessageUid, |
|
184 const TDesC8& aMessageParameters ); |
|
185 |
|
186 |
|
187 private: |
|
188 // From MEikMenuObserver |
|
189 void DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane); |
|
190 |
|
191 // from CCoeAppUi |
|
192 void HandleForegroundEventL(TBool aForeground); |
|
193 /** |
|
194 * From CAknAppUi, called when screen layout changes |
|
195 */ |
|
196 void HandleScreenDeviceChangedL(); |
|
197 private: |
|
198 /** |
|
199 * From CEikAppUi, takes care of command handling. |
|
200 * @param aCommand command to be handled |
|
201 */ |
|
202 void HandleCommandL(TInt aCommand); |
|
203 |
|
204 /** |
|
205 * From CEikAppUi, handles key events. |
|
206 * @param aKeyEvent Event to handled. |
|
207 * @param aType Type of the key event. |
|
208 * @return Reponse code (EKeyWasConsumed, EKeyWasNotConsumed). |
|
209 */ |
|
210 virtual TKeyResponse HandleKeyEventL( |
|
211 const TKeyEvent& aKeyEvent,TEventCode aType); |
|
212 virtual void HandlePointerEventL(const TPointerEvent& aPointerEvent); |
|
213 private: |
|
214 /** |
|
215 * From AknViewAppUi. Handles pointer-initiated view switch. |
|
216 * @param aEvent Window server event. |
|
217 * @param aDestination Pointer to the control which the event is targeted to. |
|
218 */ |
|
219 void HandleWsEventL( const TWsEvent& aEvent, CCoeControl* aDestination ); |
|
220 |
|
221 /** |
|
222 * Used for communication with SysAp |
|
223 * @param aMessage message enumeration defined in eikon.hrh |
|
224 */ |
|
225 void SendMessageToSysAp(TInt aMessage); |
|
226 |
|
227 /** |
|
228 * From MAknEcsObserver |
|
229 * part of emergency call handling when telephony+devicelock is active |
|
230 * this solution is meant only for 3.1 and 3.2 |
|
231 * handles emergency call |
|
232 */ |
|
233 virtual void HandleEcsEvent( CAknEcsDetector* aEcsDetector, CAknEcsDetector::TState aState ); |
|
234 |
|
235 TBool TarmState(); |
|
236 void HandleWindowGroupListChange(); |
|
237 private: //Data |
|
238 CAutoLockModel* iModel; |
|
239 RTelServer iServer; |
|
240 RMobilePhone iPhone; |
|
241 TInt iAppKey; |
|
242 TInt iSideKey1; |
|
243 TInt iSideKey2; |
|
244 CValueObserver* iPhoneObserver; |
|
245 TBool iLocked; |
|
246 TBool iDeviceLockQueryStatus; |
|
247 // Idle Incall Bubbles. |
|
248 CAknIncallBubble* iIncallBubble; |
|
249 CAutoKeyguardObserver* iKeyguardObserver; |
|
250 CAutolockGripStatusObserver* iGripStatusObserver; |
|
251 CAutolockFpsStatusObserver* iFpsStatusObserver; |
|
252 RMmCustomAPI iCustomPhone; |
|
253 |
|
254 // part of emergency call handling when t//iEmergencySupportReadyelephony+devicelock is active |
|
255 // this solution is meant only for 3.1 and 3.2 |
|
256 CAknEcsDetector* iEcsDetector; |
|
257 CEcsNote* iEcsNote; |
|
258 TBool iEmergencySupportReady; |
|
259 CWait* iWait; |
|
260 TRect aCallButtonRect; |
|
261 }; |
|
262 |
|
263 inline CAutoLockModel* CAutolockAppUi::Model() const |
|
264 {return iModel;} |
|
265 |
|
266 #endif |
|
267 |
|
268 // End of File |