phonebookui/Phonebook2/Commands/src/CPbk2SindInfoViewCmd.cpp
changeset 0 e686773b3f54
equal deleted inserted replaced
-1:000000000000 0:e686773b3f54
       
     1 /*
       
     2 * Copyright (c) 2005-2007 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:  Phonebook 2 SIND InfoView command.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 #include "CPbk2SindInfoViewCmd.h"
       
    21 
       
    22 // System includes
       
    23 #include <AiwGenericParam.hrh>
       
    24 #include <AiwServiceHandler.h>      // AIW
       
    25 #include <coemain.h>
       
    26 
       
    27 // Debugging headers
       
    28 #include <Pbk2Debug.h>
       
    29 
       
    30 
       
    31 // --------------------------------------------------------------------------
       
    32 // CPbk2SindInfoViewCmd::NewL
       
    33 // --------------------------------------------------------------------------
       
    34 //
       
    35 CPbk2SindInfoViewCmd* CPbk2SindInfoViewCmd::NewL(        
       
    36         TInt aCommandId,
       
    37         CAiwServiceHandler& aServiceHandler )
       
    38     {
       
    39     CPbk2SindInfoViewCmd* self = new( ELeave ) CPbk2SindInfoViewCmd(        
       
    40         aCommandId,
       
    41         aServiceHandler );
       
    42     return self;
       
    43     }
       
    44 
       
    45 // --------------------------------------------------------------------------
       
    46 // CPbk2SindInfoViewCmd::CPbk2SindInfoViewCmd
       
    47 // --------------------------------------------------------------------------
       
    48 //
       
    49 CPbk2SindInfoViewCmd::CPbk2SindInfoViewCmd(        
       
    50         TInt aCommandId,
       
    51         CAiwServiceHandler& aServiceHandler ) :			
       
    52 	iCommandId( aCommandId ),
       
    53     iServiceHandler( aServiceHandler )
       
    54 	{
       
    55     PBK2_DEBUG_PRINT
       
    56         (PBK2_DEBUG_STRING("CPbk2SindInfoViewCmd::CPbk2SindInfoViewCmd(0x%x)"), this);    
       
    57     }
       
    58 
       
    59 // --------------------------------------------------------------------------
       
    60 // CPbk2SindInfoViewCmd::~CPbk2SindInfoViewCmd
       
    61 // --------------------------------------------------------------------------
       
    62 //
       
    63 CPbk2SindInfoViewCmd::~CPbk2SindInfoViewCmd()
       
    64     {
       
    65     delete iPackedLinkArray;
       
    66     
       
    67     PBK2_DEBUG_PRINT
       
    68         (PBK2_DEBUG_STRING("CPbk2SindInfoViewCmd::~CPbk2SindInfoViewCmd(0x%x)"), this);
       
    69     }
       
    70 
       
    71 // --------------------------------------------------------------------------
       
    72 // CPbk2SindInfoViewCmd::ExecuteLD
       
    73 // --------------------------------------------------------------------------
       
    74 //
       
    75 void CPbk2SindInfoViewCmd::ExecuteLD()
       
    76     {
       
    77     PBK2_DEBUG_PRINT
       
    78         (PBK2_DEBUG_STRING("CPbk2SindInfoViewCmd::ExecuteLD(0x%x)"), this);
       
    79 
       
    80    	CleanupStack::PushL( this );
       
    81    
       
    82     // Set parameters for the AIW InfoView
       
    83     CAiwGenericParamList& paramList = iServiceHandler.InParamListL();
       
    84     
       
    85     paramList.AppendL( TAiwGenericParam( EGenericParamContactLinkArray,
       
    86                                          TAiwVariant( *iPackedLinkArray ) ) );
       
    87                                          
       
    88     // Relay the command to AIW for handling
       
    89     iServiceHandler.ExecuteMenuCmdL(
       
    90         iCommandId,
       
    91         paramList,
       
    92         iServiceHandler.OutParamListL(),
       
    93         0,      // No options used.
       
    94         NULL ); // No need for callback
       
    95         
       
    96 	// Destroy itself as promised
       
    97     CleanupStack::PopAndDestroy(); // this
       
    98     }
       
    99     
       
   100 // --------------------------------------------------------------------------
       
   101 // CPbk2SindInfoViewCmd::ResetUiControl
       
   102 // --------------------------------------------------------------------------
       
   103 //
       
   104 void CPbk2SindInfoViewCmd::ResetUiControl
       
   105         ( MPbk2ContactUiControl& /*aUiControl*/ )
       
   106     {
       
   107     // Do nothing
       
   108     }
       
   109 
       
   110 // --------------------------------------------------------------------------
       
   111 // CPbk2SindInfoViewCmd::AddObserver
       
   112 // --------------------------------------------------------------------------
       
   113 //
       
   114 void CPbk2SindInfoViewCmd::AddObserver
       
   115         ( MPbk2CommandObserver& /*aObserver*/ )
       
   116     {
       
   117     // Do nothing
       
   118     }
       
   119 
       
   120 
       
   121 // --------------------------------------------------------------------------
       
   122 // CPbk2SindInfoViewCmd::SetPackedLinkArray
       
   123 // --------------------------------------------------------------------------
       
   124 //
       
   125 void CPbk2SindInfoViewCmd::SetPackedLinkArray( TDesC8* aPackedLinkArray )
       
   126     {
       
   127     delete iPackedLinkArray;
       
   128     // takes ownership of the object
       
   129     iPackedLinkArray = aPackedLinkArray;
       
   130     }
       
   131 
       
   132 //  End of File