author | hgs |
Fri, 09 Jul 2010 15:40:55 +0300 | |
changeset 50 | 377c906a8701 |
parent 45 | 6b911d05207e |
child 65 | 2a5d4ab426d3 |
permissions | -rw-r--r-- |
37 | 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 |
||
26 |
// FORWARD DECLARATIONS |
|
27 |
||
28 |
// CLASS DECLARATION |
|
29 |
||
30 |
/** |
|
31 |
* Idle state |
|
32 |
*/ |
|
33 |
class CPhoneStateIdle : public CPhoneState |
|
34 |
{ |
|
35 |
public: |
|
36 |
||
37 |
/** Dial initiation method. */ |
|
38 |
enum TDialInitiationMethod |
|
39 |
{ |
|
40 |
/** Dial initiation method unknown. */ |
|
41 |
EDialMethodUnknown = 0, |
|
42 |
/** Dial is initiated by explicit call type selection from menu.*/ |
|
43 |
EDialMethodMenuSelection = 1, |
|
44 |
/** Dial is initiated by send command. */ |
|
45 |
EDialMethodSendCommand = 2, |
|
46 |
/** Dial is initiated by one key dialing. */ |
|
47 |
EDialMethodOneKeyDialing = 3 |
|
48 |
||
49 |
}; |
|
50 |
||
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
51 |
/** |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
52 |
* Phone number types |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
53 |
* |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
54 |
* EPhoneNumberTypeNotFound - phone number's type was not found |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
55 |
* EPhoneNumberTypeCS - CS call can be made to the phone number |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
56 |
* EPhoneNumberTypeVideo - video call can be made to the phone number |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
57 |
* EPhoneNumberTypeVoip - VoIP call can be made to the address. |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
58 |
*/ |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
59 |
enum TPhoneNumberType |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
60 |
{ |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
61 |
EPhoneNumberTypeNotFound = -1, |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
62 |
EPhoneNumberTypeCS = 0, |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
63 |
EPhoneNumberTypeVideo, |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
64 |
EPhoneNumberTypeVoip |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
65 |
}; |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
66 |
|
37 | 67 |
/** |
68 |
* Destructor. |
|
69 |
*/ |
|
70 |
IMPORT_C virtual ~CPhoneStateIdle(); |
|
71 |
||
72 |
/** |
|
73 |
* Creates the Idle state class |
|
74 |
* @param aStateMachine: a container of state objects |
|
75 |
* @param aViewCommandHandle: handle to the PhoneUIView |
|
76 |
* @return an instance of class CPhoneStateIdle |
|
77 |
*/ |
|
78 |
static CPhoneStateIdle* NewL( |
|
79 |
MPhoneStateMachine* aStateMachine, |
|
80 |
MPhoneViewCommandHandle* aViewCommandHandle, |
|
81 |
MPhoneCustomization* aPhoneCustomization ); |
|
82 |
||
83 |
IMPORT_C virtual void HandleKeyEventL( |
|
84 |
const TKeyEvent& aKeyEvent, |
|
85 |
TEventCode aEventCode ); |
|
86 |
||
87 |
IMPORT_C void HandleKeyMessageL( |
|
88 |
TPhoneKeyEventMessages aMessage, |
|
89 |
TKeyCode aCode ); |
|
90 |
||
91 |
/** |
|
92 |
* A message handling function for Phone Engine messages |
|
93 |
* @param aMessage Message from Phone Engine |
|
94 |
* @param aCallId Call id the message concerns |
|
95 |
*/ |
|
96 |
IMPORT_C virtual void HandlePhoneEngineMessageL( |
|
97 |
const TInt aMessage, |
|
98 |
TInt aCallId ); |
|
99 |
||
100 |
IMPORT_C virtual TBool HandleCommandL( TInt aCommand ); |
|
101 |
||
102 |
IMPORT_C virtual TBool ProcessCommandL( TInt aCommand ); |
|
103 |
||
104 |
/** |
|
105 |
* Indicates when the Idle app is in the foreground. |
|
106 |
*/ |
|
107 |
IMPORT_C virtual void HandleIdleForegroundEventL(); |
|
108 |
||
109 |
/** |
|
110 |
* Indicates when the Phone app is in the foreground. |
|
111 |
*/ |
|
112 |
IMPORT_C virtual void HandlePhoneForegroundEventL(); |
|
113 |
||
114 |
/** |
|
115 |
* Indicates when the Phone app has lost focus. |
|
116 |
*/ |
|
117 |
IMPORT_C virtual void HandlePhoneFocusLostEventL(); |
|
118 |
||
119 |
protected: |
|
120 |
||
121 |
/** |
|
122 |
* Handle state-specific behaviour when number entry is cleared |
|
123 |
*/ |
|
124 |
IMPORT_C virtual void HandleNumberEntryClearedL(); |
|
125 |
||
126 |
IMPORT_C virtual TBool HandleRemConCommandL( |
|
127 |
TRemConCoreApiOperationId aOperationId, |
|
128 |
TRemConCoreApiButtonAction aButtonAct ); |
|
129 |
||
130 |
/** |
|
131 |
* Display Incoming Call |
|
132 |
* @param aCallid call id |
|
133 |
*/ |
|
134 |
IMPORT_C void DisplayIncomingCallL( TInt aCallId ); |
|
135 |
||
136 |
/** |
|
137 |
* Display Call Setup |
|
138 |
* @param aCallid call id |
|
139 |
*/ |
|
140 |
IMPORT_C void DisplayCallSetupL( TInt aCallId ); |
|
141 |
||
142 |
/** |
|
143 |
* By default EPOC constructor is private. |
|
144 |
*/ |
|
145 |
IMPORT_C CPhoneStateIdle( |
|
146 |
MPhoneStateMachine* aStateMachine, |
|
147 |
MPhoneViewCommandHandle* aViewCommandHandle, |
|
148 |
MPhoneCustomization* aPhoneCustomization ); |
|
149 |
||
150 |
/** |
|
151 |
* ConstructL() |
|
152 |
*/ |
|
153 |
IMPORT_C virtual void ConstructL(); |
|
154 |
||
155 |
/** |
|
156 |
* Dial the specified number. |
|
157 |
* @param aNumber The number to call. |
|
158 |
* @param aNumberType A number type. |
|
159 |
* @param aDialMethod A dial initiation method. |
|
160 |
*/ |
|
161 |
IMPORT_C virtual void DialL( const TDesC& aNumber, |
|
162 |
TPhoneNumberType aNumberType, TDialInitiationMethod aDialMethod ); |
|
163 |
||
164 |
/** |
|
165 |
* Dial CS multimedia call |
|
166 |
* @param None |
|
167 |
*/ |
|
168 |
IMPORT_C void DialMultimediaCallL(); |
|
169 |
||
170 |
/** |
|
171 |
* Dial CS voice call |
|
172 |
* @param None |
|
173 |
*/ |
|
174 |
IMPORT_C void DialVoiceCallL(); |
|
175 |
||
176 |
/** |
|
177 |
* Handles situation when hash key has been kept down long |
|
178 |
* (long keypress) and the hash character is the only character |
|
179 |
* in number entry. |
|
180 |
*/ |
|
181 |
IMPORT_C virtual void OnlyHashInNumberEntryL(); |
|
182 |
||
183 |
/** |
|
184 |
* A message handling function for EPEMessageDialling |
|
185 |
* @param aCallId: the call id of the call |
|
186 |
*/ |
|
187 |
IMPORT_C virtual void HandleDialingL( TInt aCallId ); |
|
188 |
||
189 |
/** |
|
190 |
* Handles send command. |
|
191 |
*/ |
|
192 |
IMPORT_C virtual void HandleSendCommandL(); |
|
193 |
||
194 |
private: // New functions |
|
195 |
||
196 |
/** |
|
197 |
* A message handling function for EPEMessageIncoming |
|
198 |
* @param aCallId: the call id of the call |
|
199 |
*/ |
|
200 |
void HandleIncomingL( TInt aCallId ); |
|
201 |
||
202 |
/** |
|
203 |
* A message handling function for EPEMessageHandleConnected |
|
204 |
* @param aCallId: the call id of the call |
|
205 |
*/ |
|
206 |
void HandleConnectedL( TInt aCallId ); |
|
207 |
||
208 |
/** |
|
209 |
* A message handling function for EPEMessageIdle |
|
210 |
* @param aCallId: the call id of the call |
|
211 |
*/ |
|
212 |
void HandleIdleL( TInt aCallId ); |
|
213 |
||
214 |
/** |
|
215 |
* Send Exit command |
|
216 |
*/ |
|
217 |
void SendExitCommandL(); |
|
218 |
||
219 |
/** |
|
220 |
* Dials video call |
|
221 |
*/ |
|
222 |
void DialVideoCallL(); |
|
223 |
||
224 |
/** |
|
225 |
* Handles end key press that was catched in HandleKeyMessageL |
|
226 |
* @param aMessage - key event message |
|
227 |
*/ |
|
228 |
void HandleEndKeyPressL( TPhoneKeyEventMessages aMessage ); |
|
229 |
||
230 |
/** |
|
231 |
* Changes manner mode. |
|
232 |
* Switches from any profile to the Silent profile or from the |
|
233 |
* Silent profile to the General profile. |
|
234 |
*/ |
|
235 |
void ChangeMannerModeL(); |
|
236 |
||
237 |
/** |
|
238 |
* Checks if MC/PCSuite restore ongoing. |
|
239 |
* @param none. |
|
240 |
* @return ETrue if ongoing. |
|
241 |
*/ |
|
242 |
TBool RestoreOngoing(); |
|
243 |
||
244 |
||
50 | 245 |
void HandleVoiceCallCommandL(); |
37 | 246 |
|
247 |
private: |
|
248 |
||
249 |
// Owned profile engine |
|
250 |
MProfileEngine* iEngine; |
|
251 |
// indicates that incomming call is arrived. |
|
252 |
TBool iIncommingCall; |
|
253 |
||
254 |
}; |
|
255 |
||
256 |
#endif // CPHONESTATEIDLE |
|
257 |
||
258 |
// End of File |