102 // |
102 // |
103 void CDialer::ConstructL( |
103 void CDialer::ConstructL( |
104 const CCoeControl& aContainer, |
104 const CCoeControl& aContainer, |
105 const TRect& aRect, |
105 const TRect& aRect, |
106 MPhoneDialerController* aController ) |
106 MPhoneDialerController* aController ) |
107 { |
107 { |
108 DIALER_PRINT("CDialer::ConstructL<"); |
108 DIALER_PRINT("CDialer::ConstructL<"); |
109 LoadResourceL(); |
109 LoadResourceL(); |
110 |
110 |
111 // set window |
111 // set window |
112 SetContainerWindowL( aContainer ); |
112 SetContainerWindowL( aContainer ); |
113 SetParent( const_cast<CCoeControl*>(&aContainer) ); |
113 SetParent( const_cast<CCoeControl*>(&aContainer) ); |
114 |
114 |
115 iNumberEntry = CDialerNumberEntry::NewL( *this ); |
115 iNumberEntry = CDialerNumberEntry::NewL( *this ); |
116 |
116 |
117 iController = aController; |
117 iController = aController; |
118 |
118 |
119 iKeypadArea = CDialerKeyPadContainer::NewL( *this, EModeEasyDialing ); |
119 iKeypadArea = CDialerKeyPadContainer::NewL( *this, EModeEasyDialing ); |
120 |
120 |
121 iToolbar = CDialerToolbarContainer::NewL( *this, iController ); |
121 iToolbar = CDialerToolbarContainer::NewL( *this, iController ); |
122 |
122 |
123 // try to create easydialing plugin. If plugin is not present, iEasydialer gets value NULL. |
123 // try to create easydialing plugin. If plugin is not present, iEasydialer gets value NULL. |
124 LoadEasyDialingPlugin(); |
124 LoadEasyDialingPlugin(); |
252 // --------------------------------------------------------------------------- |
253 // --------------------------------------------------------------------------- |
253 // CDialer::RelayoutAndDraw |
254 // CDialer::RelayoutAndDraw |
254 // --------------------------------------------------------------------------- |
255 // --------------------------------------------------------------------------- |
255 // |
256 // |
256 EXPORT_C void CDialer::RelayoutAndDraw() |
257 EXPORT_C void CDialer::RelayoutAndDraw() |
257 { |
258 { |
258 if ( iIsUsed ) |
259 if ( iIsUsed ) |
259 { |
260 { |
260 SetSize( Size() ); |
261 SetSize( Size() ); |
261 DrawDeferred(); |
262 DrawDeferred(); |
262 UpdateToolbar(); |
263 UpdateToolbar(); |
263 } |
264 } |
264 } |
265 } |
265 |
266 |
266 // Methods from MNumberEntry |
267 // Methods from MNumberEntry |
267 |
268 |
268 // --------------------------------------------------------------------------- |
269 // --------------------------------------------------------------------------- |
269 // CDialer::CreateNumberEntry |
270 // CDialer::CreateNumberEntry |
273 // |
274 // |
274 void CDialer::CreateNumberEntry() |
275 void CDialer::CreateNumberEntry() |
275 { |
276 { |
276 DIALER_PRINT("CDialer::CreateNumberEntry<"); |
277 DIALER_PRINT("CDialer::CreateNumberEntry<"); |
277 |
278 |
278 iIsUsed = ETrue; |
279 if ( !iIsUsed ) |
279 |
280 { |
280 UpdateNumberEntryConfiguration(); |
281 iIsUsed = ETrue; |
281 |
282 UpdateNumberEntryConfiguration(); |
282 DIALER_PRINT("CDialer::CreateNumberEntry>"); |
283 } |
283 } |
284 |
284 |
285 DIALER_PRINT("CDialer::CreateNumberEntry>"); |
|
286 } |
|
287 |
285 // --------------------------------------------------------------------------- |
288 // --------------------------------------------------------------------------- |
286 // CDialer::GetNumberEntry |
289 // CDialer::GetNumberEntry |
287 // |
290 // |
288 // --------------------------------------------------------------------------- |
291 // --------------------------------------------------------------------------- |
289 // |
292 // |
291 { |
294 { |
292 CCoeControl* control( NULL ); |
295 CCoeControl* control( NULL ); |
293 control = iNumberEntry->GetNumberEntry(); |
296 control = iNumberEntry->GetNumberEntry(); |
294 return control; |
297 return control; |
295 } |
298 } |
296 |
299 |
297 // --------------------------------------------------------------------------- |
300 // --------------------------------------------------------------------------- |
298 // CDialer::IsNumberEntryUsed |
301 // CDialer::IsNumberEntryUsed |
299 // |
302 // |
300 // --------------------------------------------------------------------------- |
303 // --------------------------------------------------------------------------- |
301 // |
304 // |
302 TBool CDialer::IsNumberEntryUsed() const |
305 TBool CDialer::IsNumberEntryUsed() const |
303 { |
306 { |
304 return iIsUsed; |
307 return iIsUsed; |
305 } |
308 } |
306 |
309 |
307 // --------------------------------------------------------------------------- |
310 // --------------------------------------------------------------------------- |
308 // CDialer::SetNumberEntryVisible |
311 // CDialer::SetNumberEntryVisible |
309 // |
312 // |
310 // --------------------------------------------------------------------------- |
313 // --------------------------------------------------------------------------- |
311 // |
314 // |
312 void CDialer::SetNumberEntryVisible( const TBool& /*aVisibility*/ ) |
315 void CDialer::SetNumberEntryVisible( const TBool& /*aVisibility*/ ) |
313 { |
316 { |
314 } |
317 } |
315 |
318 |
316 // --------------------------------------------------------------------------- |
319 // --------------------------------------------------------------------------- |
317 // CDialer::SetTextToNumberEntry |
320 // CDialer::SetTextToNumberEntry |
318 // |
321 // |
319 // --------------------------------------------------------------------------- |
322 // --------------------------------------------------------------------------- |
320 // |
323 // |
321 void CDialer::SetTextToNumberEntry( const TDesC& aDesC ) |
324 void CDialer::SetTextToNumberEntry( const TDesC& aDesC ) |
322 { |
325 { |
323 iNumberEntry->SetTextToNumberEntry( aDesC ); |
326 iNumberEntry->SetTextToNumberEntry( aDesC ); |
324 } |
327 } |
325 |
328 |
326 // --------------------------------------------------------------------------- |
329 // --------------------------------------------------------------------------- |
327 // CDialer::GetTextFromNumberEntry |
330 // CDialer::GetTextFromNumberEntry |
328 // |
331 // |
329 // --------------------------------------------------------------------------- |
332 // --------------------------------------------------------------------------- |
330 // |
333 // |
331 void CDialer::GetTextFromNumberEntry( TDes& aDes ) |
334 void CDialer::GetTextFromNumberEntry( TDes& aDes ) |
332 { |
335 { |
333 iNumberEntry->GetTextFromNumberEntry( aDes ); |
336 iNumberEntry->GetTextFromNumberEntry( aDes ); |
334 } |
337 } |
335 |
338 |
336 // --------------------------------------------------------------------------- |
339 // --------------------------------------------------------------------------- |
337 // CDialer::RemoveNumberEntry |
340 // CDialer::RemoveNumberEntry |
338 // |
341 // |
339 // --------------------------------------------------------------------------- |
342 // --------------------------------------------------------------------------- |
340 // |
343 // |
341 void CDialer::RemoveNumberEntry() |
344 void CDialer::RemoveNumberEntry() |
342 { |
345 { |
343 ResetEditorToDefaultValues(); |
346 ResetEditorToDefaultValues(); |
|
347 iVirtualKeyBoardOpen = EFalse; |
|
348 |
344 iIsUsed = EFalse; |
349 iIsUsed = EFalse; |
345 |
350 |
346 // easydialer change begins |
351 // easydialer change begins |
347 if (iEasyDialer) |
352 if (iEasyDialer) |
348 { |
353 { |
349 TRAP_IGNORE( iEasyDialer->HandleCommandL( EEasyDialingClosePopup ) ); |
354 TRAP_IGNORE( iEasyDialer->HandleCommandL( EEasyDialingClosePopup ); |
|
355 iEasyDialer->HandleCommandL( EEasyDialingVkbClosed ) ); |
350 iEasyDialer->Reset(); |
356 iEasyDialer->Reset(); |
351 } |
357 } |
352 // easydialer change ends |
358 // easydialer change ends |
353 } |
359 } |
354 |
360 |
355 // --------------------------------------------------------------------------- |
361 // --------------------------------------------------------------------------- |
356 // CDialer::ChangeEditorMode |
362 // CDialer::ChangeEditorMode |
357 // |
363 // |
358 // --------------------------------------------------------------------------- |
364 // --------------------------------------------------------------------------- |
359 // |
365 // |
373 { |
379 { |
374 iVirtualKeyBoardOpen = ETrue; |
380 iVirtualKeyBoardOpen = ETrue; |
375 UpdateEdwinState( EVirtualKeyboardEditor ); |
381 UpdateEdwinState( EVirtualKeyboardEditor ); |
376 |
382 |
377 iNumberEntry->HandleCommandL( EDialerCmdTouchInput ); |
383 iNumberEntry->HandleCommandL( EDialerCmdTouchInput ); |
|
384 if ( iEasyDialer ) |
|
385 { |
|
386 iEasyDialer->HandleCommandL( EEasyDialingVkbOpened ); |
|
387 } |
378 } |
388 } |
379 |
389 |
380 // --------------------------------------------------------------------------- |
390 // --------------------------------------------------------------------------- |
381 // CDialer::GetEditorMode |
391 // CDialer::GetEditorMode |
382 // |
392 // |
383 // --------------------------------------------------------------------------- |
393 // --------------------------------------------------------------------------- |
384 // |
394 // |
385 TInt CDialer::GetEditorMode() const |
395 TInt CDialer::GetEditorMode() const |
386 { |
396 { |
387 TBool vkbOpen = EdwinState()->Flags() & EAknEditorFlagTouchInputModeOpened; |
397 return ( iEditorType == ENumericEditor ) ? |
388 return ( iQwertyMode || vkbOpen ) ? EAknEditorTextInputMode : |
398 EAknEditorNumericInputMode : EAknEditorTextInputMode; |
389 EAknEditorNumericInputMode; |
399 } |
390 } |
400 |
391 |
|
392 // --------------------------------------------------------------------------- |
401 // --------------------------------------------------------------------------- |
393 // CDialer::ResetEditorToDefaultValues |
402 // CDialer::ResetEditorToDefaultValues |
394 // |
403 // |
395 // --------------------------------------------------------------------------- |
404 // --------------------------------------------------------------------------- |
396 // |
405 // |
397 void CDialer::ResetEditorToDefaultValues() |
406 void CDialer::ResetEditorToDefaultValues() |
398 { |
407 { |
399 iNumberEntry->ResetEditorToDefaultValues(); |
408 iNumberEntry->ResetEditorToDefaultValues(); |
400 } |
409 } |
401 |
410 |
402 // --------------------------------------------------------------------------- |
411 // --------------------------------------------------------------------------- |
403 // CDialer::SetNumberEntryPromptText |
412 // CDialer::SetNumberEntryPromptText |
404 // |
413 // |
405 // --------------------------------------------------------------------------- |
414 // --------------------------------------------------------------------------- |
406 // |
415 // |
558 |
571 |
559 // --------------------------------------------------------------------------- |
572 // --------------------------------------------------------------------------- |
560 // CDialer::FocusChanged |
573 // CDialer::FocusChanged |
561 // --------------------------------------------------------------------------- |
574 // --------------------------------------------------------------------------- |
562 // |
575 // |
563 void CDialer::FocusChanged(TDrawNow aDrawNow) |
576 void CDialer::FocusChanged( TDrawNow aDrawNow ) |
564 { |
577 { |
565 if ( iEasyDialer ) |
578 if ( iEasyDialer ) |
566 { |
579 { |
567 // Number entry is set to focus if dialer is in focus and easydialing plugin |
580 // Number entry is set to focus if dialer is in focus and easydialing plugin |
568 // is not in focus. |
581 // is not in focus. |
569 TBool numberEntryFocus = IsFocused() && !iEasyDialer->IsFocused(); |
582 TBool numberEntryFocus = IsFocused() && !iEasyDialer->IsFocused(); |
570 iNumberEntry->SetFocus( numberEntryFocus, aDrawNow ); |
583 iNumberEntry->SetFocus( numberEntryFocus, aDrawNow ); |
571 } |
584 } |
572 else |
585 else |
573 { |
586 { |
574 iNumberEntry->SetFocus( IsFocused(), aDrawNow ); |
587 iNumberEntry->SetFocus( IsFocused(), aDrawNow ); |
575 } |
588 } |
576 } |
589 } |
577 |
590 |
578 // --------------------------------------------------------------------------- |
591 // --------------------------------------------------------------------------- |
579 // CDialer::MakeVisible |
592 // CDialer::MakeVisible |
580 // --------------------------------------------------------------------------- |
593 // --------------------------------------------------------------------------- |
581 // |
594 // |
582 void CDialer::MakeVisible( TBool aVisible ) |
595 void CDialer::MakeVisible( TBool aVisible ) |
845 // CDialer::LayoutNumberEntry |
863 // CDialer::LayoutNumberEntry |
846 // --------------------------------------------------------------------------- |
864 // --------------------------------------------------------------------------- |
847 // |
865 // |
848 void CDialer::LayoutNumberEntry( const TRect& aParent, TInt aVariety ) |
866 void CDialer::LayoutNumberEntry( const TRect& aParent, TInt aVariety ) |
849 { |
867 { |
850 // Use larger number entry if Easy dialing is not currently enabled. |
868 TAknLayoutRect neLayoutRect; |
|
869 neLayoutRect.LayoutRect( aParent, AknLayoutScalable_Apps::dia3_numentry_pane( aVariety ) ); |
|
870 TRect neRect = neLayoutRect.Rect(); |
|
871 |
851 if ( EasyDialingEnabled() ) |
872 if ( EasyDialingEnabled() ) |
852 { |
873 { |
853 iNumberEntry->SetOperationMode( EModeEasyDialing ); |
874 iNumberEntry->SetOperationMode( EModeEasyDialing ); |
854 AknLayoutUtils::LayoutControl( |
875 |
855 iNumberEntry, aParent, |
876 // Layout doesn't define any margin between number entry and contact list. |
856 AknLayoutScalable_Apps::dia3_numentry_pane( aVariety ).LayoutLine() ); |
877 // Add a small margin here. |
|
878 neRect.iTl.iY += 2; |
857 } |
879 } |
858 else |
880 else |
859 { |
881 { |
860 iNumberEntry->SetOperationMode( EModeDialer ); |
882 iNumberEntry->SetOperationMode( EModeDialer ); |
861 TAknLayoutRect neLayoutRect; |
883 |
862 neLayoutRect.LayoutRect( aParent, AknLayoutScalable_Apps::dia3_numentry_pane( aVariety ) ); |
884 // Use rect which is an union of layout rects for ED and NE |
863 TAknLayoutRect edLayoutRect; |
885 TAknLayoutRect edLayoutRect; |
864 edLayoutRect.LayoutRect( aParent, AknLayoutScalable_Apps::dia3_listscroll_pane( aVariety ) ); |
886 edLayoutRect.LayoutRect( aParent, AknLayoutScalable_Apps::dia3_listscroll_pane( aVariety ) ); |
865 |
887 neRect.iTl.iY = edLayoutRect.Rect().iTl.iY; |
866 // create rect which is union of layout rects for ED and NE |
888 } |
867 TRect neRect( edLayoutRect.Rect().iTl, neLayoutRect.Rect().iBr ); |
889 |
868 |
890 iNumberEntry->SetRect( neRect ); |
869 iNumberEntry->SetRect( neRect ); |
|
870 } |
|
871 } |
891 } |
872 |
892 |
873 // End of File |
893 // End of File |