|
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 // DoImap4ConnectAndPopulateMailSelectionAndStayOnline |
|
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 paramSelection <input> : Reference to the message selection |
|
24 // [Action Description] |
|
25 // Establishes a connection with the IMAP4 server and populates the mails present |
|
26 // in the mail selection. A Full or Partial download of mails is perfomred based |
|
27 // on the type of limits that is set. The connection with the IMAP4 server is |
|
28 // retained after the download of messages. |
|
29 // Calls the CImap4ClientMtm::InvokeAsyncFunctionL() with the IMAP4 command |
|
30 // KIMAP4MTMConnectAndPopulateMailSelectionAndStayOnline by calling the |
|
31 // ExecuteIMAP4CommandL() function of the base class |
|
32 // CMtfDoInvokeAsyncFunctionWithSelectionTestAction. |
|
33 // [APIs Used] |
|
34 // CMsvEntry::SetEntryL |
|
35 // CMsvEntrySelection::AppendL |
|
36 // CImap4ClientMtm::InvokeAsyncFunctionL |
|
37 // __ACTION_INFO_END__ |
|
38 // |
|
39 // |
|
40 |
|
41 /** |
|
42 @file |
|
43 @internalTechnology |
|
44 */ |
|
45 |
|
46 |
|
47 // EPOC include |
|
48 #include <impcmtm.h> |
|
49 |
|
50 // User include |
|
51 #include "CMtfTestActionDoImap4ConnectAndPopulateMailSelectionAndStayOnline.h" |
|
52 #include "CMtfTestCase.h" |
|
53 |
|
54 |
|
55 |
|
56 /** |
|
57 NewL() |
|
58 Constructs a CMtfTestActionDoImap4ConnectAndPopulateMailSelectionAndStayOnline object. |
|
59 Uses two phase construction and leaves nothing on the CleanupStack. |
|
60 @internalTechnology |
|
61 @param aTestCase Test Case to which this Test Action belongs |
|
62 @param aActionParameters Action parameters, must not be NULL |
|
63 @return Created object of type CMtfTestActionDoImap4ConnectAndPopulateMailSelectionAndStayOnline |
|
64 @pre None |
|
65 @post CMtfTestActionDoImap4ConnectAndPopulateMailSelectionAndStayOnline object is created |
|
66 */ |
|
67 CMtfTestAction* CMtfTestActionDoImap4ConnectAndPopulateMailSelectionAndStayOnline:: |
|
68 NewL(CMtfTestCase& aTestCase,CMtfTestActionParameters* aActionParameters) |
|
69 { |
|
70 CMtfTestActionDoImap4ConnectAndPopulateMailSelectionAndStayOnline* self = |
|
71 new (ELeave) |
|
72 CMtfTestActionDoImap4ConnectAndPopulateMailSelectionAndStayOnline(aTestCase); |
|
73 |
|
74 CleanupStack::PushL(self); |
|
75 self->ConstructL(aActionParameters); |
|
76 CleanupStack::Pop(self); |
|
77 return self; |
|
78 } |
|
79 |
|
80 /** |
|
81 CMtfTestActionDoImap4ConnectAndPopulateMailSelectionAndStayOnline constructor |
|
82 Calls the base class' constructor |
|
83 @internalTechnology |
|
84 @param aTestCase Test Case to which this Test Action belongs |
|
85 @pre None |
|
86 @post None |
|
87 */ |
|
88 CMtfTestActionDoImap4ConnectAndPopulateMailSelectionAndStayOnline:: |
|
89 CMtfTestActionDoImap4ConnectAndPopulateMailSelectionAndStayOnline |
|
90 (CMtfTestCase& aTestCase) |
|
91 : CMtfDoInvokeAsyncFunctionWithSelectionTestAction(aTestCase) |
|
92 { |
|
93 } |
|
94 |
|
95 |
|
96 /** |
|
97 Function : ExecuteActionL |
|
98 Invokes the asynchronous operation for IMAP4 specific command |
|
99 KIMAP4MTMConnectAndPopulateMailSelectionAndStayOnline by calling the base class |
|
100 function ExecuteIMAP4CommandL(). ExecuteIMAP4CommandL() function retrieves |
|
101 the Full or Partidal download limits package from the HBufC8 descriptor and |
|
102 calls the CImap4ClientMtm::InvokeAsyncFunctionL() function. |
|
103 @internalTechnology |
|
104 @return None |
|
105 @pre None |
|
106 @post None |
|
107 @leave KErrUnknown If package is not of type TImImap4GetMailInfo or |
|
108 TImImap4GetPartialMailInfo |
|
109 */ |
|
110 void CMtfTestActionDoImap4ConnectAndPopulateMailSelectionAndStayOnline::ExecuteActionL() |
|
111 { |
|
112 TestCase().INFO_PRINTF2(_L("Test Action %S start..."), &KTestActionDoImap4ConnectAndPopulateMailSelectionAndStayOnline); |
|
113 TestCase().INFO_PRINTF1(_L("KIMAP4MTMConnectAndPopulateMailSelectionAndStayOnline Imap4 command execution")); |
|
114 //Call the base class function to invoke the IMAP4 command asynchronously |
|
115 ExecuteIMAP4CommandL(KIMAP4MTMConnectAndPopulateMailSelectionAndStayOnline); |
|
116 TestCase().INFO_PRINTF2(_L("Test Action %S completed."), &KTestActionDoImap4ConnectAndPopulateMailSelectionAndStayOnline); |
|
117 } |