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