The Web Browser for S60 enables mobile phone users to browse the World Wide Web. Web pages can be implemented in Hypertext Markup Language (HTML), Extended Hypertext Markup Language (XHTML), or Wireless Markup Language (WML).
The Browser Control API enables developers to do the following:
Display XHTML, HTML, WML, CSS, or scripted content inside an application
Customize the Browser Control for your specific application. For example, you can:
Logical and Technical Classification
The Browser Control API is classified as a Library API. It provides classes and functions that are used in the context of the client's thread. The classes and functions can be used independently of each other.
The Browser Control API is a Method Call API. The interface uses only local objects.
Audience
This API is intended for developers who wish to use a browser control plug-in in their applications. The reader should be familiar with the C++ programming language and the Symbian operation system.
Standards Compliance
The Browser Control API complies with the following standards:
ECMA Script Mobile Profile
HTML 4.0.1
JavaScript
Wireless CSS
WML 1.3
WML Script
XHTML Mobile Profile
Browser Control Functionality
Basic Browser Control functionality includes:
Downloading and displaying Web content
Resolving links
Retrieving the following information about the downloaded content:
ContentSize
function) WMLOptionMenuItemsL
function)BrowserSettingL
function) IsUrlInCache
function)PageInfoLC
function)NavigationAvailable
function)VersionInfoLC
function)ImageCountL
function)FocusedElementType
function) MinimumSize
function) The functions defined in the CBrCtlInterface
class implement
basic Browser Control functionality. The following table lists and describes
these functions.
Function Name | Description |
HandleCommandL | Passes a command to the Browser Control |
HandleDownloadCommandL
| Passes the following commands to the Download Manager by
means of the Browser Control:
|
ContentSize
| Returns the display size needed to see all of the selection options of the Browser Control. |
SetBrowserSettingL
| Updates a Browser Control setting. |
LoadDataL
| Displays the content of a buffer. |
InitLoadDataL
| Displays the content of a buffer incrementally. |
LoadUrlL
| Loads a URL. |
LoadFileL
| Loads a file. |
PostUrlL | Requests the Browser Control to POST to a URL. |
WMLOptionMenuItemsL
| Returns the WML options associated with the current page. |
AddOptionMenuItemsL | Adds options to the options menu. |
ClearCache
| Clears the cache. |
IsUrlInCache
| Queries whether or not a specified URL is in the cache. |
ClearItemInCache
| Clears a URL from the cache. |
PageInfoLC
| Returns information about the page, such as its title, URL, and content. |
NavigationAvailable
| Queries whether a previous or subsequent element exists in the history stack. |
CertInfo
| Passes server certificate information for the current page to the reader. |
AddLoadEventObserverL
| Registers load events. |
RemoveLoadEventObserver | Unregisters load events. |
ImageCountL | Returns the number of images in the current page. |
FocusedElementType | Returns the type of focused element. |
AddStateChangeObserverL | Registers an observer for state changes. |
RemoveStateChangeObserver | Unregisters an observer for state changes. |
MinimumSize | Returns the minimum size that the Browser Control can be. |
OfferKeyEventL | Passes key events to the Browser Control. |
SetFocus
| Sets the keyboard focus for the Browser Control. |
VersionInfoLC | Requests the Browser Control to return information about the Browser Control version. |
SetSelfDownloadContentTypesL
| Passes a list of content types to the Browser Control. |
SetParamL | Updates a Browser Control parameter. Subsequent calls to update the same parameter result in replacing its value. |
LoadSavedPageL
| Requests the Browser Control to load a saved page. |
GetBitmapData | Associates a favorites icon (favicon) with a specified URL or with a thumbnail of the current page. Favicons can be displayed in the Bookmarks, Adaptive Bookmarks, and News & Blogs lists, and in the Saved Pages view.Returns the bitmap of the current page or the favicon of a specified URL. |
ZoomLevels
| Returns the array of possible zoom levels. |
FindKeyword | Finds a specified string in the current page. |
FindKeywordAgain | Searches for the next location of the keyword on the page. |
You can customize the Browser Control to extend its functionality by implementing additional interface classes in the host application. The following table lists the interfaces implemented by the host application.
Class | Header file | Description |
MBrCtlDataLoadSupplier
| BrCtlInterface.h
| Interface that provides the Browser Control with incremental
content to display. Implement this interface if the host application receives content incrementally. |
MBrCtlDialogsProvider
| BrCtlDialogsProvider.h
| Interface that provides dialogs used by the Browser Control. Implement this interface to change the default dialogs provided by the Browser Control. To use the default dialogs provided by the Browser Control, do not specify this interface. |
MBrCtlDownloadObserver
| BrCtlDownloadObserver.h
| Interface that passes download events from the Download Manager through the Browser Control to the host application. Examples of download events include:
|
MBrCtlLayoutObserver
| BrCtlLayoutObserver.h
| Interface used to receive scrolling events.
Implement this interface when the host application draws the scroll bars around the Browser Control. Set
the capability |
MBrCtlLinkResolver
| BrCtlLinkResolver.h
| Interface that provides a callback mechanism for receiving
the content of an embedded link or the content of a user-initiated load request.
Implement this interface if the host application must control page navigation or if the host application stores its content in a private store. Set the capability |
MBrCtlLoadEventObserver
| BrCtlInterface.h
| Interface used to receive load progress events.
Implement this interface if the host application implements a load-progress indicator. Multiple components of the host application can implement this interface. |
MBrCtlSoftkeysObserver
| BrCtlSoftKeysObserver.h
| Interface that handles requests to change the softkeys. Implement this interface if the host application requires a change in the softkeys as a result of changes in the state of the Browser Control. The Browser Control may request the host application to change one or both softkeys when:
The host application has the option of honoring the request or ignoring it. |
MBrCtlSpecialLoadObserver
| BrCtlSpecialLoadObserver.h
| Interface that handles special load needs. Implement this interface if the host application requires:
This interface should use the Document Handler and the Download Manager for non-markup responses. The Proxy Filter establishes the network connection if this interface is not implemented. |
MBrCtlStateChangeObserver
| BrCtlInterface.h
| Interface used to receive state-changed events. Multiple components of the host application can implement this interface. Currently the only state-change event is generated when the Browser Control switches into and out of the Image Map view, in which only the image map is displayed. |
MBrCtlWindowObserver
| BrCtlWindow Observer.h
| Handles window events such as opening a URL in a new window, closing a window, and finding a window of a specified name. |
This section describes the types of things you can do with the Browser Control API. The main use cases are as follows:
Figure 1 shows the class diagram of the new classes created for the Browser Control feature.
Figure 1: Browser Control Class Diagram
The following table contains descriptions of the structural classes shown in Figure 1.
The following table contains the auxiliary class that contains the enumerations for the Browser Control.
ClassHeader File | Description |
---|---|
TBrCtlDefs
| Helper class that provides a namespace for the enumerations used by the Browser Control. |