|
1 /* |
|
2 * Copyright (c) 2003 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 the License "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: Provides an interface observe/track load requests. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef MHEDLOADOBSERVER_H |
|
21 #define MHEDLOADOBSERVER_H |
|
22 |
|
23 // INCLUDES |
|
24 #include "BrsrStatusCodes.h" |
|
25 |
|
26 // FORWARD DECLARATIONS |
|
27 |
|
28 #ifdef __cplusplus |
|
29 extern "C" { |
|
30 #endif /* __cplusplus */ |
|
31 |
|
32 typedef struct NW_Url_Resp_s NW_Url_Resp_t; |
|
33 typedef struct NW_HED_UrlRequest_s NW_HED_UrlRequest_t; |
|
34 |
|
35 #ifdef __cplusplus |
|
36 } |
|
37 #endif /* __cplusplus */ |
|
38 |
|
39 |
|
40 // CLASS DECLARATION |
|
41 |
|
42 class MHEDLoadObserver |
|
43 { |
|
44 public: // Interface |
|
45 /** |
|
46 * Passes a HEAD response to the observer. |
|
47 * |
|
48 * @param aTransactionId the transaction id. |
|
49 * @param aResponse the HEAD response to be processed. |
|
50 * @param aUrlRequest the url request. |
|
51 * @param aClientData the client data past with the request. |
|
52 * @return void. |
|
53 */ |
|
54 virtual void HeadCompleted(TUint16 aTransactionId, const NW_Url_Resp_t& aResponse, |
|
55 const NW_HED_UrlRequest_t& aUrlRequest, void* aClientData) = 0; |
|
56 |
|
57 /** |
|
58 * Passes a chunk of a response to the observer. |
|
59 * |
|
60 * @param aTransactionId the transaction id. |
|
61 * @param aChunkIndex the chunk count of this call, aChunkIndex > 0 |
|
62 * @param aResponse the HEAD response to be processed. |
|
63 * @param aUrlRequest the url request. |
|
64 * @param aClientData the client data past with the request. |
|
65 * @return void. |
|
66 */ |
|
67 virtual void ChunkReceived(TUint16 aTransactionId, TUint32 aChunkIndex, |
|
68 const NW_Url_Resp_t& aResponse, const NW_HED_UrlRequest_t& aUrlRequest, |
|
69 void* aClientData) = 0; |
|
70 |
|
71 /** |
|
72 * Passes a chunk of a response to the observer. |
|
73 * |
|
74 * @param aStatusClass the type of status-code found in aStatus -- |
|
75 BRSR_STAT_CLASS_HTTP or BRSR_STAT_CLASS_GENERAL. |
|
76 * @param aStatus the final load status of the request. |
|
77 * @param aTransactionId the transaction id. |
|
78 * @param aUrlRequest the url request. |
|
79 * @param aClientData the client data past with the request. |
|
80 * @return void. |
|
81 */ |
|
82 virtual void LoadCompleted(TInt16 aStatusClass, TBrowserStatusCode aStatus, |
|
83 TUint16 aTransactionId, const NW_HED_UrlRequest_t& aUrlRequest, |
|
84 void* aClientData) = 0; |
|
85 }; |
|
86 |
|
87 #endif // MHEDLOADOBSERVER_H |