2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: Handle special load events such as network connection, deal with non-http or non-html requests
19 #ifndef BRCTLSPECIALLOADOBSERVER_H
20 #define BRCTLSPECIALLOADOBSERVER_H
26 #include <ApEngineConsts.h>
34 enum TBrCtlDownloadParam
36 EParamRequestUrl, ///< URL requested
37 EParamRealm, ///< Realm (if www)
38 EParamUsername, ///< User name (if www authentication)
39 EParamPassword, ///< Password (if www authentication)
40 EParamProxyRealm, ///< Realm in the case of proxy authentication
41 EParamProxyUsername, ///< User name (if proxy authentication)
42 EParamProxyPassword, ///< Password (if proxy authentication)
43 EParamRawRequestHeader, ///< Request header in the form: Header:Value
44 EParamReceivedContentType, ///< Type of content received
45 EParamExpectedContentType, ///< Type of content expected to appear in the markup <object> tag.
46 EParamTotalContentLength, ///< Expected length of the content
47 EParamReceivedContentLength, ///< Length of the content already received
48 EParamReceivedContent, ///< Body of the content received
49 EParamRawResponseHeader, ///< Response header in the form: Header: Value
50 EParamLocalFileName, ///< Name of the file containing the content to be downloaded
51 EParamCharset, ///< Character set of the content to be downloaded
52 EParamRefererHeader, ///< Referrer header used in the download request, if applicable
53 EParamTransactionId ///< Transaction ID
56 // FUNCTION PROTOTYPES
60 * The MBrCtlSpecialLoadObserver class handles special load events, such as
61 * network connection, non-HTTP(S) load requests, and non-HTML responses.
66 * #include <brctlspecialloadobserver.h>
69 * @see S60 Platform: Browser Control API Developer's Guide Version 2.0
70 * @lib BrowserEngine.lib
71 * @file brctlspecialloadobserver.h
74 class MBrCtlSpecialLoadObserver
76 public: // New functions
78 * Request to create a network connection.
80 * @param aConnectionPtr Pointer to the network connection. It must
81 * be type casted to an integer. If NULL, the Proxy Filter creates
82 * a network connection automatically. It must be type casted to an integer.
83 * @param aSockSvrHandle A handle to the socket server.
84 * @param aNewConn A flag if a new connection was created. If the
85 * connection is not new, proxy filter optimization will not read
86 * the proxy again from CommsBd.
87 * ETrue if a new connection was created.
88 * EFalse if a previously created connection was used.
89 * @param aBearerType Bearer type of the new connection. For example, GPRS, WCDMA.
90 * TapBearerType is defined in ApEngineConsts.h.
92 * @attention This function is called for every HTTP request for which
93 * the content was not found in the cache. This function is called
94 * whether or not a connection was established in a previous request.
95 * The host application determines whether to create a new connection
96 * or to use an existing connection.
98 virtual void NetworkConnectionNeededL(TInt* aConnectionPtr,
101 TApBearerType* aBearerType) = 0;
104 * Requests the host application to handle non-HTTP requests. It is expected that the
105 * host application will call the Scheme Dispatcher to handle these requests.
107 * @param aTypeArray Array of request parameters. Examples: URL, referrer header
108 * @param aDesArray Array of values corresponding to the types in aTypeArray
109 * @return ETrue if the host application handles the scheme.
110 * EFalse if the host application cannot handle the scheme.
111 * @attention The browser checks the scheme to determine whether or
112 * not it is supported. The browser supports the following schemes:
113 * File scheme, HTTP scheme or HTTPS scheme
114 * If the URL contains a scheme that the browser does not
115 * support, such as RTSP, then the host application should pass the
116 * content to an application that can handle that scheme.
118 virtual TBool HandleRequestL(RArray<TUint>* aTypeArray, CDesCArrayFlat* aDesArray) = 0;
121 * Request the host applicaion to handle downloads
123 * @param aTypeArray array of download parameter types
124 * @param aDesArray array of values associated with the types in the type array
125 * @return ETrue if handled by the host application
126 * EFalse if not handled by the host application
127 * @attention The host application should call the Download Manager to
128 * handle non-HTML content.
129 * Only GET requests are supported because the Browser Control must
130 * cancel the transaction before the Download Manager can take over.
131 * If a POST request is cancelled, the server may enter an unpredictable state.
132 * For POST requests, the Browser Control downloads the content before calling
133 * this function. It stores the content in a file whose name is passed to the
134 * host application by using the EParamLocalFileName parameter. The host
135 * application should check whether this parameter was passed by the
136 * Browser Control to determine whether the Browser Control already downloaded
137 * the content. If not, the host application should download the content.
139 virtual TBool HandleDownloadL(RArray<TUint>* aTypeArray, CDesCArrayFlat* aDesArray) = 0;
143 #endif // BRCTLSPECIALLOADOBSERVER_H