idlehomescreen/widgetmanager/src/wmmaincontainer.cpp
branchRCL_3
changeset 11 ff572dfe6d86
parent 9 f966699dea19
child 12 9674c1a575e9
equal deleted inserted replaced
9:f966699dea19 11:ff572dfe6d86
   258     // EModifierAutorepeatable.
   258     // EModifierAutorepeatable.
   259     if ( aType == EEventKey && 
   259     if ( aType == EEventKey && 
   260              aKeyEvent.iScanCode == EStdKeyBackspace && 
   260              aKeyEvent.iScanCode == EStdKeyBackspace && 
   261              aKeyEvent.iModifiers == EModifierAutorepeatable )
   261              aKeyEvent.iModifiers == EModifierAutorepeatable )
   262         {
   262         {
   263         return EKeyWasNotConsumed;
   263         return EKeyWasConsumed;
   264         }
   264         }
   265     
   265     
   266     // Handle search keyevent
   266     // Handle search keyevent
   267     keyResponse = HandleSearchKeyEventL( aKeyEvent, aType );
   267     keyResponse = HandleSearchKeyEventL( aKeyEvent, aType );
   268     
   268     
   308     // open search field with alpha digit numbers
   308     // open search field with alpha digit numbers
   309     if ( aType == EEventKeyDown && !iFindPaneIsVisible && 
   309     if ( aType == EEventKeyDown && !iFindPaneIsVisible && 
   310             aKeyEvent.iScanCode < EStdKeyF1 &&
   310             aKeyEvent.iScanCode < EStdKeyF1 &&
   311         TChar( aKeyEvent.iScanCode ).IsAlphaDigit() )
   311         TChar( aKeyEvent.iScanCode ).IsAlphaDigit() )
   312         {
   312         {
   313         ActivateFindPaneL();
   313         ActivateFindPaneL( EFalse );
   314         
   314         
   315         if ( iFindPaneIsVisible )
   315         if ( iFindPaneIsVisible )
   316             {
   316             {
   317             return EKeyWasConsumed;
   317             return EKeyWasConsumed;
   318             }
   318             }
   972 // CWmMainContainer::CanDoFind
   972 // CWmMainContainer::CanDoFind
   973 // ---------------------------------------------------------
   973 // ---------------------------------------------------------
   974 //
   974 //
   975 TBool CWmMainContainer::CanDoFind()
   975 TBool CWmMainContainer::CanDoFind()
   976     {
   976     {
   977     TBool canDo( !iFindPaneIsVisible );
   977     return !iFindPaneIsVisible;
   978     if ( canDo )
       
   979         {
       
   980         canDo = ( iFocusMode == EList || iFocusMode == ENowhere );
       
   981         }
       
   982     return canDo;
       
   983     }
   978     }
   984 
   979 
   985 // ---------------------------------------------------------
   980 // ---------------------------------------------------------
   986 // CWmMainContainer::CanDoSort
   981 // CWmMainContainer::CanDoSort
   987 // ---------------------------------------------------------
   982 // ---------------------------------------------------------
  1079 
  1074 
  1080 // ---------------------------------------------------------------------------
  1075 // ---------------------------------------------------------------------------
  1081 // CWmMainContainer::ActivateFindPaneL
  1076 // CWmMainContainer::ActivateFindPaneL
  1082 // ---------------------------------------------------------------------------
  1077 // ---------------------------------------------------------------------------
  1083 //
  1078 //
  1084 void CWmMainContainer::ActivateFindPaneL()
  1079 void CWmMainContainer::ActivateFindPaneL( TBool aActivateAdabtive )
  1085     {
  1080     {
  1086     if ( iFindbox && !iFindPaneIsVisible &&
  1081     if ( iFindbox && !iFindPaneIsVisible &&
  1087             iWidgetsList->Model()->NumberOfItems() > KMinWidgets )
  1082             iWidgetsList->Model()->NumberOfItems() > KMinWidgets )
  1088         {
  1083         {
  1089 		// enable filtering
  1084 		// enable filtering
  1100 
  1095 
  1101         iFindbox->ActivateL();
  1096         iFindbox->ActivateL();
  1102         iFindbox->ResetL();
  1097         iFindbox->ResetL();
  1103         iFindbox->SetSearchTextL( KNullDesC );
  1098         iFindbox->SetSearchTextL( KNullDesC );
  1104         iFindbox->SetSkinEnabledL( ETrue );
  1099         iFindbox->SetSkinEnabledL( ETrue );
  1105 
       
  1106         iFindPaneIsVisible = ETrue;
  1100         iFindPaneIsVisible = ETrue;
  1107         iFindbox->MakeVisible( ETrue );
  1101         iFindbox->MakeVisible( ETrue );
  1108         
  1102         
  1109         // layout listbox and findbox
  1103         // layout listbox and findbox
  1110         LayoutControls();        
  1104         LayoutControls();        
  1111         
  1105         
       
  1106         if ( aActivateAdabtive )
       
  1107             {
       
  1108             iFindbox->ShowAdaptiveSearchGrid();
       
  1109             }
  1112         iFindbox->SetFocus( ETrue );
  1110         iFindbox->SetFocus( ETrue );
  1113         iWidgetsList->SetFindPaneIsVisible( ETrue );
  1111         iWidgetsList->SetFindPaneIsVisible( ETrue );
  1114 
  1112 
  1115         // set soft key set
  1113         // set soft key set
  1116         CEikButtonGroupContainer* cbaGroup =
  1114         CEikButtonGroupContainer* cbaGroup =
  1174 //
  1172 //
  1175 void CWmMainContainer::SortListAlphabeticallyL()
  1173 void CWmMainContainer::SortListAlphabeticallyL()
  1176     {
  1174     {
  1177     if ( iWidgetsList )
  1175     if ( iWidgetsList )
  1178         {
  1176         {
  1179         iWidgetsList->SetSortOrderL( CWmListBox::EAlphabetical );
  1177         iWidgetsList->DoSortToVisibleArray( CWmListBox::EAlphabetical );
       
  1178         iWidgetsList->DoSortToOrderData( CWmListBox::EAlphabetical );
  1180        
  1179        
  1181         //store changed list order
  1180         //store changed list order
  1182         CWmPersistentWidgetOrder* widgetOrder =
  1181         CWmPersistentWidgetOrder* widgetOrder =
  1183             CWmPersistentWidgetOrder::NewL( iWmPlugin.FileServer() );
  1182             CWmPersistentWidgetOrder::NewL( iWmPlugin.FileServer() );
  1184         CleanupStack::PushL( widgetOrder );
  1183         CleanupStack::PushL( widgetOrder );
  1185         widgetOrder->StoreL( iWidgetsList->WidgetDataArray() );
  1184         widgetOrder->StoreL( iWidgetsList->OrderDataArray() );
       
  1185 		
  1186         CleanupStack::PopAndDestroy( widgetOrder );
  1186         CleanupStack::PopAndDestroy( widgetOrder );
  1187 
       
  1188         }
  1187         }
  1189     }
  1188     }
  1190 
  1189 
  1191 // ---------------------------------------------------------------------------
  1190 // ---------------------------------------------------------------------------
  1192 // CWmMainContainer::UninstallWidgetL
  1191 // CWmMainContainer::UninstallWidgetL