1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
|
'\" t
.TH QNPlugin 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
QNPlugin \- The main factory for plugin objects
.SH SYNOPSIS
This class is part of the \fBQt Netscape Extension\fR.
.PP
\fC#include <ntqnp.h>\fR
.PP
.SS "Public Members"
.in +1c
.ti -1c
.BI "virtual \fB~QNPlugin\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 QNPInstance * \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 "QNPlugin * \fBcreate\fR ()"
.br
.ti -1c
.BI "QNPlugin * \fBactual\fR ()"
.br
.in -1c
.SS "Protected Members"
.in +1c
.ti -1c
.BI "\fBQNPlugin\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 Qt API.
.PP
The QNPlugin 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 QNPlugin::create(), which must be implemented in your plugin code to return some derived class of QNPlugin. The one QNPlugin object creates all QNPInstance instances for a web browser running in a single process.
.PP
Additionally, if Qt 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 "QNPlugin::QNPlugin ()\fC [protected]\fR"
Creates a QNPlugin. This may only be used by the constructor of the class, derived from QNPlugin, that is returned by your plugin's implementation of the QNPlugin::create() function.
.SH "QNPlugin::~QNPlugin ()\fC [virtual]\fR"
Destroys the QNPlugin. 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 "QNPlugin * QNPlugin::actual ()\fC [static]\fR"
Returns the plugin most recently returned by QNPlugin::create().
.SH "QNPlugin * QNPlugin::create ()\fC [static]\fR"
This function must be implemented by your plugin code. It should return a derived class of QNPlugin.
.SH "void * QNPlugin::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 QNPlugin::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 QNPInstance::getJavaPeer().
.SH "void * QNPlugin::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 QNPInstance::getJavaPeer().
.SH "const char * QNPlugin::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 * QNPlugin::getPluginDescriptionString () const\fC [pure virtual]\fR"
Returns a pointer to the plain-text description of the plugin.
.SH "const char * QNPlugin::getPluginNameString () const\fC [pure virtual]\fR"
Returns a pointer to the plain-text name of the plugin.
.SH "void QNPlugin::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 "QNPInstance * QNPlugin::newInstance ()\fC [pure virtual]\fR"
Override this function to return an appropriate derived class of QNPInstance.
.SH "void QNPlugin::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/qnplugin.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 Qt documentation is provided in HTML format; it is
located at $QTDIR/doc/html and can be read using Qt 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 (qnplugin.3qt) and the Qt
version (3.3.8).
|