|
1 // Copyright (c) 2008-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 "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #ifndef __MPARSEROBSERVER_H_ |
|
17 #define __MPARSEROBSERVER_H_ |
|
18 |
|
19 #include <e32std.h> |
|
20 //#include <es_mbuf.h> |
|
21 #include <rmemchunk.h> |
|
22 //#include <comms-infras/mbufchain.h> |
|
23 |
|
24 /** |
|
25 The MParserObserver class is the observer API for the upnp request and response parser. |
|
26 It allows the upnp request and response parser to notify its observer when it has found the |
|
27 headers, bodydata etc. |
|
28 */ |
|
29 class MParserObserver |
|
30 { |
|
31 public: |
|
32 /** |
|
33 The request/response headers have been found. The observer can gain access to the headers |
|
34 through the RHTTPHeaders class. |
|
35 */ |
|
36 virtual void GotHeaders() = 0; |
|
37 |
|
38 /** |
|
39 The body data has been found. The observer can gain access to the body through |
|
40 the MHTTPDataSupplier class. |
|
41 */ |
|
42 virtual void GotBodyData() = 0; |
|
43 |
|
44 /** |
|
45 The parser has parsed the supplied data and is waiting for more data from the observer. |
|
46 This API does not indicate the end of the complete request or response parsing. It only |
|
47 indicates that the data supplied is insufficient and more data is required for complete |
|
48 parsing. |
|
49 */ |
|
50 virtual void DataParsed() = 0; |
|
51 |
|
52 /** |
|
53 The parser has completed the parsing of a single request/response. Any exess data will be |
|
54 supplied to the observer through the aExcessData. This data could be the start of the next |
|
55 message. |
|
56 @param aExcessData The excess data within the request/response if any. |
|
57 */ |
|
58 virtual void ParsingComplete(RMemChunk& aExcessData) = 0; |
|
59 |
|
60 /** |
|
61 Error notifier. The parser has experienced an error. |
|
62 @param aError The error code.Possible error codes are: |
|
63 KErrNoMemory - When there is insufficient memory for allocations, |
|
64 KErrCorrupt - If the protocol in the response is not HTTP. |
|
65 KErrNotFound - When the Locate() and Find() APIs of TDesC8 fail. |
|
66 */ |
|
67 virtual void ParserError(TInt aError) = 0; |
|
68 }; |
|
69 |
|
70 #endif /*MPARSEROBSERVER_H_*/ |