1 /* |
1 /* |
2 * Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). |
2 * Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). |
3 * All rights reserved. |
3 * All rights reserved. |
4 * This component and the accompanying materials are made available |
4 * This component and the accompanying materials are made available |
5 * under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members |
5 * under the terms of "Eclipse Public License v1.0" |
6 * which accompanies this distribution, and is available |
6 * which accompanies this distribution, and is available |
7 * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
8 * |
8 * |
9 * Initial Contributors: |
9 * Initial Contributors: |
10 * Nokia Corporation - initial contribution. |
10 * Nokia Corporation - initial contribution. |
11 * |
11 * |
12 * Contributors: |
12 * Contributors: |
13 * |
13 * |
14 * Description: CSenServiceConnection offers public API for |
14 * Description: CSenServiceConnection offers public API for |
15 * service consumers to access invocable services, |
15 * service consumers to access invocable services, |
16 * as a part of the Web Services Framework (WSF). |
16 * as a part of the Web Services Framework (WSF). |
17 * |
17 * |
18 */ |
18 */ |
|
19 |
|
20 |
|
21 |
19 |
22 |
20 |
23 |
21 |
24 |
22 |
25 |
23 |
26 |
73 |
76 |
74 const TInt KErrSenHostNotAvailable = -30318; |
77 const TInt KErrSenHostNotAvailable = -30318; |
75 |
78 |
76 const TInt KErrSenAuthenticationFault = -30319; |
79 const TInt KErrSenAuthenticationFault = -30319; |
77 const TInt KErrSenNoEndUserPermission = -30321; |
80 const TInt KErrSenNoEndUserPermission = -30321; |
78 |
81 const TInt KErrSenBrandNotSupported = -30322; |
79 |
82 |
80 const TInt KSenConnectionStatusCreateFailed = -1; // post-state |
83 const TInt KSenConnectionStatusCreateFailed = -1; // post-state |
81 const TInt KSenConnectionStatusNew = 0; // post-state |
84 const TInt KSenConnectionStatusNew = 0; // post-state |
82 const TInt KSenConnectionStatusReady = 1; // post-state |
85 const TInt KSenConnectionStatusReady = 1; // post-state |
83 const TInt KSenConnectionStatusExpired = 2; // post-state |
86 const TInt KSenConnectionStatusExpired = 2; // post-state |
102 const TInt KSenTransportStatusCodeVtcpUnavailable = 2005; // KSenTransportStatusCodeOffsetBaseVtcp +5 |
105 const TInt KSenTransportStatusCodeVtcpUnavailable = 2005; // KSenTransportStatusCodeOffsetBaseVtcp +5 |
103 |
106 |
104 // FORWARD DECLARATIONS |
107 // FORWARD DECLARATIONS |
105 class CSenServicePattern; |
108 class CSenServicePattern; |
106 class CSenIdentityProvider; |
109 class CSenIdentityProvider; |
|
110 |
|
111 struct TSenDataTrafficDetails |
|
112 { |
|
113 public: |
|
114 |
|
115 TSenDataTrafficDetails():iTotalBytesSent(0), |
|
116 iTotalBytesRecieved(0) |
|
117 { |
|
118 } |
|
119 |
|
120 TBool operator==(TSenDataTrafficDetails& rhs) |
|
121 { |
|
122 if( (this->iTotalBytesSent == rhs.iTotalBytesSent) && |
|
123 (this->iTotalBytesRecieved == rhs.iTotalBytesRecieved) ) |
|
124 return ETrue; |
|
125 else |
|
126 return EFalse; |
|
127 } |
|
128 |
|
129 TSenDataTrafficDetails& operator=(TSenDataTrafficDetails& rhs) |
|
130 { |
|
131 if(*this == rhs) |
|
132 return *this; |
|
133 this->iTotalBytesSent = rhs.iTotalBytesSent; |
|
134 this->iTotalBytesRecieved = rhs.iTotalBytesRecieved; |
|
135 return *this; |
|
136 } |
|
137 |
|
138 TSenDataTrafficDetails& operator+=(TSenDataTrafficDetails& rhs) |
|
139 { |
|
140 this->iTotalBytesSent += rhs.iTotalBytesSent; |
|
141 this->iTotalBytesRecieved += rhs.iTotalBytesRecieved; |
|
142 return *this; |
|
143 } |
|
144 |
|
145 TUint iTotalBytesSent ; |
|
146 TUint iTotalBytesRecieved ; |
|
147 private: |
|
148 TAny* iReserved; |
|
149 }; |
|
150 |
|
151 struct TSenDataTrafficOperations |
|
152 { |
|
153 public: |
|
154 TSenDataTrafficOperations(): iReset(EFalse) |
|
155 { |
|
156 } |
|
157 TBool iReset; |
|
158 private: |
|
159 TAny* iReserved; |
|
160 }; |
107 |
161 |
108 // CLASS DECLARATION |
162 // CLASS DECLARATION |
109 |
163 |
110 /** |
164 /** |
111 * The class for connecting to service providers |
165 * The class for connecting to service providers |
1175 * Registers observer of BLOBs transfer progress. |
1229 * Registers observer of BLOBs transfer progress. |
1176 * |
1230 * |
1177 * @param aFilesObserver Implementation of transfer progress observer. |
1231 * @param aFilesObserver Implementation of transfer progress observer. |
1178 */ |
1232 */ |
1179 |
1233 |
|
1234 virtual void DataTrafficDetails(TSenDataTrafficDetails& aDetails, |
|
1235 TSenDataTrafficOperations& aOperations) = 0; |
|
1236 |
|
1237 /** |
|
1238 * Service Consumer can call this method to acquire a new interface, |
|
1239 * which is identified by unique ID (UID). |
|
1240 * @param aUID is the UID of the interface being requested |
|
1241 * @return TAny* pointer to the interface, or if no interface to |
|
1242 * given UID exists, function returns NULL. In typical cases, returned |
|
1243 * pointer should be cast to some preknown M-class pointer (the actual |
|
1244 * new interface). |
|
1245 * |
|
1246 * List of currently supported interfaces: |
|
1247 * KSenInterfaceUidAlrServiceConnection => MSenAlrServiceConnection |
|
1248 */ |
|
1249 virtual TAny* InterfaceByUid( TUid aUID ) = 0; |
|
1250 |
|
1251 /* |
|
1252 * Sends a RFile Handle to the service. |
|
1253 * the Identity Based Web Service Framework (which ID is "ID-WSF") |
|
1254 * and the Basic Web Services Framework (which ID is "WS-I"). |
|
1255 * Please note, that ID-WSF does NOT support this method. |
|
1256 * SendL(const TDesC8&). |
|
1257 * So, currently this method is supported only in Basic Web Services framework. |
|
1258 * @param aMessage The service specific message - a full SOAP envelope |
|
1259 * @return Transaction ID (positive integer) or error code, if method fails. |
|
1260 * Transaction ids: |
|
1261 * Positive integers SendL returns transaction ID of the request, |
|
1262 * which can be later on utilized inside |
|
1263 * HandleMessageL and HandleErrorL methods, |
|
1264 * in order to map request and its response |
|
1265 * together. |
|
1266 * Error codes: |
|
1267 * KErrSenNotInitialized Connection has not been initialized. |
|
1268 * KErrArgument RFile handle is NULL ( Specified file doesnot exist) |
|
1269 * KErrSenServiceConnectionBusy Connection is already busy with another |
|
1270 * request. |
|
1271 * KErrConnectionInitializing Connection is still initializing and |
|
1272 * cannot yet process commands. |
|
1273 * KErrConnectionExpired Connection is expired and needs to be |
|
1274 * renewed. |
|
1275 * KErrSubmitting An internal error has occurred. |
|
1276 * KErrNoMemory Not enough memory to process the |
|
1277 * message. |
|
1278 * Other error codes are system-wide Symbian error codes. |
|
1279 */ |
|
1280 virtual TInt SendL(RFile& aFileHandle) = 0; |
|
1281 |
|
1282 /* |
|
1283 * Submits a RFile Handle to the service. This is a synchronous call, |
|
1284 * returning a SOAP envelope that was received from the service. |
|
1285 * There are two default frameworks available: |
|
1286 * @param aResponseTo This is a ref-to-pointer where response |
|
1287 * from the service will be allocated. If the |
|
1288 * complete server messages mode is set to OFF, |
|
1289 * then only <Body> element will be returned, |
|
1290 * otherwise a complete SOAP envelope. |
|
1291 * The ownership of aResponse is transfered to |
|
1292 * the caller. |
|
1293 * @return status/error code |
|
1294 * Status codes: |
|
1295 * KErrNone ok |
|
1296 * Error codes: |
|
1297 * KErrSenNotInitialized Connection has not been initialized. |
|
1298 * KErrSenServiceConnectionBusy Connection is already busy with another |
|
1299 * request. |
|
1300 * KErrConnectionInitializing Connection is still initializing and |
|
1301 * cannot yet process commands. |
|
1302 * KErrConnectionExpired Connection is expired and needs to be |
|
1303 * renewed. |
|
1304 * KErrSubmitting An internal error has occurred. |
|
1305 * KErrNoMemory Not enough memory to process the |
|
1306 * message. |
|
1307 * KErrArgument RFile handle is NULL ( Specified file doesnot exist) |
|
1308 * KErrSenInternal Internal state is invalid. |
|
1309 * Other error codes are system-wide Symbian error codes. |
|
1310 */ |
|
1311 virtual TInt SubmitL(RFile& aFileHandle, HBufC8*& aResponseTo) = 0; |
|
1312 |
1180 protected: |
1313 protected: |
1181 |
1314 |
1182 /** |
1315 /** |
1183 * C++ default constructor. |
1316 * C++ default constructor. |
1184 */ |
1317 */ |