24 |
24 |
25 /** |
25 /** |
26 * Connect operation. |
26 * Connect operation. |
27 * Encapsulates connection validation. |
27 * Encapsulates connection validation. |
28 */ |
28 */ |
29 class CIpsPlgPop3ConnectOp : |
29 NONSHARABLE_CLASS ( CIpsPlgPop3ConnectOp ) : |
30 public CIpsPlgOnlineOperation, |
30 public CIpsPlgOnlineOperation |
31 public MIpsPlgConnectOpCallback |
31 // public MIpsPlgConnectOpCallback <qmail> not used any more |
32 { |
32 { |
33 public://from MIpsPlgConnectOpCallback |
33 // <qmail> MIpsPlgConnectOpCallback not used any more |
34 |
34 public: |
35 void CredientialsSetL( TInt aEvent ); |
|
36 public: |
|
37 |
35 |
38 /** |
36 /** |
39 * |
37 * NewL |
40 */ |
38 * @param aMsvSession client/server session to MsvServer |
|
39 * @param aObserverRequestStatus client status |
|
40 * @param aService serviceId of the mailbox |
|
41 * @param aForcePopulate whether to populate fetched messages |
|
42 * @param aActivityTimer mailbox specific activity timer |
|
43 * @param aFSMailBoxId specifies mailbox |
|
44 * @param aFSOperationObserver observer callback pointer |
|
45 * @param aFSRequestId client assigned identifier for the request instance |
|
46 * @param aEventHandler event handler for sending sync events |
|
47 * @param aSignallingAllowed for asynchronous request response message |
|
48 * @param aFetchWillFollow used when connection must be kept open |
|
49 * @return new instance of the class |
|
50 */ |
|
51 // <qmail> MFSMailRequestObserver& changed to pointer |
|
52 // <qmail> aSignallingAllowed parameter added |
|
53 // <qmail> aFetchWillFollow parameter added |
41 static CIpsPlgPop3ConnectOp* NewL( |
54 static CIpsPlgPop3ConnectOp* NewL( |
42 CMsvSession& aMsvSession, |
55 CMsvSession& aMsvSession, |
43 TRequestStatus& aObserverRequestStatus, |
56 TRequestStatus& aObserverRequestStatus, |
44 TMsvId aService, |
57 TMsvId aService, |
45 TBool aForcePopulate, |
58 TBool aForcePopulate, |
46 CIpsPlgTimerOperation& aActivityTimer, |
59 CIpsPlgTimerOperation& aActivityTimer, |
47 TFSMailMsgId aFSMailBoxId, |
60 TFSMailMsgId aFSMailBoxId, |
48 MFSMailRequestObserver& aFSOperationObserver, |
61 MFSMailRequestObserver* aFSOperationObserver, |
49 TInt aFSRequestId, |
62 TInt aFSRequestId, |
50 CIpsPlgEventHandler* aEventHandler=NULL, |
63 CIpsPlgEventHandler* aEventHandler, |
51 TBool aSignallingAllowed=ETrue ); |
64 TBool aSignallingAllowed=ETrue, |
|
65 TBool aFetchWillFollow=EFalse ); |
52 |
66 |
53 /** |
67 /** |
54 * |
68 * |
55 */ |
69 */ |
56 virtual ~CIpsPlgPop3ConnectOp(); |
70 virtual ~CIpsPlgPop3ConnectOp(); |
57 |
71 |
58 /** |
72 /** |
59 * |
73 * From CIpsPlgBaseOperation |
|
74 * For reporting if DoRunL leaves |
60 */ |
75 */ |
61 const TDesC8& GetErrorProgressL(TInt aError); |
76 const TDesC8& GetErrorProgressL(TInt aError); |
62 |
77 |
63 /** |
78 /** |
64 * |
79 * |
65 */ |
80 */ |
66 TFSProgress GetFSProgressL() const; |
81 TFSProgress GetFSProgressL() const; |
67 |
82 |
|
83 /** |
|
84 * From MsvOperation |
|
85 * Gets information on the progress of the operation |
|
86 * (see MsvOperation header) |
|
87 */ |
|
88 // <qmail> moved to 'public:'as defined so in base class |
|
89 const TDesC8& ProgressL(); |
|
90 // <qmail> Connected() used from baseclass |
|
91 |
|
92 // <qmail> change ret val type |
68 /** |
93 /** |
69 * |
94 * Returns operation type |
70 */ |
95 */ |
71 TBool Connected() const; |
96 TIpsOpType IpsOpType() const; |
|
97 // </qmail> |
|
98 |
|
99 TInt GetOperationErrorCodeL( ); |
72 |
100 |
73 /** |
|
74 * |
|
75 */ |
|
76 virtual TInt IpsOpType() const; |
|
77 |
|
78 protected: |
101 protected: |
79 |
102 |
80 /** |
|
81 * |
|
82 */ |
|
83 const TDesC8& ProgressL(); |
|
84 |
|
85 /** |
103 /** |
86 * |
104 * |
87 */ |
105 */ |
88 void DoCancel(); |
106 void DoCancel(); |
89 |
107 |
90 /** |
108 /** |
91 * From CActive |
109 * From CActive |
92 */ |
110 */ |
93 void DoRunL(); |
111 void DoRunL(); |
94 |
112 |
95 /** |
|
96 * |
|
97 */ |
|
98 TInt GetOperationErrorCodeL( ); |
|
99 |
|
100 private: |
113 private: |
101 |
114 |
102 /** |
115 /** |
103 * |
116 * |
104 */ |
117 */ |
|
118 // <qmail> MFSMailRequestObserver& changed to pointer |
|
119 // <qmail> aSignallingAllowed parameter added |
|
120 // <qmail> aFetchWillFollow parameter added |
105 CIpsPlgPop3ConnectOp( |
121 CIpsPlgPop3ConnectOp( |
106 CMsvSession& aMsvSession, |
122 CMsvSession& aMsvSession, |
107 TRequestStatus& aObserverRequestStatus, |
123 TRequestStatus& aObserverRequestStatus, |
108 TMsvId aServiceId, |
124 TMsvId aServiceId, |
109 TBool aForcePopulate, |
125 TBool aForcePopulate, |
110 CIpsPlgTimerOperation& aActivityTimer, |
126 CIpsPlgTimerOperation& aActivityTimer, |
111 TFSMailMsgId aFSMailBoxId, |
127 TFSMailMsgId aFSMailBoxId, |
112 MFSMailRequestObserver& aFSOperationObserver, |
128 MFSMailRequestObserver* aFSOperationObserver, |
113 TInt aFSRequestId, |
129 TInt aFSRequestId, |
114 CIpsPlgEventHandler* aEventHandler, |
130 CIpsPlgEventHandler* aEventHandler, |
115 TBool aSignallingAllowed ); |
131 TBool aSignallingAllowed, |
|
132 TBool aFetchWillFollow ); |
116 |
133 |
117 /** |
134 /** |
118 * |
135 * |
119 */ |
136 */ |
120 void ConstructL(); |
137 void ConstructL(); |
121 |
138 |
|
139 // <qmail> |
122 /** |
140 /** |
123 * |
141 * Do.. functions handle certain state of this operation |
124 */ |
142 */ |
125 void DoConnectL(); |
143 void DoConnectL(); |
126 |
|
127 /** |
|
128 * |
|
129 * |
|
130 */ |
|
131 void DoPopulateL(); |
144 void DoPopulateL(); |
132 /** |
145 // <qmail> removed TBool ValidateL() (did nothing) |
133 * |
146 // <qmail> removed void DoQueryPasswordL() not used any more |
134 */ |
147 // <qmail> DoDisconnect -> DoDisconnectL |
135 TBool ValidateL(); |
148 void DoDisconnectL(); |
136 |
149 // </qmail> |
137 /** |
|
138 * Send user password query request to CIpsPlgEventHandler |
|
139 * @return ETrue - if query send |
|
140 */ |
|
141 TBool QueryUserPassL(); |
|
142 |
150 |
143 |
151 // <qmail> removed flag methods as they were not used or even defined anywhere |
144 /** |
152 |
145 * |
153 // <qmail> new function |
146 */ |
154 /** |
147 inline void SetFlag(TUint32 aFlag); |
155 * Reads populate limit from account's settings and converts it to member variable |
148 |
156 */ |
149 /** |
157 TInt GetPopulateLimitFromSettingsL(); |
150 * |
|
151 */ |
|
152 inline void UnsetFlag(TUint32 aFlag); |
|
153 |
|
154 /** |
|
155 * |
|
156 */ |
|
157 inline TBool FlagIsSet(TUint32 aFlag) const; |
|
158 |
|
159 private: // Data |
158 private: // Data |
160 |
159 |
161 enum TPopConnectStates |
160 enum TOperationState |
162 { |
161 { |
163 EStartConnect, |
162 EStartConnect, |
164 EConnected, |
163 EConnected, |
165 EPopulate, |
164 EPopulate, |
166 EQueryingDetails, |
165 // <qmail> removed EQueryingDetails/EQueryingDetailsBusy state |
167 EQueryingDetailsBusy, |
166 // <qmail> new EDisconnecting state |
|
167 EDisconnecting, |
|
168 // <qmail> removed EErrInvalidDetails, |
168 EIdle |
169 EIdle |
169 }; |
170 }; |
170 |
171 |
171 TInt iState; |
172 TOperationState iState; |
172 CMsvEntry* iEntry; |
173 // <qmail> removed iEntry; |
173 TPckgBuf<TPop3Progress> iProgress; |
174 TPckgBuf<TPop3Progress> iProgress; |
174 TInt iPopulateLimit; |
175 // <qmail> removed iPopulateLimit; |
175 TBool iForcePopulate; |
176 TBool iForcePopulate; |
176 CMsvEntrySelection* iSelection; |
177 // <qmail> removed iSelection; |
177 // not owned |
178 CIpsPlgEventHandler* iEventHandler; // not owned |
178 CIpsPlgEventHandler* iEventHandler; |
179 // <qmail> iAlreadyConnected removed |
179 // set to true if connection is already exists |
180 // <qmail> |
180 TBool iAlreadyConnected; |
181 TBool iFetchWillFollow; |
|
182 // </qmail> |
181 }; |
183 }; |
182 |
184 |
183 #endif |
185 #endif |