com.webrenderer.se
Interface IMozillaBrowserCanvas

All Superinterfaces:
IBrowserCanvas

public interface IMozillaBrowserCanvas
extends IBrowserCanvas

IMozillaBrowserCanvas provides Mozilla specific extensions to the standard IBrowserCanvas interface. This functionality can be accessed by casting a standard IBrowserCanvas interface, but only if Mozilla is the currently used browser. For example:


 if ( browser.getBrowserType().equals("MOZILLA") ) {
     ( (IMozillaBrowserCanvas) browser ).saveToFile( "filename.html" );
 }
 


Field Summary
static int COOKIE_ACCEPT_ALL
          This flag inidicates to setCookieMode that all cookies will be accepted by Mozilla.
static int COOKIE_ACCEPT_FROM_ORIGINATING_SERVER
          This flag inidicates to setCookieMode that only cookies that have requested by the originating server will be accepted.
static int COOKIE_ACCEPT_NONE
          This flag inidicates to setCookieMode that all cookies will be discarded by Mozilla.
 
Fields inherited from interface com.webrenderer.se.IBrowserCanvas
IMAGE_FORMAT_JPEG, IMAGE_FORMAT_PNG, KEY_CODE_BACKSPACE, KEY_CODE_DELETE, KEY_CODE_TAB, KEY_MODIFIER_CTRL_DOWN, KEY_MODIFIER_SHIFT_DOWN, RELOAD_BYPASS_CACHE, RELOAD_BYPASS_PROXY, RELOAD_BYPASS_PROXY_AND_CACHE, RELOAD_NORMAL
 
Method Summary
 boolean findInPage(java.lang.String toFind, boolean matchCase, boolean wrap, boolean backwards)
          The given string will be found and highlighted in the document if it exists Set matchCase if it is a case sensitive search Set wrap if you want the search to continue searching from top when it hits the bottom Set bacwards if you want the search to go backwards throught the page
 int getCookieMode()
          Get the current cookie accept mode.
 java.lang.String getMozillaVersion()
          Returns the current version of mozilla from corecomponents
 void registerProtocol(java.lang.String protocol, ProtocolListener l)
          Registers a protocol to Mozilla.
 void saveToFile(java.lang.String filename)
          Save the current HTML page to a local file.
 void setCookieMode(int mode)
          Set the mode for accepting cookies.
 void setProxyAuthentication(java.lang.String username, java.lang.String password)
          Set Proxy Authentication.
 
Methods inherited from interface com.webrenderer.se.IBrowserCanvas
addBlockedURL, addBrowserListener, addJavascriptListener, addNetworkListener, addPromptListener, addWindowListener, autoconfigureProxy, canGoBack, canGoForward, copy, cut, decreaseTextZoom, deleteCookies, destroy, disableCache, disableCookies, disableProxy, emptyCache, enableCache, enableCookies, enableImageLoading, enableProxy, executeScript, executeScriptWithReturn, getBoolPrefProperty, getBrowserType, getCompanyName, getCookie, getCookie, getCookieFromHttp, getDocument, getElementAtCaretPosition, getHistory, getHTMLEditingMode, getIntPrefProperty, getJavascriptEnabled, getMaxRenderSize, getPageSize, getPrintable, getProductName, getProxyBypasses, getProxyProtocol, getSelectedText, getStringPrefProperty, getTitle, getURL, getVersion, getWebRendererVersion, goBack, goForward, highlightSelectedText, httpPOST, httpPOST, httpPOST, increaseTextZoom, invokeAndWait, invokeLater, isCacheDisabled, isCookiesEnabled, isPopup, isProxyEnabled, loadHTML, loadHTML, loadHTML, loadURL, loadURL, loadURL, makeImageUrl, paste, print, print, reload, removeBlockedURL, removeBrowserListener, removeImage, removeJavascriptListener, removeNetworkListener, removePromptListener, removeWindowListener, savePageImageToDisk, savePageImageToDisk, savePageImageToDiskScaled, savePageImageToDiskScaled, savePageImageToDiskScaled, savePageImageToDiskScaled, savePageSectionToBufferedImage, savePageSectionToBufferedImage, saveToBufferedImage, saveToBufferedImage, saveToBufferedImageNoAlpha, saveToBufferedImageNoAlpha, saveToBufferedImageScaled, saveToBufferedImageScaled, saveToBufferedImageScaled, saveToBufferedImageScaled, saveToBufferedImageScaledNoAlpha, saveToBufferedImageScaledNoAlpha, saveToBufferedImageScaledNoAlpha, saveToBufferedImageScaledNoAlpha, selectAll, sendKeyPressToElement, setCookie, setCookie, setHTMLEditingMode, setJavascriptEnabled, setMaxRenderSize, setMinimumWidth, setPrefProperty, setPrefProperty, setPrefProperty, setPrintFooters, setPrintHeaders, setProxyBypasses, setProxyProtocol, setSize, stopLoad, writePageImage, writePageImage, writePageImageScaled, writePageImageScaled, writePageImageScaled, writePageImageScaled
 

Field Detail

COOKIE_ACCEPT_ALL

static final int COOKIE_ACCEPT_ALL
This flag inidicates to setCookieMode that all cookies will be accepted by Mozilla. setCookieMode(COOKIE_ACCEPT_ALL) is the same as using IBrowserCanvas.enableCookies().

See Also:
setCookieMode(int), Constant Field Values

COOKIE_ACCEPT_FROM_ORIGINATING_SERVER

static final int COOKIE_ACCEPT_FROM_ORIGINATING_SERVER
This flag inidicates to setCookieMode that only cookies that have requested by the originating server will be accepted. The functionality provided by this is currently only found in Mozilla.

See Also:
setCookieMode(int), Constant Field Values

COOKIE_ACCEPT_NONE

static final int COOKIE_ACCEPT_NONE
This flag inidicates to setCookieMode that all cookies will be discarded by Mozilla. setCookieMode(COOKIE_ACCEPT_NONE) is the same as using IBrowserCanvas.disableCookies().

See Also:
setCookieMode(int), Constant Field Values
Method Detail

saveToFile

void saveToFile(java.lang.String filename)
Save the current HTML page to a local file.

Specified by:
saveToFile in interface IBrowserCanvas
Parameters:
filename - Filename to save HTML to.

getMozillaVersion

java.lang.String getMozillaVersion()
Returns the current version of mozilla from corecomponents


setCookieMode

void setCookieMode(int mode)
Set the mode for accepting cookies. Mozilla provides extra functionality with cookies, namingly the concept of discarding cookies unless they come from the originating server. The modes are defined using static COOKIE_* members in this class. Using COOKIE_ACCEPT_ALL or COOKIE_ACCEPT_NONE modes are equivalent to the IBrowserCanvas methods enableCookies and disableCookies respectively.

Parameters:
mode - The cookie accept mode defined by COOKIE_*.

getCookieMode

int getCookieMode()
Get the current cookie accept mode. Mozilla provides extra functionality with cookies, namingly the concept of discarding cookies unless they come from the originating server. The modes are defined using static COOKIE_* members in this class. Using COOKIE_ACCEPT_ALL or COOKIE_ACCEPT_NONE modes are equivalent to the IBrowserCanvas methods

Returns:
int Cookie accept mode defined by COOKIE_*.

findInPage

boolean findInPage(java.lang.String toFind,
                   boolean matchCase,
                   boolean wrap,
                   boolean backwards)
The given string will be found and highlighted in the document if it exists Set matchCase if it is a case sensitive search Set wrap if you want the search to continue searching from top when it hits the bottom Set bacwards if you want the search to go backwards throught the page


setProxyAuthentication

void setProxyAuthentication(java.lang.String username,
                            java.lang.String password)
Set Proxy Authentication.


registerProtocol

void registerProtocol(java.lang.String protocol,
                      ProtocolListener l)
Registers a protocol to Mozilla. You can create a new protocol or override an existing protocol (e.g. http).

Parameters:
protocol - name of protocol to create or override
l - listener to implement protocol