messagingfw/msgtestfw/TestActions/Email/Imap4/src/CMtfTestActionDoImap4PopulateAllMailWhenAlreadyConnected.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 // DoImap4PopulateAllMailWhenAlreadyConnected
       
    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 // TMsvId				paramFolderId	<input>		: Destination folder id
       
    24 // [Action Description]
       
    25 // Populates all mails available on the IMAP4 Server.  The connection to the IMAP4 server
       
    26 // should be establieshed before executing this Test Action. Does a Partial or Full download of mails based on the
       
    27 // type of the download limits (TImImap4GetMailInfo  or  TImImap4GetPartialMailInfo) provided 
       
    28 // as input to the Test Action.
       
    29 // Calls the CImap4ClientMtm::InvokeAsyncFunctionL() with the IMAP4 command 
       
    30 // KIMAP4MTMPopulateAllMailWhenAlreadyConnected by calling the ExecuteIMAP4CommandL()
       
    31 // function of the base class.
       
    32 // [APIs Used]
       
    33 // CMsvEntry::SetEntryL()
       
    34 // CMsvEntrySelection::AppendL()
       
    35 // CMsvEntrySelection::ResizeL()
       
    36 // CImap4ClientMtm::InvokeAsyncFunctionL()
       
    37 // __ACTION_INFO_END__
       
    38 // 
       
    39 //
       
    40 
       
    41 /**
       
    42  @file 
       
    43  @internalTechnology 
       
    44 */
       
    45 
       
    46 
       
    47 // User include
       
    48 #include "CMtfTestActionDoImap4PopulateAllMailWhenAlreadyConnected.h"
       
    49 #include "CMtfTestCase.h"
       
    50 
       
    51 
       
    52 /**
       
    53   NewL()
       
    54   Constructs a CMtfTestActionDoImap4PopulateAllMailWhenAlreadyConnected 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 CMtfTestActionDoImap4PopulateAllMailWhenAlreadyConnected
       
    60   @pre    None
       
    61   @post   CMtfTestActionDoImap4PopulateAllMailWhenAlreadyConnected object is created
       
    62 */
       
    63 CMtfTestAction* CMtfTestActionDoImap4PopulateAllMailWhenAlreadyConnected::
       
    64 			NewL(CMtfTestCase& aTestCase,CMtfTestActionParameters* aActionParameters)
       
    65 	{
       
    66 	CMtfTestActionDoImap4PopulateAllMailWhenAlreadyConnected* self = 
       
    67 			new (ELeave) CMtfTestActionDoImap4PopulateAllMailWhenAlreadyConnected(aTestCase);
       
    68 
       
    69 	CleanupStack::PushL(self);
       
    70 	self->ConstructL(aActionParameters);
       
    71 	CleanupStack::Pop(self);
       
    72 	return self;
       
    73 	}
       
    74 	
       
    75 
       
    76 /**
       
    77   CMtfTestActionDoImap4PopulateAllMailWhenAlreadyConnected 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 CMtfTestActionDoImap4PopulateAllMailWhenAlreadyConnected::
       
    85 			CMtfTestActionDoImap4PopulateAllMailWhenAlreadyConnected
       
    86 											(CMtfTestCase& aTestCase)
       
    87 	: CMtfDoInvokeAsyncFunctionWithoutSelectionTestAction(aTestCase)
       
    88 	{
       
    89 	}
       
    90 
       
    91 
       
    92 /**
       
    93   ExecuteActionL
       
    94   Invokes the asynchronous operation for IMAP4 command 
       
    95   KIMAP4MTMPopulateAllMailWhenAlreadyConnected by calling the base class
       
    96   function ExecuteIMAP4CommandL()
       
    97 
       
    98   @internalTechnology 
       
    99   @pre    None
       
   100   @post   None
       
   101   @leave  System wide errors
       
   102 */
       
   103 void CMtfTestActionDoImap4PopulateAllMailWhenAlreadyConnected::ExecuteActionL()
       
   104 	{
       
   105 	TestCase().INFO_PRINTF2(_L("Test Action %S start..."), &KTestActionDoImap4PopulateAllMailWhenAlreadyConnected);
       
   106 	TestCase().INFO_PRINTF1(_L("KIMAP4MTMPopulateAllMailWhenAlreadyConnected Imap4 command execution"));
       
   107 	// Call the base class function to invoke the IMAP4 command asynchronously
       
   108 	ExecuteIMAP4CommandL(KIMAP4MTMPopulateAllMailWhenAlreadyConnected);
       
   109 	TestCase().INFO_PRINTF2(_L("Test Action %S completed."), &KTestActionDoImap4PopulateAllMailWhenAlreadyConnected);
       
   110 	}