uifw/EikStd/coctlsrc/akntoolbarextension.cpp
branchRCL_3
changeset 20 d48ab3b357f1
parent 19 aecbbf00d063
equal deleted inserted replaced
19:aecbbf00d063 20:d48ab3b357f1
    20 #include <akntoolbarextension.h>
    20 #include <akntoolbarextension.h>
    21 #include <avkon.mbg>
    21 #include <avkon.mbg>
    22 #include <aknconsts.h>
    22 #include <aknconsts.h>
    23 #include <akntoolbar.h>
    23 #include <akntoolbar.h>
    24 
    24 
       
    25 #include <touchfeedback.h>
       
    26 #include <akntranseffect.h>
       
    27 #include <akntransitionutils.h>
       
    28 
    25 #include "akntoolbarextensionview.h"
    29 #include "akntoolbarextensionview.h"
    26 
    30 
    27 
    31 
    28 // ======== MEMBER FUNCTIONS ========
    32 // ======== MEMBER FUNCTIONS ========
    29 
    33 
   199        
   203        
   200 
   204 
   201     // construct view from resource, items are standard TBAR_CTRL structures
   205     // construct view from resource, items are standard TBAR_CTRL structures
   202     iView = CAknToolbarExtensionView::NewL( aReader, this );
   206     iView = CAknToolbarExtensionView::NewL( aReader, this );
   203 
   207 
   204     aReader.ReadInt32();    // extension
   208     // Update the extension with given resource.
       
   209     TInt extensionLink = aReader.ReadInt32();    // extension
       
   210     if ( extensionLink != 0 )
       
   211     	{
       
   212     	CAknButtonState* state = State( 0 );
       
   213     	if ( state )
       
   214     		{
       
   215     		state->UpdateExtensionInfoL( extensionLink );    		
       
   216     		}
       
   217     	state = State( 1 );
       
   218     	if ( state )
       
   219     		{
       
   220     		state->UpdateExtensionInfoL( extensionLink );
       
   221     		}
       
   222     
       
   223     	}
       
   224     
   205     }
   225     }
   206     
   226     
   207 // ---------------------------------------------------------------------------
   227 // ---------------------------------------------------------------------------
   208 // From class CCoeControl.
   228 // From class CCoeControl.
   209 // Handles key events
   229 // Handles key events
   291                     {
   311                     {
   292                     TBool nonFocusing = iToolbar->IsNonFocusing(); 
   312                     TBool nonFocusing = iToolbar->IsNonFocusing(); 
   293                     iView->SetFocusing( !nonFocusing ); 
   313                     iView->SetFocusing( !nonFocusing ); 
   294                     if ( IsVisible() )
   314                     if ( IsVisible() )
   295                         {
   315                         {
       
   316 
       
   317                         //
       
   318                         // the pop up feedback for droping out toolbar extention view
       
   319                         //
       
   320                         if ( AknLayoutUtils::PenEnabled() )
       
   321                             {
       
   322                             MTouchFeedback* feedback = MTouchFeedback::Instance();
       
   323                             if ( feedback )
       
   324                                 {
       
   325                                 TTouchLogicalFeedback fbLogicalType = ETouchFeedbackPopUp;
       
   326                                 if ( CAknTransitionUtils::TransitionsEnabled(
       
   327                                         AknTransEffect::EComponentTransitionsOff ) )
       
   328                                     {
       
   329                                     fbLogicalType = ETouchFeedbackIncreasingPopUp;
       
   330                                     }
       
   331 
       
   332                                 feedback->InstantFeedback( this,
       
   333                                                            fbLogicalType,
       
   334                                                            ETouchFeedbackVibra, TPointerEvent() );
       
   335                                 }
       
   336                             }
       
   337 
   296                         iToolbar->DynInitExtensionL( this );
   338                         iToolbar->DynInitExtensionL( this );
   297                         iView->MakeVisible( ETrue ); // show view
   339                         iView->MakeVisible( ETrue ); // show view
   298                         }
   340                         }
   299                     }
   341                     }
   300                 }
   342                 }