|
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_IMAPNEWMSGDURINGSYNCIDLECANCELCLIENT_H__ |
|
17 #define __T_IMAPNEWMSGDURINGSYNCIDLECANCELCLIENT_H__ |
|
18 |
|
19 #include <e32base.h> |
|
20 #include <msvapi.h> |
|
21 #include <imapconnectionobserver.h> |
|
22 #include "cspoofserver.h" |
|
23 #include <cemailaccounts.h> |
|
24 |
|
25 class CClientMtmRegistry; |
|
26 |
|
27 // For loading the serial comms device drivers |
|
28 #if defined (__WINS__) |
|
29 #define PDD_NAME _L("ECDRV") |
|
30 #define LDD_NAME _L("ECOMM") |
|
31 #else |
|
32 #define PDD_NAME _L("EUART1") |
|
33 #define LDD_NAME _L("ECOMM") |
|
34 #endif |
|
35 |
|
36 class TDummySessionObserver : public CBase, public MMsvSessionObserver |
|
37 { |
|
38 public: |
|
39 void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* aArg3); |
|
40 }; |
|
41 |
|
42 class CImapNewMsgDuringSyncIdleCancelClient : public CActive, public MMsvImapConnectionObserver |
|
43 { |
|
44 public: |
|
45 IMPORT_C static CImapNewMsgDuringSyncIdleCancelClient* NewL(MImapTestEventHandler* aOwner); |
|
46 IMPORT_C static CImapNewMsgDuringSyncIdleCancelClient* NewLC(MImapTestEventHandler* aOwner); |
|
47 ~CImapNewMsgDuringSyncIdleCancelClient(); |
|
48 void StartL(); |
|
49 void CreateImapAccountL(); |
|
50 TImapAccount GetImapAccount(); |
|
51 |
|
52 private: |
|
53 CImapNewMsgDuringSyncIdleCancelClient(MImapTestEventHandler* aOwner); |
|
54 void ConstructL(); |
|
55 |
|
56 // From CActive |
|
57 virtual void DoCancel(); |
|
58 virtual void RunL(); |
|
59 virtual TInt RunError(TInt aError); |
|
60 |
|
61 //implementation of pure virtual inherited from MMsvImapConnectionObserver |
|
62 virtual void HandleImapConnectionEvent(TImapConnectionEvent aConnectionState); |
|
63 |
|
64 private: |
|
65 enum TIMAPClientState |
|
66 { |
|
67 ESync1 = 0, |
|
68 ESync2, |
|
69 EDisconnect, |
|
70 EComplete |
|
71 }; |
|
72 |
|
73 CEmailAccounts* iAccounts; |
|
74 TImapAccount iImapAccount; |
|
75 CMsvSession* iSession; |
|
76 CBaseMtm* iClientMtm; |
|
77 CClientMtmRegistry* iClientRegistry; |
|
78 TDummySessionObserver* iSessionObserver; |
|
79 CMsvOperation* iMsvOperation; |
|
80 TIMAPClientState iNextStep; |
|
81 CMsvEntrySelection* iSelection; |
|
82 MImapTestEventHandler* iOwner; |
|
83 }; |
|
84 |
|
85 #endif //__T_IMAPNEWMSGDURINGSYNCIDLECANCELCLIENT_H__ |