messagingfw/msgtestfw/TestActions/Email/Imap4/src/CMtfDoInvokeAsyncFunctionWithoutSelectionTestAction.cpp
changeset 0 8e480a14352b
equal deleted inserted replaced
-1:000000000000 0:8e480a14352b
       
     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  @internalTechnology 
       
    19 */
       
    20 
       
    21 
       
    22 // EPOC include 
       
    23 #include <imapset.h>
       
    24 
       
    25 // User include
       
    26 #include "CMtfDoInvokeAsyncFunctionWithoutSelectionTestAction.h"
       
    27 #include "CMtfTestCase.h"
       
    28 #include "CMtfTestActionParameters.h"
       
    29 
       
    30 
       
    31 /**
       
    32   Constructor.
       
    33 */
       
    34 CMtfDoInvokeAsyncFunctionWithoutSelectionTestAction::
       
    35 	CMtfDoInvokeAsyncFunctionWithoutSelectionTestAction(CMtfTestCase& aTestCase)
       
    36 	: CMtfDoInvokeAsyncFunctionTestAction(aTestCase),iMailSelection(NULL)
       
    37 	{
       
    38 	}
       
    39 
       
    40 /**
       
    41   Destructor.
       
    42 */
       
    43 CMtfDoInvokeAsyncFunctionWithoutSelectionTestAction::
       
    44 	~CMtfDoInvokeAsyncFunctionWithoutSelectionTestAction()
       
    45 	{
       
    46 	delete iMailSelection;
       
    47 	}
       
    48 
       
    49 /** 
       
    50   DoCancel
       
    51   Cancels the pending asynchronous operation
       
    52 */
       
    53 void CMtfDoInvokeAsyncFunctionWithoutSelectionTestAction::DoCancel()
       
    54 	{
       
    55 	delete iMailSelection;
       
    56 	iMailSelection = NULL;
       
    57 	CMtfDoInvokeAsyncFunctionTestAction::DoCancel();
       
    58 	}
       
    59 
       
    60 
       
    61 /**
       
    62   ExecuteIMAP4CommandL
       
    63   Obtains the Test Action input parameters, creates a mail selection
       
    64   and calls the base class function InvokeAsyncImap4PopulateCommandL()
       
    65   @internalTechnology 
       
    66   @param	aImap4Command	IMAP4-specific command
       
    67   @pre		None
       
    68   @post	The asynchronous operation for the IMAP4 command is initiated
       
    69   @leave	System wide errors
       
    70 */	
       
    71 void CMtfDoInvokeAsyncFunctionWithoutSelectionTestAction::ExecuteIMAP4CommandL
       
    72 													 (TImap4Cmds aImap4Command)
       
    73 	{
       
    74 	// Obtain input parameter IMAP4 Service Id
       
    75 	TMsvId	paramServiceId  =	ObtainValueParameterL<TMsvId>(TestCase(),
       
    76 									  ActionParameters().Parameter(0));
       
    77 
       
    78 
       
    79 	// Obtain input parameter destination folder Id
       
    80 	TMsvId	paramFolderId  =	ObtainValueParameterL<TMsvId>(TestCase(),
       
    81 									  ActionParameters().Parameter(3));	
       
    82 
       
    83 	/*********************************************************************
       
    84 	 Create a mail selection. The first entry in this selection MUST be 
       
    85 	 the service. For the 'populate new', 'populate all' situations, the 
       
    86 	 folder from which the mails are to be populated should be appended
       
    87 	 after the service ID.
       
    88 	**********************************************************************/
       
    89 	iMailSelection = new (ELeave) CMsvEntrySelection;
       
    90 	
       
    91 	iMailSelection->ResizeL(0);
       
    92 	iMailSelection->InsertL(0,paramServiceId);
       
    93 	iMailSelection->InsertL(1,paramFolderId); 
       
    94 
       
    95 	// Call the base class function to invokes asynchronous IMAP4-specific operation
       
    96 	InvokeAsyncImap4PopulateCommandL(aImap4Command, *iMailSelection);
       
    97 	}