classQNPInstance.html
QNPInstance Class Reference
The QNPInstance class provides a QObject that is a Web-browser plugin. More...
#include <qnp.h>
Inheritance diagram for QNPInstance:

Public Types | |
enum | Reason { ReasonDone = 0, ReasonBreak = 1, ReasonError = 2, ReasonUnknown = -1 } |
enum | InstanceMode { Embed = 1, Full = 2, Background = 3 } |
enum | StreamMode { Normal = 1, Seek = 2, AsFile = 3, AsFileOnly = 4 } |
Public Member Functions | |
~QNPInstance () | |
int | argc () const |
const char * | argn (int) const |
const char * | argv (int) const |
const char * | arg (const char *name) const |
InstanceMode | mode () const |
const char * | userAgent () const |
virtual QNPWidget * | newWindow () |
QNPWidget * | widget () |
virtual bool | newStreamCreated (QNPStream *, StreamMode &smode) |
virtual int | writeReady (QNPStream *) |
virtual int | write (QNPStream *, int offset, int len, void *buffer) |
virtual void | streamDestroyed (QNPStream *) |
void | status (const char *msg) |
void | getURLNotify (const char *url, const char *window=0, void *data=0) |
void | getURL (const char *url, const char *window=0) |
void | postURL (const char *url, const char *window, uint len, const char *buf, bool file) |
QNPStream * | newStream (const char *mimetype, const char *window, bool as_file=FALSE) |
virtual void | streamAsFile (QNPStream *, const char *fname) |
void * | getJavaPeer () const |
virtual void | notifyURL (const char *url, Reason r, void *notifyData) |
virtual bool | printFullPage () |
virtual void | print (QPainter *) |
Protected Member Functions | |
QNPInstance () | |
Friends | |
class | QNPStream |
Detailed Description
The QNPInstance class provides a QObject that is a Web-browser plugin.Netscape Plugin
Deriving from QNPInstance creates an object that represents a single {<embed>} tag in an HTML document.
The QNPInstance is responsible for creating an appropriate QNPWidget window if required (not all plugins have windows), and for interacting with the input/output facilities intrinsic to plugins.
Note that there is {absolutely no guarantee} regarding the order in which functions are called. Sometimes the browser will call newWindow() first, at other times, newStreamCreated() will be called first (assuming the {<embed>} tag has a SRC parameter).
{None of Qt's GUI functionality} may be used until after the first call to newWindow(). This includes any use of QPaintDevice (ie. QPixmap, QWidget, and all subclasses), QApplication, anything related to QPainter (QBrush, etc.), fonts, QMovie, QToolTip, etc. Useful classes which specifically can be used are QImage, QFile, and QBuffer.
This restriction can easily be accommodated by structuring your plugin so that the task of the QNPInstance is to gather data, while the task of the QNPWidget is to provide a graphical interface to that data,
Member Enumeration Documentation
|
This enum type provides Qt-style names for three #defines in Embed - corresponds to NP_EMBED Full - corresponds to NP_FULL Background - corresponds to NP_BACKGROUND |
|
ReasonDone ReasonBreak ReasonError ReasonUnknown |
|
Normal Seek AsFile AsFileOnly |
Constructor & Destructor Documentation
|
Called when the plugin instance is about to disappear. |
|
Creates a QNPInstance. Can only be called from within a derived class created within QNPlugin::newInstance(). |
Member Function Documentation
|
Returns the value of the named arguments, or 0 if no argument called name appears in the
Tag Result |
|
Returns the number of arguments to the instance. Note that you should not normally rely on the ordering of arguments, and also note that the SGML specification does not permit multiple arguments with the same name.
|
|
Returns the name of the {i}-th argument.
|
|
Returns the value of the {i}-th argument. |
|
Returns the Java object associated with the plug-in instance, an object of the plug-in's Java class, or 0 if the plug-in does not have a Java class, Java is disabled, or an error occurred.
The return value is actually a
|
|
Requests that the url be retrieved and sent to the named window. See Netscape's JavaScript documentation for an explanation of window names. |
|
Print the instance full-page. By default, this returns FALSE, causing the browser to call the (embedded) print() function instead. Requests that the given url be retrieved and sent to the named window. See Netscape's JavaScript documentation for an explanation of window names. Passes the arguments including data to NPN_GetURLNotify.
|
|
Returns the mode of the plugin. |
|
This function is {not tested}.
Requests the creation of a new data stream from the plug-in. The mime type and window are passed in mimetype and window. as_file holds the |
|
This function is called when a new stream has been created. The instance should return TRUE if it accepts the processing of the stream. If the instance requires the stream as a file, it should set smode to
Note that the The default implementation accepts any stream. |
|
Called at most once, at some time after the QNPInstance is created. If the plugin requires a window, this function should return a derived class of QNPWidget that provides the required interface. Reimplemented in iARSInstance. |
|
This function is {not tested}. Called whenever a url is notified after a call to NPN_GetURLNotify with notifyData. The reason is given in r. It is an encapsulation of the NPP_URLNotify function of the Netscape Plugin API. See also: Netscape: NPP_URLNotify method |
|
This function is {not tested}. It is an interface to the NPN_PostURL function of the Netscape Plugin API. Passes url, window, buf, len, and file to NPN_PostURL. |
|
This function is {not tested}. Print the instance embedded in a page. It is an encapsulation of the NPP_Print function of the Netscape Plugin API. |
|
This function is {not tested}. It is an encapsulation of the NPP_Print function of the Netscape Plugin API. |
|
Sets the status message in the browser containing this instance to msg. |
|
Called when a stream is delivered as a single file called fname rather than as chunks. This may be simpler for a plugin to deal with, but precludes any incremental behavior.
Note that the
|
|
Called when a stream is destroyed. At this point, the stream may be complete() and okay(). If it is not okay(), then an error has occurred. If it is okay(), but not complete(), then the user has cancelled the transmission: do not give an error message in this case. |
|
Returns the user agent (browser name) containing this instance. |
|
Returns the plugin window created by newWindow(), if any. |
|
Called when incoming data is available for processing by the instance. The instance must consume at least the amount that it returned in the most recent call to writeReady(), but it may consume up to the amount given by len. buffer is the data available for consumption. The offset argument is merely an informational value indicating the total amount of data that has been consumed in prior calls. This function should return the amount of data actually consumed. Reimplemented in iARSInstance. |
|
Returns the minimum amount of data the instance is willing to receive from the given stream. The default returns a very large value. |
The documentation for this class was generated from the following files:
- qnp.h
- qnp.cpp
Generated on Thu Nov 25 15:42:55 2004 for iARS(internetAudioRenderingSystem) by
