|
1 // Copyright (c) 2005-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 #ifndef __T_DEF062024_IMAPCLIENT_H__ |
|
17 #define __T_DEF062024_IMAPCLIENT_H__ |
|
18 |
|
19 #include <e32cons.h> |
|
20 #include <e32const.h> |
|
21 #include <in_sock.h> |
|
22 #include <nifman.h> |
|
23 #include "emailtestutils.h" |
|
24 #include <iapprefs.h> |
|
25 #include <cemailaccounts.h> |
|
26 #include "impsmtm.h" |
|
27 #include <imapconnectionobserver.h> |
|
28 #include "cspoofserver.h" |
|
29 |
|
30 // For loading the serial comms device drivers |
|
31 #if defined (__WINS__) |
|
32 #define PDD_NAME _L("ECDRV") |
|
33 #define LDD_NAME _L("ECOMM") |
|
34 #else |
|
35 #define PDD_NAME _L("EUART1") |
|
36 #define LDD_NAME _L("ECOMM") |
|
37 #endif |
|
38 |
|
39 class TDummySessionObserver : public CBase , public MMsvSessionObserver |
|
40 { |
|
41 public: |
|
42 void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* aArg3); |
|
43 }; |
|
44 |
|
45 class CActiveImapClient : public CActive , public MMsvImapConnectionObserver |
|
46 { |
|
47 |
|
48 public: |
|
49 |
|
50 IMPORT_C static CActiveImapClient* NewL(MImapTestEventHandler& aObserver); |
|
51 IMPORT_C static CActiveImapClient* NewLC(MImapTestEventHandler& aObserver); |
|
52 void StartL(); |
|
53 void CreateImapAccountL(); |
|
54 ~CActiveImapClient(); |
|
55 TImapAccount GetAccount(); |
|
56 // Return iMessageId, the message ID of the email being fetched with its attachment |
|
57 TMsvId GetMessageId(); |
|
58 |
|
59 private: |
|
60 CActiveImapClient(MImapTestEventHandler& aObserver); |
|
61 void ConstructL(); |
|
62 |
|
63 // From CActive |
|
64 virtual void DoCancel(); |
|
65 virtual void RunL(); |
|
66 virtual TInt RunError(TInt aError); |
|
67 |
|
68 //implementation of pure virtual inherited from MMsvImapConnectionObserver |
|
69 virtual void HandleImapConnectionEvent(TImapConnectionEvent aConnectionState); |
|
70 private: |
|
71 |
|
72 enum TIMAPClientState |
|
73 { |
|
74 EFetch=0, |
|
75 EDisconnect, |
|
76 EComplete |
|
77 }; |
|
78 |
|
79 CEmailAccounts* iAccounts; |
|
80 TImapAccount iImapAccount; |
|
81 CMsvSession* iSession; |
|
82 CBaseMtm* iClientMtm; |
|
83 CClientMtmRegistry* iClientRegistry; |
|
84 TDummySessionObserver* iSessionObserver; |
|
85 CMsvOperation* iMsvOperation; |
|
86 TIMAPClientState iState; |
|
87 CMsvEntrySelection* iSelection; |
|
88 MImapTestEventHandler& iObserver; |
|
89 TMsvId iMessageId; |
|
90 }; |
|
91 |
|
92 #endif //__T_DEF062024_IMAPCLIENT_H__ |