44 #include <CPsPattern.h> |
44 #include <CPsPattern.h> |
45 #include <CPsRequestHandler.h> |
45 #include <CPsRequestHandler.h> |
46 |
46 |
47 // Virtual phonebook header files |
47 // Virtual phonebook header files |
48 #include <VPbkContactStoreUris.h> |
48 #include <VPbkContactStoreUris.h> |
|
49 #include <CVPbkContactStoreUriArray.h> |
|
50 #include <TVPbkContactStoreUriPtr.h> |
|
51 #include <CVPbkContactLinkArray.h> |
49 #include <VPbkEng.rsg> // contains virtual phonebook data fields |
52 #include <VPbkEng.rsg> // contains virtual phonebook data fields |
50 #include <phoneui.rsg> |
53 #include <phoneui.rsg> |
51 |
54 |
52 // CCA Launcher header files. |
55 // CCA Launcher header files. |
53 #include <ccafactory.h> |
56 #include <ccafactory.h> |
177 // ----------------------------------------------------------------------------- |
180 // ----------------------------------------------------------------------------- |
178 // |
181 // |
179 void CEasyDialingPlugin::ConstructL() |
182 void CEasyDialingPlugin::ConstructL() |
180 { |
183 { |
181 iLongTapped = EFalse; |
184 iLongTapped = EFalse; |
182 // Create contact data manager. |
185 |
183 iContactDataManager = CEasyDialingContactDataManager::NewL(); |
186 // Create a contact store array. |
184 iContactDataManager->SetObserver( this ); |
187 HBufC* defaultCdb = VPbkContactStoreUris::DefaultCntDbUri().AllocLC(); |
|
188 iContactDataStores.AppendL( defaultCdb ); |
|
189 CleanupStack::Pop( defaultCdb ); |
|
190 |
|
191 // Create a contact manager instance. |
|
192 iContactStoreUriArray = CVPbkContactStoreUriArray::NewL(); |
|
193 iContactStoreUriArray->AppendL( TVPbkContactStoreUriPtr( VPbkContactStoreUris::DefaultCntDbUri() ) ); |
|
194 iContactManager = CVPbkContactManager::NewL( *iContactStoreUriArray ); |
|
195 |
|
196 iContactDataManager = new (ELeave) CEasyDialingContactDataManager(iContactManager); |
|
197 iContactDataManager->ConstructL(); |
|
198 iContactDataManager->SetObserver(this); |
185 |
199 |
186 // Find a handle to ca launcher extension MCCAConnectionExt. |
200 // Find a handle to ca launcher extension MCCAConnectionExt. |
187 // Easydialing has to use the extension API, because it needs function CloseAppL |
201 // Easydialing has to use the extension API, because it needs function CloseAppL |
188 // only found in extension. |
202 // only found in extension. |
189 // MCCAConnection extension has to be obtained through MCCAParameter extension, |
203 // MCCAConnection extension has to be obtained through MCCAParameter extension, |
197 |
211 |
198 // Cast the pointer into contact launcher object. |
212 // Cast the pointer into contact launcher object. |
199 User::LeaveIfNull( any ); |
213 User::LeaveIfNull( any ); |
200 iContactLauncher = static_cast<MCCAConnectionExt*>( any ); |
214 iContactLauncher = static_cast<MCCAConnectionExt*>( any ); |
201 |
215 |
202 iCenrepListener = CEasyDialingCenrepListener::NewL( this ); |
216 iCenrepListener = CEasyDialingCenrepListener::NewL(this); |
203 |
217 |
204 iContactorService = CEDContactorService::NewL( this ); |
218 iContactorService = CEDContactorService::NewL( this ); |
205 |
219 |
206 // EasyDialing resource file is attempted to be read from the same directory where the |
220 // EasyDialing resource file is attempted to be read from the same directory where the |
207 // executed binary is located |
221 // executed binary is located |
228 iObservers.Reset(); |
242 iObservers.Reset(); |
229 |
243 |
230 delete iCenrepListener; |
244 delete iCenrepListener; |
231 delete iContactDataManager; |
245 delete iContactDataManager; |
232 delete iPredictiveSearchQuery; |
246 delete iPredictiveSearchQuery; |
|
247 delete iContactManager; |
|
248 delete iContactStoreUriArray; |
233 iContactDataStores.ResetAndDestroy(); |
249 iContactDataStores.ResetAndDestroy(); |
234 |
250 |
235 if ( iPredictiveContactSearchHandler ) |
251 if ( iPredictiveContactSearchHandler ) |
236 { |
252 { |
237 iPredictiveContactSearchHandler->RemoveObserver(this); |
253 iPredictiveContactSearchHandler->RemoveObserver(this); |
390 void CEasyDialingPlugin::InitPredictiveContactSearchL() |
406 void CEasyDialingPlugin::InitPredictiveContactSearchL() |
391 { |
407 { |
392 iPredictiveContactSearchHandler = CPSRequestHandler::NewL(); |
408 iPredictiveContactSearchHandler = CPSRequestHandler::NewL(); |
393 iPredictiveContactSearchHandler->AddObserverL(this); |
409 iPredictiveContactSearchHandler->AddObserverL(this); |
394 |
410 |
|
411 // Put the searched contact fields into array. |
|
412 RArray<TInt> contact_fields; |
|
413 CleanupClosePushL(contact_fields); |
|
414 |
395 // Check which relevant contact fields are indexed in PCS search. |
415 // Check which relevant contact fields are indexed in PCS search. |
396 iFirstNamePCSIndex = FindContactFieldPCSIndexL( R_VPBK_FIELD_TYPE_FIRSTNAME ); |
416 iFirstNamePCSIndex = FindContactFieldPCSIndexL( R_VPBK_FIELD_TYPE_FIRSTNAME ); |
397 iLastNamePCSIndex = FindContactFieldPCSIndexL( R_VPBK_FIELD_TYPE_LASTNAME ); |
417 iLastNamePCSIndex = FindContactFieldPCSIndexL( R_VPBK_FIELD_TYPE_LASTNAME ); |
398 iCompanyNamePCSIndex = FindContactFieldPCSIndexL( R_VPBK_FIELD_TYPE_COMPANYNAME ); |
418 iCompanyNamePCSIndex = FindContactFieldPCSIndexL( R_VPBK_FIELD_TYPE_COMPANYNAME ); |
399 |
419 |
413 OstTrace0( TRACE_ERROR, CEASYDIALINGPLUGIN_INITPREDICTIVECONTACTSEARCHL_ERROR_NO_LAST_NAME, "ERROR, PCS does not support last name indexing!" ); |
433 OstTrace0( TRACE_ERROR, CEASYDIALINGPLUGIN_INITPREDICTIVECONTACTSEARCHL_ERROR_NO_LAST_NAME, "ERROR, PCS does not support last name indexing!" ); |
414 LOGSTRING("EasyDialingPlugin: PCS does not support last name indexing => Leave"); |
434 LOGSTRING("EasyDialingPlugin: PCS does not support last name indexing => Leave"); |
415 User::Leave( KErrEasyDialingNoLastNamePCSIndexing ); |
435 User::Leave( KErrEasyDialingNoLastNamePCSIndexing ); |
416 } |
436 } |
417 |
437 |
418 SetupPcsSettingsL(); |
438 // First name, last name and company name (if supported) are used in PCS search. |
|
439 contact_fields.Append(R_VPBK_FIELD_TYPE_FIRSTNAME); |
|
440 contact_fields.Append(R_VPBK_FIELD_TYPE_LASTNAME); |
|
441 if ( iCompanyNamePCSIndex != KErrNotFound ) |
|
442 { |
|
443 contact_fields.Append(R_VPBK_FIELD_TYPE_COMPANYNAME); |
|
444 } |
|
445 |
|
446 SetSortOrderL( iContactDataManager->NameOrder() ); |
|
447 |
|
448 // Create and fill ps settings object. |
|
449 CPsSettings* ps_settings = CPsSettings::NewL(); |
|
450 CleanupStack::PushL(ps_settings); |
|
451 |
|
452 ps_settings->SetSearchUrisL(iContactDataStores); |
|
453 ps_settings->SetMaxResults(KEDMaximumMatchingContactsCount); |
|
454 ps_settings->SetSortType(EAlphabetical); |
|
455 ps_settings->SetDisplayFieldsL(contact_fields); |
|
456 |
|
457 // Set the PCS settings. |
|
458 iPredictiveContactSearchHandler->SetSearchSettingsL(*ps_settings); |
|
459 |
|
460 CleanupStack::PopAndDestroy(ps_settings); |
|
461 CleanupStack::PopAndDestroy(&contact_fields); |
419 |
462 |
420 iPredictiveSearchQuery = CPsQuery::NewL(); |
463 iPredictiveSearchQuery = CPsQuery::NewL(); |
421 } |
|
422 |
|
423 // ----------------------------------------------------------------------------- |
|
424 // SetupPcsSettingsL |
|
425 // ----------------------------------------------------------------------------- |
|
426 // |
|
427 void CEasyDialingPlugin::SetupPcsSettingsL() |
|
428 { |
|
429 // Get current store configuration from Phonebook settings |
|
430 iContactDataStores.ResetAndDestroy(); |
|
431 iContactDataManager->GetCurrentStoreUrisL( iContactDataStores ); |
|
432 |
|
433 // Put the searched contact fields into array. |
|
434 RArray<TInt> contact_fields; |
|
435 CleanupClosePushL(contact_fields); |
|
436 |
|
437 // First name, last name and company name (if supported) are used in PCS search. |
|
438 contact_fields.Append( R_VPBK_FIELD_TYPE_FIRSTNAME ); |
|
439 contact_fields.Append( R_VPBK_FIELD_TYPE_LASTNAME ); |
|
440 contact_fields.Append( R_VPBK_FIELD_TYPE_COMPANYNAME ); |
|
441 |
|
442 // Create and fill PS settings object. |
|
443 CPsSettings* ps_settings = CPsSettings::NewL(); |
|
444 CleanupStack::PushL( ps_settings ); |
|
445 |
|
446 ps_settings->SetSearchUrisL( iContactDataStores ); |
|
447 ps_settings->SetMaxResults( KEDMaximumMatchingContactsCount ); |
|
448 ps_settings->SetSortType( EAlphabetical ); |
|
449 ps_settings->SetDisplayFieldsL( contact_fields ); |
|
450 |
|
451 // Set the PCS settings. |
|
452 iPredictiveContactSearchHandler->SetSearchSettingsL( *ps_settings ); |
|
453 |
|
454 CleanupStack::PopAndDestroy( ps_settings ); |
|
455 CleanupStack::PopAndDestroy( &contact_fields ); |
|
456 |
|
457 // Set the sort order. This must happen after the contact store settings |
|
458 // are up-to-date. |
|
459 SetSortOrderL( iContactDataManager->NameOrder() ); |
|
460 } |
464 } |
461 |
465 |
462 // ----------------------------------------------------------------------------- |
466 // ----------------------------------------------------------------------------- |
463 // SetSortOrderL |
467 // SetSortOrderL |
464 // ----------------------------------------------------------------------------- |
468 // ----------------------------------------------------------------------------- |
467 { |
471 { |
468 RArray<TInt> fields; |
472 RArray<TInt> fields; |
469 CleanupClosePushL( fields ); |
473 CleanupClosePushL( fields ); |
470 if ( aNameOrder == CEasyDialingContactDataManager::EFirstnameLastname ) |
474 if ( aNameOrder == CEasyDialingContactDataManager::EFirstnameLastname ) |
471 { |
475 { |
472 fields.AppendL( R_VPBK_FIELD_TYPE_FIRSTNAME ); |
476 fields.Append(R_VPBK_FIELD_TYPE_FIRSTNAME); |
473 fields.AppendL( R_VPBK_FIELD_TYPE_LASTNAME ); |
477 fields.Append(R_VPBK_FIELD_TYPE_LASTNAME); |
474 } |
478 } |
475 else |
479 else |
476 { |
480 { |
477 fields.AppendL( R_VPBK_FIELD_TYPE_LASTNAME ); |
481 fields.Append(R_VPBK_FIELD_TYPE_LASTNAME); |
478 fields.AppendL( R_VPBK_FIELD_TYPE_FIRSTNAME ); |
482 fields.Append(R_VPBK_FIELD_TYPE_FIRSTNAME); |
479 } |
483 } |
480 fields.AppendL( R_VPBK_FIELD_TYPE_COMPANYNAME ); |
484 if ( iCompanyNamePCSIndex != KErrNotFound ) |
481 |
485 { |
482 // Set the same order for each contact store. PCS automatically ignores |
486 fields.Append(R_VPBK_FIELD_TYPE_COMPANYNAME); |
483 // fields not supported by the given store. |
487 } |
484 for ( TInt i = 0 ; i < iContactDataStores.Count() ; ++i ) |
488 iPredictiveContactSearchHandler->ChangeSortOrderL( *iContactDataStores[0], fields ); |
485 { |
|
486 iPredictiveContactSearchHandler->ChangeSortOrderL( *iContactDataStores[i], fields ); |
|
487 } |
|
488 CleanupStack::PopAndDestroy( &fields ); |
489 CleanupStack::PopAndDestroy( &fields ); |
489 } |
490 } |
490 |
491 |
491 // ----------------------------------------------------------------------------- |
492 // ----------------------------------------------------------------------------- |
492 // OfferKeyEventL |
493 // OfferKeyEventL |
845 { |
846 { |
846 TRAP_IGNORE( DoHandleContactsChangedL() ); |
847 TRAP_IGNORE( DoHandleContactsChangedL() ); |
847 } |
848 } |
848 |
849 |
849 // ----------------------------------------------------------------------------- |
850 // ----------------------------------------------------------------------------- |
850 // StoreConfigurationChanged |
|
851 // From MContactDataManagerObserver |
|
852 // ----------------------------------------------------------------------------- |
|
853 // |
|
854 void CEasyDialingPlugin::StoreConfigurationChanged() |
|
855 { |
|
856 TRAP_IGNORE( |
|
857 // Reconfigure PCS to update its store settings |
|
858 SetupPcsSettingsL(); |
|
859 // Contacts available have changed and a new search is needed if we have |
|
860 // previous results shown. |
|
861 DoHandleContactsChangedL() |
|
862 ); |
|
863 } |
|
864 |
|
865 // ----------------------------------------------------------------------------- |
|
866 // InformContactorEvent |
851 // InformContactorEvent |
867 // From MEDContactorObserver |
852 // From MEDContactorObserver |
868 // ----------------------------------------------------------------------------- |
853 // ----------------------------------------------------------------------------- |
869 // |
854 // |
870 void CEasyDialingPlugin::InformContactorEvent( MEDContactorObserver::TEvent aEvent ) |
855 void CEasyDialingPlugin::InformContactorEvent( MEDContactorObserver::TEvent aEvent ) |
930 |
915 |
931 // The PCS mode used with character is based on character itself, |
916 // The PCS mode used with character is based on character itself, |
932 // not to the keyboard it is made with. While this is not strictly |
917 // not to the keyboard it is made with. While this is not strictly |
933 // identical to checking the used keyboard, this behaves identically |
918 // identical to checking the used keyboard, this behaves identically |
934 // in most of the normal cases, and makes the logic simpler. |
919 // in most of the normal cases, and makes the logic simpler. |
935 // In case of hybrid mode keyboard, use always predictive default |
920 if ( IsItuTCharacter( iSearchString[i] ) ) |
936 // keyboard. |
|
937 if ( iKeyboardMode == EDefaultKeyboard && |
|
938 IsItuTCharacter( iSearchString[i] ) ) |
|
939 { |
921 { |
940 item->SetMode( EPredictiveItuT ); |
922 item->SetMode( EPredictiveItuT ); |
941 } |
923 } |
942 else |
924 else |
943 { |
925 { |
1023 TInt CEasyDialingPlugin::FindContactFieldPCSIndexL( TInt aIndex ) |
1005 TInt CEasyDialingPlugin::FindContactFieldPCSIndexL( TInt aIndex ) |
1024 { |
1006 { |
1025 RArray<TInt> fieldOrder; |
1007 RArray<TInt> fieldOrder; |
1026 CleanupClosePushL( fieldOrder ); |
1008 CleanupClosePushL( fieldOrder ); |
1027 |
1009 |
1028 // PCS uses the same data plugin for all the Phonebook databases |
1010 // Current implementation searches only from default database. |
1029 // (i.e. phone contacts, SIM contacts, SDN contacts), and there can be only |
1011 // Later this may be expanded to search SIM contacts as well. |
1030 // one data order per plugin. Thus, data order for all databases supported |
|
1031 // by us is the same, and it's enough to ask data order just for the default CDB. |
|
1032 const TDesC& defaultCdb = VPbkContactStoreUris::DefaultCntDbUri(); |
1012 const TDesC& defaultCdb = VPbkContactStoreUris::DefaultCntDbUri(); |
1033 |
1013 |
1034 iPredictiveContactSearchHandler->GetDataOrderL( defaultCdb, fieldOrder ); |
1014 iPredictiveContactSearchHandler->GetDataOrderL( defaultCdb, fieldOrder ); |
1035 TInt pcsIndex = fieldOrder.Find( aIndex ); |
1015 TInt pcsIndex = fieldOrder.Find( aIndex ); |
1036 |
1016 |
1092 for ( TInt i = 0; i < numberOfPCSMatches; i++ ) |
1072 for ( TInt i = 0; i < numberOfPCSMatches; i++ ) |
1093 { |
1073 { |
1094 TInt indexFromEnd = numberOfPCSMatches - i - 1; |
1074 TInt indexFromEnd = numberOfPCSMatches - i - 1; |
1095 |
1075 |
1096 MVPbkContactLink* link = iPredictiveContactSearchHandler->ConvertToVpbkLinkLC( |
1076 MVPbkContactLink* link = iPredictiveContactSearchHandler->ConvertToVpbkLinkLC( |
1097 *(aResults[indexFromEnd]), iContactDataManager->ContactManager() ); |
1077 *(aResults[indexFromEnd]), *iContactManager ); |
1098 if ( !iContactDataManager->IsFavL( link ) ) |
1078 if ( !iContactDataManager->IsFavL( link ) ) |
1099 { |
1079 { |
1100 // handle favourites separately, in another loop |
1080 // handle favourites separately, in another loop |
1101 HBufC* contactString = CreateContactStringLC( aResults[ indexFromEnd ], nameOrder ); |
1081 HBufC* contactString = CreateContactStringLC( aResults[ indexFromEnd ], nameOrder ); |
1102 CreateListBoxContactStringL( *contactString, link, matchThumbnails, EFalse ); |
1082 CreateListBoxContactStringL( *contactString, link, matchThumbnails, EFalse ); |
1459 voiceCall = iContactDataManager->VoiceCallAvailable( index ); |
1439 voiceCall = iContactDataManager->VoiceCallAvailable( index ); |
1460 videoCall = iContactDataManager->VideoCallAvailable( index ); |
1440 videoCall = iContactDataManager->VideoCallAvailable( index ); |
1461 message = iContactDataManager->UniEditorAvailable( index ); |
1441 message = iContactDataManager->UniEditorAvailable( index ); |
1462 } |
1442 } |
1463 |
1443 |
1464 |
1444 // Call menu item is not show if neither voice call nor video call are possible. |
1465 aMenuPane.SetItemDimmed( EEasyDialingVoiceCall, !voiceCall ); |
1445 aMenuPane.SetItemDimmed( EEasyDialingVoiceCall, !voiceCall && !videoCall ); |
1466 aMenuPane.SetItemDimmed( EEasyDialingVideoCall, !videoCall ); |
|
1467 aMenuPane.SetItemDimmed( EEasyDialingSendMessage, !message ); |
1446 aMenuPane.SetItemDimmed( EEasyDialingSendMessage, !message ); |
1468 |
1447 |
1469 LOGSTRING("EasyDialingPlugin::InitializeMenuPaneL: InitializeMenuPaneL done" ); |
1448 LOGSTRING("EasyDialingPlugin::InitializeMenuPaneL: InitializeMenuPaneL done" ); |
1470 |
1449 |
1471 return ETrue; |
1450 return ETrue; |
1472 } |
1451 } |
1473 |
1452 |
|
1453 else if ( aMenuResourceId == R_EASYDIALING_OPTIONS_CALL_MENU ) |
|
1454 { |
|
1455 TBool voiceCall = EFalse; |
|
1456 TBool videoCall = EFalse; |
|
1457 |
|
1458 if ( iContactListBox->CurrentItemIndex() >= 0 ) |
|
1459 { |
|
1460 TInt index = iContactListBox->CurrentContactDataIndex(); |
|
1461 |
|
1462 voiceCall = iContactDataManager->VoiceCallAvailable( index ); |
|
1463 videoCall = iContactDataManager->VideoCallAvailable( index ); |
|
1464 } |
|
1465 |
|
1466 aMenuPane.SetItemDimmed( EEasyDialingVoiceCall, !voiceCall ); |
|
1467 aMenuPane.SetItemDimmed( EEasyDialingVideoCall, !videoCall ); |
|
1468 |
|
1469 LOGSTRING("EasyDialingPlugin::InitializeMenuPaneL: InitializeMenuPaneL for call submenu done" ); |
|
1470 |
|
1471 return ETrue; |
|
1472 } |
|
1473 |
1474 else if ( aMenuResourceId == R_EASYDIALING_OPTIONS_ON_OFF_CASCADE_MENU ) |
1474 else if ( aMenuResourceId == R_EASYDIALING_OPTIONS_ON_OFF_CASCADE_MENU ) |
1475 { |
1475 { |
1476 if ( IsEnabled() ) |
1476 if ( IsEnabled() ) |
1477 { |
1477 { |
1478 aMenuPane.SetItemButtonState( EEasyDialingOn, EEikMenuItemSymbolOn ); |
1478 aMenuPane.SetItemButtonState( EEasyDialingOn, EEikMenuItemSymbolOn ); |
1512 // Vkb status flag should be updated always too (invokes no action). |
1512 // Vkb status flag should be updated always too (invokes no action). |
1513 return ETrue; |
1513 return ETrue; |
1514 } |
1514 } |
1515 |
1515 |
1516 |
1516 |
1517 TBool ret(ETrue); |
1517 TBool ret(EFalse); |
1518 |
1518 |
1519 switch ( aCommand ) |
1519 switch ( aCommand ) |
1520 { |
1520 { |
1521 case EEasyDialingOpenContact: |
1521 case EEasyDialingOpenContact: |
1522 |
1522 |
1523 iRememberFocus = ETrue; |
1523 iRememberFocus = ETrue; |
1524 AsyncActionLaunchL( ELaunchCurrentContact ); |
1524 AsyncActionLaunchL( ELaunchCurrentContact ); |
|
1525 ret = ETrue; |
1525 break; |
1526 break; |
1526 |
1527 |
1527 // EEasyDialingEnterKeyAction is sent when Enter key is pressed. |
1528 // EEasyDialingEnterKeyAction is sent when Enter key is pressed. |
1528 // EEasyDialingMakeCall is sent when send key or send toolbar button or send menu item is pressed. |
1529 // EEasyDialingMakeCall is sent when send key or send toolbar button or send menu item is pressed. |
1529 case EEasyDialingVoiceCall: // fall through |
1530 case EEasyDialingVoiceCall: // fall through |
1530 case EEasyDialingEnterKeyAction: |
1531 case EEasyDialingEnterKeyAction: |
1531 // Make a call. |
1532 // Make a call. |
1532 iRememberFocus = ETrue; |
1533 iRememberFocus = ETrue; |
1533 AsyncActionLaunchL( ECallCurrentContact ); |
1534 AsyncActionLaunchL( ECallCurrentContact ); |
|
1535 ret = ETrue; |
1534 break; |
1536 break; |
1535 |
1537 |
1536 // Video call is selectable only through menu. |
1538 // Video call is selectable only through menu. |
1537 case EEasyDialingVideoCall: |
1539 case EEasyDialingVideoCall: |
1538 // Make a video call. |
1540 // Make a video call. |
1539 iRememberFocus = ETrue; |
1541 iRememberFocus = ETrue; |
1540 AsyncActionLaunchL( EVideoCallCurrentContact ); |
1542 AsyncActionLaunchL( EVideoCallCurrentContact ); |
|
1543 ret = ETrue; |
1541 break; |
1544 break; |
1542 |
1545 |
1543 // Uni-editor message is selectable only through menu. |
1546 // Uni-editor message is selectable only through menu. |
1544 case EEasyDialingSendMessage: |
1547 case EEasyDialingSendMessage: |
1545 // Create a message. |
1548 // Create a message. |
1546 iRememberFocus = ETrue; |
1549 iRememberFocus = ETrue; |
1547 AsyncActionLaunchL( ESendMessageCurrentContact ); |
1550 AsyncActionLaunchL( ESendMessageCurrentContact ); |
|
1551 ret = ETrue; |
1548 break; |
1552 break; |
1549 |
1553 |
1550 // EEasyDialingCallHandlingActivated is sent when the in-call-ui of telephony gets activated |
1554 // EEasyDialingCallHandlingActivated is sent when the in-call-ui of telephony gets activated |
1551 case EEasyDialingCallHandlingActivated: |
1555 case EEasyDialingCallHandlingActivated: |
1552 |
1556 |
1559 if ( iContactLauncherActive ) |
1563 if ( iContactLauncherActive ) |
1560 { |
1564 { |
1561 iNewSearchNeeded = EFalse; |
1565 iNewSearchNeeded = EFalse; |
1562 iContactLauncher->CloseAppL(); |
1566 iContactLauncher->CloseAppL(); |
1563 } |
1567 } |
|
1568 ret = ETrue; |
1564 break; |
1569 break; |
1565 |
1570 |
1566 case EEasyDialingOn: |
1571 case EEasyDialingOn: |
1567 |
1572 |
1568 iCenrepListener->SetEasyDialingSettingsValue( 1 ); |
1573 iCenrepListener->SetEasyDialingSettingsValue( 1 ); |
|
1574 ret = ETrue; |
1569 break; |
1575 break; |
1570 |
1576 |
1571 case EEasyDialingOff: |
1577 case EEasyDialingOff: |
1572 |
1578 |
1573 iCenrepListener->SetEasyDialingSettingsValue( 0 ); |
1579 iCenrepListener->SetEasyDialingSettingsValue( 0 ); |
|
1580 ret = ETrue; |
1574 break; |
1581 break; |
1575 |
1582 |
1576 case EEasyDialingClosePopup: |
1583 case EEasyDialingClosePopup: |
1577 |
1584 |
1578 // Not only Number Entry is removed but also closes down number selection popup in case it happens to be open. |
1585 // Not only Number Entry is removed but also closes down number selection popup in case it happens to be open. |
1579 iContactorService->CancelService(); |
1586 iContactorService->CancelService(); |
|
1587 ret = ETrue; |
1580 break; |
1588 break; |
1581 |
1589 |
1582 case EEasyDialingVkbOpened: |
1590 case EEasyDialingVkbOpened: |
1583 |
1591 |
1584 iVirtualKeyboardOpen = ETrue; |
1592 iVirtualKeyboardOpen = ETrue; |
|
1593 ret = ETrue; |
1585 break; |
1594 break; |
1586 |
1595 |
1587 case EEasyDialingVkbClosed: |
1596 case EEasyDialingVkbClosed: |
1588 |
1597 |
1589 iVirtualKeyboardOpen = EFalse; |
1598 iVirtualKeyboardOpen = EFalse; |
1590 HandleGainingForeground(); |
1599 ret = ETrue; |
1591 break; |
1600 break; |
1592 |
1601 |
1593 default: |
1602 default: |
1594 ret = EFalse; |
|
1595 break; |
1603 break; |
1596 } |
1604 } |
1597 return ret; |
1605 return ret; |
1598 } |
1606 } |
1599 |
1607 |
1603 // ----------------------------------------------------------------------------- |
1611 // ----------------------------------------------------------------------------- |
1604 // |
1612 // |
1605 TBool CEasyDialingPlugin::IsEnabled() const |
1613 TBool CEasyDialingPlugin::IsEnabled() const |
1606 { |
1614 { |
1607 return ( iCenrepListener && iCenrepListener->Value() != 0 ); |
1615 return ( iCenrepListener && iCenrepListener->Value() != 0 ); |
1608 } |
|
1609 |
|
1610 // ----------------------------------------------------------------------------- |
|
1611 // SetKeyboardMode |
|
1612 // Sets keyboard mode |
|
1613 // ----------------------------------------------------------------------------- |
|
1614 // |
|
1615 void CEasyDialingPlugin::SetKeyboardMode( TKeyboardMode aMode ) |
|
1616 { |
|
1617 iKeyboardMode = aMode; |
|
1618 } |
1616 } |
1619 |
1617 |
1620 // ----------------------------------------------------------------------------- |
1618 // ----------------------------------------------------------------------------- |
1621 // AsyncSimulateKeyEvent |
1619 // AsyncSimulateKeyEvent |
1622 // |
1620 // |
1675 |
1673 |
1676 // Remove highlight separators. It is possible that some contactor API has problem with them. |
1674 // Remove highlight separators. It is possible that some contactor API has problem with them. |
1677 iContactToBeLaunchedName = AllocWithoutHighlightSeparatorsLC( fullNameSeparators ); |
1675 iContactToBeLaunchedName = AllocWithoutHighlightSeparatorsLC( fullNameSeparators ); |
1678 CleanupStack::Pop( iContactToBeLaunchedName ); |
1676 CleanupStack::Pop( iContactToBeLaunchedName ); |
1679 } |
1677 } |
1680 |
1678 |
1681 CancelActionLaunchAndInputBlock(); |
1679 CancelActionLaunchAndInputBlock(); |
1682 |
1680 |
1683 if ( aAction == ELaunchSearch ) |
1681 if ( aAction == ELaunchSearch ) |
1684 { |
1682 { |
1685 // Must be set as low as possible to enable PCS to update its store. |
1683 // Must be set as low as possible to enable PCS to update its store. |
1969 void CEasyDialingPlugin::DoHandleContactsChangedL() |
1967 void CEasyDialingPlugin::DoHandleContactsChangedL() |
1970 { |
1968 { |
1971 if ( iSearchString.Length() > 0 && IsEnabled() ) |
1969 if ( iSearchString.Length() > 0 && IsEnabled() ) |
1972 { |
1970 { |
1973 CAknAppUi* appUi = static_cast<CAknAppUi*>( iCoeEnv->AppUi() ); |
1971 CAknAppUi* appUi = static_cast<CAknAppUi*>( iCoeEnv->AppUi() ); |
1974 if ( appUi->IsForeground() && !iVirtualKeyboardOpen ) |
1972 if ( appUi->IsForeground() ) |
1975 { |
1973 { |
1976 // Do new search immediately, if contacts change while we are on the |
1974 // Do new search immediately, if contacts change while we are on the |
1977 // foreground. This can happen for example if view is switched to |
1975 // foreground. This can happen for example if view is switched to |
1978 // dialer while deletion of multiple contacts is still ongoing or if |
1976 // dialer while deletion of multiple contacts is still ongoing or if |
1979 // PCS takes so long to update the cache that view gets changed |
1977 // PCS takes so long to update the cache that view gets changed |