uifw/EikStd/coctlsrc/eikcba.cpp
branchRCL_3
changeset 18 fcdfafb36fe7
parent 15 c52421ed5f07
child 19 aecbbf00d063
equal deleted inserted replaced
17:a1caeb42b3a3 18:fcdfafb36fe7
   214     ECbaSingleClickEnabled, // single click enabled in appUi
   214     ECbaSingleClickEnabled, // single click enabled in appUi
   215     ECbaItemSoftkeyDisabled, // item specific softkey disabled
   215     ECbaItemSoftkeyDisabled, // item specific softkey disabled
   216     ECbaItemSpecificSoftkeyInUse, // item specific softkey is in use
   216     ECbaItemSpecificSoftkeyInUse, // item specific softkey is in use
   217     ECbaItemSoftkeyDisabledByClient, // client has disabled item specific softkey
   217     ECbaItemSoftkeyDisabledByClient, // client has disabled item specific softkey
   218     ECbaMultipleMarkingActive, // multiple marking has changed RSK
   218     ECbaMultipleMarkingActive, // multiple marking has changed RSK
   219     ECbaCombinePaneUncovered // The combine pane in status pane is invisible.
   219     ECbaCombinePaneUncovered, // The combine pane in status pane is invisible.
       
   220     ECbaKeepItemSoftkeyVisible // No auto hide for item specific commands
   220     };
   221     };
   221 
   222 
   222 enum TCbaLayers
   223 enum TCbaLayers
   223     {
   224     {
   224     ECbaLayerWallpaper,
   225     ECbaLayerWallpaper,
  1070     if (aFlags & CEikButtonGroupContainer::EIsEmbedded)
  1071     if (aFlags & CEikButtonGroupContainer::EIsEmbedded)
  1071         {
  1072         {
  1072         // CBA is embedded in another component (eg. dialog/popup/setting page
  1073         // CBA is embedded in another component (eg. dialog/popup/setting page
  1073         iFlags.Set(ECbaEmbedded);
  1074         iFlags.Set(ECbaEmbedded);
  1074         }
  1075         }
  1075 
  1076     
       
  1077     if ( aFlags & CEikButtonGroupContainer::EAlwaysShown )
       
  1078         {
       
  1079         iFlags.Set( ECbaKeepItemSoftkeyVisible  );
       
  1080         }
       
  1081     
  1076     if ( aFlags & CEikButtonGroupContainer::EParentIsControl )
  1082     if ( aFlags & CEikButtonGroupContainer::EParentIsControl )
  1077         {
  1083         {
  1078         iFlags.Set( ECbaParentAsControl );
  1084         iFlags.Set( ECbaParentAsControl );
  1079         }
  1085         }
  1080     
  1086     
  2250     TEikGroupControl& groupCtrl = (*iControlArray)[aPosition];
  2256     TEikGroupControl& groupCtrl = (*iControlArray)[aPosition];
  2251     
  2257     
  2252     if ( iFlags.IsSet( ECbaInsideDialog ) )
  2258     if ( iFlags.IsSet( ECbaInsideDialog ) )
  2253         {
  2259         {
  2254         CAknButton* button = static_cast<CAknButton*>( groupCtrl.iControl );
  2260         CAknButton* button = static_cast<CAknButton*>( groupCtrl.iControl );
       
  2261 
       
  2262         if ( aCommandId == EAknSoftkeyEmergencyCall )
       
  2263             {
       
  2264             // Change the button to use "call button" (green) frame graphics
       
  2265             // in case of ECS call command to highlight the possibility
       
  2266             // of making an emergency call from the query.
       
  2267             button->SetBackgroundIds( KAknsIIDQsnFrButtonNormalAnswer,
       
  2268                                       KAknsIIDNone,
       
  2269                                       KAknsIIDNone,
       
  2270                                       KAknsIIDQsnFrButtonPressedAnswer,
       
  2271                                       KAknsIIDNone );
       
  2272             }
       
  2273         else
       
  2274             {
       
  2275             // Revert the frame graphics back to normal in case that a
       
  2276             // new command is added to the stack on top of the emergency
       
  2277             // call command (shouldn't happen though).
       
  2278             button->SetBackgroundIds( KAknsIIDQsnFrFunctionButtonNormal,
       
  2279                                       KAknsIIDQsnFrFunctionButtonPressed,
       
  2280                                       KAknsIIDQsnFrFunctionButtonInactive,
       
  2281                                       KAknsIIDQsnFrFunctionButtonPressed,
       
  2282                                       KAknsIIDQsnFrFunctionButtonInactive );
       
  2283             }
       
  2284 
  2255         button->AddStateL( NULL, NULL, NULL, NULL, *aText, KNullDesC, 0, aCommandId );
  2285         button->AddStateL( NULL, NULL, NULL, NULL, *aText, KNullDesC, 0, aCommandId );
  2256             
  2286             
  2257         if ( aText->Length() == 0 || !aText->Compare( _L(" ") ) )
  2287         if ( aText->Length() == 0 || !aText->Compare( _L(" ") ) )
  2258             {
  2288             {
  2259             button->SetDimmed( ETrue );
  2289             button->SetDimmed( ETrue );
  2434                 static_cast<CAknCommandButtonState*>( button->State() );
  2464                 static_cast<CAknCommandButtonState*>( button->State() );
  2435                 
  2465                 
  2436             groupCtrl.iId     = buttonState->CommandId();
  2466             groupCtrl.iId     = buttonState->CommandId();
  2437             groupCtrl.iLongId = 0;
  2467             groupCtrl.iLongId = 0;
  2438                 
  2468                 
       
  2469             if ( aCommandId == EAknSoftkeyEmergencyCall )
       
  2470                 {
       
  2471                 // Revert the button's frame graphics to the normal ones.
       
  2472                 button->SetBackgroundIds( KAknsIIDQsnFrFunctionButtonNormal,
       
  2473                                           KAknsIIDQsnFrFunctionButtonPressed,
       
  2474                                           KAknsIIDQsnFrFunctionButtonInactive,
       
  2475                                           KAknsIIDQsnFrFunctionButtonPressed,
       
  2476                                           KAknsIIDQsnFrFunctionButtonInactive );
       
  2477                 }
       
  2478                 
  2439             if ( buttonState->Text().Length() == 0 ||
  2479             if ( buttonState->Text().Length() == 0 ||
  2440                  !buttonState->Text().Compare( _L(" ") ) )
  2480                  !buttonState->Text().Compare( _L(" ") ) )
  2441                 {
  2481                 {
  2442                 button->SetDimmed( ETrue );
  2482                 button->SetDimmed( ETrue );
  2443                 }
  2483                 }
  2698         TRect button2Rect( 0, 0, 0, 0 );
  2738         TRect button2Rect( 0, 0, 0, 0 );
  2699         TRect buttonMSKRect( 0, 0, 0, 0 );
  2739         TRect buttonMSKRect( 0, 0, 0, 0 );
  2700 
  2740 
  2701         if ( iFlags.IsSet( ECbaEmbedded ) )
  2741         if ( iFlags.IsSet( ECbaEmbedded ) )
  2702             {
  2742             {
  2703             TRect rect ( Rect() );
  2743             // The touch area for the softkeys will be larger than the actual
  2704             TAknLayoutRect layoutRect;
  2744             // softkey area (whole CBA area is used).
  2705             layoutRect.LayoutRect(
  2745             TInt buttonWidth = containerRect.Width() / 2;
  2706                     rect, 
  2746             TSize buttonSize( buttonWidth, containerRect.Height() );
  2707                     AknLayoutScalable_Avkon::popup_sk_window_g1( 0 ) );
       
  2708             
       
  2709             // Button widths are calculated based on cba area width
       
  2710             // margin width is taken from layout
       
  2711             TInt margin = layoutRect.Rect().iTl.iX - rect.iTl.iX;
       
  2712             TInt buttonWidth = ( rect.Width() - margin * 2 ) / 2;
       
  2713             TSize buttonSize ( buttonWidth, layoutRect.Rect().Height() );
       
  2714                     
  2747                     
  2715             button1Rect = TRect(
  2748             button1Rect.SetRect( containerRect.iTl, buttonSize );
  2716                     TPoint( rect.iTl.iX + margin, layoutRect.Rect().iTl.iY ),
  2749             button2Rect.SetRect( TPoint( button1Rect.iBr.iX,
  2717                     buttonSize );
  2750                                          containerRect.iTl.iY ), 
  2718             button2Rect = TRect( 
  2751                                  containerRect.iBr );
  2719                     TPoint( button1Rect.iBr.iX, layoutRect.Rect().iTl.iY ), 
       
  2720                     TPoint( rect.iBr.iX - margin, 
       
  2721                             layoutRect.Rect().iBr.iY ) );
       
  2722             }
  2752             }
  2723         else if ( AknLayoutFlags() & EAknLayoutCbaInRightPane )
  2753         else if ( AknLayoutFlags() & EAknLayoutCbaInRightPane )
  2724             {
  2754             {
  2725             // Landcsape nHD layout, button parent rectangle
  2755             // Landcsape nHD layout, button parent rectangle
  2726             // is the whole screen so aRelativeToScreen parameter
  2756             // is the whole screen so aRelativeToScreen parameter
  7799 // ---------------------------------------------------------------------------
  7829 // ---------------------------------------------------------------------------
  7800 //
  7830 //
  7801 void CEikCba::UpdateItemSpecificSoftkey( CCoeControl& aControl, TBool aEnable )
  7831 void CEikCba::UpdateItemSpecificSoftkey( CCoeControl& aControl, TBool aEnable )
  7802     {
  7832     {
  7803     _AKNTRACE_FUNC_ENTER;
  7833     _AKNTRACE_FUNC_ENTER;
       
  7834     if ( iFlags.IsSet( ECbaKeepItemSoftkeyVisible  ))
       
  7835         {
       
  7836         _AKNTRACE_FUNC_EXIT;
       
  7837         return;
       
  7838         }    
  7804     TBool skEnabled( aControl.IsVisible() && !aControl.IsDimmed() );
  7839     TBool skEnabled( aControl.IsVisible() && !aControl.IsDimmed() );
  7805     TBool changeState( EFalse );
  7840     TBool changeState( EFalse );
  7806     if ( !aEnable )
  7841     if ( !aEnable )
  7807         {
  7842         {
  7808         iFlags.Set( ECbaItemSoftkeyDisabled );
  7843         iFlags.Set( ECbaItemSoftkeyDisabled );