'\" t .TH TQNPlugin 3qt "2 February 2007" "Trolltech AS" \" -*- nroff -*- .\" Copyright 1992-2007 Trolltech ASA. All rights reserved. See the .\" license file included in the distribution for a complete license .\" statement. .\" .ad l .nh .SH NAME TQNPlugin \- The main factory for plugin objects .SH SYNOPSIS This class is part of the \fBQt Netscape Extension\fR. .PP \fC#include \fR .PP .SS "Public Members" .in +1c .ti -1c .BI "virtual \fB~TQNPlugin\fR ()" .br .ti -1c .BI "void \fBgetVersionInfo\fR ( int & plugin_major, int & plugin_minor, int & browser_major, int & browser_minor )" .br .ti -1c .BI "virtual TQNPInstance * \fBnewInstance\fR () = 0" .br .ti -1c .BI "virtual const char * \fBgetMIMEDescription\fR () const = 0" .br .ti -1c .BI "virtual const char * \fBgetPluginNameString\fR () const = 0" .br .ti -1c .BI "virtual const char * \fBgetPluginDescriptionString\fR () const = 0" .br .ti -1c .BI "virtual void * \fBgetJavaClass\fR ()" .br .ti -1c .BI "virtual void \fBunuseJavaClass\fR ()" .br .ti -1c .BI "void * \fBgetJavaEnv\fR () const" .br .in -1c .SS "Static Public Members" .in +1c .ti -1c .BI "TQNPlugin * \fBcreate\fR ()" .br .ti -1c .BI "TQNPlugin * \fBactual\fR ()" .br .in -1c .SS "Protected Members" .in +1c .ti -1c .BI "\fBTQNPlugin\fR ()" .br .in -1c .SH DESCRIPTION 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. .PP The TQNPlugin class provides the main factory for plugin objects. .PP This class is the heart of the plugin. One instance of this object is created when the plugin is \fIfirst\fR needed, by calling TQNPlugin::create(), which must be implemented in your plugin code to return some derived class of TQNPlugin. The one TQNPlugin object creates all TQNPInstance instances for a web browser running in a single process. .PP Additionally, if TQt is linked to the plugin as a dynamic library, only one instance of QApplication will exist \fIacross all plugins that have been made with Qt\fR. So, your plugin should tread lightly on global settings. Do not, for example, use QApplication::setFont() - that will change the font in every widget of every Qt-based plugin currently loaded! .SH MEMBER FUNCTION DOCUMENTATION .SH "TQNPlugin::TQNPlugin ()\fC [protected]\fR" Creates a TQNPlugin. This may only be used by the constructor of the class, derived from TQNPlugin, that is returned by your plugin's implementation of the TQNPlugin::create() function. .SH "TQNPlugin::~TQNPlugin ()\fC [virtual]\fR" Destroys the TQNPlugin. This is called by the plugin binding code just before the plugin is about to be unloaded from memory. If newWindow() has been called, a QApplication will still exist at this time, but will be deleted shortly after, just before the plugin is deleted. .SH "TQNPlugin * TQNPlugin::actual ()\fC [static]\fR" Returns the plugin most recently returned by TQNPlugin::create(). .SH "TQNPlugin * TQNPlugin::create ()\fC [static]\fR" This function must be implemented by your plugin code. It should return a derived class of TQNPlugin. .SH "void * TQNPlugin::getJavaClass ()\fC [virtual]\fR" Override this function to return a reference to the Java class that represents the plugin. The default returns 0, indicating no class. .PP If you override this class, you must also override TQNPlugin::unuseJavaClass(). .PP The return value is actually a \fCjref\fR; we use \fCvoid*\fR so as to avoid burdening plugins which do not require Java. .PP See also getJavaEnv() and TQNPInstance::getJavaPeer(). .SH "void * TQNPlugin::getJavaEnv () const" Returns a pointer to the Java execution environment, or 0 if either Java is disabled or an error occurred. .PP The return value is actually a \fCJRIEnv*\fR; we use \fCvoid*\fR so as to avoid burdening plugins which do not require Java. .PP See also getJavaClass() and TQNPInstance::getJavaPeer(). .SH "const char * TQNPlugin::getMIMEDescription () const\fC [pure virtual]\fR" Override this function to return the MIME description of the data formats supported by your plugin. The format of this string is shown by the following example: .PP .nf .br const char* getMIMEDescription() const .br { .br return "image/x-png:png:PNG Image;" .br "image/png:png:PNG Image;" .br "image/x-portable-bitmap:pbm:PBM Image;" .br "image/x-portable-graymap:pgm:PGM Image;" .br "image/x-portable-pixmap:ppm:PPM Image;" .br "image/bmp:bmp:BMP Image;" .br "image/x-ms-bmp:bmp:BMP Image;" .br "image/x-xpixmap:xpm:XPM Image;" .br "image/xpm:xpm:XPM Image"; .br } .fi .SH "const char * TQNPlugin::getPluginDescriptionString () const\fC [pure virtual]\fR" Returns a pointer to the plain-text description of the plugin. .SH "const char * TQNPlugin::getPluginNameString () const\fC [pure virtual]\fR" Returns a pointer to the plain-text name of the plugin. .SH "void TQNPlugin::getVersionInfo ( int & plugin_major, int & plugin_minor, int & browser_major, int & browser_minor )" Populates \fI*\fR\fIplugin_major\fR and \fI*\fR\fIplugin_minor\fR with the version of the plugin API and populates \fI*\fR\fIbrowser_major\fR and \fI*\fR\fIbrowser_minor\fR with the version of the web browser. .SH "TQNPInstance * TQNPlugin::newInstance ()\fC [pure virtual]\fR" Override this function to return an appropriate derived class of TQNPInstance. .SH "void TQNPlugin::unuseJavaClass ()\fC [virtual]\fR" This function is called when the plugin is shutting down. The function should \fIunuse\fR the Java class returned earlier by getJavaClass(). .SH "SEE ALSO" .BR http://doc.trolltech.com/tqnplugin.html .BR http://www.trolltech.com/faq/tech.html .SH COPYRIGHT Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the license file included in the distribution for a complete license statement. .SH AUTHOR Generated automatically from the source code. .SH BUGS If you find a bug in Qt, please report it as described in .BR http://doc.trolltech.com/bughowto.html . Good bug reports help us to help you. Thank you. .P The definitive TQt documentation is provided in HTML format; it is located at $TQTDIR/doc/html and can be read using TQt Assistant or with a web browser. This man page is provided as a convenience for those users who prefer man pages, although this format is not officially supported by Trolltech. .P If you find errors in this manual page, please report them to .BR qt-bugs@trolltech.com . Please include the name of the manual page (tqnplugin.3qt) and the Qt version (3.3.8).