phonebookui/Phonebook2/xSPExtensionManager/src/CxSPCommand.cpp
branchRCL_3
changeset 20 f4a778e096c2
parent 0 e686773b3f54
equal deleted inserted replaced
19:5b6f26637ad3 20:f4a778e096c2
       
     1 /*
       
     2 * Copyright (c) 2006 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 *       xSP command
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 // INCLUDE FILES
       
    21 #include <MPbk2CommandObserver.h>
       
    22 #include "CxSPCommand.h"
       
    23 #include "CxSPViewManager.h"
       
    24 
       
    25 // CONSTANTS
       
    26 
       
    27 // ==================== MEMBER FUNCTIONS ====================
       
    28 CxSPCommand::CxSPCommand( TInt aCommandId,
       
    29 							MPbk2ContactUiControl& aUiControl,
       
    30 							CxSPViewManager& aViewManager ) :
       
    31     								iCommandId( aCommandId ),
       
    32     								iUiControl( &aUiControl ),
       
    33     								iViewManager( aViewManager )
       
    34     {
       
    35     }
       
    36 
       
    37 CxSPCommand::~CxSPCommand()
       
    38     {
       
    39     }
       
    40 
       
    41 CxSPCommand* CxSPCommand::NewL( TInt aCommandId,
       
    42 							MPbk2ContactUiControl& aUiControl,
       
    43 							CxSPViewManager& aViewManager )
       
    44     {
       
    45     CxSPCommand* self = new (ELeave) CxSPCommand( aCommandId, aUiControl, aViewManager );
       
    46     return self;
       
    47     }
       
    48 
       
    49 void CxSPCommand::ExecuteLD()
       
    50 	{
       
    51 	CleanupStack::PushL( this );
       
    52 	iViewManager.HandleCommandL( iCommandId, iUiControl );
       
    53 	if( iCommandObserver )
       
    54         {
       
    55         iCommandObserver->CommandFinished( *this );
       
    56         }
       
    57 	CleanupStack::Pop( this );
       
    58 	}
       
    59 	
       
    60 void CxSPCommand::ResetUiControl( MPbk2ContactUiControl& aUiControl )
       
    61 	{
       
    62 	if( iUiControl == &aUiControl )
       
    63         {
       
    64         iUiControl = NULL;
       
    65         }	
       
    66 	}
       
    67 	
       
    68 void CxSPCommand::AddObserver( MPbk2CommandObserver& aObserver )
       
    69     {
       
    70     iCommandObserver = &aObserver;
       
    71     }	
       
    72 
       
    73 //  End of File