uifw/EikStd/coctlsrc/aknitemactionmenu.cpp
branchRCL_3
changeset 10 9f56a4e1b8ab
parent 9 aabf2c525e0f
child 16 71dd06cfe933
equal deleted inserted replaced
9:aabf2c525e0f 10:9f56a4e1b8ab
    26 #include <eikpanic.h>
    26 #include <eikpanic.h>
    27 
    27 
    28 #include "akncollectionobserver.h"
    28 #include "akncollectionobserver.h"
    29 #include "aknitemactionmenudata.h"
    29 #include "aknitemactionmenudata.h"
    30 #include "aknitemactionmenuregister.h"
    30 #include "aknitemactionmenuregister.h"
       
    31 #include "akntrace.h"
    31 
    32 
    32 /**
    33 /**
    33  * Index for invalid list index.
    34  * Index for invalid list index.
    34  */
    35  */
    35 const TInt KInvalidListIndex( -1 );
    36 const TInt KInvalidListIndex( -1 );
    39 // ---------------------------------------------------------------------------
    40 // ---------------------------------------------------------------------------
    40 //
    41 //
    41 CAknItemActionMenu* CAknItemActionMenu::NewL(
    42 CAknItemActionMenu* CAknItemActionMenu::NewL(
    42         MAknCollection& aCollection, MObjectProvider* aOwner )
    43         MAknCollection& aCollection, MObjectProvider* aOwner )
    43     {
    44     {
       
    45     _AKNTRACE_FUNC_ENTER;
    44     CAknItemActionMenu* self = CAknItemActionMenu::NewLC( 
    46     CAknItemActionMenu* self = CAknItemActionMenu::NewLC( 
    45             aCollection, aOwner );
    47             aCollection, aOwner );
    46     CleanupStack::Pop( self );
    48     CleanupStack::Pop( self );
       
    49     _AKNTRACE_FUNC_EXIT;
    47     return self;
    50     return self;
    48     }
    51     }
    49 
    52 
    50 
    53 
    51 // ---------------------------------------------------------------------------
    54 // ---------------------------------------------------------------------------
    53 // ---------------------------------------------------------------------------
    56 // ---------------------------------------------------------------------------
    54 //
    57 //
    55 CAknItemActionMenu* CAknItemActionMenu::NewLC(
    58 CAknItemActionMenu* CAknItemActionMenu::NewLC(
    56         MAknCollection& aCollection, MObjectProvider* aOwner )
    59         MAknCollection& aCollection, MObjectProvider* aOwner )
    57     {
    60     {
       
    61     _AKNTRACE_FUNC_ENTER;
    58     CAknItemActionMenu* self = new ( ELeave ) CAknItemActionMenu( aOwner );
    62     CAknItemActionMenu* self = new ( ELeave ) CAknItemActionMenu( aOwner );
    59     CleanupStack::PushL( self );
    63     CleanupStack::PushL( self );
    60     self->ConstructL( aCollection );
    64     self->ConstructL( aCollection );
       
    65     _AKNTRACE_FUNC_EXIT;
    61     return self;
    66     return self;
    62     }
    67     }
    63 
    68 
    64 
    69 
    65 // ---------------------------------------------------------------------------
    70 // ---------------------------------------------------------------------------
    66 // CAknItemActionMenu::~CAknItemActionMenu
    71 // CAknItemActionMenu::~CAknItemActionMenu
    67 // ---------------------------------------------------------------------------
    72 // ---------------------------------------------------------------------------
    68 //
    73 //
    69 CAknItemActionMenu::~CAknItemActionMenu()
    74 CAknItemActionMenu::~CAknItemActionMenu()
    70     {
    75     {
       
    76     _AKNTRACE_FUNC_ENTER;
    71     AKNTASHOOK_REMOVE();
    77     AKNTASHOOK_REMOVE();
    72     delete iPopupMenu;
    78     delete iPopupMenu;
    73     delete iMenuPane;
    79     delete iMenuPane;
    74     delete iMenuData;
    80     delete iMenuData;
    75     iStates.Close();
    81     iStates.Close();
    78         {
    84         {
    79         iObservers[i]->SetItemActionMenu( NULL );
    85         iObservers[i]->SetItemActionMenu( NULL );
    80         }
    86         }
    81 
    87 
    82     iObservers.Close();
    88     iObservers.Close();
       
    89     _AKNTRACE_FUNC_EXIT;
    83     }
    90     }
    84 
    91 
    85 
    92 
    86 // ---------------------------------------------------------------------------
    93 // ---------------------------------------------------------------------------
    87 // CAknItemActionMenu::RegisterCollectionL
    94 // CAknItemActionMenu::RegisterCollectionL
    88 // ---------------------------------------------------------------------------
    95 // ---------------------------------------------------------------------------
    89 //
    96 //
    90 EXPORT_C CAknItemActionMenu* CAknItemActionMenu::RegisterCollectionL(
    97 EXPORT_C CAknItemActionMenu* CAknItemActionMenu::RegisterCollectionL(
    91         MAknCollection& aCollection )
    98         MAknCollection& aCollection )
    92     {
    99     {
       
   100     _AKNTRACE_FUNC_ENTER;
       
   101     _AKNTRACE_FUNC_EXIT;
    93     return AknItemActionMenuRegister::RegisterCollectionL( aCollection );
   102     return AknItemActionMenuRegister::RegisterCollectionL( aCollection );
    94     }
   103     }
    95 
   104 
    96 
   105 
    97 // ---------------------------------------------------------------------------
   106 // ---------------------------------------------------------------------------
    99 // ---------------------------------------------------------------------------
   108 // ---------------------------------------------------------------------------
   100 //
   109 //
   101 EXPORT_C void CAknItemActionMenu::RemoveCollection(
   110 EXPORT_C void CAknItemActionMenu::RemoveCollection(
   102         MAknCollection& aCollection )
   111         MAknCollection& aCollection )
   103     {
   112     {
       
   113     _AKNTRACE_FUNC_ENTER;
   104     for ( TInt i = 0; i < iStates.Count(); i++ )
   114     for ( TInt i = 0; i < iStates.Count(); i++ )
   105         {
   115         {
   106         MAknCollection* state( iStates[ i ] );
   116         MAknCollection* state( iStates[ i ] );
   107         if ( state == &aCollection )
   117         if ( state == &aCollection )
   108             {
   118             {
   109             iStates.Remove( i );
   119             iStates.Remove( i );
   110             break;
   120             break;
   111             }
   121             }
   112         }
   122         }
   113     UnregisterMenu(); 
   123     UnregisterMenu(); 
       
   124     _AKNTRACE_FUNC_EXIT;
   114     }
   125     }
   115 
   126 
   116 
   127 
   117 // ---------------------------------------------------------------------------
   128 // ---------------------------------------------------------------------------
   118 // CAknItemActionMenu::InitMenuL
   129 // CAknItemActionMenu::InitMenuL
   119 // ---------------------------------------------------------------------------
   130 // ---------------------------------------------------------------------------
   120 //
   131 //
   121 EXPORT_C TBool CAknItemActionMenu::InitMenuL()
   132 EXPORT_C TBool CAknItemActionMenu::InitMenuL()
   122     {
   133     {
       
   134     _AKNTRACE_FUNC_ENTER;
   123     iMenuData->Reset();
   135     iMenuData->Reset();
   124     if ( !iMenuBar )
   136     if ( !iMenuBar )
   125         {
   137         {
   126         AknItemActionMenuRegister::RegisterItemActionMenuL( *this );
   138         AknItemActionMenuRegister::RegisterItemActionMenuL( *this );
   127         }
   139         }
   137     else
   149     else
   138         {
   150         {
   139         return EFalse;
   151         return EFalse;
   140         }
   152         }
   141 
   153 
       
   154     _AKNTRACE_FUNC_EXIT;
   142     return iMenuData->Count();
   155     return iMenuData->Count();
   143     }
   156     }
   144 
   157 
   145 
   158 
   146 // ---------------------------------------------------------------------------
   159 // ---------------------------------------------------------------------------
   149 //
   162 //
   150 EXPORT_C void CAknItemActionMenu::ShowMenuL(
   163 EXPORT_C void CAknItemActionMenu::ShowMenuL(
   151         const TPoint& aPosition,
   164         const TPoint& aPosition,
   152         TUint /*aFlags*/ )
   165         TUint /*aFlags*/ )
   153     {
   166     {
       
   167     _AKNTRACE_FUNC_ENTER;
   154     if ( iMenuData->Count() )
   168     if ( iMenuData->Count() )
   155         {
   169         {
   156         if ( !iPopupMenu )
   170         if ( !iPopupMenu )
   157             {
   171             {
   158             iPopupMenu = CAknStylusPopUpMenu::NewL( this, TPoint() );
   172             iPopupMenu = CAknStylusPopUpMenu::NewL( this, TPoint() );
   162         iPopupMenu->SetPosition(
   176         iPopupMenu->SetPosition(
   163                 aPosition,
   177                 aPosition,
   164                 CAknStylusPopUpMenu::EPositionTypeRightBottom );
   178                 CAknStylusPopUpMenu::EPositionTypeRightBottom );
   165         iPopupMenu->ShowMenu();
   179         iPopupMenu->ShowMenu();
   166         }
   180         }
       
   181     _AKNTRACE_FUNC_EXIT;
   167     }
   182     }
   168 
   183 
   169 
   184 
   170 // ---------------------------------------------------------------------------
   185 // ---------------------------------------------------------------------------
   171 // CAknItemActionMenu::CollectionChanged
   186 // CAknItemActionMenu::CollectionChanged
   172 // ---------------------------------------------------------------------------
   187 // ---------------------------------------------------------------------------
   173 //
   188 //
   174 EXPORT_C void CAknItemActionMenu::CollectionChanged(
   189 EXPORT_C void CAknItemActionMenu::CollectionChanged(
   175         MAknCollection& aCollection )
   190         MAknCollection& aCollection )
   176     {
   191     {
       
   192     _AKNTRACE_FUNC_ENTER;
   177     if ( iObservers.Count() && iStates.Find( &aCollection ) != KErrNotFound )
   193     if ( iObservers.Count() && iStates.Find( &aCollection ) != KErrNotFound )
   178         {
   194         {
   179         TBool collectionVisible( aCollection.CollectionState()
   195         TBool collectionVisible( aCollection.CollectionState()
   180                 & MAknCollection::EStateCollectionVisible );
   196                 & MAknCollection::EStateCollectionVisible );
   181         NotifyChangeToActiveObserver( collectionVisible );
   197         NotifyChangeToActiveObserver( collectionVisible );
   182         }
   198         }
       
   199     _AKNTRACE_FUNC_EXIT;
   183     }
   200     }
   184 
   201 
   185 
   202 
   186 // ---------------------------------------------------------------------------
   203 // ---------------------------------------------------------------------------
   187 // CAknItemActionMenu::AddCollectionStateL
   204 // CAknItemActionMenu::AddCollectionStateL
   188 // ---------------------------------------------------------------------------
   205 // ---------------------------------------------------------------------------
   189 //
   206 //
   190 void CAknItemActionMenu::AddCollectionStateL(
   207 void CAknItemActionMenu::AddCollectionStateL(
   191         MAknCollection& aCollection )
   208         MAknCollection& aCollection )
   192     {
   209     {
       
   210     _AKNTRACE_FUNC_ENTER;
   193     if ( iStates.Find( &aCollection ) == KErrNotFound )
   211     if ( iStates.Find( &aCollection ) == KErrNotFound )
   194         {
   212         {
   195         iStates.InsertL( &aCollection, 0 );
   213         iStates.InsertL( &aCollection, 0 );
   196         }
   214         }
       
   215     _AKNTRACE_FUNC_EXIT;
   197     }
   216     }
   198 
   217 
   199 
   218 
   200 // ---------------------------------------------------------------------------
   219 // ---------------------------------------------------------------------------
   201 // CAknItemActionMenu::SetMenuBar
   220 // CAknItemActionMenu::SetMenuBar
   203 //
   222 //
   204 void CAknItemActionMenu::SetMenuBar(
   223 void CAknItemActionMenu::SetMenuBar(
   205         MEikMenuObserver* aMenuObserver,
   224         MEikMenuObserver* aMenuObserver,
   206         CEikMenuBar* aMenuBar )
   225         CEikMenuBar* aMenuBar )
   207     {
   226     {
       
   227     _AKNTRACE_FUNC_ENTER;
   208     iMenuBarObserver = aMenuObserver;
   228     iMenuBarObserver = aMenuObserver;
   209     iMenuBar = aMenuBar;
   229     iMenuBar = aMenuBar;
       
   230     _AKNTRACE_FUNC_EXIT;
   210     }
   231     }
   211 
   232 
   212 
   233 
   213 // ---------------------------------------------------------------------------
   234 // ---------------------------------------------------------------------------
   214 // CAknItemActionMenu::CollectionHighlightVisible
   235 // CAknItemActionMenu::CollectionHighlightVisible
   215 // ---------------------------------------------------------------------------
   236 // ---------------------------------------------------------------------------
   216 //
   237 //
   217 TBool CAknItemActionMenu::CollectionHighlightVisible() const
   238 TBool CAknItemActionMenu::CollectionHighlightVisible() const
   218     {
   239     {
       
   240     _AKNTRACE_FUNC_ENTER;
   219     TBool highlightVisible( ETrue );
   241     TBool highlightVisible( ETrue );
   220     for ( TInt i = 0; i < iStates.Count(); i++ )
   242     for ( TInt i = 0; i < iStates.Count(); i++ )
   221         {
   243         {
   222         MAknCollection* collection( iStates[ i ] );
   244         MAknCollection* collection( iStates[ i ] );
   223         TUint state = collection->CollectionState();
   245         TUint state = collection->CollectionState();
   229             // Highlight can't be visible if the collection is not visible.
   251             // Highlight can't be visible if the collection is not visible.
   230             highlightVisible = state & MAknCollection::EStateCollectionVisible;
   252             highlightVisible = state & MAknCollection::EStateCollectionVisible;
   231             break;
   253             break;
   232             }
   254             }
   233         }
   255         }
       
   256     _AKNTRACE_FUNC_EXIT;
   234     return highlightVisible;
   257     return highlightVisible;
   235     }
   258     }
   236 
   259 
   237 
   260 
   238 // ---------------------------------------------------------------------------
   261 // ---------------------------------------------------------------------------
   240 // ---------------------------------------------------------------------------
   263 // ---------------------------------------------------------------------------
   241 //
   264 //
   242 TBool CAknItemActionMenu::CollectionSoftkeyVisible(
   265 TBool CAknItemActionMenu::CollectionSoftkeyVisible(
   243         TBool aVisibleCollection ) const
   266         TBool aVisibleCollection ) const
   244     {
   267     {
       
   268     _AKNTRACE_FUNC_ENTER;
   245     TBool softkeyVisible( ETrue );
   269     TBool softkeyVisible( ETrue );
   246     for ( TInt i = 0; i < iStates.Count(); i++ )
   270     for ( TInt i = 0; i < iStates.Count(); i++ )
   247         {
   271         {
   248         TInt state( iStates[ i ]->CollectionState() );
   272         TInt state( iStates[ i ]->CollectionState() );
   249         if ( !aVisibleCollection
   273         if ( !aVisibleCollection
   260                     state & MAknCollection::EStateHighlightVisible;
   284                     state & MAknCollection::EStateHighlightVisible;
   261                 }
   285                 }
   262             break;
   286             break;
   263             }
   287             }
   264         }
   288         }
       
   289     _AKNTRACE_FUNC_EXIT;
   265     return softkeyVisible;
   290     return softkeyVisible;
   266     }
   291     }
   267 
   292 
   268 
   293 
   269 // ---------------------------------------------------------------------------
   294 // ---------------------------------------------------------------------------
   270 // CAknItemActionMenu::MenuData
   295 // CAknItemActionMenu::MenuData
   271 // ---------------------------------------------------------------------------
   296 // ---------------------------------------------------------------------------
   272 //
   297 //
   273 CAknItemActionMenuData& CAknItemActionMenu::MenuData()
   298 CAknItemActionMenuData& CAknItemActionMenu::MenuData()
   274     {
   299     {
       
   300     _AKNTRACE_FUNC_ENTER;
       
   301     _AKNTRACE_FUNC_EXIT;
   275     return *iMenuData;
   302     return *iMenuData;
   276     }
   303     }
   277 
   304 
   278 
   305 
   279 // ---------------------------------------------------------------------------
   306 // ---------------------------------------------------------------------------
   281 // ---------------------------------------------------------------------------
   308 // ---------------------------------------------------------------------------
   282 //
   309 //
   283 void CAknItemActionMenu::RegisterCollectionObserverL(
   310 void CAknItemActionMenu::RegisterCollectionObserverL(
   284         MAknCollectionObserver& aObserver )
   311         MAknCollectionObserver& aObserver )
   285     {
   312     {
       
   313     _AKNTRACE_FUNC_ENTER;
   286     if ( iObservers.Find( &aObserver ) == KErrNotFound )
   314     if ( iObservers.Find( &aObserver ) == KErrNotFound )
   287         {
   315         {
   288         iObservers.InsertL( &aObserver, 0 );
   316         iObservers.InsertL( &aObserver, 0 );
   289         aObserver.SetItemActionMenu( this );
   317         aObserver.SetItemActionMenu( this );
   290         }
   318         }
       
   319     _AKNTRACE_FUNC_EXIT;
   291     }
   320     }
   292 
   321 
   293 
   322 
   294 // ---------------------------------------------------------------------------
   323 // ---------------------------------------------------------------------------
   295 // CAknItemActionMenu::RemoveCollectionObserver
   324 // CAknItemActionMenu::RemoveCollectionObserver
   296 // ---------------------------------------------------------------------------
   325 // ---------------------------------------------------------------------------
   297 //
   326 //
   298 void CAknItemActionMenu::RemoveCollectionObserver(
   327 void CAknItemActionMenu::RemoveCollectionObserver(
   299         MAknCollectionObserver& aObserver )
   328         MAknCollectionObserver& aObserver )
   300     {
   329     {
       
   330     _AKNTRACE_FUNC_ENTER;
   301     TInt index( iObservers.Find( &aObserver ) );
   331     TInt index( iObservers.Find( &aObserver ) );
   302     if ( index != KErrNotFound )
   332     if ( index != KErrNotFound )
   303         {
   333         {
   304         iObservers.Remove( index );
   334         iObservers.Remove( index );
   305         UnregisterMenu(); 
   335         UnregisterMenu(); 
   306         }
   336         }
       
   337     _AKNTRACE_FUNC_EXIT;
   307     }
   338     }
   308 
   339 
   309 
   340 
   310 // ---------------------------------------------------------------------------
   341 // ---------------------------------------------------------------------------
   311 // CAknItemActionMenu::CollectionCount
   342 // CAknItemActionMenu::CollectionCount
   312 // ---------------------------------------------------------------------------
   343 // ---------------------------------------------------------------------------
   313 //
   344 //
   314 TInt CAknItemActionMenu::CollectionCount() const
   345 TInt CAknItemActionMenu::CollectionCount() const
   315     {
   346     {
       
   347     _AKNTRACE_FUNC_ENTER;
       
   348     _AKNTRACE_FUNC_EXIT;
   316     return iStates.Count();
   349     return iStates.Count();
   317     }
   350     }
   318 
   351 
   319 
   352 
   320 // ---------------------------------------------------------------------------
   353 // ---------------------------------------------------------------------------
   321 // CAknItemActionMenu::Owner
   354 // CAknItemActionMenu::Owner
   322 // ---------------------------------------------------------------------------
   355 // ---------------------------------------------------------------------------
   323 //
   356 //
   324  MObjectProvider* CAknItemActionMenu::Owner() const
   357  MObjectProvider* CAknItemActionMenu::Owner() const
   325      {
   358      {
       
   359     _AKNTRACE_FUNC_ENTER;
       
   360     _AKNTRACE_FUNC_EXIT;
   326      return iOwner;
   361      return iOwner;
   327      }
   362      }
   328 
   363 
   329 
   364 
   330 // ---------------------------------------------------------------------------
   365 // ---------------------------------------------------------------------------
   337     iMenuBar( NULL ),
   372     iMenuBar( NULL ),
   338     iMenuPane( NULL ),
   373     iMenuPane( NULL ),
   339     iMenuData( NULL ),
   374     iMenuData( NULL ),
   340     iOwner( aOwner )
   375     iOwner( aOwner )
   341     {
   376     {
       
   377     _AKNTRACE_FUNC_ENTER;
   342     AKNTASHOOK_ADD( this, "CAknItemActionMenu" );
   378     AKNTASHOOK_ADD( this, "CAknItemActionMenu" );
       
   379     _AKNTRACE_FUNC_EXIT;
   343     }
   380     }
   344 
   381 
   345 
   382 
   346 // ---------------------------------------------------------------------------
   383 // ---------------------------------------------------------------------------
   347 // CAknItemActionMenu::ConstructL
   384 // CAknItemActionMenu::ConstructL
   348 // ---------------------------------------------------------------------------
   385 // ---------------------------------------------------------------------------
   349 //
   386 //
   350 void CAknItemActionMenu::ConstructL( MAknCollection& aCollection )
   387 void CAknItemActionMenu::ConstructL( MAknCollection& aCollection )
   351     {
   388     {
       
   389     _AKNTRACE_FUNC_ENTER;
   352     AddCollectionStateL( aCollection );
   390     AddCollectionStateL( aCollection );
   353     iMenuData = CAknItemActionMenuData::NewL();
   391     iMenuData = CAknItemActionMenuData::NewL();
       
   392     _AKNTRACE_FUNC_EXIT;
   354     }
   393     }
   355 
   394 
   356 
   395 
   357 // ---------------------------------------------------------------------------
   396 // ---------------------------------------------------------------------------
   358 // CAknItemActionMenu::LaunchSubMenuQueryL
   397 // CAknItemActionMenu::LaunchSubMenuQueryL
   359 // ---------------------------------------------------------------------------
   398 // ---------------------------------------------------------------------------
   360 //
   399 //
   361 TInt CAknItemActionMenu::LaunchSubMenuQueryL( const TDesC& aHeading )
   400 TInt CAknItemActionMenu::LaunchSubMenuQueryL( const TDesC& aHeading )
   362     {
   401     {
       
   402     _AKNTRACE_FUNC_ENTER;
   363     TInt selectedIndex( KInvalidListIndex );
   403     TInt selectedIndex( KInvalidListIndex );
   364     if ( iMenuData->Count() )
   404     if ( iMenuData->Count() )
   365         {
   405         {
   366         CAknListQueryDialog* queryDialog
   406         CAknListQueryDialog* queryDialog
   367             = new ( ELeave ) CAknListQueryDialog( &selectedIndex );
   407             = new ( ELeave ) CAknListQueryDialog( &selectedIndex );
   373             {
   413             {
   374             queryDialog->QueryHeading()->SetTextL( aHeading );
   414             queryDialog->QueryHeading()->SetTextL( aHeading );
   375             }
   415             }
   376         queryDialog->RunLD();
   416         queryDialog->RunLD();
   377         }
   417         }
       
   418     _AKNTRACE_FUNC_EXIT;
   378     return ++selectedIndex;
   419     return ++selectedIndex;
   379     }
   420     }
   380 
   421 
   381 
   422 
   382 // ---------------------------------------------------------------------------
   423 // ---------------------------------------------------------------------------
   384 // ---------------------------------------------------------------------------
   425 // ---------------------------------------------------------------------------
   385 //
   426 //
   386 void CAknItemActionMenu::NotifyChangeToActiveObserver(
   427 void CAknItemActionMenu::NotifyChangeToActiveObserver(
   387         TBool aCollectionVisible )
   428         TBool aCollectionVisible )
   388     {
   429     {
       
   430     _AKNTRACE_FUNC_ENTER;
   389     for ( TInt i = 0; i < iObservers.Count(); i++ )
   431     for ( TInt i = 0; i < iObservers.Count(); i++ )
   390         {
   432         {
   391         MAknCollectionObserver* observer( iObservers[ i ] );
   433         MAknCollectionObserver* observer( iObservers[ i ] );
   392         if ( observer->Active() )
   434         if ( observer->Active() )
   393             {
   435             {
   394             observer->CollectionChanged( aCollectionVisible );
   436             observer->CollectionChanged( aCollectionVisible );
   395             break;
   437             break;
   396             }
   438             }
   397         }
   439         }
       
   440     _AKNTRACE_FUNC_EXIT;
   398     }
   441     }
   399 
   442 
   400 
   443 
   401 // ---------------------------------------------------------------------------
   444 // ---------------------------------------------------------------------------
   402 // CAknItemActionMenu::SetEmphasis
   445 // CAknItemActionMenu::SetEmphasis
   404 //
   447 //
   405 void CAknItemActionMenu::SetEmphasis(
   448 void CAknItemActionMenu::SetEmphasis(
   406         CCoeControl* /*aMenuControl*/,
   449         CCoeControl* /*aMenuControl*/,
   407         TBool /*aEmphasis*/ )
   450         TBool /*aEmphasis*/ )
   408     {
   451     {
       
   452     _AKNTRACE_FUNC_ENTER;
       
   453     _AKNTRACE_FUNC_EXIT;
   409     }
   454     }
   410 
   455 
   411 
   456 
   412 // ---------------------------------------------------------------------------
   457 // ---------------------------------------------------------------------------
   413 // CAknItemActionMenu::ProcessCommandL
   458 // CAknItemActionMenu::ProcessCommandL
   414 // ---------------------------------------------------------------------------
   459 // ---------------------------------------------------------------------------
   415 //
   460 //
   416 void CAknItemActionMenu::ProcessCommandL( TInt aCommandId )
   461 void CAknItemActionMenu::ProcessCommandL( TInt aCommandId )
   417     {
   462     {
       
   463     _AKNTRACE_FUNC_ENTER;
   418     MAknCollection* informState ( NULL );
   464     MAknCollection* informState ( NULL );
   419     // Store collection state before sending the command
   465     // Store collection state before sending the command
   420     for ( TInt i = 0; i < iStates.Count(); i++ )
   466     for ( TInt i = 0; i < iStates.Count(); i++ )
   421         {
   467         {
   422         MAknCollection* state( iStates[ i ] );
   468         MAknCollection* state( iStates[ i ] );
   452     if ( iStates.Find( informState ) != KErrNotFound ) 
   498     if ( iStates.Find( informState ) != KErrNotFound ) 
   453         {
   499         {
   454         informState->ItemActionMenuClosed();
   500         informState->ItemActionMenuClosed();
   455         }
   501         }
   456     UnregisterMenu(); 
   502     UnregisterMenu(); 
       
   503     _AKNTRACE_FUNC_EXIT;
   457     }
   504     }
   458 
   505 
   459 
   506 
   460 // ---------------------------------------------------------------------------
   507 // ---------------------------------------------------------------------------
   461 // CAknItemActionMenu::UnregisterMenu
   508 // CAknItemActionMenu::UnregisterMenu
   462 // ---------------------------------------------------------------------------
   509 // ---------------------------------------------------------------------------
   463 //
   510 //
   464 void CAknItemActionMenu::UnregisterMenu()
   511 void CAknItemActionMenu::UnregisterMenu()
   465     {
   512     {
       
   513     _AKNTRACE_FUNC_ENTER;
   466     if ( !iProcessingCommand && !iStates.Count() && !iObservers.Count() )
   514     if ( !iProcessingCommand && !iStates.Count() && !iObservers.Count() )
   467         {
   515         {
   468         delete iPopupMenu;
   516         delete iPopupMenu;
   469         iPopupMenu = NULL;
   517         iPopupMenu = NULL;
   470         delete iMenuPane;
   518         delete iMenuPane;
   471         iMenuPane = NULL;
   519         iMenuPane = NULL;
   472         AknItemActionMenuRegister::UnregisterItemActionMenu( *this );
   520         AknItemActionMenuRegister::UnregisterItemActionMenu( *this );
   473         }
   521         }
       
   522     _AKNTRACE_FUNC_EXIT;
   474     }
   523     }
   475 
   524 
   476 // End of File
   525 // End of File