This class is defined in the \fBQt Netscape Extension\fR, which can be found in the \fCqt/extensions\fR directory. It is not included in the main TQt API.
The TQNPInstance is responsible for creating an appropriate TQNPWidget window if required (not all plugins have windows), and for interacting with the input/output facilities intrinsic to plugins.
Note that there is \fIabsolutely no guarantee\fR 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 \fC<EMBED>\fR tag has a SRC parameter).
\fINone of Qt's GUI functionality\fR may be used until after the first call to newWindow(). This includes any use of TQPaintDevice (i.e. TQPixmap, TQWidget, and all subclasses), QApplication, anything related to TQPainter (TQBrush, etc.), fonts, TQMovie, TQToolTip, etc. Useful classes which specifically \fIcan\fR be used are TQImage, TQFile, and TQBuffer.
This restriction can easily be accommodated by structuring your plugin so that the task of the TQNPInstance is to gather data, while the task of the TQNPWidget is to provide a graphical interface to that data.
Returns the value of the named arguments, or 0 if no argument called \fIname\fR appears in the \fC<EMBED>\fR tag of this instance. If the argument appears, but has no value assigned, the empty string is returned. In summary:
Returns the number of arguments to the instance. Note that you should not normally rely on the ordering of arguments, and note that the SGML specification does not permit multiple arguments with the same name.
Returns the Java object associated with the plugin instance, an object of the plugin's Java class, or 0 if the plug-in does not have a Java class, Java is disabled, or an error occurred.
Requests that the \fIurl\fR be retrieved and sent to the named \fIwindow\fR. See Netscape's JavaScript documentation for an explanation of window names.
Requests that the given \fIurl\fR be retrieved and sent to the named \fIwindow\fR. See Netscape's JavaScript documentation for an explanation of window names. Passes the arguments including \fIdata\fR to NPN_GetURLNotify.
\fBThis function is under development and is subject to change.\fR
.PP
This function is \fInot tested\fR.
.PP
Requests the creation of a new data stream \fIfrom\fR the plugin. The MIME type and window are passed in \fImimetype\fR and \fIwindow\fR. \fIas_file\fR holds the AsFileOnly flag. It is an interface to the NPN_NewStream function of the Netscape Plugin API.
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 \fIsmode\fR to AsFileOnly, in which case the data will be delivered some time later to the streamAsFile() function. Otherwise, the data will be delivered in chunks to the write() function, which must consume at least as much data as returned by the most recent call to writeReady().
Called at most once, at some time after the TQNPInstance is created. If the plugin requires a window, this function should return a derived class of TQNPWidget that provides the required interface.
Called when a stream is delivered as a single file called \fIfname\fR rather than as chunks. This may be simpler for a plugin to deal with, but precludes any incremental behavior.
.PP
Note that the AsFileOnly method is not supported by Netscape 2.0 and MSIE 3.0.
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.
Called when incoming data is available for processing by the instance. The instance \fImust\fR 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 \fIlen\fR. \fIbuffer\fR is the data available for consumption. The \fIoffset\fR argument is merely an informational value indicating the total amount of data that has been consumed in prior calls.
.PP
This function should return the amount of data actually consumed.