org.dvb.internet
Interface WWWBrowserService

All Superinterfaces:
InternetClientService, javax.tv.service.Service

public interface WWWBrowserService
extends InternetClientService

Service representing a resident WWW browser


Method Summary
 void addBookmark(javax.tv.locator.Locator locator, java.lang.String name)
          Add a bookmark to the list of bookmarks in the current application.
 void addBookmark(java.net.URL bookmarkUrl, java.lang.String name)
          Add a bookmark to the list of bookmarks in the current application.
 boolean areFramesSupported()
          Check whether frames are supported by the browser and enabled.
 java.lang.String[] getAcceptedMediaTypes()
          Returns an array of supported MIME types, e.g.
 java.lang.String[] getSupportedPlugins()
          Returns an array of names of installed plug-ins.
 java.lang.String getUserAgent()
          Returns the string used in the HTTP "User-Agent" header.
 void setHomepage(java.net.URL defaultUrl)
          Set the home page for the web browser.
 void setInitialURL(java.net.URL initialUrl)
          Set the inital URL to be used when the WWW browser starts.
 
Methods inherited from interface org.dvb.internet.InternetClientService
canRunApplication, getName, getServiceType, getSupportedClientServices, hasMultipleInstances, retrieveDetails
 
Methods inherited from interface javax.tv.service.Service
equals, getLocator, hashCode
 

Method Detail

getAcceptedMediaTypes

public java.lang.String[] getAcceptedMediaTypes()
Returns an array of supported MIME types, e.g. "application/vnd.rn-realmedia" The returned MIME types shall include at least one entry with type "text/html". Each entry of this type shall have a 'version' parameter that indicates the version of HTML that is supported, for example text/html; version = "4.0". A browser may claim to support an HTML version while only implementing a subset of the features - this is implementation-dependent. A browser that wishes to explicitly indicate support for multiple HTML versions shall return multiple entries of type "text/html" with different values for the 'version' parameter.
Returns:
an array of MIME types supported by the web browser

getSupportedPlugins

public java.lang.String[] getSupportedPlugins()
Returns an array of names of installed plug-ins. The name in each string is defined by the plug-in provider
Returns:
an array of plugin names

getUserAgent

public java.lang.String getUserAgent()
Returns the string used in the HTTP "User-Agent" header.
Returns:
the string identifying the user agent

areFramesSupported

public boolean areFramesSupported()
Check whether frames are supported by the browser and enabled.
Returns:
true if the browser supports frames and frame support is enabled by the user, false otherwise.

setHomepage

public void setHomepage(java.net.URL defaultUrl)
Set the home page for the web browser.
Parameters:
defaultUrl - the URL to be used as the default when the application is launched with no starting URL.
Throws:
java.lang.SecurityException - if the caller does not have a HomePagePermission
java.lang.IllegalArgumentException - if the URL scheme is not supported by the application. Different classes which implement or extend this interface may implement different schemes.

addBookmark

public void addBookmark(java.net.URL bookmarkUrl,
                        java.lang.String name)
                 throws EntryExistsException,
                        java.io.IOException
Add a bookmark to the list of bookmarks in the current application. As a side-effect a bookmark previously added by this method may be lost. Implementations may restrict the number of bookmarks a single MHP application or source of applications may add.
Parameters:
bookmarkUrl - the URL that should be added to the bookmarks list.
name - the name that should be displayed for that URL in the bookmarks list.
Throws:
EntryExistsException - if a bookmark with both the same name and the same URL already exists in the bookmarks list.
java.lang.IllegalArgumentException - if the URL scheme is not supported by the application.
IOException - if no more bookmarks can be added due to a lack of storage space or other limitation in the client

addBookmark

public void addBookmark(javax.tv.locator.Locator locator,
                        java.lang.String name)
                 throws EntryExistsException,
                        java.io.IOException
Add a bookmark to the list of bookmarks in the current application. As a side-effect a bookmark previously added by this method may be lost. Implementations may restrict the number of bookmarks a single MHP application or source of applications may add.
Parameters:
locator - the Locator that should be added to the bookmarks list
name - the name that should be displayed for that locator in the bookmarks list. Multiple entries in the bookmarks list may not have the same name.
Throws:
EntryExistsException - if a bookmark with both the same name and the same locator already exists in the bookmarks list.
IOException - if no more bookmarks can be added due to a lack of storage space or a limitation in the client

setInitialURL

public void setInitialURL(java.net.URL initialUrl)
Set the inital URL to be used when the WWW browser starts. This URL is specific to this instance of WWWBrowserService and will not impact any other instance and is only valid for the lifetime of this instance. Calling this method and then selecting the WWWBrowserService instance is equivalent to selecting the WWWBrowserService instance, obtaining the WWWBrowser and then calling the goToURL method there. If the application calling this method is still running when the specified initial page is displayed (or fails) and has registered an InternetClientListener then the appropriate InternetClientEvent shall be sent corresponding to the success or failure of the operation to display the specified initial URL.
Parameters:
initialUrl - the URL to use
Throws:
java.lang.IllegalArgumentException - if the URL scheme is not supported by the application. Different classes which implement or extend this interface may implement different schemes.