menucontentsrv/srvsrc/mcsrunningappsaddremovehandler.cpp
changeset 0 79c6a41cd166
equal deleted inserted replaced
-1:000000000000 0:79c6a41cd166
       
     1 /*
       
     2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include <e32cmn.h> 
       
    20 
       
    21 #include "mcsrunningappsaddremovehandler.h"
       
    22 #include "menueng.h"
       
    23 #include "mcsrunningappshandler.h"
       
    24 
       
    25 // ---------------------------------------------------------
       
    26 // CMcsRunningAppsAddRemoveHandler::NewL
       
    27 // ---------------------------------------------------------
       
    28 //
       
    29 CMcsRunningAppsAddRemoveHandler* CMcsRunningAppsAddRemoveHandler::NewL(
       
    30     CMenuEng& aEng, MMcsRunningAppsHandler* aRunningAppsHandler )
       
    31 	{
       
    32 	CMcsRunningAppsAddRemoveHandler* self = 
       
    33 		new ( ELeave ) CMcsRunningAppsAddRemoveHandler( aEng, 
       
    34 		aRunningAppsHandler );
       
    35 	CleanupStack::PushL( self );
       
    36 	self->ConstructL();
       
    37 	CleanupStack::Pop( self );
       
    38 	return self;
       
    39 	}
       
    40 
       
    41 // ---------------------------------------------------------
       
    42 // CMcsRunningAppsAddRemoveHandler::~CMcsRunningAppsAddRemoveHandler
       
    43 // ---------------------------------------------------------
       
    44 //
       
    45 CMcsRunningAppsAddRemoveHandler::~CMcsRunningAppsAddRemoveHandler()
       
    46     {
       
    47     iEng.DequeueOperation( *this );
       
    48     iFolders.Close();
       
    49     }
       
    50 
       
    51 // ---------------------------------------------------------
       
    52 // CMcsRunningAppsAddRemoveHandler::CMcsRunningAppsAddRemoveHandler
       
    53 // ---------------------------------------------------------
       
    54 //
       
    55 CMcsRunningAppsAddRemoveHandler::CMcsRunningAppsAddRemoveHandler(
       
    56     CMenuEng& aEng, MMcsRunningAppsHandler* aRunningAppsHandler):
       
    57     iEng(aEng),
       
    58     iRunningAppsHandler(aRunningAppsHandler)
       
    59     {
       
    60     iOperationInProgress = EFalse;
       
    61     }
       
    62 
       
    63 // ---------------------------------------------------------
       
    64 // CMcsRunningAppsAddRemoveHandler::HandleAddRemoveL
       
    65 // ---------------------------------------------------------
       
    66 //
       
    67 void CMcsRunningAppsAddRemoveHandler::HandleAddRemoveL( TInt aFolder )
       
    68     {
       
    69     iFolders.AppendL( aFolder );
       
    70     if( !iOperationInProgress )
       
    71     	{
       
    72     	iEng.QueueOperationL( *this );
       
    73     	iOperationInProgress = ETrue;
       
    74     	}
       
    75     }    
       
    76 
       
    77 // ---------------------------------------------------------
       
    78 // CMcsRunningAppsAddRemoveHandler::ConstructL
       
    79 // ---------------------------------------------------------
       
    80 //
       
    81 void CMcsRunningAppsAddRemoveHandler::ConstructL()
       
    82 	{
       
    83 	}
       
    84 
       
    85 // ---------------------------------------------------------
       
    86 // CMcsRunningAppsAddRemoveHandler::RunMenuEngOperationL
       
    87 // ---------------------------------------------------------
       
    88 //
       
    89 void CMcsRunningAppsAddRemoveHandler::RunMenuEngOperationL()
       
    90     {
       
    91     iRunningAppsHandler->HandleAddRemoveRunningAppL( iFolders[0] );
       
    92     iFolders.Remove( 0 );
       
    93     iOperationInProgress = EFalse;
       
    94     if ( iFolders.Count() > 0 )
       
    95     	{
       
    96     	iEng.QueueOperationL( *this );
       
    97     	iOperationInProgress = ETrue;
       
    98     	}
       
    99     } 
       
   100        
       
   101 // ---------------------------------------------------------
       
   102 // CMcsRunningAppsAddRemoveHandler::CompletedMenuEngOperation
       
   103 // ---------------------------------------------------------
       
   104 //
       
   105 void CMcsRunningAppsAddRemoveHandler::CompletedMenuEngOperation( TInt /*aErr*/ )
       
   106     {
       
   107     // If there was error, ignore it (what else could we do?).
       
   108     // When next AppArc update occurs, we will run again.
       
   109     }
       
   110 //  End of File