messagingfw/msgtestfw/TestActions/Email/Pop3/src/CMtfTestActionPop3TopBase.cpp
changeset 22 bde600d88860
parent 0 8e480a14352b
equal deleted inserted replaced
21:08008ce8a6df 22:bde600d88860
       
     1 // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 /**
       
    17  @file
       
    18 */
       
    19 
       
    20 #include "CMtfTestCase.h"
       
    21 #include "MtfTestActionUtilsUser.h"
       
    22 #include "CMtfTestActionPop3TopBase.h"
       
    23 #include "CMtfTestActionParameters.h"
       
    24 #include "CPop3MailInfo.h"
       
    25 
       
    26 
       
    27 CMtfTestActionPop3TopBase::CMtfTestActionPop3TopBase(CMtfTestCase& aTestCase)
       
    28 	: CMtfTestAction(aTestCase)
       
    29 	{
       
    30 	}
       
    31 
       
    32 CMtfTestActionPop3TopBase::~CMtfTestActionPop3TopBase()
       
    33 	{
       
    34 	delete iOperation;
       
    35 	}
       
    36 
       
    37 void CMtfTestActionPop3TopBase::DoCancel()
       
    38 	{
       
    39 	iOperation->Cancel();
       
    40 	}
       
    41 
       
    42 void CMtfTestActionPop3TopBase::RunL()
       
    43 	{
       
    44 	TInt err = MtfTestActionUtilsUser::FinalProgressStatus( *iOperation, iStatus );
       
    45 	delete iOperation;
       
    46 	iOperation = NULL;
       
    47 	User::LeaveIfError(err);
       
    48 	TestCase().ActionCompletedL(*this);
       
    49 	}
       
    50 
       
    51 void CMtfTestActionPop3TopBase::DoInvokeAsyncFunctionL( TPop3Cmds aCommand )
       
    52 	{
       
    53 	TMsvId paramServiceId = ObtainValueParameterL<TMsvId>(TestCase(), ActionParameters().Parameter(0));
       
    54 	CPop3ClientMtm *paramMtm = ObtainParameterReferenceL<CPop3ClientMtm>(TestCase(),ActionParameters().Parameter(1));
       
    55 	CPop3MailInfo *paramMailInfo = ObtainParameterReferenceL<CPop3MailInfo>(TestCase(),ActionParameters().Parameter(2));
       
    56 	CMsvEntrySelection* paramSelection = ObtainParameterReferenceL<CMsvEntrySelection>(TestCase(),ActionParameters().Parameter(3));
       
    57 
       
    58 	TPop3MailInfoBuf paramPack( paramMailInfo->MailInfo() );
       
    59 	paramSelection->InsertL( 0, paramServiceId ); 
       
    60 	iOperation = paramMtm->InvokeAsyncFunctionL( aCommand, *paramSelection, paramPack, iStatus );	
       
    61 	CActiveScheduler::Add(this);
       
    62 	iStatus = KRequestPending;
       
    63 	SetActive();
       
    64 	}
       
    65 
       
    66