|
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: |
|
15 * Idle state implementation. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef CPHONESTATEIDLE |
|
21 #define CPHONESTATEIDLE |
|
22 |
|
23 // INCLUDES |
|
24 #include "cphonestate.h" |
|
25 #include "tphonecmdparamspeeddial.h" |
|
26 |
|
27 // FORWARD DECLARATIONS |
|
28 |
|
29 // CLASS DECLARATION |
|
30 |
|
31 /** |
|
32 * Idle state |
|
33 */ |
|
34 class CPhoneStateIdle : public CPhoneState |
|
35 { |
|
36 public: |
|
37 |
|
38 /** Dial initiation method. */ |
|
39 enum TDialInitiationMethod |
|
40 { |
|
41 /** Dial initiation method unknown. */ |
|
42 EDialMethodUnknown = 0, |
|
43 /** Dial is initiated by explicit call type selection from menu.*/ |
|
44 EDialMethodMenuSelection = 1, |
|
45 /** Dial is initiated by send command. */ |
|
46 EDialMethodSendCommand = 2, |
|
47 /** Dial is initiated by one key dialing. */ |
|
48 EDialMethodOneKeyDialing = 3 |
|
49 |
|
50 }; |
|
51 |
|
52 /** |
|
53 * Destructor. |
|
54 */ |
|
55 IMPORT_C virtual ~CPhoneStateIdle(); |
|
56 |
|
57 /** |
|
58 * Creates the Idle state class |
|
59 * @param aStateMachine: a container of state objects |
|
60 * @param aViewCommandHandle: handle to the PhoneUIView |
|
61 * @return an instance of class CPhoneStateIdle |
|
62 */ |
|
63 static CPhoneStateIdle* NewL( |
|
64 MPhoneStateMachine* aStateMachine, |
|
65 MPhoneViewCommandHandle* aViewCommandHandle, |
|
66 MPhoneCustomization* aPhoneCustomization ); |
|
67 |
|
68 IMPORT_C virtual void HandleKeyEventL( |
|
69 const TKeyEvent& aKeyEvent, |
|
70 TEventCode aEventCode ); |
|
71 |
|
72 IMPORT_C void HandleKeyMessageL( |
|
73 TPhoneKeyEventMessages aMessage, |
|
74 TKeyCode aCode ); |
|
75 |
|
76 /** |
|
77 * A message handling function for Phone Engine messages |
|
78 * @param aMessage Message from Phone Engine |
|
79 * @param aCallId Call id the message concerns |
|
80 */ |
|
81 IMPORT_C virtual void HandlePhoneEngineMessageL( |
|
82 const TInt aMessage, |
|
83 TInt aCallId ); |
|
84 |
|
85 IMPORT_C virtual TBool HandleCommandL( TInt aCommand ); |
|
86 |
|
87 IMPORT_C virtual TBool ProcessCommandL( TInt aCommand ); |
|
88 |
|
89 /** |
|
90 * Indicates when the Idle app is in the foreground. |
|
91 */ |
|
92 IMPORT_C virtual void HandleIdleForegroundEventL(); |
|
93 |
|
94 /** |
|
95 * Indicates when the Phone app is in the foreground. |
|
96 */ |
|
97 IMPORT_C virtual void HandlePhoneForegroundEventL(); |
|
98 |
|
99 /** |
|
100 * Indicates when the Phone app has lost focus. |
|
101 */ |
|
102 IMPORT_C virtual void HandlePhoneFocusLostEventL(); |
|
103 |
|
104 protected: |
|
105 |
|
106 /** |
|
107 * Handle state-specific behaviour when number entry is cleared |
|
108 */ |
|
109 IMPORT_C virtual void HandleNumberEntryClearedL(); |
|
110 |
|
111 IMPORT_C virtual TBool HandleRemConCommandL( |
|
112 TRemConCoreApiOperationId aOperationId, |
|
113 TRemConCoreApiButtonAction aButtonAct ); |
|
114 |
|
115 /** |
|
116 * Display Incoming Call |
|
117 * @param aCallid call id |
|
118 */ |
|
119 IMPORT_C void DisplayIncomingCallL( TInt aCallId ); |
|
120 |
|
121 /** |
|
122 * Display Call Setup |
|
123 * @param aCallid call id |
|
124 */ |
|
125 IMPORT_C void DisplayCallSetupL( TInt aCallId ); |
|
126 |
|
127 /** |
|
128 * By default EPOC constructor is private. |
|
129 */ |
|
130 IMPORT_C CPhoneStateIdle( |
|
131 MPhoneStateMachine* aStateMachine, |
|
132 MPhoneViewCommandHandle* aViewCommandHandle, |
|
133 MPhoneCustomization* aPhoneCustomization ); |
|
134 |
|
135 /** |
|
136 * ConstructL() |
|
137 */ |
|
138 IMPORT_C virtual void ConstructL(); |
|
139 |
|
140 /** |
|
141 * Dial the specified number. |
|
142 * @param aNumber The number to call. |
|
143 * @param aNumberType A number type. |
|
144 * @param aDialMethod A dial initiation method. |
|
145 */ |
|
146 IMPORT_C virtual void DialL( const TDesC& aNumber, |
|
147 TPhoneNumberType aNumberType, TDialInitiationMethod aDialMethod ); |
|
148 |
|
149 /** |
|
150 * Dial CS multimedia call |
|
151 * @param None |
|
152 */ |
|
153 IMPORT_C void DialMultimediaCallL(); |
|
154 |
|
155 /** |
|
156 * Dial CS voice call |
|
157 * @param None |
|
158 */ |
|
159 IMPORT_C void DialVoiceCallL(); |
|
160 |
|
161 /** |
|
162 * Handles situation when hash key has been kept down long |
|
163 * (long keypress) and the hash character is the only character |
|
164 * in number entry. |
|
165 */ |
|
166 IMPORT_C virtual void OnlyHashInNumberEntryL(); |
|
167 |
|
168 /** |
|
169 * A message handling function for EPEMessageDialling |
|
170 * @param aCallId: the call id of the call |
|
171 */ |
|
172 IMPORT_C virtual void HandleDialingL( TInt aCallId ); |
|
173 |
|
174 /** |
|
175 * This is called when Speed Dial dialog is cancelled or user didn't give |
|
176 * a valid number. |
|
177 * @param aDigit: entered digit |
|
178 */ |
|
179 IMPORT_C void SpeedDialCanceledL( const TUint& aDigit ); |
|
180 |
|
181 /** |
|
182 * Handle long key press of a number. |
|
183 */ |
|
184 IMPORT_C void HandleNumberLongKeyPressL(); |
|
185 |
|
186 /** |
|
187 * Tests whether given number is speed dial number. |
|
188 * @param aNumber A number to test. |
|
189 * @return ETrue if given number is speed dial number. |
|
190 */ |
|
191 IMPORT_C TBool IsSpeedDialNumber( const TDesC& aNumber ) const; |
|
192 |
|
193 /** |
|
194 * Handles speed dialing. |
|
195 * @param aDigit Entered digit. |
|
196 * @param aDialMethod Dial initiation method. |
|
197 */ |
|
198 IMPORT_C void SpeedDialL( const TUint& aDigit, |
|
199 TDialInitiationMethod aDialMethod ); |
|
200 |
|
201 /** |
|
202 * Handles send command. |
|
203 */ |
|
204 IMPORT_C virtual void HandleSendCommandL(); |
|
205 |
|
206 private: // New functions |
|
207 |
|
208 /** |
|
209 * A message handling function for EPEMessageIncoming |
|
210 * @param aCallId: the call id of the call |
|
211 */ |
|
212 void HandleIncomingL( TInt aCallId ); |
|
213 |
|
214 /** |
|
215 * A message handling function for EPEMessageHandleConnected |
|
216 * @param aCallId: the call id of the call |
|
217 */ |
|
218 void HandleConnectedL( TInt aCallId ); |
|
219 |
|
220 /** |
|
221 * A message handling function for EPEMessageIdle |
|
222 * @param aCallId: the call id of the call |
|
223 */ |
|
224 void HandleIdleL( TInt aCallId ); |
|
225 |
|
226 /** |
|
227 * Launches application. |
|
228 */ |
|
229 void LaunchApplicationL(); |
|
230 |
|
231 /** |
|
232 * Send Exit command |
|
233 */ |
|
234 void SendExitCommandL(); |
|
235 |
|
236 /** |
|
237 * Dials video call |
|
238 */ |
|
239 void DialVideoCallL(); |
|
240 |
|
241 /** |
|
242 * Handles end key press that was catched in HandleKeyMessageL |
|
243 * @param aMessage - key event message |
|
244 */ |
|
245 void HandleEndKeyPressL( TPhoneKeyEventMessages aMessage ); |
|
246 |
|
247 /** |
|
248 * Changes manner mode. |
|
249 * Switches from any profile to the Silent profile or from the |
|
250 * Silent profile to the General profile. |
|
251 */ |
|
252 void ChangeMannerModeL(); |
|
253 |
|
254 /** |
|
255 * Checks if MC/PCSuite restore ongoing. |
|
256 * @param none. |
|
257 * @return ETrue if ongoing. |
|
258 */ |
|
259 TBool RestoreOngoing(); |
|
260 |
|
261 /** |
|
262 * Handles back command. |
|
263 */ |
|
264 void HandleBackCommandL(); |
|
265 |
|
266 /** |
|
267 * Checks for application launching configurations from |
|
268 * central repository. |
|
269 * @param aCode key code. |
|
270 * @return ETrue if configuration found. |
|
271 */ |
|
272 TBool CheckAppLaunchingL( const TKeyCode aCode ); |
|
273 |
|
274 /** |
|
275 * Returns phone number for specified speed dial location. |
|
276 * @param aDigit Speed dial digit. |
|
277 * @param aDigit On return contains speed dial parameters. |
|
278 * @return Phone number |
|
279 */ |
|
280 HBufC* NumberForSpeedDialLocationL( const TUint& aDigit, |
|
281 TPhoneCmdParamSpeedDial& aSpeedDialParam ) const; |
|
282 |
|
283 void HandleVoiceCallCommandL( TBool aSendKey ); |
|
284 |
|
285 private: |
|
286 |
|
287 // Owned profile engine |
|
288 MProfileEngine* iEngine; |
|
289 // indicates that incomming call is arrived. |
|
290 TBool iIncommingCall; |
|
291 |
|
292 }; |
|
293 |
|
294 #endif // CPHONESTATEIDLE |
|
295 |
|
296 // End of File |