16 */ |
16 */ |
17 |
17 |
18 #ifndef IPSPLGONLINEOPERATION_H |
18 #ifndef IPSPLGONLINEOPERATION_H |
19 #define IPSPLGONLINEOPERATION_H |
19 #define IPSPLGONLINEOPERATION_H |
20 |
20 |
21 |
|
22 #include "ipsplgbaseoperation.h" |
21 #include "ipsplgbaseoperation.h" |
23 |
22 |
24 class CMsvEntrySelection; |
23 class CMsvEntrySelection; |
25 class TFSMailMsgId; |
24 class TFSMailMsgId; |
26 class MFSMailRequestObserver; |
25 class MFSMailRequestObserver; |
27 class CIpsPlgTimerOperation; |
26 class CIpsPlgTimerOperation; |
28 class CClientMtmRegistry; |
27 class CClientMtmRegistry; |
29 |
28 |
30 |
29 // <qmail> removing class MIpsPlgConnectOpCallback |
31 class MIpsPlgConnectOpCallback |
|
32 { |
|
33 public: |
|
34 virtual void CredientialsSetL( TInt aEvent )=0; |
|
35 }; |
|
36 |
30 |
37 /** |
31 /** |
38 * class CIpsPlgOnlineOperation |
32 * class CIpsPlgOnlineOperation |
39 * |
|
40 * Common base class for email online operations. |
33 * Common base class for email online operations. |
41 */ |
34 */ |
42 class CIpsPlgOnlineOperation : public CIpsPlgBaseOperation |
35 NONSHARABLE_CLASS ( CIpsPlgOnlineOperation ) : public CIpsPlgBaseOperation |
43 { |
36 { |
44 public: |
37 public: |
45 |
38 virtual ~CIpsPlgOnlineOperation(); |
46 /** |
|
47 * |
|
48 */ |
|
49 virtual ~CIpsPlgOnlineOperation(); |
|
50 |
39 |
51 /** |
40 // <qmail> removing virtual const TDesC8& ProgressL() = 0; as unnecessary (already in baseclass) |
52 * |
41 // <qmail> removing virtual const TDesC8& GetErrorProgressL(TInt aError) = 0; as unnecessary (already in baseclass) |
53 */ |
42 |
54 virtual const TDesC8& ProgressL() = 0; |
43 /** |
55 |
44 * return progress information about ongoing operation |
56 /** |
45 */ |
57 * For reporting if DoRunL leaves |
46 virtual TFSProgress GetFSProgressL() const = 0; |
58 */ |
47 |
59 virtual const TDesC8& GetErrorProgressL(TInt aError) = 0; |
48 // <qmail> removing IpsOpType() from here because this is abstract base class |
60 |
49 |
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: |
50 protected: |
150 |
51 |
151 /** |
52 /** |
152 * |
53 * constructor |
|
54 * @param aMsvSession reference to existing client-server session to MessageServer |
|
55 * @param aObserverRequestStatus client status |
|
56 * @param aActivityTimer reference to mailbox's online activity timer |
|
57 * @param aFSMailBoxId mailbox id |
|
58 * @param aFSOperationObserver callback interface to caller for reporting progress (completion) statuses |
|
59 * @param aFSRequestId id of the request |
|
60 * @param aSignallingAllowed for asynchronous request response message |
|
61 */ |
|
62 // <qmail> priority parameter has been removed |
|
63 // <qmail> MFSMailRequestObserver& changed to pointer |
|
64 // <qmail> aSignallingAllowed parameter has been returned |
|
65 CIpsPlgOnlineOperation( |
|
66 CMsvSession& aMsvSession, |
|
67 TRequestStatus& aObserverRequestStatus, |
|
68 CIpsPlgTimerOperation& aActivityTimer, |
|
69 TFSMailMsgId aFSMailBoxId, |
|
70 MFSMailRequestObserver* aFSOperationObserver, |
|
71 TInt aFSRequestId, |
|
72 TBool aSignallingAllowed=ETrue ); |
|
73 |
|
74 /** |
|
75 * Base constructor |
|
76 */ |
|
77 void BaseConstructL( TUid aMtmType ); |
|
78 |
|
79 protected: // From CActive |
|
80 virtual void DoCancel(); |
|
81 virtual void RunL(); |
|
82 |
|
83 /** |
|
84 * All concrete classes must implement this |
|
85 * It is called by OnlineOperation's RunL() |
|
86 */ |
|
87 virtual void DoRunL() = 0; |
|
88 |
|
89 // <qmail> removing virtual TInt RunError( TInt aError ); Not needed because RunL uses TRAP harness and never leaves |
|
90 |
|
91 /** |
|
92 * Completes observer with status aStatus |
|
93 * @param aStatus: Status of the operation. |
|
94 * Override if needed to complete with other status than KErrNone. |
|
95 */ |
|
96 void CompleteObserver( TInt aStatus = KErrNone ); |
|
97 |
|
98 /** |
|
99 * Completes "ourselves" not observer; used for starting a new round in statemachine. |
|
100 */ |
|
101 void CompleteThis(); |
|
102 |
|
103 /** |
|
104 * Sends a command to MessageServer |
|
105 * @param aFunctionId specifies the command |
|
106 * @param aEntryId specifies the entry on which the command should be executed |
|
107 * (e.g. which message entry to send) |
|
108 * @param aParams specifies other parameters needed by particular command |
|
109 */ |
|
110 // <qmail> aContextId parameter has been removed |
|
111 void InvokeClientMtmAsyncFunctionL( |
|
112 TInt aFunctionId, |
|
113 TMsvId aEntryId, |
|
114 const TDesC8& aParams=KNullDesC8); |
|
115 |
|
116 /** |
|
117 * Sends a command to MessageServer |
|
118 * @param aFunctionId specifies the command |
|
119 * @param aSel specifies a selection of entries on which the command should be executed |
|
120 * (e.g. which messages to send) |
|
121 * @param aParams specifies other parameters needed by particular command |
|
122 */ |
|
123 // <qmail> aContextId parameter has been removed |
|
124 void InvokeClientMtmAsyncFunctionL( |
|
125 TInt aFunctionId, |
|
126 const CMsvEntrySelection& aSel, |
|
127 const TDesC8& aParams=KNullDesC8); |
|
128 |
|
129 // <qmail> |
|
130 /** |
|
131 * Finds out the current connection state of the mailbox |
|
132 * @return true/false |
|
133 */ |
|
134 virtual TBool Connected() const; |
|
135 // </qmail> |
|
136 |
|
137 /** |
|
138 * Signals observer of the operation if such exists |
|
139 * @param aStatus completion status of the operation |
153 */ |
140 */ |
154 void SignalFSObserver( TInt aStatus ); |
141 void SignalFSObserver( TInt aStatus ); |
155 |
142 |
156 protected: |
143 protected: |
157 // REVIEW: should tell whether the attributes are owned or not |
144 // mailbox specific activity timer |
158 // REVIEW: CMsvOperation already has similar attribute, change the name |
|
159 CIpsPlgTimerOperation* iActivityTimer; |
145 CIpsPlgTimerOperation* iActivityTimer; |
160 CBaseMtm* iBaseMtm; |
146 CBaseMtm* iBaseMtm; |
161 CClientMtmRegistry* iMtmReg; |
147 CClientMtmRegistry* iMtmReg; |
162 // The sub-operation. |
148 // sub-operation that this operation is using currently |
163 CMsvOperation* iOperation; |
149 CMsvOperation* iSubOperation; |
164 // Status of current operation |
150 // Status of current operation |
165 TInt iError; |
151 TInt iError; |
166 // Return this if iOperation==NULL. |
152 // Return this if iSubOperation==NULL. |
167 TBuf8<1> iDummyProg; |
153 TBuf8<1> iDummyProg; |
168 |
154 |
169 |
155 // <qmail> boolean returned |
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; |
156 TBool iSignallingAllowed; |
175 //not owned |
157 // </qmail> |
176 MFSMailRequestObserver& iFSOperationObserver; |
158 MFSMailRequestObserver* iFSOperationObserver; //not owned |
177 |
|
178 |
|
179 }; |
159 }; |
180 |
160 |
181 |
161 #endif //IPSPLGONLINEOPERATION_H |
182 #endif//IPSPLGONLINEOPERATION_H |
|