org.mozilla.pluglet.mozilla
Interface PlugletPeer


public interface PlugletPeer

The PlugletPeer interface is the set of functions implemented by the browser to support a Pluglet instance. When a Pluglet instance is constructed, a PlugeletPeer object is passed to its initializer. The peer object represents the instantiation of the Pluglet instance on the page.


Field Summary
static int NETSCAPE_WINDOW
          This is a static final integer variable set to 3.
 
Method Summary
 java.lang.String getMIMEType()
          Returns the MIME type of the Pluglet instance.
 int getMode()
          Returns an int (integer value) indicating whether the Pluglet is embedded in HTML in the page via an OBJECT or EMBED element and is part of the page, or whether the Pluglet is in a full page of its own.
 PlugletTagInfo getTagInfo()
          For the Pluglet instance, returns the tag information associated with it.
 java.lang.String getValue(int variable)
          Returns the value of a variable associated with the PlugletManager instance.
 java.io.OutputStream newStream(java.lang.String type, java.lang.String target)
          This method is called by the Pluglet instance when it wishes to send a stream of data to the browser.
 void setWindowSize(int width, int height)
          Sets the desired size of the window associated with the Pluglet instance.
 void showStatus(java.lang.String message)
          Invoking this method causes status information to be displayed at the bottom of the window associated with the Pluglet instance.
 

Field Detail

NETSCAPE_WINDOW

public static final int NETSCAPE_WINDOW
This is a static final integer variable set to 3.
Method Detail

getMIMEType

public java.lang.String getMIMEType()
Returns the MIME type of the Pluglet instance.

Returns:
Returns a String for the MIME type of the Pluglet instance.

getMode

public int getMode()
Returns an int (integer value) indicating whether the Pluglet is embedded in HTML in the page via an OBJECT or EMBED element and is part of the page, or whether the Pluglet is in a full page of its own.

A full-page Pluglet can occur when a file of the Pluglet MIME type is entered in the Address/URL field of the browser; when JavaScript sets the document URL (document.URL) to that file; or when an applet redirects the browser to the file (via java.net.HttpURLConnection).

Returns:
Returns an int (integer value) representing the mode. A value of 1 indicates the Pluglet is embedded in a page; a value of 2 indicates it is in a full page of its own.

getValue

public java.lang.String getValue(int variable)
Returns the value of a variable associated with the PlugletManager instance.

Parameters:
variable - This is the PlugletManager instance variable to get.

Returns:
Returns a String representing the value of the variable.

newStream

public java.io.OutputStream newStream(java.lang.String type,
                                      java.lang.String target)
This method is called by the Pluglet instance when it wishes to send a stream of data to the browser. It constructs a new output stream to which the Pluglet instance may send data.

Parameters:
type - The MIME type of the stream to create.

target - The name of the target window to receive the data.

Returns:
Returns the resulting output stream.

showStatus

public void showStatus(java.lang.String message)
Invoking this method causes status information to be displayed at the bottom of the window associated with the Pluglet instance.

Parameters:
message - This is the status message to display.

setWindowSize

public void setWindowSize(int width,
                          int height)
Sets the desired size of the window associated with the Pluglet instance.

Parameters:
width - The width of the new window.
height - The height of the new window.

getTagInfo

public PlugletTagInfo getTagInfo()
For the Pluglet instance, returns the tag information associated with it. This is an object of type PlugletTagInfo, which contains all the name-value pairs for the attributes of the tag/element.

Returns:
Gets the Pluglet instance tag information.