|
1 /* |
|
2 * Copyright (c) 2007-2008 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: Base online operation class |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef IPSPLGONLINEOPERATION_H |
|
19 #define IPSPLGONLINEOPERATION_H |
|
20 |
|
21 |
|
22 #include "ipsplgbaseoperation.h" |
|
23 |
|
24 class CMsvEntrySelection; |
|
25 class TFSMailMsgId; |
|
26 class MFSMailRequestObserver; |
|
27 class CIpsPlgTimerOperation; |
|
28 class CClientMtmRegistry; |
|
29 |
|
30 |
|
31 class MIpsPlgConnectOpCallback |
|
32 { |
|
33 public: |
|
34 virtual void CredientialsSetL( TInt aEvent )=0; |
|
35 }; |
|
36 |
|
37 /** |
|
38 * class CIpsPlgOnlineOperation |
|
39 * |
|
40 * Common base class for email online operations. |
|
41 */ |
|
42 class CIpsPlgOnlineOperation : public CIpsPlgBaseOperation |
|
43 { |
|
44 public: |
|
45 |
|
46 /** |
|
47 * |
|
48 */ |
|
49 virtual ~CIpsPlgOnlineOperation(); |
|
50 |
|
51 /** |
|
52 * |
|
53 */ |
|
54 virtual const TDesC8& ProgressL() = 0; |
|
55 |
|
56 /** |
|
57 * For reporting if DoRunL leaves |
|
58 */ |
|
59 virtual const TDesC8& GetErrorProgressL(TInt aError) = 0; |
|
60 |
|
61 /** |
|
62 * |
|
63 */ |
|
64 virtual TFSProgress GetFSProgressL() const = 0; |
|
65 |
|
66 /** |
|
67 * |
|
68 */ |
|
69 virtual TInt IpsOpType() const; |
|
70 |
|
71 |
|
72 protected: |
|
73 /** |
|
74 * C++ constructor |
|
75 */ |
|
76 // Construction. |
|
77 CIpsPlgOnlineOperation( |
|
78 CMsvSession& aMsvSession, |
|
79 TInt aPriority, |
|
80 TRequestStatus& aObserverRequestStatus, |
|
81 CIpsPlgTimerOperation& aActivityTimer, |
|
82 TFSMailMsgId aFSMailBoxId, |
|
83 MFSMailRequestObserver& aFSOperationObserver, |
|
84 TInt aFSRequestId, |
|
85 TBool aSignallingAllowed=ETrue ); |
|
86 |
|
87 /** |
|
88 * Base constructor |
|
89 */ |
|
90 void BaseConstructL(TUid aMtmType); |
|
91 |
|
92 /** |
|
93 * From CActive |
|
94 */ |
|
95 virtual void DoCancel(); |
|
96 |
|
97 /** |
|
98 * From CActive |
|
99 */ |
|
100 virtual void RunL(); |
|
101 |
|
102 /** |
|
103 * From CActive |
|
104 */ |
|
105 virtual void DoRunL() = 0; |
|
106 |
|
107 /** |
|
108 * From CActive |
|
109 */ |
|
110 virtual TInt RunError( TInt aError ); |
|
111 |
|
112 /** |
|
113 * Completes observer with status aStatus |
|
114 * @param aStatus: Status of the operation. |
|
115 * Override if needed to complete with other status than KErrNone. |
|
116 */ |
|
117 void CompleteObserver( TInt aStatus = KErrNone ); |
|
118 |
|
119 /** |
|
120 * |
|
121 */ |
|
122 void CompleteThis(); |
|
123 |
|
124 |
|
125 // REVIEW: is there any good reason for next two methods |
|
126 /** |
|
127 * |
|
128 */ |
|
129 void InvokeClientMtmAsyncFunctionL( |
|
130 TInt aFunctionId, |
|
131 TMsvId aEntryId, |
|
132 TMsvId aContextId, |
|
133 const TDesC8& aParams=KNullDesC8); |
|
134 |
|
135 /** |
|
136 * |
|
137 */ |
|
138 void InvokeClientMtmAsyncFunctionL( |
|
139 TInt aFunctionId, |
|
140 const CMsvEntrySelection& aSel, |
|
141 TMsvId aContextId, |
|
142 const TDesC8& aParams=KNullDesC8); |
|
143 |
|
144 /** |
|
145 * |
|
146 */ |
|
147 //virtual TInt GetEngineProgress( const TDesC8& aProgress ); |
|
148 |
|
149 protected: |
|
150 |
|
151 /** |
|
152 * |
|
153 */ |
|
154 void SignalFSObserver( TInt aStatus ); |
|
155 |
|
156 protected: |
|
157 // REVIEW: should tell whether the attributes are owned or not |
|
158 // REVIEW: CMsvOperation already has similar attribute, change the name |
|
159 CIpsPlgTimerOperation* iActivityTimer; |
|
160 CBaseMtm* iBaseMtm; |
|
161 CClientMtmRegistry* iMtmReg; |
|
162 // The sub-operation. |
|
163 CMsvOperation* iOperation; |
|
164 // Status of current operation |
|
165 TInt iError; |
|
166 // Return this if iOperation==NULL. |
|
167 TBuf8<1> iDummyProg; |
|
168 |
|
169 |
|
170 //we need to be able to prevent completion signal |
|
171 //to framework, because online operations |
|
172 //may be nested ( fetch uses connect operation ) |
|
173 //and we don't want sub operation to signal completion. |
|
174 TBool iSignallingAllowed; |
|
175 //not owned |
|
176 MFSMailRequestObserver& iFSOperationObserver; |
|
177 |
|
178 |
|
179 }; |
|
180 |
|
181 |
|
182 #endif//IPSPLGONLINEOPERATION_H |