1QNPlugin(3qt)                                                    QNPlugin(3qt)
2
3
4

NAME

6       QNPlugin - The main factory for plugin objects
7

SYNOPSIS

9       This class is part of the Qt Netscape Extension.
10
11       #include <qnp.h>
12
13   Public Members
14       virtual ~QNPlugin ()
15       void getVersionInfo ( int & plugin_major, int & plugin_minor, int &
16           browser_major, int & browser_minor )
17       virtual QNPInstance * newInstance () = 0
18       virtual const char * getMIMEDescription () const = 0
19       virtual const char * getPluginNameString () const = 0
20       virtual const char * getPluginDescriptionString () const = 0
21       virtual void * getJavaClass ()
22       virtual void unuseJavaClass ()
23       void * getJavaEnv () const
24
25   Static Public Members
26       QNPlugin * create ()
27       QNPlugin * actual ()
28
29   Protected Members
30       QNPlugin ()
31

DESCRIPTION

33       This class is defined in the Qt Netscape Extension, which can be found
34       in the qt/extensions directory. It is not included in the main Qt API.
35
36       The QNPlugin class provides the main factory for plugin objects.
37
38       This class is the heart of the plugin. One instance of this object is
39       created when the plugin is first needed, by calling QNPlugin::create(),
40       which must be implemented in your plugin code to return some derived
41       class of QNPlugin. The one QNPlugin object creates all QNPInstance
42       instances for a web browser running in a single process.
43
44       Additionally, if Qt is linked to the plugin as a dynamic library, only
45       one instance of QApplication will exist across all plugins that have
46       been made with Qt. So, your plugin should tread lightly on global
47       settings. Do not, for example, use QApplication::setFont() - that will
48       change the font in every widget of every Qt-based plugin currently
49       loaded!
50

MEMBER FUNCTION DOCUMENTATION

QNPlugin::QNPlugin () [protected]

53       Creates a QNPlugin. This may only be used by the constructor of the
54       class, derived from QNPlugin, that is returned by your plugin's
55       implementation of the QNPlugin::create() function.
56

QNPlugin::~QNPlugin () [virtual]

58       Destroys the QNPlugin. This is called by the plugin binding code just
59       before the plugin is about to be unloaded from memory. If newWindow()
60       has been called, a QApplication will still exist at this time, but will
61       be deleted shortly after, just before the plugin is deleted.
62

QNPlugin * QNPlugin::actual () [static]

64       Returns the plugin most recently returned by QNPlugin::create().
65

QNPlugin * QNPlugin::create () [static]

67       This function must be implemented by your plugin code. It should return
68       a derived class of QNPlugin.
69

void * QNPlugin::getJavaClass () [virtual]

71       Override this function to return a reference to the Java class that
72       represents the plugin. The default returns 0, indicating no class.
73
74       If you override this class, you must also override
75       QNPlugin::unuseJavaClass().
76
77       The return value is actually a jref; we use void* so as to avoid
78       burdening plugins which do not require Java.
79
80       See also getJavaEnv() and QNPInstance::getJavaPeer().
81

void * QNPlugin::getJavaEnv () const

83       Returns a pointer to the Java execution environment, or 0 if either
84       Java is disabled or an error occurred.
85
86       The return value is actually a JRIEnv*; we use void* so as to avoid
87       burdening plugins which do not require Java.
88
89       See also getJavaClass() and QNPInstance::getJavaPeer().
90

const char * QNPlugin::getMIMEDescription () const [pure virtual]

92       Override this function to return the MIME description of the data
93       formats supported by your plugin. The format of this string is shown by
94       the following example:
95
96           const char* getMIMEDescription() const
97           {
98               return "image/x-png:png:PNG Image;"
99                      "image/png:png:PNG Image;"
100                      "image/x-portable-bitmap:pbm:PBM Image;"
101                      "image/x-portable-graymap:pgm:PGM Image;"
102                      "image/x-portable-pixmap:ppm:PPM Image;"
103                      "image/bmp:bmp:BMP Image;"
104                      "image/x-ms-bmp:bmp:BMP Image;"
105                      "image/x-xpixmap:xpm:XPM Image;"
106                      "image/xpm:xpm:XPM Image";
107           }
108

const char * QNPlugin::getPluginDescriptionString () const [pure virtual]

110       Returns a pointer to the plain-text description of the plugin.
111

const char * QNPlugin::getPluginNameString () const [pure virtual]

113       Returns a pointer to the plain-text name of the plugin.
114

void QNPlugin::getVersionInfo ( int & plugin_major, int & plugin_minor, int &

116       browser_major, int & browser_minor )
117       Populates *plugin_major and *plugin_minor with the version of the
118       plugin API and populates *browser_major and *browser_minor with the
119       version of the web browser.
120

QNPInstance * QNPlugin::newInstance () [pure virtual]

122       Override this function to return an appropriate derived class of
123       QNPInstance.
124

void QNPlugin::unuseJavaClass () [virtual]

126       This function is called when the plugin is shutting down. The function
127       should unuse the Java class returned earlier by getJavaClass().
128
129

SEE ALSO

131       http://doc.trolltech.com/qnplugin.html
132       http://www.trolltech.com/faq/tech.html
133
135       Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com.  See the
136       license file included in the distribution for a complete license
137       statement.
138

AUTHOR

140       Generated automatically from the source code.
141

BUGS

143       If you find a bug in Qt, please report it as described in
144       http://doc.trolltech.com/bughowto.html.  Good bug reports help us to
145       help you. Thank you.
146
147       The definitive Qt documentation is provided in HTML format; it is
148       located at $QTDIR/doc/html and can be read using Qt Assistant or with a
149       web browser. This man page is provided as a convenience for those users
150       who prefer man pages, although this format is not officially supported
151       by Trolltech.
152
153       If you find errors in this manual page, please report them to qt-
154       bugs@trolltech.com.  Please include the name of the manual page
155       (qnplugin.3qt) and the Qt version (3.3.8).
156
157
158
159Trolltech AS                    2 February 2007                  QNPlugin(3qt)
Impressum