messagingfw/msgtestfw/TestActions/Email/Imap4/src/CMtfTestActionDoImap4PopulateMailSelectionWhenAlreadyConnected.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 // __ACTION_INFO_BEGIN__ 
       
    15 // [Action Name]
       
    16 // DoImap4PopulateMailSelectionWhenAlreadyConnected
       
    17 // [Action Parameters]
       
    18 // TMsvId				paramServiceId	<input>		: Value of IMAP4 Service Id
       
    19 // CImap4ClientMtm		paramMtm		<input>		: Reference to Imap4 client MTM
       
    20 // TImImap4GetMailInfo or TImImap4GetMailInfo	paramDownloadLimits	<input>	
       
    21 // : The Full or Partial download 
       
    22 // download limits
       
    23 // CMsvEntrySelection   paramMailSelection <input>	: Referece to the mail selection
       
    24 // [Action Description]
       
    25 // Populates the mails present in the message selection from the IMPA4 server.
       
    26 // A connection to the IMAP4 server should be established before executing this Test Action.
       
    27 // Does a Partial or Full download of mails based on the
       
    28 // type of the download limits (TImImap4GetMailInfo  or  TImImap4GetPartialMailInfo) provided 
       
    29 // as input to the Test Action.
       
    30 // Calls the CImap4ClientMtm::InvokeAsyncFunctionL() with the IMAP4 command 
       
    31 // KIMAP4MTMPopulateMailSelectionWhenAlreadyConnected by calling the ExecuteIMAP4CommandL()
       
    32 // function of the base class.
       
    33 // [APIs Used]
       
    34 // CMsvEntry::SetEntryL()
       
    35 // CMsvEntrySelection::AppendL()
       
    36 // CMsvEntrySelection::ResizeL()
       
    37 // CImap4ClientMtm::InvokeAsyncFunctionL()
       
    38 // __ACTION_INFO_END__
       
    39 // 
       
    40 //
       
    41 
       
    42 /**
       
    43  @file 
       
    44  @internalTechnology 
       
    45 */
       
    46 
       
    47 
       
    48 // User include
       
    49 #include "CMtfTestActionDoImap4PopulateMailSelectionWhenAlreadyConnected.h"
       
    50 #include "CMtfTestCase.h"
       
    51 
       
    52 
       
    53 /**
       
    54   NewL()
       
    55   Constructs a CMtfTestActionDoImap4PopulateMailSelectionWhenAlreadyConnected object.
       
    56   Uses two phase construction and leaves nothing on the CleanupStack.   
       
    57   @internalTechnology
       
    58   @param  aTestCase         Test Case to which this Test Action belongs
       
    59   @param  aActionParameters Action parameters, must not be NULL
       
    60   @return Created object of type CMtfTestActionDoImap4PopulateMailSelectionWhenAlreadyConnected
       
    61   @pre    None
       
    62   @post   CMtfTestActionDoImap4PopulateMailSelectionWhenAlreadyConnected object is created
       
    63 */
       
    64 CMtfTestAction* CMtfTestActionDoImap4PopulateMailSelectionWhenAlreadyConnected::NewL(CMtfTestCase& aTestCase,CMtfTestActionParameters* aActionParameters)
       
    65 	{
       
    66 	CMtfTestActionDoImap4PopulateMailSelectionWhenAlreadyConnected* self = new (ELeave) CMtfTestActionDoImap4PopulateMailSelectionWhenAlreadyConnected(aTestCase);
       
    67 	CleanupStack::PushL(self);
       
    68 	self->ConstructL(aActionParameters);
       
    69 	CleanupStack::Pop(self);
       
    70 	return self;
       
    71 	}
       
    72 	
       
    73 
       
    74 /**
       
    75   CMtfTestActionDoImap4PopulateMailSelectionWhenAlreadyConnected constructor
       
    76   Calls the base class' constructor
       
    77   @internalTechnology  
       
    78   @param  aTestCase  Test Case to which this Test Action belongs
       
    79   @pre    None
       
    80   @post   None
       
    81 */ 
       
    82 CMtfTestActionDoImap4PopulateMailSelectionWhenAlreadyConnected::CMtfTestActionDoImap4PopulateMailSelectionWhenAlreadyConnected(CMtfTestCase& aTestCase)
       
    83 	: CMtfDoInvokeAsyncFunctionWithSelectionTestAction(aTestCase)
       
    84 	{
       
    85 	}
       
    86 
       
    87 
       
    88 /**
       
    89   ExecuteActionL
       
    90   Invokes the asynchronous operation for IMAP4 command 
       
    91   KIMAP4MTMPopulateMailSelectionWhenAlreadyConnected by calling the base class
       
    92   function ExecuteIMAP4CommandL()
       
    93 
       
    94   @internalTechnology 
       
    95   @pre    None
       
    96   @post   None
       
    97   @leave  System wide errors
       
    98 */
       
    99 void CMtfTestActionDoImap4PopulateMailSelectionWhenAlreadyConnected::ExecuteActionL()
       
   100 	{
       
   101 	TestCase().INFO_PRINTF2(_L("Test Action %S start..."), &KTestActionDoImap4PopulateMailSelectionWhenAlreadyConnected);
       
   102 	TestCase().INFO_PRINTF1(_L("KIMAP4MTMPopulateMailSelectionWhenAlreadyConnected Imap4 command execution"));
       
   103 	// Call the base class function to invoke the IMAP4 command asynchronously 
       
   104 	ExecuteIMAP4CommandL(KIMAP4MTMPopulateMailSelectionWhenAlreadyConnected);
       
   105 	TestCase().INFO_PRINTF2(_L("Test Action %S completed."), &KTestActionDoImap4PopulateMailSelectionWhenAlreadyConnected);
       
   106 	}
       
   107