author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Wed, 13 Oct 2010 14:31:22 +0300 | |
branch | RCL_3 |
changeset 81 | c26cc2a7c548 |
parent 62 | 5266b1f337bd |
permissions | -rw-r--r-- |
62 | 1 |
/* |
2 |
* Copyright (c) 2007 - 2010 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: Manager for keypad and numberentry container. |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
||
19 |
// INCLUDE FILES |
|
20 |
||
21 |
#include <avkon.rsg> |
|
22 |
#include <apgcli.h> |
|
23 |
#include <apacmdln.h> |
|
24 |
#include <eikspane.h> |
|
25 |
#include <aknenv.h> // AKN_LAF_COLOR |
|
26 |
#include <AknUtils.h> |
|
27 |
#include <AknsUtils.h> |
|
28 |
#include <aknappui.h> |
|
29 |
#include <aknsoundsystem.h> |
|
30 |
#include <aknlayoutscalable_apps.cdl.h> |
|
31 |
#include <layoutmetadata.cdl.h> |
|
32 |
#include <data_caging_path_literals.hrh> // for KDC_APP_RESOURCE_DIR |
|
33 |
#include <bautils.h> // for BaflUtils |
|
34 |
#include <aknedsts.h> |
|
35 |
#include <spsettings.h> |
|
36 |
#include <dialingextensioninterface.h> |
|
37 |
#include <easydialingcommands.hrh> |
|
38 |
#include <dialer.rsg> |
|
39 |
#include <phoneui.rsg> |
|
40 |
#include <featmgr.h> |
|
41 |
||
42 |
#include "cdialer.h" |
|
43 |
#include "dialercommon.h" |
|
44 |
#include "dialer.hrh" |
|
45 |
#include "cdialerkeypadcontainer.h" |
|
46 |
#include "cdialernumberentry.h" |
|
47 |
#include "dialertrace.h" |
|
48 |
#include "mnumberentry.h" |
|
49 |
#include "cdialingextensionobserver.h" |
|
50 |
#include "cdialertoolbarcontainer.h" |
|
51 |
||
52 |
/// ROM drive. |
|
53 |
_LIT( KDialerResourceFile, "dialer.rsc" ); |
|
54 |
||
81
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
55 |
// number entry, keypad area, easydialing, toolbar |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
56 |
const TInt KContainedControlsInTelephonyMode = 4; |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
57 |
|
62 | 58 |
|
59 |
// ========================= MEMBER FUNCTIONS ================================ |
|
60 |
||
61 |
// --------------------------------------------------------------------------- |
|
62 |
// CDialer::NewL |
|
63 |
// |
|
64 |
// Symbian OS two phased constructor for telephony phone dialer mode |
|
65 |
// --------------------------------------------------------------------------- |
|
66 |
// |
|
67 |
EXPORT_C CDialer* CDialer::NewL( const CCoeControl& aContainer, |
|
68 |
const TRect& aRect, |
|
69 |
MPhoneDialerController* aController ) |
|
70 |
{ |
|
71 |
CDialer* self = new( ELeave )CDialer(); |
|
72 |
CleanupStack::PushL( self ); |
|
73 |
self->ConstructL( aContainer, aRect, aController ); |
|
74 |
CleanupStack::Pop( self ); |
|
75 |
return self; |
|
76 |
} |
|
77 |
||
78 |
// ----------------------------------------------------------------------------- |
|
79 |
// CDialer::~CDialer |
|
80 |
// |
|
81 |
// Destructor |
|
82 |
// ----------------------------------------------------------------------------- |
|
83 |
// |
|
84 |
EXPORT_C CDialer::~CDialer() |
|
85 |
{ |
|
86 |
DIALER_PRINT("CDialer::~CDialer<"); |
|
87 |
#ifdef RD_SCALABLE_UI_V2 |
|
88 |
iPeninputServer.RemovePenUiActivationHandler( this ); |
|
89 |
iPeninputServer.Close(); |
|
90 |
#endif |
|
91 |
AknsUtils::DeregisterControlPosition( this ); |
|
92 |
||
93 |
delete iKeypadArea; |
|
94 |
delete iNumberEntry; |
|
95 |
||
96 |
delete iEasyDialer; |
|
97 |
delete iDialingExtensionObserver; |
|
98 |
delete iToolbar; |
|
99 |
||
100 |
UnLoadResources(); |
|
101 |
DIALER_PRINT("CDialer::~CDialer>"); |
|
102 |
} |
|
103 |
||
104 |
// --------------------------------------------------------------------------- |
|
105 |
// CDialer::ConstructL |
|
106 |
// |
|
107 |
// Symbian OS two phased constructor for phone dialer more. |
|
108 |
// --------------------------------------------------------------------------- |
|
109 |
// |
|
110 |
void CDialer::ConstructL( |
|
111 |
const CCoeControl& aContainer, |
|
112 |
const TRect& aRect, |
|
113 |
MPhoneDialerController* aController ) |
|
114 |
{ |
|
115 |
DIALER_PRINT("CDialer::ConstructL<"); |
|
116 |
LoadResourceL(); |
|
117 |
||
118 |
// set window |
|
119 |
SetContainerWindowL( aContainer ); |
|
120 |
SetParent( const_cast<CCoeControl*>(&aContainer) ); |
|
121 |
||
122 |
iNumberEntry = CDialerNumberEntry::NewL( *this ); |
|
123 |
||
124 |
iController = aController; |
|
125 |
||
81
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
126 |
iKeypadArea = CDialerKeyPadContainer::NewL( *this, EModeEasyDialing ); |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
127 |
|
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
128 |
iToolbar = CDialerToolbarContainer::NewL( *this, iController ); |
62 | 129 |
|
130 |
// try to create easydialing plugin. If plugin is not present, iEasydialer gets value NULL. |
|
131 |
LoadEasyDialingPlugin(); |
|
132 |
||
133 |
iNumberEntry->SetEasyDialingPlugin( iEasyDialer ); |
|
134 |
iNumberEntry->SetObserver( this ); |
|
135 |
iNumberEntry->SetNumberEntryPromptTextL( iController->NumberEntryPromptTextL() ); |
|
136 |
||
137 |
UpdateToolbar(); |
|
138 |
||
139 |
SetRect( aRect ); |
|
140 |
||
141 |
SetComponentsToInheritVisibility( EFalse ); |
|
142 |
||
143 |
// By default, numeric keysounds are disabled. |
|
144 |
DisableNumericKeySounds( ETrue ); |
|
145 |
||
146 |
ActivateL(); |
|
147 |
#ifdef RD_SCALABLE_UI_V2 |
|
148 |
if ( AknLayoutUtils::PenEnabled() ) |
|
149 |
{ |
|
150 |
User::LeaveIfError( iPeninputServer.Connect() ); |
|
151 |
iPeninputServer.AddPenUiActivationHandler( this, EPluginInputModeAll ); |
|
152 |
} |
|
153 |
#endif |
|
154 |
DIALER_PRINT("CDialer::ConstructL>"); |
|
155 |
} |
|
156 |
||
157 |
// ----------------------------------------------------------------------------- |
|
158 |
// CDialer::CDialer |
|
159 |
// |
|
160 |
// Default constructor |
|
161 |
// ----------------------------------------------------------------------------- |
|
162 |
// |
|
163 |
CDialer::CDialer() |
|
164 |
{ |
|
165 |
// Empty |
|
166 |
} |
|
167 |
||
168 |
// ----------------------------------------------------------------------------- |
|
169 |
// CDialer::NumberEntry |
|
170 |
// |
|
171 |
// Return pointer to MNumberEntry interface. |
|
172 |
// ----------------------------------------------------------------------------- |
|
173 |
// |
|
174 |
EXPORT_C MNumberEntry* CDialer::NumberEntry() |
|
175 |
{ |
|
176 |
return this; |
|
177 |
} |
|
178 |
||
179 |
// ----------------------------------------------------------------------------- |
|
180 |
// CDialer::SetNumberEntryObserver |
|
181 |
// ----------------------------------------------------------------------------- |
|
182 |
// |
|
183 |
EXPORT_C void CDialer::SetNumberEntryObserver( MNumberEntryObserver& aObserver ) |
|
184 |
{ |
|
185 |
iNumberEntry->SetNumberEntryObserver( aObserver ); |
|
186 |
} |
|
187 |
||
188 |
// ----------------------------------------------------------------------------- |
|
189 |
// CDialer::SetControllerL |
|
190 |
// ----------------------------------------------------------------------------- |
|
191 |
// |
|
192 |
EXPORT_C void CDialer::SetControllerL( MPhoneDialerController* aController ) |
|
193 |
{ |
|
194 |
DIALER_PRINTF( "CDialer::SetControllerL, aController = %x", aController ); |
|
195 |
__ASSERT_DEBUG( aController, DialerPanic(EDialerPanicNullController) ); |
|
196 |
if ( aController && iController != aController ) |
|
197 |
{ |
|
198 |
iController = aController; |
|
81
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
199 |
iToolbar->SetContentProviderL( iController ); |
62 | 200 |
iNumberEntry->SetNumberEntryPromptTextL( iController->NumberEntryPromptTextL() ); |
201 |
SizeChanged(); |
|
202 |
UpdateToolbar(); |
|
203 |
UpdateNumberEntryConfiguration(); |
|
204 |
} |
|
205 |
} |
|
206 |
||
207 |
// --------------------------------------------------------------------------- |
|
208 |
// CDialer::Controller |
|
209 |
// --------------------------------------------------------------------------- |
|
210 |
// |
|
211 |
EXPORT_C MPhoneDialerController* CDialer::Controller() |
|
212 |
{ |
|
213 |
return iController; |
|
214 |
} |
|
215 |
||
216 |
// --------------------------------------------------------------------------- |
|
217 |
// CDialer::GetEasyDialingInterface |
|
218 |
// --------------------------------------------------------------------------- |
|
219 |
// |
|
220 |
EXPORT_C CDialingExtensionInterface* CDialer::GetEasyDialingInterface() const |
|
221 |
{ |
|
222 |
DIALER_PRINT("CDialer::GetEasyDialingInterface"); |
|
223 |
return iEasyDialer; |
|
224 |
} |
|
225 |
||
226 |
// --------------------------------------------------------------------------- |
|
227 |
// CDialer::UpdateToolbar |
|
228 |
// --------------------------------------------------------------------------- |
|
229 |
// |
|
230 |
EXPORT_C void CDialer::UpdateToolbar() |
|
231 |
{ |
|
232 |
if ( iToolbar && iNumberEntry && iController ) |
|
233 |
{ |
|
234 |
TBool numAvailable = ( iNumberEntry->TextLength() > 0 ); |
|
235 |
iController->SetNumberEntryIsEmpty( !numAvailable ); |
|
236 |
iToolbar->UpdateButtonStates(); |
|
237 |
iToolbar->DrawDeferred(); |
|
81
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
238 |
iKeypadArea->DrawDeferred(); // needed to remove drawing problem from leftmost button column |
62 | 239 |
} |
240 |
} |
|
241 |
||
242 |
// --------------------------------------------------------------------------- |
|
243 |
// CDialer::UpdateNumberEntryConfiguration |
|
244 |
// --------------------------------------------------------------------------- |
|
245 |
// |
|
246 |
void CDialer::UpdateNumberEntryConfiguration() |
|
247 |
{ |
|
248 |
TEditorType editorType = ENumericEditor; |
|
249 |
if ( iQwertyMode && iController->EasyDialingAllowed() ) |
|
250 |
{ |
|
251 |
TBool voipSupported( EFalse ); |
|
252 |
CSPSettings* serviceProviderSettings = NULL; |
|
253 |
TRAPD( err, serviceProviderSettings = CSPSettings::NewL() ); |
|
254 |
if ( !err ) |
|
255 |
{ |
|
256 |
voipSupported = serviceProviderSettings->IsFeatureSupported( |
|
257 |
ESupportInternetCallFeature ); |
|
258 |
delete serviceProviderSettings; |
|
259 |
} |
|
260 |
||
261 |
if ( EasyDialingEnabled() || voipSupported ) |
|
262 |
{ |
|
263 |
editorType = EAlphanumericEditor; |
|
264 |
} |
|
265 |
} |
|
266 |
||
267 |
UpdateEdwinState( editorType ); |
|
268 |
||
269 |
// Numeric keysound are disabled in if not in alpha mode. |
|
270 |
// In numeric mode numeric keys should play DTMF only. |
|
271 |
DisableNumericKeySounds( editorType != EAlphanumericEditor ); |
|
272 |
} |
|
273 |
||
274 |
// --------------------------------------------------------------------------- |
|
275 |
// CDialer::RelayoutAndDraw |
|
276 |
// --------------------------------------------------------------------------- |
|
277 |
// |
|
278 |
EXPORT_C void CDialer::RelayoutAndDraw() |
|
279 |
{ |
|
280 |
if ( iIsUsed ) |
|
281 |
{ |
|
282 |
SetSize( Size() ); |
|
283 |
DrawDeferred(); |
|
284 |
UpdateToolbar(); |
|
285 |
} |
|
286 |
} |
|
287 |
||
288 |
// Methods from MNumberEntry |
|
289 |
||
290 |
// --------------------------------------------------------------------------- |
|
291 |
// CDialer::CreateNumberEntry |
|
292 |
// |
|
293 |
// Creates number entry in phone dialer mode. |
|
294 |
// --------------------------------------------------------------------------- |
|
295 |
// |
|
296 |
void CDialer::CreateNumberEntry() |
|
297 |
{ |
|
298 |
DIALER_PRINT("CDialer::CreateNumberEntry<"); |
|
299 |
||
300 |
if ( !iIsUsed ) |
|
301 |
{ |
|
302 |
iIsUsed = ETrue; |
|
303 |
UpdateNumberEntryConfiguration(); |
|
304 |
} |
|
305 |
||
306 |
DIALER_PRINT("CDialer::CreateNumberEntry>"); |
|
307 |
} |
|
308 |
||
309 |
// --------------------------------------------------------------------------- |
|
310 |
// CDialer::GetNumberEntry |
|
311 |
// |
|
312 |
// --------------------------------------------------------------------------- |
|
313 |
// |
|
314 |
CCoeControl* CDialer::GetNumberEntry() const |
|
315 |
{ |
|
316 |
CCoeControl* control( NULL ); |
|
317 |
control = iNumberEntry->GetNumberEntry(); |
|
318 |
return control; |
|
319 |
} |
|
320 |
||
321 |
// --------------------------------------------------------------------------- |
|
322 |
// CDialer::IsNumberEntryUsed |
|
323 |
// |
|
324 |
// --------------------------------------------------------------------------- |
|
325 |
// |
|
326 |
TBool CDialer::IsNumberEntryUsed() const |
|
327 |
{ |
|
328 |
return iIsUsed; |
|
329 |
} |
|
330 |
||
331 |
// --------------------------------------------------------------------------- |
|
332 |
// CDialer::SetNumberEntryVisible |
|
333 |
// |
|
334 |
// --------------------------------------------------------------------------- |
|
335 |
// |
|
336 |
void CDialer::SetNumberEntryVisible( const TBool& /*aVisibility*/ ) |
|
337 |
{ |
|
338 |
} |
|
339 |
||
340 |
// --------------------------------------------------------------------------- |
|
341 |
// CDialer::SetTextToNumberEntry |
|
342 |
// |
|
343 |
// --------------------------------------------------------------------------- |
|
344 |
// |
|
345 |
void CDialer::SetTextToNumberEntry( const TDesC& aDesC ) |
|
346 |
{ |
|
347 |
iNumberEntry->SetTextToNumberEntry( aDesC ); |
|
348 |
} |
|
349 |
||
350 |
// --------------------------------------------------------------------------- |
|
351 |
// CDialer::GetTextFromNumberEntry |
|
352 |
// |
|
353 |
// --------------------------------------------------------------------------- |
|
354 |
// |
|
355 |
void CDialer::GetTextFromNumberEntry( TDes& aDes ) |
|
356 |
{ |
|
357 |
iNumberEntry->GetTextFromNumberEntry( aDes ); |
|
358 |
} |
|
359 |
||
360 |
// --------------------------------------------------------------------------- |
|
361 |
// CDialer::RemoveNumberEntry |
|
362 |
// |
|
363 |
// --------------------------------------------------------------------------- |
|
364 |
// |
|
365 |
void CDialer::RemoveNumberEntry() |
|
366 |
{ |
|
367 |
ResetEditorToDefaultValues(); |
|
81
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
368 |
iVirtualKeyBoardOpen = EFalse; |
62 | 369 |
|
370 |
iIsUsed = EFalse; |
|
371 |
||
372 |
// easydialer change begins |
|
373 |
if (iEasyDialer) |
|
374 |
{ |
|
81
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
375 |
TRAP_IGNORE( iEasyDialer->HandleCommandL( EEasyDialingClosePopup ); |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
376 |
iEasyDialer->HandleCommandL( EEasyDialingVkbClosed ) ); |
62 | 377 |
iEasyDialer->Reset(); |
378 |
} |
|
379 |
// easydialer change ends |
|
380 |
} |
|
381 |
||
382 |
// --------------------------------------------------------------------------- |
|
383 |
// CDialer::ChangeEditorMode |
|
384 |
// |
|
385 |
// --------------------------------------------------------------------------- |
|
386 |
// |
|
387 |
TInt CDialer::ChangeEditorMode( TBool aDefaultMode ) |
|
388 |
{ |
|
389 |
TInt ret( KErrNotSupported ); |
|
390 |
ret = iNumberEntry->ChangeEditorMode( aDefaultMode ); |
|
391 |
return ret; |
|
392 |
} |
|
393 |
||
394 |
// --------------------------------------------------------------------------- |
|
395 |
// CDialer::OpenVKBL |
|
396 |
// |
|
397 |
// --------------------------------------------------------------------------- |
|
398 |
// |
|
399 |
void CDialer::OpenVkbL() |
|
400 |
{ |
|
81
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
401 |
iVirtualKeyBoardOpen = ETrue; |
62 | 402 |
UpdateEdwinState( EVirtualKeyboardEditor ); |
403 |
||
404 |
iNumberEntry->HandleCommandL( EDialerCmdTouchInput ); |
|
81
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
405 |
if ( iEasyDialer ) |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
406 |
{ |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
407 |
iEasyDialer->HandleCommandL( EEasyDialingVkbOpened ); |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
408 |
} |
62 | 409 |
} |
410 |
||
411 |
// --------------------------------------------------------------------------- |
|
412 |
// CDialer::GetEditorMode |
|
413 |
// |
|
414 |
// --------------------------------------------------------------------------- |
|
415 |
// |
|
416 |
TInt CDialer::GetEditorMode() const |
|
417 |
{ |
|
418 |
return ( iEditorType == ENumericEditor ) ? |
|
419 |
EAknEditorNumericInputMode : EAknEditorTextInputMode; |
|
420 |
} |
|
421 |
||
422 |
// --------------------------------------------------------------------------- |
|
423 |
// CDialer::ResetEditorToDefaultValues |
|
424 |
// |
|
425 |
// --------------------------------------------------------------------------- |
|
426 |
// |
|
427 |
void CDialer::ResetEditorToDefaultValues() |
|
428 |
{ |
|
429 |
iNumberEntry->ResetEditorToDefaultValues(); |
|
430 |
} |
|
431 |
||
432 |
// --------------------------------------------------------------------------- |
|
433 |
// CDialer::SetNumberEntryPromptText |
|
434 |
// |
|
435 |
// --------------------------------------------------------------------------- |
|
436 |
// |
|
437 |
void CDialer::SetNumberEntryPromptText( const TDesC& aPromptText ) |
|
438 |
{ |
|
439 |
TRAP_IGNORE( iNumberEntry->SetNumberEntryPromptTextL( aPromptText ) ); |
|
440 |
} |
|
441 |
||
442 |
// --------------------------------------------------------------------------- |
|
443 |
// CDialer::EnableTactileFeedback |
|
444 |
// |
|
445 |
// --------------------------------------------------------------------------- |
|
446 |
// |
|
447 |
void CDialer::EnableTactileFeedback( const TBool aEnable ) |
|
448 |
{ |
|
81
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
449 |
iKeypadArea->EnableTactileFeedback( aEnable ); |
62 | 450 |
} |
451 |
||
452 |
// --------------------------------------------------------- |
|
453 |
// CDialer::HandleQwertyModeChange |
|
454 |
// --------------------------------------------------------- |
|
455 |
// |
|
456 |
EXPORT_C void CDialer::HandleQwertyModeChange( TInt aMode ) |
|
457 |
{ |
|
458 |
iQwertyMode = aMode; |
|
459 |
UpdateNumberEntryConfiguration(); |
|
81
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
460 |
if ( iEasyDialer && aMode ) |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
461 |
{ |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
462 |
TRAP_IGNORE( iEasyDialer->HandleCommandL( EEasyDialingVkbClosed ) ); |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
463 |
} |
62 | 464 |
} |
465 |
||
466 |
// --------------------------------------------------------- |
|
467 |
// CDialer::HandleKeyboardLayoutChange |
|
468 |
// --------------------------------------------------------- |
|
469 |
// |
|
470 |
EXPORT_C void CDialer::HandleKeyboardLayoutChange() |
|
471 |
{ |
|
472 |
} |
|
473 |
||
474 |
// --------------------------------------------------------------------------- |
|
475 |
// CDialer::HandleControlEventL |
|
476 |
// --------------------------------------------------------------------------- |
|
477 |
// |
|
478 |
void CDialer::HandleControlEventL( CCoeControl* aControl, TCoeEvent aEventType ) |
|
479 |
{ |
|
480 |
switch ( aEventType ) |
|
481 |
{ |
|
482 |
case MCoeControlObserver::EEventRequestFocus: |
|
483 |
if ( aControl == iNumberEntry ) |
|
484 |
{ |
|
485 |
if ( iEasyDialer ) |
|
486 |
{ |
|
487 |
iEasyDialer->SetFocus( EFalse ); |
|
488 |
} |
|
489 |
iNumberEntry->SetFocus( ETrue ); |
|
490 |
} |
|
491 |
break; |
|
492 |
||
493 |
default: |
|
494 |
break; |
|
495 |
} |
|
496 |
} |
|
497 |
||
498 |
// Functions from CCoeControl |
|
499 |
||
500 |
// --------------------------------------------------------------------------- |
|
501 |
// CDialer::SizeChanged |
|
502 |
// |
|
503 |
// Called by framework when the view size is changed |
|
504 |
// |
|
505 |
// --------------------------------------------------------------------------- |
|
506 |
// |
|
507 |
void CDialer::SizeChanged() |
|
508 |
{ |
|
509 |
AknsUtils::RegisterControlPosition( this ); |
|
510 |
TRect parentRect( Rect() ); |
|
511 |
||
81
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
512 |
// Method is called before containers are created. |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
513 |
if ( !iKeypadArea ) |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
514 |
{ |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
515 |
return; |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
516 |
} |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
517 |
|
62 | 518 |
TDialerVariety variety = ( Layout_Meta_Data::IsLandscapeOrientation() ? |
519 |
EDialerVarietyLandscape : EDialerVarietyPortrait ); |
|
520 |
||
521 |
// keypad area |
|
81
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
522 |
TDialerOperationMode keypadOpMode = |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
523 |
( EasyDialingEnabled() ? EModeEasyDialing : EModeDialer ); |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
524 |
iKeypadArea->SetOperationMode( keypadOpMode ); |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
525 |
AknLayoutUtils::LayoutControl( |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
526 |
iKeypadArea, parentRect, |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
527 |
AknLayoutScalable_Apps::dia3_keypad_num_pane( variety ).LayoutLine() ); |
62 | 528 |
|
529 |
// toolbar |
|
81
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
530 |
AknLayoutUtils::LayoutControl( |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
531 |
iToolbar, parentRect, |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
532 |
AknLayoutScalable_Apps::dia3_keypad_fun_pane( variety ).LayoutLine() ); |
62 | 533 |
|
534 |
// easy dial contacts list |
|
535 |
if ( iEasyDialer ) |
|
536 |
{ |
|
537 |
AknLayoutUtils::LayoutControl( |
|
538 |
iEasyDialer, parentRect, |
|
539 |
AknLayoutScalable_Apps::dia3_listscroll_pane( variety ).LayoutLine() ); |
|
540 |
} |
|
541 |
||
542 |
// number entry |
|
543 |
LayoutNumberEntry( parentRect, variety ); |
|
544 |
} |
|
545 |
||
546 |
// --------------------------------------------------------------------------- |
|
547 |
// CDialer::PositionChanged |
|
548 |
// --------------------------------------------------------------------------- |
|
549 |
// |
|
550 |
void CDialer::PositionChanged() |
|
551 |
{ |
|
552 |
AknsUtils::RegisterControlPosition( this ); |
|
553 |
} |
|
554 |
||
555 |
// --------------------------------------------------------------------------- |
|
556 |
// CDialer::CountComponentControls |
|
557 |
// |
|
558 |
// Returns contained controls in phone dialer mode |
|
559 |
// --------------------------------------------------------------------------- |
|
560 |
// |
|
561 |
TInt CDialer::CountComponentControls() const |
|
562 |
{ |
|
81
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
563 |
TInt count( KContainedControlsInTelephonyMode ); |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
564 |
|
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
565 |
if ( !iEasyDialer ) |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
566 |
{ |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
567 |
count--; |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
568 |
} |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
569 |
return count; |
62 | 570 |
} |
571 |
||
572 |
// --------------------------------------------------------------------------- |
|
573 |
// CDialer::ComponentControl(TInt aIndex) const |
|
574 |
// |
|
575 |
// Returns contained control by given index. |
|
576 |
// --------------------------------------------------------------------------- |
|
577 |
// |
|
578 |
CCoeControl* CDialer::ComponentControl( TInt aIndex ) const |
|
579 |
{ |
|
81
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
580 |
CCoeControl* currentControl(NULL); |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
581 |
currentControl = ComponentControlForDialerMode( aIndex ); |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
582 |
return currentControl; |
62 | 583 |
} |
584 |
||
585 |
// --------------------------------------------------------------------------- |
|
586 |
// CDialer::Draw |
|
587 |
// --------------------------------------------------------------------------- |
|
588 |
// |
|
589 |
void CDialer::Draw( const TRect& /*aRect*/ ) const |
|
590 |
{ |
|
591 |
} |
|
592 |
||
593 |
// --------------------------------------------------------------------------- |
|
594 |
// CDialer::FocusChanged |
|
595 |
// --------------------------------------------------------------------------- |
|
596 |
// |
|
597 |
void CDialer::FocusChanged( TDrawNow aDrawNow ) |
|
598 |
{ |
|
599 |
if ( iEasyDialer ) |
|
600 |
{ |
|
601 |
// Number entry is set to focus if dialer is in focus and easydialing plugin |
|
602 |
// is not in focus. |
|
603 |
TBool numberEntryFocus = IsFocused() && !iEasyDialer->IsFocused(); |
|
604 |
iNumberEntry->SetFocus( numberEntryFocus, aDrawNow ); |
|
605 |
} |
|
606 |
else |
|
607 |
{ |
|
608 |
iNumberEntry->SetFocus( IsFocused(), aDrawNow ); |
|
609 |
} |
|
610 |
} |
|
611 |
||
612 |
// --------------------------------------------------------------------------- |
|
613 |
// CDialer::MakeVisible |
|
614 |
// --------------------------------------------------------------------------- |
|
615 |
// |
|
616 |
void CDialer::MakeVisible( TBool aVisible ) |
|
617 |
{ |
|
618 |
CCoeControl::MakeVisible( aVisible ); |
|
619 |
||
620 |
// Component control do not inherit visibility automatically as we |
|
621 |
// want to control their visibility separately. |
|
622 |
if ( iNumberEntry ) |
|
623 |
{ |
|
624 |
iNumberEntry->MakeVisible( aVisible ); |
|
625 |
} |
|
626 |
||
627 |
if ( iKeypadArea ) |
|
628 |
{ |
|
629 |
iKeypadArea->MakeVisible( aVisible ); |
|
630 |
} |
|
631 |
||
632 |
if ( iEasyDialer ) |
|
633 |
{ |
|
634 |
TBool edVisible = |
|
635 |
( aVisible && EasyDialingEnabled() ); |
|
636 |
iEasyDialer->MakeVisible( edVisible ); |
|
637 |
} |
|
638 |
if ( iToolbar ) |
|
639 |
{ |
|
640 |
iToolbar->MakeVisible( aVisible ); |
|
641 |
} |
|
642 |
} |
|
643 |
||
644 |
// --------------------------------------------------------------------------- |
|
645 |
// CDialer::PrepareForFocusGainL |
|
646 |
// |
|
647 |
// --------------------------------------------------------------------------- |
|
648 |
// |
|
649 |
void CDialer::PrepareForFocusGainL( ) |
|
650 |
{ |
|
651 |
if ( iVirtualKeyBoardOpen ) |
|
652 |
{ |
|
653 |
// Clear editor flags and report |
|
654 |
// edwin state changed. |
|
81
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
655 |
iVirtualKeyBoardOpen = EFalse; |
62 | 656 |
UpdateNumberEntryConfiguration(); |
81
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
657 |
if ( iEasyDialer ) |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
658 |
{ |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
659 |
iEasyDialer->HandleCommandL( EEasyDialingVkbClosed ); |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
660 |
} |
62 | 661 |
} |
662 |
} |
|
663 |
||
664 |
// --------------------------------------------------------------------------- |
|
665 |
// CDialer::HandleResourceChange |
|
666 |
// |
|
667 |
// --------------------------------------------------------------------------- |
|
668 |
// |
|
669 |
void CDialer::HandleResourceChange( TInt aType ) |
|
670 |
{ |
|
671 |
if ( aType == KEikDynamicLayoutVariantSwitch ) |
|
672 |
{ |
|
673 |
SizeChanged(); |
|
674 |
} |
|
675 |
CCoeControl::HandleResourceChange( aType ); |
|
676 |
} |
|
677 |
||
678 |
// ----------------------------------------------------------------------------- |
|
679 |
// CDialer::HandlePointerEventL |
|
680 |
// |
|
681 |
// ----------------------------------------------------------------------------- |
|
682 |
// |
|
683 |
void CDialer::HandlePointerEventL( const TPointerEvent& aPointerEvent ) |
|
684 |
{ |
|
685 |
// Calling base class implementation |
|
686 |
CCoeControl::HandlePointerEventL(aPointerEvent); |
|
687 |
} |
|
688 |
||
689 |
// Private methods |
|
690 |
||
691 |
// ----------------------------------------------------------------------------- |
|
692 |
// CDialer::LoadResourceL |
|
693 |
// |
|
694 |
// ----------------------------------------------------------------------------- |
|
695 |
// |
|
696 |
void CDialer::LoadResourceL() |
|
697 |
{ |
|
698 |
TFileName path( KDriveZ ); |
|
699 |
path.Append( KDC_RESOURCE_FILES_DIR ); |
|
700 |
path.Append( KDialerResourceFile ); |
|
701 |
||
702 |
RFs& fsSession= ControlEnv()->FsSession(); |
|
703 |
BaflUtils::NearestLanguageFile( fsSession, path ); |
|
704 |
iResourceOffset = ControlEnv()->AddResourceFileL( path ); |
|
705 |
} |
|
706 |
||
707 |
// ----------------------------------------------------------------------------- |
|
708 |
// CDialer::UnLoadResources |
|
709 |
// |
|
710 |
// ----------------------------------------------------------------------------- |
|
711 |
// |
|
712 |
void CDialer::UnLoadResources() |
|
713 |
{ |
|
714 |
if ( iResourceOffset > 0 ) |
|
715 |
{ |
|
716 |
ControlEnv()->DeleteResourceFile( iResourceOffset ); |
|
717 |
iResourceOffset = 0; |
|
718 |
} |
|
719 |
} |
|
720 |
||
721 |
// --------------------------------------------------------------------------- |
|
81
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
722 |
// CDialer::ComponentControlForDialerMode |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
723 |
// |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
724 |
// Returns contained control by given index in ohonedialer mode. |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
725 |
// |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
726 |
// --------------------------------------------------------------------------- |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
727 |
// |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
728 |
CCoeControl* CDialer::ComponentControlForDialerMode( const TInt aIndex ) const |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
729 |
{ |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
730 |
CCoeControl* currentControl(NULL); |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
731 |
|
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
732 |
switch ( aIndex ) |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
733 |
{ |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
734 |
case 0: |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
735 |
currentControl = iNumberEntry; |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
736 |
break; |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
737 |
case 1: |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
738 |
currentControl = iKeypadArea; |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
739 |
break; |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
740 |
|
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
741 |
case 2: |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
742 |
currentControl = iToolbar; |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
743 |
break; |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
744 |
case 3: |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
745 |
currentControl = iEasyDialer; |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
746 |
break; |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
747 |
|
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
748 |
default: |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
749 |
{ |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
750 |
__ASSERT_DEBUG( EFalse, _L("CDialer::ComponentControl no such component defined")); |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
751 |
} |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
752 |
} |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
753 |
|
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
754 |
return currentControl; |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
755 |
} |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
756 |
|
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
757 |
// --------------------------------------------------------------------------- |
62 | 758 |
// CDialer::EdwinState |
759 |
// |
|
760 |
// Returns edwin state of the editor. |
|
761 |
// |
|
762 |
// --------------------------------------------------------------------------- |
|
763 |
// |
|
764 |
CAknEdwinState* CDialer::EdwinState() const |
|
765 |
{ |
|
766 |
MCoeFepAwareTextEditor_Extension1* extension = |
|
767 |
static_cast<MCoeFepAwareTextEditor_Extension1*> |
|
768 |
( static_cast<CAknPhoneNumberEditor*> (GetNumberEntry()) ); |
|
769 |
||
770 |
return static_cast< CAknEdwinState* >( extension->State( KNullUid ) ); |
|
771 |
} |
|
772 |
||
773 |
// --------------------------------------------------------------------------- |
|
774 |
// CDialer::UpdateEdwinState |
|
775 |
// |
|
776 |
// --------------------------------------------------------------------------- |
|
777 |
// |
|
778 |
void CDialer::UpdateEdwinState( TEditorType aType ) |
|
779 |
{ |
|
780 |
iEditorType = aType; |
|
781 |
CAknEdwinState* edwinState = EdwinState(); |
|
782 |
||
783 |
switch ( aType ) |
|
784 |
{ |
|
785 |
case ENumericEditor: |
|
786 |
{ |
|
787 |
iNumberEntry->ClearEditorFlags(); |
|
788 |
} |
|
789 |
break; |
|
790 |
||
791 |
case EAlphanumericEditor: |
|
792 |
case EVirtualKeyboardEditor: |
|
793 |
// intended fall-through |
|
794 |
{ |
|
795 |
TBool vkbOpen = edwinState->Flags() & EAknEditorFlagTouchInputModeOpened; |
|
796 |
TInt flags = EAknEditorFlagNoT9 | |
|
797 |
EAknEditorFlagLatinInputModesOnly | |
|
798 |
EAknEditorFlagSelectionVisible; |
|
81
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
799 |
edwinState->SetDefaultInputMode( EAknEditorTextInputMode ); |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
800 |
edwinState->SetCurrentInputMode( EAknEditorTextInputMode ); |
62 | 801 |
|
802 |
if ( EVirtualKeyboardEditor == aType || vkbOpen ) |
|
803 |
{ |
|
804 |
// Indicators would be shown after closing VKB unless disabled |
|
805 |
// here. |
|
806 |
flags = ( flags |= EAknEditorFlagNoEditIndicators ); |
|
807 |
} |
|
81
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
808 |
else |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
809 |
{ |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
810 |
iVirtualKeyBoardOpen = EFalse; |
c26cc2a7c548
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
62
diff
changeset
|
811 |
} |
62 | 812 |
|
813 |
edwinState->SetFlags( flags ); |
|
814 |
edwinState->SetPermittedInputModes( |
|
815 |
EAknEditorNumericInputMode | EAknEditorTextInputMode ); |
|
816 |
edwinState->SetPermittedCases( |
|
817 |
EAknEditorUpperCase | EAknEditorLowerCase ); |
|
818 |
edwinState->SetDefaultCase( EAknEditorLowerCase ); |
|
819 |
edwinState->SetCurrentCase( EAknEditorLowerCase ); |
|
820 |
edwinState->SetSpecialCharacterTableResourceId( |
|
821 |
R_AVKON_URL_SPECIAL_CHARACTER_TABLE_DIALOG ); |
|
822 |
edwinState->SetNumericKeymap( |
|
823 |
EAknEditorAlphanumericNumberModeKeymap ); |
|
824 |
edwinState->SetMenu(); |
|
825 |
} |
|
826 |
break; |
|
827 |
||
828 |
default: |
|
829 |
DIALER_PRINT( "CDialer::ConfigureEditorSettings, DEFAULT" ) |
|
830 |
ASSERT( EFalse ); |
|
831 |
} |
|
832 |
||
833 |
TRAPD( result, edwinState->ReportAknEdStateEventL( |
|
834 |
MAknEdStateObserver::EAknEdwinStateEventStateUpdate ) ); |
|
835 |
||
836 |
if ( KErrNone != result ) |
|
837 |
{ |
|
838 |
DIALER_PRINTF( "CDialer::ConfigureEditorSettings, RESULT: %d", result ) |
|
839 |
} |
|
840 |
} |
|
841 |
||
842 |
// --------------------------------------------------------------------------- |
|
843 |
// CDialer::SetNumericKeySounds |
|
844 |
// --------------------------------------------------------------------------- |
|
845 |
// |
|
846 |
void CDialer::DisableNumericKeySounds( TBool aDisable ) |
|
847 |
{ |
|
848 |
CAknAppUi *appUi = static_cast<CAknAppUi*>( ControlEnv()->AppUi() ); |
|
849 |
CAknKeySoundSystem* keySounds = appUi->KeySounds(); |
|
850 |
||
851 |
if ( aDisable && !iNumericKeySoundsDisabled ) |
|
852 |
{ |
|
853 |
// Disable numeric key sounds. This is done only if key sounds were not disabled previously, |
|
854 |
// to avoid situation that there were multiple key sound contexts in the stack. |
|
855 |
TRAP_IGNORE( keySounds->PushContextL( R_PHONEUI_DEFAULT_SKEY_LIST ) ); |
|
856 |
} |
|
857 |
else if ( !aDisable && iNumericKeySoundsDisabled ) |
|
858 |
{ |
|
859 |
// Remove numeric key sound disabling. |
|
860 |
keySounds->PopContext(); |
|
861 |
} |
|
862 |
||
863 |
iNumericKeySoundsDisabled = aDisable; |
|
864 |
} |
|
865 |
||
866 |
// --------------------------------------------------------------------------- |
|
867 |
// CDialer::LoadEasyDialingPlugin |
|
868 |
// --------------------------------------------------------------------------- |
|
869 |
// |
|
870 |
void CDialer::LoadEasyDialingPlugin() |
|
871 |
{ |
|
872 |
DIALER_PRINT( "CDialer::LoadEasyDialingPlugin" ) |
|
873 |
||
874 |
if ( FeatureManager::FeatureSupported( KFeatureIdProductIncludesHomeScreenEasyDialing ) ) |
|
875 |
{ |
|
876 |
TRAPD( error, |
|
877 |
{ |
|
878 |
iEasyDialer = CDialingExtensionInterface::NewL(); |
|
879 |
iEasyDialer->InitializeL( *this ); |
|
880 |
||
881 |
iDialingExtensionObserver = CDialingExtensionObserver::NewL( iEasyDialer, iNumberEntry, this ); |
|
882 |
iEasyDialer->AddObserverL( iDialingExtensionObserver ); |
|
883 |
} ); |
|
884 |
||
885 |
if ( error ) |
|
886 |
{ |
|
887 |
DIALER_PRINT( "CDialer::LoadEasyDialingPlugin, load failed" ) |
|
888 |
||
889 |
delete iEasyDialer; |
|
890 |
iEasyDialer = NULL; |
|
891 |
||
892 |
delete iDialingExtensionObserver; |
|
893 |
iDialingExtensionObserver = NULL; |
|
894 |
} |
|
895 |
} |
|
896 |
} |
|
897 |
||
898 |
// --------------------------------------------------------------------------- |
|
899 |
// CDialer::EasyDialingEnabled |
|
900 |
// --------------------------------------------------------------------------- |
|
901 |
// |
|
902 |
TBool CDialer::EasyDialingEnabled() const |
|
903 |
{ |
|
904 |
TBool easyDialEnabled = ( iEasyDialer && |
|
905 |
iEasyDialer->IsEnabled() && |
|
906 |
iController && |
|
907 |
iController->EasyDialingAllowed() ); |
|
908 |
return easyDialEnabled; |
|
909 |
} |
|
910 |
||
911 |
// --------------------------------------------------------------------------- |
|
912 |
// CDialer::LayoutNumberEntry |
|
913 |
// --------------------------------------------------------------------------- |
|
914 |
// |
|
915 |
void CDialer::LayoutNumberEntry( const TRect& aParent, TInt aVariety ) |
|
916 |
{ |
|
917 |
TAknLayoutRect neLayoutRect; |
|
918 |
neLayoutRect.LayoutRect( aParent, AknLayoutScalable_Apps::dia3_numentry_pane( aVariety ) ); |
|
919 |
TRect neRect = neLayoutRect.Rect(); |
|
920 |
||
921 |
if ( EasyDialingEnabled() ) |
|
922 |
{ |
|
923 |
iNumberEntry->SetOperationMode( EModeEasyDialing ); |
|
924 |
||
925 |
// Layout doesn't define any margin between number entry and contact list. |
|
926 |
// Add a small margin here. |
|
927 |
neRect.iTl.iY += 2; |
|
928 |
} |
|
929 |
else |
|
930 |
{ |
|
931 |
iNumberEntry->SetOperationMode( EModeDialer ); |
|
932 |
||
933 |
// Use rect which is an union of layout rects for ED and NE |
|
934 |
TAknLayoutRect edLayoutRect; |
|
935 |
edLayoutRect.LayoutRect( aParent, AknLayoutScalable_Apps::dia3_listscroll_pane( aVariety ) ); |
|
936 |
neRect.iTl.iY = edLayoutRect.Rect().iTl.iY; |
|
937 |
} |
|
938 |
||
939 |
iNumberEntry->SetRect( neRect ); |
|
940 |
} |
|
941 |
||
942 |
// --------------------------------------------------------------------------- |
|
943 |
// CDialer::OnPeninputUiDeactivated |
|
944 |
// |
|
945 |
// Gets called when the virtual keyboard editor is closed. |
|
946 |
// --------------------------------------------------------------------------- |
|
947 |
// |
|
948 |
void CDialer::OnPeninputUiDeactivated() |
|
949 |
{ |
|
950 |
DIALER_PRINT( "CDialer::OnPeninputUiDeactivated" ) |
|
951 |
FocusChanged( EDrawNow ); |
|
952 |
} |
|
953 |
||
954 |
// --------------------------------------------------------------------------- |
|
955 |
// CDialer::OnPeninputUiActivated |
|
956 |
// |
|
957 |
// Gets called when the virtual keyboard editor is opened. |
|
958 |
// --------------------------------------------------------------------------- |
|
959 |
// |
|
960 |
void CDialer::OnPeninputUiActivated() |
|
961 |
{ |
|
962 |
DIALER_PRINT( "CDialer::OnPeninputUiActivated" ) |
|
963 |
} |
|
964 |
// End of File |