37
|
1 |
/*
|
|
2 |
* Copyright (c) 2008 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 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
#include <StringLoader.h>
|
|
20 |
#include <featmgr.h>
|
|
21 |
#include <eikenv.h>
|
|
22 |
|
|
23 |
#include "cphonenumberentrymanager.h"
|
|
24 |
#include "mpeengineinfo.h"
|
|
25 |
#include "mphoneviewcommandhandle.h"
|
|
26 |
#include "mphonestatemachine.h"
|
|
27 |
#include "mphonecustomization.h"
|
|
28 |
|
|
29 |
#include "cphonecbamanager.h"
|
|
30 |
#include "cphonepubsubproxy.h"
|
|
31 |
#include "cphonekeys.h"
|
|
32 |
#include "tphonecmdparamstring.h"
|
|
33 |
#include "tphonecmdparamboolean.h"
|
|
34 |
#include "tphonecmdparaminteger.h"
|
|
35 |
#include "tphonecmdparamcallheaderdata.h"
|
|
36 |
#include "cphonemainresourceresolver.h"
|
|
37 |
#include "phonerssbase.h"
|
|
38 |
#include "phoneui.pan"
|
|
39 |
#include "phoneviewcommanddefinitions.h"
|
|
40 |
#include "phoneappcommands.hrh"
|
|
41 |
#include "phonelogger.h"
|
|
42 |
|
|
43 |
const TInt KPhoneKeyStart = 33;
|
|
44 |
const TInt KPhoneKeyEnd = 127;
|
|
45 |
|
|
46 |
// ======== MEMBER FUNCTIONS ========
|
|
47 |
|
|
48 |
// ---------------------------------------------------------------------------
|
|
49 |
// CPhoneNumberEntryManager::CPhoneNumberEntryManager
|
|
50 |
// ---------------------------------------------------------------------------
|
|
51 |
//
|
|
52 |
CPhoneNumberEntryManager::CPhoneNumberEntryManager(
|
|
53 |
CPhoneState* aState,
|
|
54 |
MPhoneViewCommandHandle& aViewCommandHandle,
|
|
55 |
MPhoneStateMachine& aStateMachine,
|
|
56 |
MPhoneCustomization* aCustomization,
|
|
57 |
CPhoneCbaManager& aCbaManager )
|
|
58 |
: iState ( aState ),
|
|
59 |
iViewCommandHandle ( aViewCommandHandle ),
|
|
60 |
iStateMachine ( aStateMachine ),
|
|
61 |
iCustomization ( aCustomization ),
|
|
62 |
iCbaManager ( aCbaManager ),
|
|
63 |
iEnv( *CEikonEnv::Static() )
|
|
64 |
{
|
|
65 |
__LOGMETHODSTARTEND( EPhoneControl, "CPhoneNumberEntryManager::CPhoneNumberEntryManager() ");
|
|
66 |
}
|
|
67 |
|
|
68 |
// ---------------------------------------------------------------------------
|
|
69 |
// CPhoneNumberEntryManager::NewL
|
|
70 |
// ---------------------------------------------------------------------------
|
|
71 |
//
|
|
72 |
CPhoneNumberEntryManager* CPhoneNumberEntryManager::NewL(
|
|
73 |
CPhoneState* aState,
|
|
74 |
MPhoneViewCommandHandle& aViewCommandHandle,
|
|
75 |
MPhoneStateMachine& aStateMachine,
|
|
76 |
MPhoneCustomization* aCustomization,
|
|
77 |
CPhoneCbaManager& aCbaManager )
|
|
78 |
{
|
|
79 |
__LOGMETHODSTARTEND( EPhoneControl, "CPhoneNumberEntryManager::NewL() ");
|
|
80 |
CPhoneNumberEntryManager* self = new (ELeave) CPhoneNumberEntryManager(
|
|
81 |
aState,
|
|
82 |
aViewCommandHandle,
|
|
83 |
aStateMachine,
|
|
84 |
aCustomization,
|
|
85 |
aCbaManager );
|
|
86 |
|
|
87 |
CleanupStack::PushL( self );
|
|
88 |
self->ConstructL();
|
|
89 |
CleanupStack::Pop( self );
|
|
90 |
|
|
91 |
return self;
|
|
92 |
}
|
|
93 |
|
|
94 |
// ---------------------------------------------------------------------------
|
|
95 |
// CPhoneNumberEntryManager::ConstructL
|
|
96 |
// ---------------------------------------------------------------------------
|
|
97 |
//
|
|
98 |
void CPhoneNumberEntryManager::ConstructL()
|
|
99 |
{
|
|
100 |
__LOGMETHODSTARTEND( EPhoneControl, "CPhoneNumberEntryManager::ConstructL() ");
|
|
101 |
}
|
|
102 |
|
|
103 |
// ---------------------------------------------------------------------------
|
|
104 |
// CPhoneNumberEntryManager::~CPhoneNumberEntryManager
|
|
105 |
// ---------------------------------------------------------------------------
|
|
106 |
//
|
|
107 |
CPhoneNumberEntryManager::~CPhoneNumberEntryManager()
|
|
108 |
{
|
|
109 |
__LOGMETHODSTARTEND( EPhoneControl, "CPhoneNumberEntryManager::~CPhoneNumberEntryManager() ");
|
|
110 |
delete iNumberEntryContent;
|
|
111 |
}
|
|
112 |
|
|
113 |
// ======== LOCAL FUNCTIONS ========
|
|
114 |
|
|
115 |
// -----------------------------------------------------------
|
|
116 |
// CPhoneNumberEntryManager::StoreNumberEntryContentL
|
|
117 |
// -----------------------------------------------------------
|
|
118 |
//
|
|
119 |
void CPhoneNumberEntryManager::StoreNumberEntryContentL()
|
|
120 |
{
|
|
121 |
__LOGMETHODSTARTEND( EPhoneControl, "CPhoneNumberEntryManager::StoreNumberEntryContentL( ) ");
|
|
122 |
// Store the number entry content to cache
|
|
123 |
if ( !iNumberEntryContent )
|
|
124 |
{
|
|
125 |
iNumberEntryContent = HBufC::NewL( KPhoneNumberEntryBufferSize );
|
|
126 |
}
|
|
127 |
TPtr ptr( iNumberEntryContent->Des() );
|
|
128 |
ptr.Zero();
|
|
129 |
|
|
130 |
TPhoneCmdParamInteger numberEntryCountParam;
|
|
131 |
iViewCommandHandle.ExecuteCommandL(
|
|
132 |
EPhoneViewGetNumberEntryCount,
|
|
133 |
&numberEntryCountParam );
|
|
134 |
|
|
135 |
TInt neLength( numberEntryCountParam.Integer() );
|
|
136 |
if ( neLength > 0 )
|
|
137 |
{
|
|
138 |
TPhoneCmdParamString stringParam;
|
|
139 |
stringParam.SetString( &ptr );
|
|
140 |
iViewCommandHandle.ExecuteCommandL(
|
|
141 |
EPhoneViewGetNumberFromEntry,
|
|
142 |
&stringParam );
|
|
143 |
}
|
|
144 |
}
|
|
145 |
|
|
146 |
// -----------------------------------------------------------
|
|
147 |
// CPhoneNumberEntryManager::RestoreNumberEntryContentL
|
|
148 |
// -----------------------------------------------------------
|
|
149 |
//
|
|
150 |
void CPhoneNumberEntryManager::RestoreNumberEntryContentL()
|
|
151 |
{
|
|
152 |
__LOGMETHODSTARTEND( EPhoneControl, "CPhoneNumberEntryManager::RestoreNumberEntryContentL( ) ");
|
|
153 |
if ( iNumberEntryContent )
|
|
154 |
{
|
|
155 |
// Restore the number entry content from cache
|
|
156 |
TPtr ptr( iNumberEntryContent->Des() );
|
|
157 |
iViewCommandHandle.ExecuteCommandL( EPhoneViewSetNumberEntryContent, 0, ptr );
|
|
158 |
delete iNumberEntryContent;
|
|
159 |
iNumberEntryContent = NULL;
|
|
160 |
}
|
|
161 |
}
|
|
162 |
|
|
163 |
// -----------------------------------------------------------
|
|
164 |
// CPhoneNumberEntryManager::IsNumberEntryContentStored
|
|
165 |
// -----------------------------------------------------------
|
|
166 |
//
|
|
167 |
TBool CPhoneNumberEntryManager::IsNumberEntryContentStored()
|
|
168 |
{
|
|
169 |
__LOGMETHODSTARTEND( EPhoneControl, "CPhoneNumberEntryManager::IsNumberEntryContentStored( ) ");
|
|
170 |
return iNumberEntryContent ? ETrue : EFalse;
|
|
171 |
}
|
|
172 |
|
|
173 |
// -----------------------------------------------------------
|
|
174 |
// CPhoneNumberEntryManager::ClearNumberEntryContentCache
|
|
175 |
// -----------------------------------------------------------
|
|
176 |
//
|
|
177 |
void CPhoneNumberEntryManager::ClearNumberEntryContentCache()
|
|
178 |
{
|
|
179 |
__LOGMETHODSTARTEND( EPhoneControl, "CPhoneNumberEntryManager::ClearNumberEntryContentCache( ) ");
|
|
180 |
delete iNumberEntryContent;
|
|
181 |
iNumberEntryContent = NULL;
|
|
182 |
}
|
|
183 |
|
|
184 |
// -----------------------------------------------------------
|
|
185 |
// CPhoneNumberEntryManager::CreateNumberEntryL
|
|
186 |
// -----------------------------------------------------------
|
|
187 |
void CPhoneNumberEntryManager::CreateNumberEntryL()
|
|
188 |
{
|
|
189 |
__LOGMETHODSTARTEND( EPhoneControl, "CPhoneNumberEntryManager::CreateNumberEntryL( ) ");
|
|
190 |
iViewCommandHandle.ExecuteCommandL( EPhoneViewCreateNumberEntry );
|
|
191 |
}
|
|
192 |
|
|
193 |
// -----------------------------------------------------------
|
|
194 |
// CPhoneNumberEntryManager::SetNumberEntryVisibilityL
|
|
195 |
// -----------------------------------------------------------
|
|
196 |
//
|
|
197 |
void CPhoneNumberEntryManager::SetNumberEntryVisibilityL( TPhoneCmdParamBoolean aVisible )
|
|
198 |
{
|
|
199 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneNumberEntryManager::SetNumberEntryVisibilityL( ) ");
|
|
200 |
__PHONELOG1( EBasic, EPhoneControl,
|
|
201 |
"CPhoneNumberEntryManager::SetNumberEntryVisibilityL : aVisible =%d",
|
|
202 |
aVisible.Boolean() );
|
|
203 |
iViewCommandHandle.ExecuteCommandL( EPhoneViewSetNumberEntryVisible, &aVisible );
|
|
204 |
if ( aVisible.Boolean() )
|
|
205 |
{
|
|
206 |
// Set Number Entry CBA
|
|
207 |
iCbaManager.UpdateCbaL( EPhoneNumberAcqCBA );
|
|
208 |
}
|
|
209 |
}
|
|
210 |
|
|
211 |
// -----------------------------------------------------------
|
|
212 |
// CPhoneNumberEntryManager::HandleCreateNumberEntryL
|
|
213 |
// add conditions here regarding when NE can be opened:
|
|
214 |
// - activeidle is not the top most application
|
|
215 |
// - any query is not visible
|
|
216 |
// - dialog is not visible ("new call")
|
|
217 |
// - information note is not visible ("IMEI code", "life timer")
|
|
218 |
// - options menu bar is not visible
|
|
219 |
// - "switch to ..." -operation is not ongoing
|
|
220 |
// -----------------------------------------------------------
|
|
221 |
//
|
|
222 |
void CPhoneNumberEntryManager::HandleCreateNumberEntryL()
|
|
223 |
{
|
|
224 |
__LOGMETHODSTARTEND( EPhoneControl, "CPhoneNumberEntryManager::HandleCreateNumberEntryL() ");
|
|
225 |
|
|
226 |
const TBool autoLcokOn = iState->IsAutoLockOn();
|
|
227 |
const TBool idleVal = false;
|
|
228 |
const TBool queryActive = iState->IsAnyQueryActiveL();
|
|
229 |
const TBool menuBarVisible = iState->IsMenuBarVisibleL();
|
|
230 |
|
|
231 |
if( autoLcokOn ||
|
|
232 |
( idleVal /*== EPSAiForeground*/ ) ||
|
|
233 |
( menuBarVisible || queryActive ) )
|
|
234 |
{
|
|
235 |
__PHONELOG( EBasic, EPhoneControl,
|
|
236 |
"CPhoneNumberEntryManager::HandleCreateNumberEntryL() NE NOT CREATED" );
|
|
237 |
__PHONELOG2( EBasic, EPhoneControl,
|
|
238 |
"CPhoneNumberEntryManager::HandleCreateNumberEntryL() autoLcokOn(%d) idleVal(%d)",
|
|
239 |
autoLcokOn, idleVal );
|
|
240 |
__PHONELOG2( EBasic, EPhoneControl,
|
|
241 |
"CPhoneNumberEntryManager::HandleCreateNumberEntryL() queryActive(%d) menuBarVisible(%d)",
|
|
242 |
queryActive, menuBarVisible );
|
|
243 |
}
|
|
244 |
else
|
|
245 |
{
|
|
246 |
//creates NE
|
|
247 |
if( ( !iStateMachine.PhoneEngineInfo()->IsSwitchToOperationOngoing () ) &&
|
|
248 |
( !IsNumberEntryUsedL() ) &&
|
|
249 |
( !queryActive || FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) ) )
|
|
250 |
{
|
|
251 |
__PHONELOG( EBasic, EPhoneControl,
|
|
252 |
"CPhoneNumberEntryManager::HandleCreateNumberEntryL() --create NE" );
|
|
253 |
|
|
254 |
if ( iState->IsNoteDismissableL() )
|
|
255 |
{
|
|
256 |
iViewCommandHandle.ExecuteCommandL( EPhoneViewRemoveNote );
|
|
257 |
}
|
|
258 |
|
|
259 |
TPhoneCmdParamBoolean isSecurityMode;
|
|
260 |
iViewCommandHandle.ExecuteCommandL( EPhoneViewGetSecurityModeStatus, &isSecurityMode );
|
|
261 |
if( isSecurityMode.Boolean() )
|
|
262 |
{
|
|
263 |
iState->HandleCommandL( EPhoneNumberAcqSecurityDialer );
|
|
264 |
}
|
|
265 |
else
|
|
266 |
{
|
|
267 |
// Effect is shown when dialer is created.
|
|
268 |
iState->BeginTransEffectLC( ENumberEntryCreate );
|
|
269 |
iViewCommandHandle.ExecuteCommandL( EPhoneViewCreateNumberEntry );
|
|
270 |
iState->EndTransEffect();
|
|
271 |
// Go to current state implementation
|
|
272 |
iCbaManager.UpdateInCallCbaL();
|
|
273 |
iState->UpdateInCallContextMenuL();
|
|
274 |
iEnv.SyncNotifyFocusObserversOfChangeInFocus();
|
|
275 |
}
|
|
276 |
}
|
|
277 |
|
|
278 |
//shows existing NE
|
|
279 |
if ( ( !iStateMachine.PhoneEngineInfo()->IsSwitchToOperationOngoing () ) &&
|
|
280 |
( !IsNumberEntryVisibleL() ) &&
|
|
281 |
( !queryActive || FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) ) )
|
|
282 |
{
|
|
283 |
__PHONELOG( EBasic, EPhoneControl,
|
|
284 |
"CPhoneNumberEntryManager::HandleCreateNumberEntryL() -- show NE" );
|
|
285 |
|
|
286 |
if ( iState->IsNoteDismissableL() )
|
|
287 |
{
|
|
288 |
iViewCommandHandle.ExecuteCommandL( EPhoneViewRemoveNote );
|
|
289 |
}
|
|
290 |
|
|
291 |
TPhoneCmdParamBoolean booleanParam;
|
|
292 |
booleanParam.SetBoolean( ETrue );
|
|
293 |
// Show the number entry
|
|
294 |
SetNumberEntryVisibilityL(booleanParam);
|
|
295 |
}
|
|
296 |
}
|
|
297 |
|
|
298 |
}
|
|
299 |
|
|
300 |
// -----------------------------------------------------------
|
|
301 |
// CPhoneNumberEntryManager::IsNumberEntryUsedL
|
|
302 |
// -----------------------------------------------------------
|
|
303 |
//
|
|
304 |
TBool CPhoneNumberEntryManager::IsNumberEntryUsedL() const
|
|
305 |
{
|
|
306 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneNumberEntryManager::IsNumberEntryUsedL( ) ");
|
|
307 |
return iViewCommandHandle.HandleCommandL(
|
|
308 |
EPhoneViewGetNumberEntryIsUsedStatus ) ==
|
|
309 |
EPhoneViewResponseSuccess;
|
|
310 |
}
|
|
311 |
|
|
312 |
// -----------------------------------------------------------
|
|
313 |
// CPhoneNumberEntryManager::IsNumberEntryVisibleL
|
|
314 |
// -----------------------------------------------------------
|
|
315 |
//
|
|
316 |
TBool CPhoneNumberEntryManager::IsNumberEntryVisibleL() const
|
|
317 |
{
|
|
318 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneNumberEntryManager::IsNumberEntryVisibleL( ) ");
|
|
319 |
return iViewCommandHandle.HandleCommandL(
|
|
320 |
EPhoneViewGetNumberEntryIsVisibleStatus ) ==
|
|
321 |
EPhoneViewResponseSuccess;
|
|
322 |
}
|
|
323 |
|
|
324 |
// -----------------------------------------------------------
|
|
325 |
// CPhoneNumberEntryManager::PhoneNumberFromEntryLC()
|
|
326 |
// -----------------------------------------------------------
|
|
327 |
//
|
|
328 |
HBufC* CPhoneNumberEntryManager::PhoneNumberFromEntryLC() const
|
|
329 |
{
|
|
330 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneNumberEntryManager::PhoneNumberFromEntryLC( ) ");
|
|
331 |
HBufC* phoneNumber = HBufC::NewLC( KPhoneNumberEntryBufferSize );
|
|
332 |
TPtr ptr( phoneNumber->Des() );
|
|
333 |
TPhoneCmdParamString stringParam;
|
|
334 |
stringParam.SetString( &ptr );
|
|
335 |
iViewCommandHandle.ExecuteCommand(
|
|
336 |
EPhoneViewGetNumberFromEntry,
|
|
337 |
&stringParam );
|
|
338 |
return phoneNumber;
|
|
339 |
}
|
|
340 |
|
|
341 |
// -----------------------------------------------------------
|
|
342 |
// CPhoneNumberEntryManager::HandleNumberEntryEdited
|
|
343 |
// -----------------------------------------------------------
|
|
344 |
//
|
|
345 |
void CPhoneNumberEntryManager::HandleNumberEntryEdited()
|
|
346 |
{
|
|
347 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneNumberEntryManager::HandleNumberEntryEdited( ) ");
|
|
348 |
TBool isNumberEntryVisible( EFalse );
|
|
349 |
TRAP_IGNORE( isNumberEntryVisible = IsNumberEntryVisibleL() );
|
|
350 |
|
|
351 |
if( isNumberEntryVisible )
|
|
352 |
{
|
|
353 |
HBufC* phoneNumber( NULL );
|
|
354 |
TRAP_IGNORE( phoneNumber = HBufC::NewL( KPhoneNumberEntryBufferSize ) );
|
|
355 |
if( phoneNumber )
|
|
356 |
{
|
|
357 |
phoneNumber->Des().Zero();
|
|
358 |
TPtr ptr( phoneNumber->Des() );
|
|
359 |
TPhoneCmdParamString stringParam;
|
|
360 |
stringParam.SetString( &ptr );
|
|
361 |
TRAP_IGNORE( iViewCommandHandle.ExecuteCommandL(
|
|
362 |
EPhoneViewGetNumberFromEntry,
|
|
363 |
&stringParam ) );
|
|
364 |
// Save the phone number
|
|
365 |
iStateMachine.PhoneEngineInfo()->SetPhoneNumber( ptr );
|
|
366 |
|
|
367 |
iStateMachine.SendPhoneEngineMessage(
|
|
368 |
MPEPhoneModel::EPEMessagePhoneNumberEdited );
|
|
369 |
|
|
370 |
// remove the phone number
|
|
371 |
delete phoneNumber;
|
|
372 |
|
|
373 |
// Set service code flag to view
|
|
374 |
TPhoneCmdParamBoolean serviceCodeParam;
|
|
375 |
serviceCodeParam.SetBoolean(
|
|
376 |
iStateMachine.PhoneEngineInfo()->PhoneNumberIsServiceCode() );
|
|
377 |
TRAP_IGNORE( iViewCommandHandle.ExecuteCommandL(
|
|
378 |
EPhoneViewSetServiceCodeFlag,
|
|
379 |
&serviceCodeParam ) );
|
|
380 |
}
|
|
381 |
}
|
|
382 |
}
|
|
383 |
|
|
384 |
// -----------------------------------------------------------
|
|
385 |
// CPhoneNumberEntryManager::KeyEventForExistingNumberEntryL
|
|
386 |
// -----------------------------------------------------------
|
|
387 |
//
|
|
388 |
void CPhoneNumberEntryManager::KeyEventForExistingNumberEntryL(
|
|
389 |
const TKeyEvent& aKeyEvent,
|
|
390 |
TEventCode aEventCode )
|
|
391 |
{
|
|
392 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneNumberEntryManager::KeyEventForExistingNumberEntryL( ) ");
|
|
393 |
|
|
394 |
TPhoneCmdParamKeyEvent keyEventParam;
|
|
395 |
keyEventParam.SetKeyEvent( aKeyEvent );
|
|
396 |
keyEventParam.SetEventCode( aEventCode );
|
|
397 |
|
|
398 |
if ( IsValidAlphaNumericKey( aKeyEvent, aEventCode ) )
|
|
399 |
{
|
|
400 |
iViewCommandHandle.HandleCommandL(
|
|
401 |
EPhoneViewSendKeyEventToNumberEntry, &keyEventParam );
|
|
402 |
}
|
|
403 |
else if ( aKeyEvent.iCode == EKeyBackspace )
|
|
404 |
{
|
|
405 |
TPhoneViewResponseId resp = iViewCommandHandle.HandleCommandL(
|
|
406 |
EPhoneViewSendKeyEventToNumberEntry, &keyEventParam );
|
|
407 |
|
|
408 |
if ( resp == EPhoneViewResponseNumberEntryCleared )
|
|
409 |
{
|
|
410 |
// Remove number entry from screen
|
|
411 |
iViewCommandHandle.ExecuteCommandL(
|
|
412 |
EPhoneViewRemoveNumberEntry );
|
|
413 |
|
|
414 |
// Stop DTMF tone playing just in case (user might be holding down a number
|
|
415 |
// key when pressed 'clear' key).
|
|
416 |
iStateMachine.SendPhoneEngineMessage( MPEPhoneModel::EPEMessageEndDTMF );
|
|
417 |
|
|
418 |
// Handle state-specific behaviour when number entry is
|
|
419 |
// cleared
|
|
420 |
HandleNumberEntryClearedL();
|
|
421 |
}
|
|
422 |
|
|
423 |
}
|
|
424 |
else if( aKeyEvent.iCode == EKeyLeftArrow ||
|
|
425 |
aKeyEvent.iCode == EKeyRightArrow ||
|
|
426 |
aKeyEvent.iCode == EKeyUpArrow ||
|
|
427 |
aKeyEvent.iCode == EKeyDownArrow )
|
|
428 |
{
|
|
429 |
iViewCommandHandle.HandleCommandL(
|
|
430 |
EPhoneViewSendKeyEventToNumberEntry, &keyEventParam );
|
|
431 |
}
|
|
432 |
}
|
|
433 |
|
|
434 |
// -----------------------------------------------------------------------------
|
|
435 |
// CPhoneNumberEntryManager::IsValidAlphaNumericKey
|
|
436 |
// Checks is the key event a number, a special character
|
|
437 |
// or if VoIP is enabled some other character
|
|
438 |
// -----------------------------------------------------------------------------
|
|
439 |
//
|
|
440 |
TBool CPhoneNumberEntryManager::IsValidAlphaNumericKey(
|
|
441 |
const TKeyEvent& aKeyEvent,
|
|
442 |
TEventCode aEventCode )
|
|
443 |
{
|
|
444 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneNumberEntryManager::IsValidAlphaNumericKey( ) ");
|
|
445 |
TBool ret(EFalse);
|
|
446 |
const TBool numericKeyEntered( CPhoneKeys::IsNumericKey(
|
|
447 |
aKeyEvent, aEventCode ) );
|
|
448 |
|
|
449 |
// a numeric key (1,2,3,4,6,7,8,9,0,+,*,p,w )
|
|
450 |
// or
|
|
451 |
// a letter from fullscreen qwerty, miniqwerty or handwriting
|
|
452 |
// when voip is enabled.
|
|
453 |
if ( numericKeyEntered
|
|
454 |
|| IsAlphanumericSupportedAndCharInput( aKeyEvent ) )
|
|
455 |
{
|
|
456 |
ret= ETrue;
|
|
457 |
}
|
|
458 |
|
|
459 |
return ret;
|
|
460 |
}
|
|
461 |
|
|
462 |
// -----------------------------------------------------------------------------
|
|
463 |
// CPhoneNumberEntryManager::IsAlphanumericSupportedAndCharInput
|
|
464 |
// -----------------------------------------------------------------------------
|
|
465 |
//
|
|
466 |
TBool CPhoneNumberEntryManager::IsAlphanumericSupportedAndCharInput(
|
|
467 |
const TKeyEvent& aKeyEvent ) const
|
|
468 |
{
|
|
469 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneNumberEntryManager::IsAlphanumericSupportedAndCharInput( ) ");
|
|
470 |
TBool ret = ( ( iCustomization &&
|
|
471 |
iCustomization->AllowAlphaNumericMode() ) &&
|
|
472 |
( ( aKeyEvent.iScanCode >= KPhoneKeyStart &&
|
|
473 |
aKeyEvent.iScanCode <= KPhoneKeyEnd ) ||
|
|
474 |
aKeyEvent.iModifiers & EModifierSpecial ) );
|
|
475 |
__PHONELOG1( EBasic, EPhoneControl,
|
|
476 |
"CPhoneNumberEntryManager::IsAlphanumericSupportedAndCharInput: %d", ret );
|
|
477 |
return ret;
|
|
478 |
}
|
|
479 |
|
|
480 |
// -----------------------------------------------------------
|
|
481 |
// CPhoneNumberEntryManager::HandleNumberEntryClearedL
|
|
482 |
// -----------------------------------------------------------
|
|
483 |
//
|
|
484 |
void CPhoneNumberEntryManager::HandleNumberEntryClearedL()
|
|
485 |
{
|
|
486 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneNumberEntryManager::HandleNumberEntryClearedL( ) ");
|
|
487 |
}
|
|
488 |
|
|
489 |
// ---------------------------------------------------------
|
|
490 |
// CPhoneNumberEntryManager::NumberEntryClearL
|
|
491 |
// ---------------------------------------------------------
|
|
492 |
//
|
|
493 |
void CPhoneNumberEntryManager::NumberEntryClearL() const
|
|
494 |
{
|
|
495 |
__LOGMETHODSTARTEND( EPhoneControl, "CPhoneNumberEntryManager::NumberEntryClearL( ) ");
|
|
496 |
iViewCommandHandle.ExecuteCommandL( EPhoneViewClearNumberEntryContent );
|
|
497 |
}
|
|
498 |
|
|
499 |
// -----------------------------------------------------------
|
|
500 |
// CPhoneNumberEntryManager::NumberEntryInNumericModeL
|
|
501 |
// -----------------------------------------------------------
|
|
502 |
//
|
|
503 |
TBool CPhoneNumberEntryManager::NumberEntryInNumericModeL()
|
|
504 |
{
|
|
505 |
__LOGMETHODSTARTEND( EPhoneControl, "CPhoneNumberEntryManager::NumberEntryInNumericModeL( ) ");
|
|
506 |
return iViewCommandHandle.HandleCommandL(
|
|
507 |
EPhoneViewIsNumberEntryNumericMode ) == EPhoneViewResponseSuccess;
|
|
508 |
}
|
|
509 |
|
|
510 |
// -----------------------------------------------------------
|
|
511 |
// CPhoneNumberEntryManager::NumberEntryToggleAlphaNumericModeL
|
|
512 |
// -----------------------------------------------------------
|
|
513 |
//
|
|
514 |
TBool CPhoneNumberEntryManager::NumberEntryToggleAlphaNumericModeL()
|
|
515 |
{
|
|
516 |
__LOGMETHODSTARTEND( EPhoneControl, "CPhoneNumberEntryManager::NumberEntryToggleAlphaNumericModeL( ) ");
|
|
517 |
TPhoneCmdParamBoolean newModeAlpha;
|
|
518 |
// Toggle number entry alpha/numeric mode
|
|
519 |
iViewCommandHandle.ExecuteCommandL(
|
|
520 |
EPhoneViewToggleNumberEntryAlphaNumericMode, &newModeAlpha );
|
|
521 |
return newModeAlpha.Boolean();
|
|
522 |
}
|
|
523 |
|
|
524 |
|