Home |
The QtNPBindable class provides an interface between a widget and the web browser. More...
#include <QtNPBindable>
The QtNPBindable class provides an interface between a widget and the web browser.
Inherit your plugin widget class from both QWidget (or QObject) and QtNPBindable to be able to call the functions of this class, and to reimplement the virtual functions. The meta-object compiler requires you to inherit from the QObject subclass first.
class PluginWidget : public QWidget, public QtNPBindable
{
Q_OBJECT
public:
PluginWidget(QWidget *parent = 0)
{
}
//...
};
This enum specifies the different display modes of a plugin
Constant | Value | Description |
---|---|---|
QtNPBindable::Embedded | 1 | The plugin widget is embedded in a web page, usually with the <EMBED> or the <OBJECT> tag. |
QtNPBindable::Fullpage | 2 | The plugin widget is the primary content of the web browser, which is usually the case when the web browser displays a file the plugin supports. |
This enum specifies how an URL operation was completed
Constant | Value |
---|---|
QtNPBindable::ReasonDone | 0 |
QtNPBindable::ReasonBreak | 1 |
QtNPBindable::ReasonError | 2 |
QtNPBindable::ReasonUnknown | -1 |
Constructs a QtNPBindable object.
This can only happen when the plugin object is created.
Destroys the object.
This can only happen when the plugin object is destroyed.
Returns the display mode of the plugin.
Extracts the version of the browser into major and minor.
See http://devedge-temp.mozilla.org/library/manuals/2002/plugin/1.0/ for an explanation of those values.
See also getNppVersion() and userAgent().
Extracts the version of the plugin API used by this plugin into major and minor.
See http://devedge-temp.mozilla.org/library/manuals/2002/plugin/1.0/ for an explanation of those values.
See also getBrowserVersion() and userAgent().
Returns the browser's plugin instance associated with this plugin object. The instance is required to call functions in the Netscape Plugin API, i.e. NPN_GetJavaPeer().
The instance returned is only valid as long as this object is.
See http://devedge-temp.mozilla.org/library/manuals/2002/plugin/1.0/ for documentation of the NPP type.
Returns the mime type this plugin has been instantiated for.
Requests that the url be retrieved and sent to the named window (or a new window if window is empty), and returns the ID of the request that is delivered to transferComplete() when the get-operation has finished. Returns 0 when the browser or the system doesn't support notification, or -1 when an error occured.
void MyPlugin::aboutQtSoftware()
{
openUrl("http://qt.nokia.com");
}
See Netscape's JavaScript documentation for an explanation of window names.
See also transferComplete(), uploadData(), and uploadFile().
Returns the parameters passed to the plugin instance.
The framework sets the properties of the plugin to the corresponding parameters when the plugin object has been created, but you can use this function to process additional parameters.
Note that the SGML specification does not permit multiple arguments with the same name.
Reimplement this function to read data from source provided with mime type format. The data is the one specified in the src or data attribute of the <EMBED> or <OBJECT> tag of in HTML page. This function is called once for every stream the browser creates for the plugin.
Return true to indicate successfull processing of the data, otherwise return false. The default implementation does nothing and returns false.
Called as a result of a call to openUrl, uploadData or uploadFile. url corresponds to the respective parameter, and id to value returned by the call. reason indicates how the transfer was completed.
Posts data to url, and displays the result in window. Returns the ID of the request that is delivered to transferComplete() when the post-operation has finished. Returns 0 when the browser or the system doesn't support notification, or -1 when an error occured.
void MyPlugin::sendMail() { uploadData("mailto:[email protected]", QString(), "There is a new file for you!"); }
See Netscape's JavaScript documentation for an explanation of window names.
See also transferComplete(), openUrl(), and uploadFile().
Posts filename to url, and displays the result in window. Returns the ID of the request that is delivered to transferComplete() when the post-operation has finished. Returns 0 when the browser or the system doesn't support notification, or -1 when an error occured.
void MyPlugin::uploadFile()
{
uploadFile("ftp://ftp.somewhere.com/incoming", "response", "c:\\temp\\file.txt");
}
See Netscape's JavaScript documentation for an explanation of window names.
See also transferComplete(), uploadData(), and openUrl().
Returns the user agent (browser name) containing this plugin.
This is a wrapper around NPN_UserAgent.
See also getBrowserVersion().
Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies) | Trademarks | Qt Solutions |