Attempt to represent the S^2->S^3 header reorganisation as a series of "hg rename" operations
1 // Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // 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 // which accompanies this distribution, and is available
6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
20 @warning : This file contains Rose Model ID comments - please do not delete
23 #ifndef __THTTPEVENT_H__
24 #define __THTTPEVENT_H__
30 The HTTP UID. This UID is used for all events defined here.
34 const TUint KHTTPUid = 0x1000A441;
37 Wildcard Matching UID. When specified as part of an event then the UID event
38 part of the match will be ignored.
42 const TUint KHTTPMatchAnyEventUid = 0x1000A44C;
45 The base status code for transaction events. Any number above this but below
46 KSessionEventBaseStatus is a transaction event.
50 const TInt KTransactionEventBaseStatus = 0;
53 The base status code for transaction warning events.
57 const TInt KTransactionWarningBaseStatus = 10000;
60 The base status code for session events. Any number above this is a session
65 const TInt KSessionEventBaseStatus = 100000;
68 The base status code for session warning events.
72 const TInt KSessionWarningBaseStatus = 110000;
75 //##ModelId=3C4C18740294
78 A HTTP status message. Status messages consist of a UID and a
79 status code within that UID. Extension dlls that needs to create
80 new status messages should use their own UID and create status codes
88 /** The TStandardEvent type is used to specify a family of event types. Any
89 negative event number is used to convey error codes. All events are
90 incoming (originate with the origin server) unless otherwise indicated.
91 Outgoing messages will not be seen by the MHTTPTransactionCallback's
96 /** Used when registering filter to indicate the filter is instrested
97 in ALL events, both transaction and session events.
99 EAll = KRequestPending + 1,
100 /** Used when registering filters to indicate the filter is interested
101 in any transaction event, from any direction.
103 EAnyTransactionEvent = KRequestPending,
104 /** Used when registering filters to indicate the filter is interested
105 in any session event.
107 EAnySessionEvent = KSessionEventBaseStatus
110 /** The TTransactionEvents type defines the events that correspond to
111 transactions. Outgoing events originate from the client or from filters.
112 The clients do not send these explicitly since the API methods of
113 RHTTPTransaction do it on their behalf. Incoming events originate from
114 the protocol handler or from filters, and clients should handle these.
115 The ESucceeded and EFailed events are mutually exclusive, but one will
116 always be sent to the client as the final event for a transaction.
118 enum TTransactionEvent
120 /** The transaction is being submitted. An outgoing event.
122 ESubmit = KTransactionEventBaseStatus,
123 /** The transaction is being cancelled. An outgoing event.
125 ECancel = KTransactionEventBaseStatus + 1,
126 /** A new part of request body data is available for transmission. An
129 ENotifyNewRequestBodyPart = KTransactionEventBaseStatus + 2,
130 /** The transaction is being closed. An outgoing event.
132 EClosed = KTransactionEventBaseStatus + 3,
133 /** All the response headers have been received. An incoming event.
135 EGotResponseHeaders = KTransactionEventBaseStatus + 4,
136 /** Some (more) body data has been received (in the HTTP response). An
139 EGotResponseBodyData = KTransactionEventBaseStatus + 5,
140 /** The transaction's response is complete. An incoming event.
142 EResponseComplete = KTransactionEventBaseStatus + 6,
143 /** Some trailer headers have been received. An incoming event.
145 EGotResponseTrailerHeaders = KTransactionEventBaseStatus + 7,
146 /** The transaction has succeeded. An incoming event.
148 ESucceeded = KTransactionEventBaseStatus + 8,
149 /** The transaction has failed. This is a 'catch-all' for communicating
150 failures, and more details of the failure should have been notified
151 in previous messages or status codes. If the client could process
152 these then it is possible that it should not consider the transaction
153 a failure. For instance a browser that displays the body of 404
154 responses to the user would not consider a 404 response to be a
155 failure, as it would display it just like a 200 response even though
156 a 404 will be flagged as a 'failure'. An incoming event.
158 EFailed = KTransactionEventBaseStatus + 9,
159 /** Generated from RHTTPTransaction::Fail(). A filter has failed in a
160 way that prevents it from using the normal event mechanism to inform
161 the client of the error. This probably means it's run out of memory.
164 EUnrecoverableError = KTransactionEventBaseStatus + 10,
165 /** An event that indicates that there is too much request data to be
166 sent. The transaction will subsequently be cancelled. An incoming
169 ETooMuchRequestData = KTransactionEventBaseStatus + 11,
172 /** If the returned status code for a transaciton is either 301, 302 or 307
173 and the requested method is NOT a GET or HEAD, then the filter sends the
174 client an event ERedirectRequiresConfirmation as stated in RFC2616.
176 On receiving this event, the transaction is already setup with the redirected URI
177 and the client is required to make the decision to whether to submit the
178 transaction or close the transaction.
180 If the requested method is GET or HEAD the transaction is automatically
181 redirected and this event is not used.
183 ERedirectRequiresConfirmation = KTransactionEventBaseStatus + 12,
185 /** A transaction has been specified to use a proxy and the request
186 requires a tunnel to be establised to the origin server.
188 ENeedTunnel = KTransactionEventBaseStatus + 13,
190 /** The client wishes to view the current cipher suite.
192 EGetCipherSuite = KTransactionEventBaseStatus + 14,
194 /** The transaction's request is complete. An incoming event.
196 ERequestComplete = KTransactionEventBaseStatus + 15,
198 /**An event to signal that 100 Continue response has been received.
200 EReceived100Continue = KTransactionEventBaseStatus + 16,
202 /**An event to cancel the wait for a 100-Continue event.
204 ECancelWaitFor100Continue = KTransactionEventBaseStatus + 17,
206 /**An event of Send Timeout for a Request.
208 ESendTimeOut = KTransactionEventBaseStatus + 18,
210 /**An event of Receive Timeout for a Response.
212 EReceiveTimeOut = KTransactionEventBaseStatus + 19
216 /** The TDirection type defines the direction of an event. An outgoing event
217 originates from the client or from filters. The clients do not send these
218 explicitly since the API methods of RHTTPTransaction or RHTTPSession do
219 it on their behalf. Incoming events originate from the protocol handler
220 or from filters, and clients should handle these.
224 /** An event originating with the client (e.g. start transaction).
227 /** An event originating with the server (e.g. something received).
232 /** The TTransactionWarning type indicates that something in a transaction
233 may be incorrect but the transaction may continue. It may also indicate
234 that something (e.g. a filter) may have performed an action that has
235 changed the transaction and that the client should be informed of this.
237 enum TTransactionWarning
239 /** An event indicating that the transaction has been redirected and the
240 original origin server indicated that it was a permanent redirection.
241 The URI for the transaction is now the redirected location. A
242 permanent redirection may require further client behavior if the
243 request came from a stored URI. This is to avoid further redirections
244 on subsequent requests for this resource.
246 ERedirectedPermanently = KTransactionWarningBaseStatus,
247 /** An event indicating that the transaction has been redirected and the
248 original server indicated that it was a temporary redirection.
250 ERedirectedTemporarily = KTransactionWarningBaseStatus + 1,
251 /** An event generated by the Protocol Handler when it receives a Content-
252 Length value that does not match the actual length of the body data.
254 EMoreDataReceivedThanExpected = KTransactionWarningBaseStatus + 2
260 @param aStatus The status value.
263 //##ModelId=3C4C187402FB
264 inline THTTPEvent(TInt aStatus, TUint aUID = KHTTPUid);
266 /** Constructor (using a standard event and the HTTP UID)
267 @param aStatus The standard event to use.
269 //##ModelId=3C4C18740304
270 inline THTTPEvent(TStandardEvent aStatus = EAnyTransactionEvent);
272 /** Constructor (using a transaction event and the HTTP UID)
273 @param aStatus The transaction event to use.
275 //##ModelId=3C4C1874030C
276 inline THTTPEvent(TTransactionEvent aStatus);
278 /** Assigns a standard event code to an event object
279 @param aStatus The standard event.
280 @return The HTTP event object.
282 //##ModelId=3C4C187402EF
283 inline THTTPEvent& operator=(TStandardEvent aStatus);
285 /** Assigns a transaction event code to an event object
286 @param aStatus The transaction event.
287 @return The HTTP event object.
289 //##ModelId=3C4C187402F1
290 inline THTTPEvent& operator=(TTransactionEvent aStatus);
292 /** Equality operator
293 @param The HTTP event object to compare.
294 @return ETrue if the HTTP event objects are equal.
296 //##ModelId=3C4C187402DA
297 inline TBool operator==(THTTPEvent aThat) const;
299 /** Inequality operator
300 @param The HTTP event object to compare.
301 @return ETrue if the HTTP event objects are not equal.
303 //##ModelId=3C4C187402BD
304 inline TBool operator!=(THTTPEvent aThat) const;
306 /** Equality operator (compares with a standard event)
307 @param The standard event object to compare.
308 @return ETrue if the standard event objects are equal.
310 //##ModelId=3C4C187402DC
311 inline TBool operator==(TStandardEvent aStatus) const;
313 /** Inequality operator (compares with a standard event)
314 @param The standard event object to compare.
315 @return ETrue if the standard event objects are not equal.
317 //##ModelId=3C4C187402C7
318 inline TBool operator!=(TStandardEvent aStatus) const;
320 /** Equality operator (compares with a transaction event)
321 @param The transaction event object to compare.
322 @return ETrue if the transaction event objects are equal.
324 //##ModelId=3C4C187402E4
325 inline TBool operator==(TTransactionEvent aStatus) const;
327 /** Inequality operator (compares with a transaction event)
328 @param The transaction event object to compare.
329 @return ETrue if the transaction event objects are not equal.
331 //##ModelId=3C4C187402D0
332 inline TBool operator!=(TTransactionEvent aStatus) const;
334 /** @return ETrue if the event is a session event
336 //##ModelId=3C4C187402BC
337 inline TBool IsSessionEvent() const;
339 public: // Attributes
341 /** The status value.
343 //##ModelId=3C4C187402B4
348 //##ModelId=3C4C187402AA
351 protected: // Attributes
352 /** Flag to indicate whether the event is a session event
354 TBool iIsSessionEventFlag;
359 class THTTPSessionEvent : public THTTPEvent
361 A HTTP session status message. Status messages consist of a UID and a
362 status code within that UID. Extension dlls that needs to create
363 new status messages should use their own UID and create status codes
369 public: // Enumerations
370 /** The TSessionEvents type defines the evenst that correspond to the
371 of a session entity. Outgoing events originate from the client or from
372 filters. Incoming events originate from the protocol handler or from
373 filters, and clients should handle these.
377 /** A session connection should be initiated. An outgoing event.
379 EConnect = KSessionEventBaseStatus,
380 /** The session should be disconnected. An outgoing event.
382 EDisconnect = KSessionEventBaseStatus + 1,
383 /** The session has been successfully connected. None of the client
384 requested capabilities were denied or reduced by the proxy. An
387 EConnectedOK = KSessionEventBaseStatus + 2,
388 /** The session has been connected, but with one or more of the client
389 requested capabilities denied or reduced by the proxy. An incoming
392 EConnectedWithReducedCapabilities = KSessionEventBaseStatus + 3,
393 /** The session has been disconnected. This either confirms an earlier
394 EDisconnect event or indicates a forced disconnection by the proxy.
397 EDisconnected = KSessionEventBaseStatus + 4,
398 /** The authentication handshake succeeded with the automatic validation
399 of the (proxy) server certificate.
401 EAuthenticatedOK = KSessionEventBaseStatus + 5,
402 /** The authentication handshake failed.
404 EAuthenticationFailure = KSessionEventBaseStatus + 6,
405 /** The connection attempt to the proxy timed out.
407 EConnectionTimedOut = KSessionEventBaseStatus + 7
411 HTTP session warning events.
415 /** The client has requested a transaction event that requires a session
416 to be connected or the connection to be initiated, but neither is
417 currently true. The transaction event will be left pending until the
418 session is connected. An incoming event.
420 ENotConnected = KSessionWarningBaseStatus,
421 /** The proxy has sent some information that is not related to a
422 transaction and has no effect on the state of the session. The
423 information from the proxy is in the EProxyExceptionInfo property.
425 EExceptionInfo = KSessionWarningBaseStatus + 1,
426 /** The client connection request was (permanently) redirected to a new
427 WAP proxy address. The client should check the EWspProxyAddress
428 property for the new address. The client's access-point database can
429 then be updated with this address. No notification is given of a
430 temporary redirection.
432 ERedirected = KSessionWarningBaseStatus + 2,
433 /** The client has requested a session event that is not valid whilst
434 the WSP session is trying to establish a connection.
436 EAlreadyConnecting = KSessionWarningBaseStatus + 3,
437 /** The client has requested a session event that is not valid whilst
438 the WSP session is in the Connected state.
440 EAlreadyConnected = KSessionWarningBaseStatus + 4,
441 /** The client has requested a session event that is not valid whilst
442 the WSP session is trying to close the connection.
444 EAlreadyDisconnecting = KSessionWarningBaseStatus + 5,
445 /** The client has requested a session event that is not valid whilst
446 the WSP session is in the Null (or disconnected) state.
448 EAlreadyDisconnected = KSessionWarningBaseStatus + 6
453 @param aStatus The status value.
456 inline THTTPSessionEvent(TInt aStatus, TUint aUID = KHTTPUid);
458 /** Constructor (using a standard event and the HTTP UID)
459 @param aStatus The standard event to use.
461 inline THTTPSessionEvent(TStandardEvent aStatus = EAnySessionEvent);
463 /** Constructor (using a session event and the HTTP UID)
464 @param aStatus The session event to use.
466 inline THTTPSessionEvent(TSessionEvent aStatus);
468 /** Assigns a session event code to an event object
469 @param aStatus The session event.
471 //##ModelId=3C4C187402F9
472 inline THTTPSessionEvent& operator=(TSessionEvent aStatus);
474 /// Equality operator (compares with a session event)
475 //##ModelId=3C4C187402E6
476 inline TBool operator==(TSessionEvent aStatus) const;
478 /// Inequality operator (compares with a session event)
479 //##ModelId=3C4C187402D2
480 inline TBool operator!=(TSessionEvent aStatus) const;
483 #include <http/thttpevent.inl>
485 #endif // __THTTPEVENT_H__