|
1 /* |
|
2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * Base class for operations requiring connection |
|
16 * |
|
17 */ |
|
18 |
|
19 #ifndef __IMAP4CONNECTEDOP_H__ |
|
20 #define __IMAP4CONNECTEDOP_H__ |
|
21 |
|
22 #include <imapset.h> |
|
23 #include <imapcmds.h> |
|
24 #include <ImumInternalApi.h> // CImumInternalApi |
|
25 |
|
26 #include "IMAPPRGR.H" |
|
27 #include "ImapConnectionOp.h" |
|
28 #include "ImumDiskSpaceObserverOperation.h" |
|
29 #include "Imap4MtmUi.hrh" // KImpuIMAPFolderNameLength |
|
30 |
|
31 /** |
|
32 * Base class for operations requiring connection. |
|
33 */ |
|
34 class CImap4ConnectedOp : |
|
35 public CImumDiskSpaceObserverOperation |
|
36 { |
|
37 public: |
|
38 /** |
|
39 * |
|
40 */ |
|
41 virtual ~CImap4ConnectedOp(); |
|
42 |
|
43 /** |
|
44 * |
|
45 */ |
|
46 virtual const TDesC8& ProgressL(); |
|
47 |
|
48 /** |
|
49 * |
|
50 */ |
|
51 virtual const TDesC8& GetErrorProgressL(TInt aError); |
|
52 |
|
53 protected: |
|
54 |
|
55 /** |
|
56 * |
|
57 */ |
|
58 CImap4ConnectedOp( |
|
59 CImumInternalApi& aMailboxApi, |
|
60 TRequestStatus& aStatus, |
|
61 MMsvProgressReporter& aReporter, |
|
62 TMsvId aServiceId ); |
|
63 |
|
64 /** |
|
65 * @param aFuncId, defaulted to 'KErrNotFound' |
|
66 */ |
|
67 void ConstructL( |
|
68 TInt aFuncId = KErrNotFound ); |
|
69 |
|
70 /** |
|
71 * |
|
72 */ |
|
73 void StartL(); |
|
74 |
|
75 /** |
|
76 * |
|
77 */ |
|
78 virtual void RunL(); |
|
79 |
|
80 /** |
|
81 * From CActive |
|
82 */ |
|
83 virtual void DoCancel(); |
|
84 |
|
85 /** |
|
86 * From CActive |
|
87 */ |
|
88 virtual void DoRunL(); |
|
89 |
|
90 /** |
|
91 * |
|
92 */ |
|
93 virtual void DoConnectedOpL() = 0; |
|
94 |
|
95 /** |
|
96 * |
|
97 */ |
|
98 virtual const TDesC8& ConnectedOpErrorProgressL(TInt aError) = 0; |
|
99 |
|
100 /** |
|
101 * |
|
102 */ |
|
103 void DoConnectL(); |
|
104 |
|
105 /** |
|
106 * |
|
107 */ |
|
108 void DoDisconnectL(); |
|
109 |
|
110 protected: |
|
111 TBool iDisconnect; |
|
112 TDesC8* iConnectedOpErrorProgress; |
|
113 TPckgBuf<TImap4CompoundProgress> iProgressBuf; |
|
114 CImapConnectionOp::TImapConnectionType iConnectionCompletionState; |
|
115 enum TConnectedOpState { EStateIdle, EStateConnecting, EStateDoingOp, EStateDisconnecting }; |
|
116 TConnectedOpState iState; |
|
117 |
|
118 }; |
|
119 |
|
120 |
|
121 |
|
122 #endif |