|
1 /* |
|
2 * Copyright (c) 2004 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: This file defines an interface for sending and receiving data |
|
15 * from CSP session as well as opening and closing methods. |
|
16 * |
|
17 * |
|
18 */ |
|
19 |
|
20 #ifndef WV_CSPSESSION_API_H |
|
21 #define WV_CSPSESSION_API_H |
|
22 |
|
23 // INCLUDES |
|
24 #include "impsservercommon.h" |
|
25 |
|
26 // FORWARD DECLARATRIONS |
|
27 class CImpsFields; |
|
28 class TImpsServices; |
|
29 |
|
30 // CLASS DECLARATIONS |
|
31 |
|
32 /** |
|
33 * MImpsDataReceiver |
|
34 * |
|
35 * Abstract interface for handling responses from CSP Sessoin. |
|
36 */ |
|
37 |
|
38 class MImpsCSPSession |
|
39 { |
|
40 |
|
41 public: // New functions |
|
42 |
|
43 /** |
|
44 * Login WV server |
|
45 * @param aUser User-id (max 50 characters) |
|
46 * @param aPsw password (max 50 characters) |
|
47 * @param aClientId client id used to log in server. |
|
48 * The client-id having prefix '+' or number is considered |
|
49 * as MSISDN number (E.164), |
|
50 * otherwise it is handled as URL (max 200 character). |
|
51 * This MAY be used for CIR addressing if SAP is not able to |
|
52 * detect MSISDN number in other way |
|
53 * @param aServer SAP URI, may include port number |
|
54 * @param aAP CommDb id for access point |
|
55 * @param aAnyAP ETrue if any other open access point is accepted |
|
56 * @param aKey1 future option |
|
57 * @param aKey2 future option |
|
58 * @param aExpiryTime expiry time of this request |
|
59 * @param aReactive reactive presence auth negotiation |
|
60 * @return TID |
|
61 */ |
|
62 virtual TPtrC LoginL( |
|
63 const TDesC& aUser, |
|
64 const TDesC& aPassword, |
|
65 const TDesC& aClientId, |
|
66 const TDesC& aSAP, |
|
67 TUint32 aAP, |
|
68 const TDesC& aKey1, |
|
69 const TDesC& aKey2, |
|
70 TTime aExpiryTime, |
|
71 TBool aReactive ) = 0; |
|
72 |
|
73 /** |
|
74 * Logout SAP |
|
75 * @param aCancel ETrue if login cancel functionaliy wanted |
|
76 * @return TID |
|
77 */ |
|
78 virtual TPtrC LogoutL( TBool aCancel ) = 0; |
|
79 |
|
80 /** |
|
81 * Receive terminal off_line/on_line indication |
|
82 * @param aParam True if connections allowed, else False. |
|
83 */ |
|
84 virtual void SetConnAllowed( TBool aParam ) = 0; |
|
85 |
|
86 /** |
|
87 * CIR message handler. OPa: Both server and MSession. |
|
88 * @param aCookie entire session cookie message |
|
89 */ |
|
90 virtual void CirMessageL( const TDesC8& aCookie ) = 0; |
|
91 |
|
92 /** |
|
93 * Send data from session current data to WV server. |
|
94 * Login must have been done. |
|
95 * @param aFields data |
|
96 * @param aExpiry expiry time in seconds, if 0, then time in gerarated. |
|
97 * @param aOwnerCh OUTPUT ETrue is ownership of aFields is changed |
|
98 * @return transaction-id |
|
99 */ |
|
100 virtual TPtrC SendDataL( |
|
101 CImpsFields* aFields, |
|
102 TInt aExpiry, |
|
103 TBool& aOwnerChange ) = 0; |
|
104 |
|
105 /** |
|
106 * Callback for response from transport watcher |
|
107 * @param aDataPtr data received. It must be set to NULL after data is consumed. |
|
108 */ |
|
109 virtual void TransportResponseL( HBufC8** aDataPtr ) = 0; |
|
110 |
|
111 /** |
|
112 * Callback for error from transport watcher |
|
113 * @param aTID transaction-id, 0 means undefined |
|
114 * @param aError error code. KImpsErrorNoIAP means lost PDP context. |
|
115 */ |
|
116 virtual void TransportErrorL( |
|
117 const TDesC& aTID, |
|
118 TInt aError ) = 0; |
|
119 |
|
120 /** |
|
121 * Cancel active data channel requests. |
|
122 */ |
|
123 virtual void CancelData() = 0; |
|
124 |
|
125 /** |
|
126 * Close All. MServer::TransportStatus( NO_IAP ) is the result. |
|
127 */ |
|
128 virtual void CloseAll() = 0; |
|
129 |
|
130 /** |
|
131 * Close PDP context only. |
|
132 */ |
|
133 virtual void ClosePDP() = 0; |
|
134 |
|
135 /** |
|
136 * Open PDP context only. |
|
137 * @return error code |
|
138 */ |
|
139 virtual TInt OpenPDP() = 0; |
|
140 |
|
141 /** |
|
142 * Transport status change indicator |
|
143 * @param aConnectionState new status, on_line, off_line or no_iap |
|
144 */ |
|
145 virtual void TransportStatus( |
|
146 EImpsInternalStatus aConnectionState ) = 0; |
|
147 |
|
148 /** |
|
149 * Get next message to be sent. |
|
150 * Validates first the expiry time and discards a message is necessary. |
|
151 */ |
|
152 virtual void GetNextMessageL() = 0; |
|
153 |
|
154 /** |
|
155 * Send Poll request |
|
156 */ |
|
157 virtual void SendPollL() = 0; |
|
158 |
|
159 /** |
|
160 * Send KeepAlive request |
|
161 * @return TID of KeepAlive request |
|
162 */ |
|
163 virtual TPtrC SendAliveL( ) = 0; |
|
164 |
|
165 /** |
|
166 * Send KeepAlive request when GPRS resumes |
|
167 */ |
|
168 virtual void SendAliveInResume( ) = 0; |
|
169 |
|
170 /** |
|
171 * Is the server logging in curretly |
|
172 * @return ETrue if log in active |
|
173 */ |
|
174 virtual TBool IsLogging() = 0; |
|
175 |
|
176 /** |
|
177 * Is the server logged in |
|
178 * @return ETrue if logged in |
|
179 */ |
|
180 virtual TBool IsLogged() = 0; |
|
181 |
|
182 /** |
|
183 * Is the CSP session capabilities negotiated |
|
184 * @return ETrue if negotiated |
|
185 */ |
|
186 virtual TBool IsNegotiated() = 0; |
|
187 |
|
188 /** |
|
189 * Current User-id accessor |
|
190 * @return UserId |
|
191 */ |
|
192 virtual TPtrC UserId() = 0; |
|
193 |
|
194 /** |
|
195 * Current SAP accessor |
|
196 * @return SAP |
|
197 */ |
|
198 virtual TPtrC SAP() = 0; |
|
199 |
|
200 /** |
|
201 * Current CSP Session-id accessor |
|
202 * @return Session-id |
|
203 */ |
|
204 virtual TPtrC SID() = 0; |
|
205 |
|
206 /** |
|
207 * Current CSP Session password accessor |
|
208 * @return password |
|
209 */ |
|
210 virtual TPtrC Password() = 0; |
|
211 |
|
212 /** |
|
213 * active services accessor |
|
214 * @return current WV services |
|
215 */ |
|
216 virtual TImpsServices* Services() = 0; |
|
217 |
|
218 /* |
|
219 * Is engine shutting down |
|
220 * @return ETrue if shutting down |
|
221 */ |
|
222 virtual TBool IsShuttingDown() = 0; |
|
223 |
|
224 /** |
|
225 * Is there pendig login operation |
|
226 * @return ETrue if yes |
|
227 */ |
|
228 virtual TBool IsPendingLogin() = 0; |
|
229 |
|
230 /** |
|
231 * Cancel a transaction. OPa: Server myös. |
|
232 * Removes request from server's transaction queue and |
|
233 * asks transport to cancel the request too. |
|
234 * @param aTID transaction id to identify the request. |
|
235 */ |
|
236 virtual void CancelTrans( const TDesC& aTID ) = 0; |
|
237 |
|
238 /** |
|
239 * Send so many queued client requests as possible to transport. |
|
240 */ |
|
241 virtual void DoSendAllQueuedL() = 0; |
|
242 |
|
243 /** |
|
244 * Do the internal logout routines immediately |
|
245 */ |
|
246 virtual void DoLogout( ) = 0; |
|
247 |
|
248 /** |
|
249 * Ip-Cir-channel opened callback |
|
250 */ |
|
251 virtual void CirChOpened() = 0; |
|
252 |
|
253 /** |
|
254 * Ip-Cir-channel error callback |
|
255 */ |
|
256 virtual void CirChError() = 0; |
|
257 |
|
258 /** |
|
259 * Check exiparation of current requests and asks server to |
|
260 * remove requests from client sessions if necessary |
|
261 * @param sType service types |
|
262 * @param aExpiry expiration time for requests |
|
263 */ |
|
264 virtual void CheckExpiry( |
|
265 TImpsEventType aType, |
|
266 const TTime aExpiry ) = 0; |
|
267 |
|
268 /** |
|
269 * Destructor |
|
270 */ |
|
271 virtual void Destroy() = 0; |
|
272 |
|
273 /** |
|
274 * Maximum parser size |
|
275 */ |
|
276 virtual TInt MaxParserSize() = 0; |
|
277 |
|
278 /** |
|
279 * Maximum IM message size |
|
280 */ |
|
281 virtual TInt MaxMessageSize() = 0; |
|
282 }; |
|
283 |
|
284 |
|
285 #endif // ?INCLUDE_H |
|
286 |
|
287 // End of File |