org.mozilla.pluglet.mozilla
Interface PlugletManager

All Known Subinterfaces:
PlugletManager2

public interface PlugletManager

The PlugletManager interface includes functionality to get and post URLs and return userAgent for the browser. It also includes a function for reloading all Pluglets in the Pluglets directory, allowing Pluglets to be installed and run without restarting the browser.


Method Summary
 void getURL(Pluglet pluglet, java.net.URL url, java.lang.String target, PlugletStreamListener streamListener, java.lang.String altHost, java.net.URL referrer, boolean forceJSEnabled)
          Fetches a URL.
 void postURL(Pluglet pluglet, java.net.URL url, int postDataLen, byte[] postData, boolean isFile, java.lang.String target, PlugletStreamListener streamListener, java.lang.String altHost, java.net.URL referrer, boolean forceJSEnabled, int postHeadersLength, byte[] postHeaders)
          Posts to a URL with post data and/or post headers.
 void reloadPluglets(boolean reloadPages)
          This method reloads all Pluglets in the Pluglets directory.
 java.lang.String userAgent()
          Returns the userAgent String for the browser.
 

Method Detail

reloadPluglets

public void reloadPluglets(boolean reloadPages)
This method reloads all Pluglets in the Pluglets directory. The browser knows about all installed Pluglets (and Plugins) at startup. But if the user adds or removes any Pluglets (or Plugins), the browser does not see them until it is restarted. This method lets the user install a new Pluglet and load it, or remove one, without having to restart the browser.

Parameters:
reloadPages - Boolean value indicates whether currently visible pages should also be reloaded.

userAgent

public java.lang.String userAgent()
Returns the userAgent String for the browser. userAgent is a property of the navigator object and contains information about the browser.

Returns:
Returns a String for the userAgent for the browser.

getURL

public void getURL(Pluglet pluglet,
                   java.net.URL url,
                   java.lang.String target,
                   PlugletStreamListener streamListener,
                   java.lang.String altHost,
                   java.net.URL referrer,
                   boolean forceJSEnabled)
Fetches a URL.

Parameters:
pluglet - This is the Pluglet instance making the request. If null, the URL is fetched in the background.

url - This is the URL to fetch.

target - This is the target window into which to load the URL.

streamListener - This is an instance of PlugletStreamListener.

altHost - This is an IP-address string that will be used instead of the host specified in the URL. This is used to prevent DNS-spoofing attacks. It can be defaulted to null, which will mean: use the host in the URL.

referrer - This is the referring URL. (It may be null).

forceJSEnabled - This will force JavaScript to be enabled for javascript: URLs, even if the user currently has JavaScript disabled. (Usually this should be set false.)

postURL

public void postURL(Pluglet pluglet,
                    java.net.URL url,
                    int postDataLen,
                    byte[] postData,
                    boolean isFile,
                    java.lang.String target,
                    PlugletStreamListener streamListener,
                    java.lang.String altHost,
                    java.net.URL referrer,
                    boolean forceJSEnabled,
                    int postHeadersLength,
                    byte[] postHeaders)
Posts to a URL with post data and/or post headers.

Parameters:
pluglet - This is the Pluglet instance making the request. If null, the URL is fetched in the background.

url - This is the URL to fetch.

postDataLen - This is the length of postData (if not null).

postData - This is the data to post. null specifies that there is no post data.

isFile - This indicates whether postData specifies the name of a file to post rather than data. The file will be deleted afterwards.

target - This is the target window into which to load the URL.

streamListener - This is an instance of PlugletStreamListner.

altHost - This is an IP-address string that will be used instead of the host specified in the URL. This is used to prevent DNS-spoofing attacks. It can be defaulted to null, which will mean: use the host in the URL.

referrer - This is the referring URL. (It may be null.)

forceJSEnabled - This will force JavaScript to be enabled for javascript: URLs, even if the user currently has JavaScript disabled (usually specify false).

postHeadersLength - This is the length of postHeaders (if not null).

postHeaders - These are the headers to POST. null specifies that there are no post headers.