uiservicetab/vimpstcmdprocess/src/cvimpstcmdcall.cpp
branchRCL_3
changeset 22 3104fc151679
parent 21 2b7283837edb
child 23 9a48e301e94b
equal deleted inserted replaced
21:2b7283837edb 22:3104fc151679
     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:  implementation for CVIMPSTCmdCall
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 
       
    21 
       
    22 #include "vimpstcmd.hrh"
       
    23 #include "mvimpstcmdobserver.h"
       
    24 #include "cvimpstcmdcall.h"
       
    25 #include "mvimpstprocessarray.h"
       
    26 
       
    27 #include "uiservicetabtracer.h"
       
    28 
       
    29 #include <aiwdialdataext.h>
       
    30 #include <aknpopup.h>
       
    31 #include <aiwcommon.hrh>
       
    32 #include <aiwservicehandler.h>
       
    33 #include <MVPbkContactLink.h>
       
    34 
       
    35 
       
    36 
       
    37 // Constants
       
    38 
       
    39 // --------------------------------------------------------------------------
       
    40 // CVIMPSTCmdCall::CVIMPSTCmdCall
       
    41 // --------------------------------------------------------------------------
       
    42 //
       
    43 CVIMPSTCmdCall::CVIMPSTCmdCall( 
       
    44         const TInt aCommandId,TInt& aIndex, 
       
    45         MVIMPSTProcessArray& mArrayProcess,
       
    46         TInt aWindowGroup,
       
    47         TUint32 aServiceId) :            
       
    48             iCommandId( aCommandId ),
       
    49             iIndex(aIndex),
       
    50             iArrayProcess(mArrayProcess),
       
    51             iWindowGroup(aWindowGroup),
       
    52             iServiceId(aServiceId)
       
    53     {
       
    54     }
       
    55 
       
    56 // --------------------------------------------------------------------------
       
    57 // CVIMPSTCmdCall::~CVIMPSTCmdCall
       
    58 // --------------------------------------------------------------------------
       
    59 //
       
    60 CVIMPSTCmdCall::~CVIMPSTCmdCall()
       
    61     {
       
    62 
       
    63     }
       
    64 
       
    65 // --------------------------------------------------------------------------
       
    66 // CVIMPSTCmdCall::NewL
       
    67 // --------------------------------------------------------------------------
       
    68 //
       
    69 CVIMPSTCmdCall* CVIMPSTCmdCall::NewL( 
       
    70         const TInt aCommandId,TInt& aIndex,
       
    71         MVIMPSTProcessArray& aArrayProcess,
       
    72         TInt aWindowGroup,
       
    73         TUint32 aServiceId)
       
    74     {
       
    75     CVIMPSTCmdCall* self = new (ELeave ) CVIMPSTCmdCall( aCommandId,aIndex,
       
    76     					aArrayProcess, aWindowGroup,
       
    77     					aServiceId);
       
    78     self->ConstructL(); //use contsurctL if necessary
       
    79     return self;
       
    80     }
       
    81 // --------------------------------------------------------------------------
       
    82 // CVIMPSTCmdCall::ConstructL
       
    83 // --------------------------------------------------------------------------
       
    84 //
       
    85 void CVIMPSTCmdCall::ConstructL()
       
    86     {
       
    87  
       
    88     }
       
    89 
       
    90 // --------------------------------------------------------------------------
       
    91 // CVIMPSTCmdCall::ExecuteLD
       
    92 // --------------------------------------------------------------------------
       
    93 //
       
    94 void CVIMPSTCmdCall::ExecuteLD()
       
    95     {
       
    96     TRACER_AUTO;
       
    97    	
       
    98     //push to the cleanupstack
       
    99     CleanupStack::PushL( this );
       
   100 
       
   101 	CAiwServiceHandler * aiwServiceHandler = CAiwServiceHandler::NewL();
       
   102 	
       
   103 	CAiwDialDataExt* dialDataExt = CAiwDialDataExt::NewL();
       
   104     CleanupStack::PushL( dialDataExt );
       
   105     
       
   106     dialDataExt->SetWindowGroup( iWindowGroup );
       
   107         
       
   108     HBufC8* pack = iArrayProcess.ContactLink(iIndex)->PackLC();
       
   109     
       
   110     dialDataExt->SetContactLinkL( *pack );
       
   111     
       
   112     dialDataExt->SetCallType( CAiwDialData::EAIWVoiP );
       
   113     
       
   114     //dialDataExt->SetServiceId( iServiceId );
       
   115 
       
   116     
       
   117     CAiwGenericParamList& paramList = 
       
   118         aiwServiceHandler->InParamListL();
       
   119     dialDataExt->FillInParamListL( paramList );
       
   120     
       
   121     aiwServiceHandler->ExecuteServiceCmdL(
       
   122             KAiwCmdCall,
       
   123             paramList,
       
   124             aiwServiceHandler->OutParamListL(),
       
   125             NULL);  // No need for callback    
       
   126     
       
   127     
       
   128     CleanupStack::PopAndDestroy( pack );
       
   129     CleanupStack::PopAndDestroy( dialDataExt );
       
   130     
       
   131     if(iObserver)
       
   132 	    {
       
   133 	    iObserver->CommandFinishedL(*this);
       
   134 	    }
       
   135 	// CHAT_DP_FUNC_ENTER("CVIMPSTCallCmd:: CommandFinished");	
       
   136 	CleanupStack::PopAndDestroy();	
       
   137 	// CHAT_DP_FUNC_DONE("CVIMPSTCallCmd::ExecuteLD");	
       
   138     }
       
   139 
       
   140 
       
   141 // --------------------------------------------------------------------------
       
   142 // CVIMPSTCmdCall::AddObserver
       
   143 // --------------------------------------------------------------------------
       
   144 //
       
   145 void CVIMPSTCmdCall::AddObserver( MVIMPSTCmdObserver& aObserver )
       
   146     {
       
   147 	TRACER_AUTO;
       
   148     // store the observer to notify the command completion
       
   149     iObserver = &aObserver;
       
   150     }
       
   151 
       
   152 
       
   153 // --------------------------------------------------------------------------
       
   154 // CVIMPSTCmdCall::CommandId
       
   155 // --------------------------------------------------------------------------
       
   156 //
       
   157 TInt CVIMPSTCmdCall::CommandId() const
       
   158 	{
       
   159 	return iCommandId;	
       
   160 	}
       
   161 
       
   162 // --------------------------------------------------------------------------
       
   163 // CVIMPSTCmdCall::Result
       
   164 // --------------------------------------------------------------------------
       
   165 //
       
   166 TInt CVIMPSTCmdCall::Result() const
       
   167 	{
       
   168 	//return valid data regd the command operation
       
   169 	return KErrNone;
       
   170 	}
       
   171 
       
   172 
       
   173 
       
   174 // End of File