Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Public Attributes | Private Attributes
EmbeddedFramePluginInstance Class Reference

#include <EmbeddedFramePluginInstance.h>

Inheritance diagram for EmbeddedFramePluginInstance:
Inheritance graph
[legend]
Collaboration diagram for EmbeddedFramePluginInstance:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 EmbeddedFramePluginInstance ()
virtual ~EmbeddedFramePluginInstance ()
NS_DECL_ISUPPORTS NS_IMETHOD Initialize (nsIPluginInstancePeer *peer)
 Initializes a newly created plugin instance, passing to it the plugin instance peer which it should use for all communication back to the browser.
NS_IMETHOD GetPeer (nsIPluginInstancePeer **resultingPeer)
 Returns a reference back to the plugin instance peer.
NS_IMETHOD Start (void)
 Called to instruct the plugin instance to start.
NS_IMETHOD Stop (void)
 Called to instruct the plugin instance to stop, thereby suspending its state.
NS_IMETHOD Destroy (void)
 Called to instruct the plugin instance to destroy itself.
NS_IMETHOD SetWindow (nsPluginWindow *window)
 Called when the window containing the plugin instance changes.
NS_IMETHOD NewStream (nsIPluginStreamListener **listener)
 Called to tell the plugin that the initial src/data stream is ready.
NS_IMETHOD Print (nsPluginPrint *platformPrint)
 Called to instruct the plugin instance to print itself to a printer.
NS_IMETHOD GetValue (nsPluginInstanceVariable variable, void *value)
 Returns the value of a variable associated with the plugin instance.
NS_IMETHOD HandleEvent (nsPluginEvent *event, PRBool *handled)
 Handles an event.
void setFrame (EmbeddedFrame *frame)
 EmbeddedFramePluginInstance ()
virtual ~EmbeddedFramePluginInstance ()
NS_DECL_ISUPPORTS NS_IMETHOD Initialize (nsIPluginInstancePeer *peer)
 Initializes a newly created plugin instance, passing to it the plugin instance peer which it should use for all communication back to the browser.
NS_IMETHOD GetPeer (nsIPluginInstancePeer **resultingPeer)
 Returns a reference back to the plugin instance peer.
NS_IMETHOD Start (void)
 Called to instruct the plugin instance to start.
NS_IMETHOD Stop (void)
 Called to instruct the plugin instance to stop, thereby suspending its state.
NS_IMETHOD Destroy (void)
 Called to instruct the plugin instance to destroy itself.
NS_IMETHOD SetWindow (nsPluginWindow *window)
 Called when the window containing the plugin instance changes.
NS_IMETHOD NewStream (nsIPluginStreamListener **listener)
 Called to tell the plugin that the initial src/data stream is ready.
NS_IMETHOD Print (nsPluginPrint *platformPrint)
 Called to instruct the plugin instance to print itself to a printer.
NS_IMETHOD GetValue (nsPluginInstanceVariable variable, void *value)
 Returns the value of a variable associated with the plugin instance.
NS_IMETHOD HandleEvent (nsPluginEvent *event, PRBool *handled)
 Handles an event.
void setFrame (EmbeddedFrame *frame)
void initialize (in nsIPluginInstancePeer aPeer)
 Initializes a newly created plugin instance, passing to it the plugin instance peer which it should use for all communication back to the browser.
void start ()
 Called to instruct the plugin instance to start.
void stop ()
 Called to instruct the plugin instance to stop, thereby suspending its state.
void destroy ()
 Called to instruct the plugin instance to destroy itself.
void setWindow (in nsPluginWindowPtr aWindow)
 Called when the window containing the plugin instance changes.
void newStream (out nsIPluginStreamListener aListener)
 Called to tell the plugin that the initial src/data stream is ready.
void print (in nsPluginPrintPtr aPlatformPrint)
 Called to instruct the plugin instance to print itself to a printer.
void getValue (in nsPluginInstanceVariable aVariable, in voidPtr aValue)
 Returns the value of a variable associated with the plugin instance.
void handleEvent (in nsPluginEventPtr aEvent, out boolean aHandled)
 Handles an event.

Public Attributes

readonly attribute
nsIPluginInstancePeer 
peer
 Returns a reference back to the plugin instance peer.

Private Attributes

nsIPluginInstancePeermPeer
MRJPluginInstancemParentInstance
EmbeddedFramemFrame

Detailed Description

Definition at line 48 of file EmbeddedFramePluginInstance.h.


Constructor & Destructor Documentation

Definition at line 50 of file EmbeddedFramePluginInstance.cpp.

       :      mPeer(NULL), mFrame(NULL)
{
}

Definition at line 55 of file EmbeddedFramePluginInstance.cpp.

{
       if (mFrame != NULL)
              delete mFrame;
}

Member Function Documentation

Called to instruct the plugin instance to destroy itself.

This is called when it become no longer possible to return to the plugin instance, either because the browser window's history list of pages is being trimmed, or because the window containing this page in the history is being closed.

Returns:
- NS_OK if this operation was successful

Definition at line 89 of file EmbeddedFramePluginInstance.cpp.

{
       NS_IF_RELEASE(mPeer);

       // assume that Java will release this frame.
       if (mFrame != NULL) {
              mFrame->showHide(false);
              // delete mFrame;
              mFrame = NULL;
       }

       return NS_OK;
}

Here is the call graph for this function:

Called to instruct the plugin instance to destroy itself.

This is called when it become no longer possible to return to the plugin instance, either because the browser window's history list of pages is being trimmed, or because the window containing this page in the history is being closed.

Returns:
- NS_OK if this operation was successful

Called to instruct the plugin instance to destroy itself.

This is called when it become no longer possible to return to the plugin instance, either because the browser window's history list of pages is being trimmed, or because the window containing this page in the history is being closed.

Returns:
- NS_OK if this operation was successful

Returns a reference back to the plugin instance peer.

This method is used whenever the browser needs to obtain the peer back from a plugin instance. The implementation of this method should be sure to increment the reference count on the peer by calling AddRef.

Parameters:
resultingPeer- the resulting plugin instance peer
Returns:
- NS_OK if this operation was successful

Definition at line 80 of file EmbeddedFramePluginInstance.cpp.

{
       if (mPeer != NULL) {
              *resultingPeer = mPeer;
              mPeer->AddRef();
       }
       return NS_OK;
}

Returns a reference back to the plugin instance peer.

This method is used whenever the browser needs to obtain the peer back from a plugin instance. The implementation of this method should be sure to increment the reference count on the peer by calling AddRef.

Parameters:
resultingPeer- the resulting plugin instance peer
Returns:
- NS_OK if this operation was successful

Returns the value of a variable associated with the plugin instance.

Parameters:
variable- the plugin instance variable to get
value- the address of where to store the resulting value
Returns:
- NS_OK if this operation was successful

Definition at line 165 of file EmbeddedFramePluginInstance.h.

Returns the value of a variable associated with the plugin instance.

Parameters:
variable- the plugin instance variable to get
value- the address of where to store the resulting value
Returns:
- NS_OK if this operation was successful

Definition at line 166 of file EmbeddedFramePluginInstance.h.

void nsIPluginInstance::getValue ( in nsPluginInstanceVariable  aVariable,
in voidPtr  aValue 
) [inherited]

Returns the value of a variable associated with the plugin instance.

Parameters:
aVariable- the plugin instance variable to get
aValue- the address of where to store the resulting value
Returns:
- NS_OK if this operation was successful
void nsIPluginInstance::handleEvent ( in nsPluginEventPtr  aEvent,
out boolean  aHandled 
) [inherited]

Handles an event.

An nsIEventHandler can also get registered with with nsIPluginManager2::RegisterWindow and will be called whenever an event comes in for that window.

Note that for Unix and Mac the nsPluginEvent structure is different from the old NPEvent structure -- it's no longer the native event record, but is instead a struct. This was done for future extensibility, and so that the Mac could receive the window argument too. For Windows and OS2, it's always been a struct, so there's no change for them.

(Corresponds to NPP_HandleEvent.)

Parameters:
aEvent- the event to be handled
aHandled- set to PR_TRUE if event was handled
Returns:
- NS_OK if this operation was successful

Handles an event.

An nsIEventHandler can also get registered with with nsIPluginManager2::RegisterWindow and will be called whenever an event comes in for that window.

Note that for Unix and Mac the nsPluginEvent structure is different from the old NPEvent structure -- it's no longer the native event record, but is instead a struct. This was done for future extensibility, and so that the Mac could receive the window argument too. For Windows and OS2, it's always been a struct, so there's no change for them.

(Corresponds to NPP_HandleEvent.)

Parameters:
event- the event to be handled
handled- set to PR_TRUE if event was handled
Returns:
- NS_OK if this operation was successful

Definition at line 114 of file EmbeddedFramePluginInstance.cpp.

{
       if (mFrame != NULL)
              *eventHandled = mFrame->handleEvent(pluginEvent->event);
       return NS_OK;
}

Here is the call graph for this function:

Handles an event.

An nsIEventHandler can also get registered with with nsIPluginManager2::RegisterWindow and will be called whenever an event comes in for that window.

Note that for Unix and Mac the nsPluginEvent structure is different from the old NPEvent structure -- it's no longer the native event record, but is instead a struct. This was done for future extensibility, and so that the Mac could receive the window argument too. For Windows and OS2, it's always been a struct, so there's no change for them.

(Corresponds to NPP_HandleEvent.)

Parameters:
event- the event to be handled
handled- set to PR_TRUE if event was handled
Returns:
- NS_OK if this operation was successful

Initializes a newly created plugin instance, passing to it the plugin instance peer which it should use for all communication back to the browser.

Parameters:
peer- the corresponding plugin instance peer
Returns:
- NS_OK if this operation was successful

Definition at line 61 of file EmbeddedFramePluginInstance.cpp.

{
       mPeer = peer;
       NS_ADDREF(mPeer);

       nsIPluginTagInfo* tagInfo = NULL;
       if (mPeer->QueryInterface(NS_GET_IID(nsIPluginTagInfo), (void **)&tagInfo) == NS_OK) {
              const char* frameValue = NULL;
              if (tagInfo->GetAttribute("JAVAFRAME", &frameValue) == NS_OK) {
                     sscanf(frameValue, "%X", &mFrame);
              }
              if (mFrame != NULL)
                     mFrame->setPluginInstance(this);
              NS_RELEASE(tagInfo);
       }

       return NS_OK;
}

Here is the call graph for this function:

Initializes a newly created plugin instance, passing to it the plugin instance peer which it should use for all communication back to the browser.

Parameters:
peer- the corresponding plugin instance peer
Returns:
- NS_OK if this operation was successful

Initializes a newly created plugin instance, passing to it the plugin instance peer which it should use for all communication back to the browser.

Parameters:
aPeer- the corresponding plugin instance peer
Returns:
- NS_OK if this operation was successful

Called to tell the plugin that the initial src/data stream is ready.

Expects the plugin to return a nsIPluginStreamListener.

(Corresponds to NPP_NewStream.)

Parameters:
listener- listener the browser will use to give the plugin the data
Returns:
- NS_OK if this operation was successful

Definition at line 137 of file EmbeddedFramePluginInstance.h.

    {
       *listener = NULL;
       return NS_ERROR_NOT_IMPLEMENTED;
    }

Called to tell the plugin that the initial src/data stream is ready.

Expects the plugin to return a nsIPluginStreamListener.

(Corresponds to NPP_NewStream.)

Parameters:
listener- listener the browser will use to give the plugin the data
Returns:
- NS_OK if this operation was successful

Definition at line 138 of file EmbeddedFramePluginInstance.h.

    {
       *listener = NULL;
       return NS_ERROR_NOT_IMPLEMENTED;
    }

Called to tell the plugin that the initial src/data stream is ready.

Expects the plugin to return a nsIPluginStreamListener.

(Corresponds to NPP_NewStream.)

Parameters:
aListener- listener the browser will use to give the plugin the data
Returns:
- NS_OK if this operation was successful

Called to instruct the plugin instance to print itself to a printer.

(Corresponds to NPP_Print.)

Parameters:
platformPrint- platform-specific printing information
Returns:
- NS_OK if this operation was successful

Definition at line 152 of file EmbeddedFramePluginInstance.h.

Called to instruct the plugin instance to print itself to a printer.

(Corresponds to NPP_Print.)

Parameters:
platformPrint- platform-specific printing information
Returns:
- NS_OK if this operation was successful

Definition at line 153 of file EmbeddedFramePluginInstance.h.

void nsIPluginInstance::print ( in nsPluginPrintPtr  aPlatformPrint) [inherited]

Called to instruct the plugin instance to print itself to a printer.

(Corresponds to NPP_Print.)

Parameters:
aPlatformPrint- platform-specific printing information
Returns:
- NS_OK if this operation was successful

Definition at line 121 of file EmbeddedFramePluginInstance.cpp.

{
       mFrame = frame;
}

Here is the caller graph for this function:

Called when the window containing the plugin instance changes.

(Corresponds to NPP_SetWindow.)

Parameters:
window- the plugin window structure
Returns:
- NS_OK if this operation was successful

Definition at line 103 of file EmbeddedFramePluginInstance.cpp.

{
       if (mFrame != NULL) {
              if (pluginWindow != NULL)
                     mFrame->setWindow(WindowRef(pluginWindow->window->port));
              else
                     mFrame->setWindow(NULL);
       }
       return NS_OK;
}

Here is the call graph for this function:

Called when the window containing the plugin instance changes.

(Corresponds to NPP_SetWindow.)

Parameters:
window- the plugin window structure
Returns:
- NS_OK if this operation was successful

Called when the window containing the plugin instance changes.

(Corresponds to NPP_SetWindow.)

Parameters:
aWindow- the plugin window structure
Returns:
- NS_OK if this operation was successful

Called to instruct the plugin instance to start.

This will be called after the plugin is first created and initialized, and may be called after the plugin is stopped (via the Stop method) if the plugin instance is returned to in the browser window's history.

Returns:
- NS_OK if this operation was successful

Definition at line 86 of file EmbeddedFramePluginInstance.h.

    {
       return NS_OK;
    }

Called to instruct the plugin instance to start.

This will be called after the plugin is first created and initialized, and may be called after the plugin is stopped (via the Stop method) if the plugin instance is returned to in the browser window's history.

Returns:
- NS_OK if this operation was successful

Definition at line 87 of file EmbeddedFramePluginInstance.h.

    {
       return NS_OK;
    }
void nsIPluginInstance::start ( ) [inherited]

Called to instruct the plugin instance to start.

This will be called after the plugin is first created and initialized, and may be called after the plugin is stopped (via the Stop method) if the plugin instance is returned to in the browser window's history.

Returns:
- NS_OK if this operation was successful

Called to instruct the plugin instance to stop, thereby suspending its state.

This method will be called whenever the browser window goes on to display another page and the page containing the plugin goes into the window's history list.

Returns:
- NS_OK if this operation was successful

Definition at line 100 of file EmbeddedFramePluginInstance.h.

    {
       return NS_OK;
    }

Called to instruct the plugin instance to stop, thereby suspending its state.

This method will be called whenever the browser window goes on to display another page and the page containing the plugin goes into the window's history list.

Returns:
- NS_OK if this operation was successful

Definition at line 101 of file EmbeddedFramePluginInstance.h.

    {
       return NS_OK;
    }
void nsIPluginInstance::stop ( ) [inherited]

Called to instruct the plugin instance to stop, thereby suspending its state.

This method will be called whenever the browser window goes on to display another page and the page containing the plugin goes into the window's history list.

Returns:
- NS_OK if this operation was successful

Member Data Documentation

Definition at line 195 of file EmbeddedFramePluginInstance.h.

Definition at line 194 of file EmbeddedFramePluginInstance.h.

Definition at line 193 of file EmbeddedFramePluginInstance.h.

Returns a reference back to the plugin instance peer.

This method is used whenever the browser needs to obtain the peer back from a plugin instance. The implementation of this method should be sure to increment the reference count on the peer by calling AddRef.

Parameters:
aPeer- the resulting plugin instance peer
Returns:
- NS_OK if this operation was successful

Definition at line 96 of file nsIPluginInstance.idl.


The documentation for this class was generated from the following files: