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