browserui/browser/FavouritesSrc/BrowserBookmarksGotoPane.cpp
changeset 10 4530440261a8
parent 1 57d5b8e231c4
child 24 868cceedabd3
equal deleted inserted replaced
5:e45c3f40ea5f 10:4530440261a8
    17 *
    17 *
    18 */
    18 */
    19 
    19 
    20 
    20 
    21 // INCLUDE FILES
    21 // INCLUDE FILES
       
    22 #include <Browser_Platform_Variant.hrh>
    22 
    23 
    23 #include <akninfrm.h>
    24 #include <akninfrm.h>
    24 #include <eikedwin.h>
    25 #include <eikedwin.h>
    25 #include <FavouritesLimits.h>
    26 #include <FavouritesLimits.h>
    26 
    27 
   358         response = iBAdaptiveListPopup->OfferKeyEventL( aKeyEvent, aType );
   359         response = iBAdaptiveListPopup->OfferKeyEventL( aKeyEvent, aType );
   359         }
   360         }
   360 
   361 
   361     if ( iEditing && response != EKeyWasConsumed)
   362     if ( iEditing && response != EKeyWasConsumed)
   362         {
   363         {
   363 
   364         // Editing; most keys simply forwarded to the editor.
   364         switch ( aKeyEvent.iCode )              // Already editing; most keys simply forwarded to the editor.
   365         switch ( aKeyEvent.iCode )
   365             {
   366             {
   366 
       
   367             case EKeyOK:
   367             case EKeyOK:
   368                 {
   368                 {
   369                 response = EKeyWasConsumed;     // MSK is now handled through HandleCommand in BrowserBookmarksView
   369                 response = EKeyWasConsumed;     // MSK is now handled through HandleCommand in BrowserBookmarksView
   370                 break;
   370                 break;
   371                 }
   371                 }
   381                 {                               // Here, "eat" all of the diagonals so they have no effect...
   381                 {                               // Here, "eat" all of the diagonals so they have no effect...
   382                 response = EKeyWasConsumed;
   382                 response = EKeyWasConsumed;
   383                 break;
   383                 break;
   384                 }
   384                 }
   385 
   385 
   386             case EKeyEnter:                     // Handle EnterKey as "GOTO" for Touch, VKB's enter key
   386             case EKeyEnter:
       
   387                 // Handle EnterKey as "GOTO" for Touch, VKB's enter key
   387                 if ( AknLayoutUtils::PenEnabled() )
   388                 if ( AknLayoutUtils::PenEnabled() )
   388                         {
   389                         {
   389                         CBrowserAppUi::Static()->ActiveView()->HandleCommandL(EWmlCmdGotoPaneGoTo);
   390                         CBrowserAppUi::Static()->ActiveView()->HandleCommandL(EWmlCmdGotoPaneGoTo);
   390                         // In case of search feature, we need to pass EKeyWasConsumed for EKeyEnter
   391                         // In case of search feature, we need to pass EKeyWasConsumed for EKeyEnter
   391                         if ( iView->ApiProvider().Preferences().SearchFeature() )
   392                         if ( iView->ApiProvider().Preferences().SearchFeature() )
   392                             {
   393                             {
   393                             response = EKeyWasConsumed;
   394                             response = EKeyWasConsumed;
   394                             }
   395                             }
   395                         break;
   396                         break;
   396                         }                       // Else *FALL THROUGH* to default in case Pen is not enabled.
   397                         }
       
   398 
       
   399             // Else *FALL THROUGH* to default in case Pen is not enabled.
   397             default:
   400             default:
   398                 {
   401                 {
   399                 response = iEditor->OfferKeyEventL(aKeyEvent, aType );
   402                 response = iEditor->OfferKeyEventL(aKeyEvent, aType );
   400                 break;
   403                 break;
   401                 }
   404                 }
   409          if ( !iView->ApiProvider().Preferences().SearchFeature() )
   412          if ( !iView->ApiProvider().Preferences().SearchFeature() )
   410              {
   413              {
   411              response = EKeyWasConsumed;
   414              response = EKeyWasConsumed;
   412              }
   415              }
   413         }
   416         }
   414     else if ( response != EKeyWasConsumed )     // Key consumed yet? If not, process onwards...
   417     else if ( response != EKeyWasConsumed )
   415         {
   418         {
   416 
   419         // Key consumed yet? If not, process onwards...
   417         if ( (aKeyEvent.iScanCode == EStdKeyHash)  ||
   420         if ( (aKeyEvent.iScanCode == EStdKeyHash)  ||
   418                 ( aKeyEvent.iModifiers &
   421                 ( aKeyEvent.iModifiers &
   419                 ( EModifierShift | EModifierLeftShift | EModifierRightShift |
   422                 ( EModifierShift | EModifierLeftShift | EModifierRightShift |
   420                 EModifierCtrl | EModifierLeftCtrl | EModifierRightCtrl ) ) )
   423                 EModifierCtrl | EModifierLeftCtrl | EModifierRightCtrl ) ) )
   421             {
   424             {
   425             response = EKeyWasNotConsumed;
   428             response = EKeyWasNotConsumed;
   426             }
   429             }
   427 
   430 
   428         //
   431         //
   429         // Not currently editing the GoTo pane.
   432         // Not currently editing the GoTo pane.
   430         // Catch alpha and numeric to pop up the GoTo pane
   433         // Catch alpha and numeric to pop
       
   434         // up goto pane
   431         //
   435         //
   432         // Only popup the GoTo Pane with a KeyDown event.
   436         // Only popup the GoTo Pane with a KeyDown event.
   433         // Otherwise, if browser is pushed to the backround (but still active)
   437         // Otherwise, if browser is pushed to the backround (but still active)
   434         // in favor of the App Shell, A long "0" press will reactivate the browser and
   438         // in favor of the App Shell, A long "0" press will reactivate the browser and
   435         // leave a KeyUp to (wrongly) pop the pane up
   439         // leave a KeyUp to (wrongly) pop the pane up
   445         //
   449         //
   446         // Otherwise, key event is generated again (to channel through FEP)
   450         // Otherwise, key event is generated again (to channel through FEP)
   447         //
   451         //
   448         else if (    !iFrozen
   452         else if (    !iFrozen
   449                   && aType == EEventKeyDown
   453                   && aType == EEventKeyDown
   450                   && iInputChar.IsAlphaDigit()
   454                   && iInputChar.IsAlphaDigit()          // We want alpha numeric keys to popup goto pane
   451                   && iInputChar != EStdKeyYes
   455                   && iInputChar != EStdKeyYes           // Ignore Send (green key)
   452                   && iInputChar != EStdKeyNo
   456                   && iInputChar != EStdKeyNo            // Ignore End (red key)
   453                   && iInputChar != EKeyRightUpArrow     // Northeast
   457                   && iInputChar != EKeyRightUpArrow     // Ignore Northeast
   454                   && iInputChar != EStdKeyDevice11      //   : Extra KeyEvent supports diagonal event simulator wedge
   458                   && iInputChar != EStdKeyDevice11      //   : Extra KeyEvent supports diagonal event simulator wedge
   455                   && iInputChar != EKeyRightDownArrow   // Southeast
   459                   && iInputChar != EKeyRightDownArrow   // Ignore Southeast
   456                   && iInputChar != EStdKeyDevice12      //   : Extra KeyEvent supports diagonal event simulator wedge
   460                   && iInputChar != EStdKeyDevice12      //   : Extra KeyEvent supports diagonal event simulator wedge
   457                   && iInputChar != EKeyLeftDownArrow    // Southwest
   461                   && iInputChar != EKeyLeftDownArrow    // Ignore Southwest
   458                   && iInputChar != EStdKeyDevice13      //   : Extra KeyEvent supports diagonal event simulator wedge
   462                   && iInputChar != EStdKeyDevice13      //   : Extra KeyEvent supports diagonal event simulator wedge
   459                   && iInputChar != EKeyLeftUpArrow      // Northwest
   463                   && iInputChar != EKeyLeftUpArrow      // Ignore Northwest
   460                   && iInputChar != EStdKeyDevice10 )    //   : Extra KeyEvent supports diagonal event simulator wedge
   464                   && iInputChar != EStdKeyDevice10 )    //   : Extra KeyEvent supports diagonal event simulator wedge
   461             {                                           // Most other alphanumeric keys activate the Goto Pane...
   465             {
   462             response = EKeyWasConsumed;                 // We'll consume the key event so it ends here
   466             // These keys activate the Goto Pane.
       
   467             // We'll consume the key event so it ends here
       
   468             response = EKeyWasConsumed;
       
   469 
   463             BeginEditingL();
   470             BeginEditingL();
       
   471 
   464             iEditor->SetCursorPosL( iEditor->TextLength(), EFalse );
   472             iEditor->SetCursorPosL( iEditor->TextLength(), EFalse );
   465             iCoeEnv->SyncNotifyFocusObserversOfChangeInFocus();
   473             iCoeEnv->SyncNotifyFocusObserversOfChangeInFocus();
   466             iCoeEnv->SimulateKeyEventL( aKeyEvent, aType );
   474             iCoeEnv->SimulateKeyEventL( aKeyEvent, aType );
   467             }
   475             }
   468         else
   476         else
   469             {                                           // Other keys do not activate the Goto Pane.
   477             {
   470             response = EKeyWasNotConsumed;              // Let someone else take the key event
   478             // Other keys do not activate the Goto Pane.
       
   479             // Let someone else take the key event
       
   480             response = EKeyWasNotConsumed;
   471             }
   481             }
   472         }
   482         }
   473     return response;
   483     return response;
   474     }
   484     }
   475 
   485 
   827 // ----------------------------------------------------------------------------
   837 // ----------------------------------------------------------------------------
   828 // CBrowserBookmarksGotoPane::SetVKBFlag
   838 // CBrowserBookmarksGotoPane::SetVKBFlag
   829 // ----------------------------------------------------------------------------
   839 // ----------------------------------------------------------------------------
   830 void CBrowserBookmarksGotoPane::SetVKBFlag( TBool aVKBFlag )
   840 void CBrowserBookmarksGotoPane::SetVKBFlag( TBool aVKBFlag )
   831     {
   841     {
       
   842 #if defined(BRDO_SEARCH_INTEGRATION_FF)
   832     if( aVKBFlag )
   843     if( aVKBFlag )
   833         {
   844         {
   834         iEditor->RemoveFlagFromUserFlags( CEikEdwin::EAvkonDisableVKB );
   845         iEditor->RemoveFlagFromUserFlags( CEikEdwin::EAvkonDisableVKB );
   835         }
   846         }
   836     else
   847     else
   837         {
   848         {
   838         iEditor->AddFlagToUserFlags( CEikEdwin::EAvkonDisableVKB );
   849         iEditor->AddFlagToUserFlags( CEikEdwin::EAvkonDisableVKB );
   839         }
   850         }
       
   851 #endif
   840     }
   852     }
   841 // End of File
   853 // End of File