QNPInstance Class ReferenceThe QNPInstance class provides a QObject that is a Web-browser plugin. More... This class is part of the Qt Netscape Extension. #include <qnp.h> Inherits QObject. Public Members
Protected Members
Detailed DescriptionThis class is defined in the Qt Netscape Extension, which can be found in the qt/extensions directory. It is not included in the main Qt API. The QNPInstance class provides a QObject that is a Web-browser 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 Type Documentation
|
Tag | Result |
---|---|
<EMBED ...> | arg("FOO") == 0 |
<EMBED FOO ...> | arg("FOO") == "" |
<EMBED FOO=BAR ...> | arg("FOO") == "BAR" |
The return value is actually a jref we use void* so as to avoid burdening plugins which do not require Java.
See also QNPlugin::getJavaClass() and QNPlugin::getJavaEnv().
Netscape: NPN_GetURLNotify method
This function is under development and is subject to change.
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 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 smode 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 was returned by the most recent call to writeReady().
Note that the AsFileOnly method is not supported by Netscape 2.0 and MSIE 3.0.
The default implementation accepts any stream.
Example: grapher/grapher.cpp.
This function is under development and is subject to change.
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 under development and is subject to change.
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 under development and is subject to change.
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 under development and is subject to change.
This function is not tested.
It is an encapsulation of the NPP_Print function of the Netscape Plugin API.
Note that the AsFileOnly method is not supported by Netscape 2.0 and MSIE 3.0.
See also newStreamCreated() and newStream().
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.
Example: grapher/grapher.cpp.
The default returns a very large value.
This file is part of the Qt toolkit. Copyright © 1995-2003 Trolltech. All Rights Reserved.
Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. | Qt 3.2 | |
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD. | ||
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP ! |
Copyright © 2000-2012 - www.developpez.com