source: trunk/doc/html/qnplugin.html

Last change on this file was 190, checked in by rudi, 14 years ago

reference documentation added

File size: 8.9 KB
Line 
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2<!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/extensions/nsplugin/src/qnp.cpp:1421 -->
3<html>
4<head>
5<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
6<title>QNPlugin Class</title>
7<style type="text/css"><!--
8fn { margin-left: 1cm; text-indent: -1cm; }
9a:link { color: #004faf; text-decoration: none }
10a:visited { color: #672967; text-decoration: none }
11body { background: #ffffff; color: black; }
12--></style>
13</head>
14<body>
15
16<table border="0" cellpadding="0" cellspacing="0" width="100%">
17<tr bgcolor="#E5E5E5">
18<td valign=center>
19 <a href="index.html">
20<font color="#004faf">Home</font></a>
21 | <a href="classes.html">
22<font color="#004faf">All&nbsp;Classes</font></a>
23 | <a href="mainclasses.html">
24<font color="#004faf">Main&nbsp;Classes</font></a>
25 | <a href="annotated.html">
26<font color="#004faf">Annotated</font></a>
27 | <a href="groups.html">
28<font color="#004faf">Grouped&nbsp;Classes</font></a>
29 | <a href="functions.html">
30<font color="#004faf">Functions</font></a>
31</td>
32<td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>QNPlugin Class Reference</h1>
33
34<p>The QNPlugin class provides the main factory for plugin objects.
35<a href="#details">More...</a>
36<p>This class is part of the <b>Qt Netscape Extension</b>.
37<p><tt>#include &lt;<a href="qnp-h.html">qnp.h</a>&gt;</tt>
38<p><a href="qnplugin-members.html">List of all member functions.</a>
39<h2>Public Members</h2>
40<ul>
41<li class=fn>virtual <a href="#~QNPlugin"><b>~QNPlugin</b></a> ()</li>
42<li class=fn>void <a href="#getVersionInfo"><b>getVersionInfo</b></a> ( int&nbsp;&amp;&nbsp;plugin_major, int&nbsp;&amp;&nbsp;plugin_minor, int&nbsp;&amp;&nbsp;browser_major, int&nbsp;&amp;&nbsp;browser_minor )</li>
43<li class=fn>virtual QNPInstance * <a href="#newInstance"><b>newInstance</b></a> () = 0</li>
44<li class=fn>virtual const char * <a href="#getMIMEDescription"><b>getMIMEDescription</b></a> () const = 0</li>
45<li class=fn>virtual const char * <a href="#getPluginNameString"><b>getPluginNameString</b></a> () const = 0</li>
46<li class=fn>virtual const char * <a href="#getPluginDescriptionString"><b>getPluginDescriptionString</b></a> () const = 0</li>
47<li class=fn>virtual void * <a href="#getJavaClass"><b>getJavaClass</b></a> ()</li>
48<li class=fn>virtual void <a href="#unuseJavaClass"><b>unuseJavaClass</b></a> ()</li>
49<li class=fn>void * <a href="#getJavaEnv"><b>getJavaEnv</b></a> () const</li>
50</ul>
51<h2>Static Public Members</h2>
52<ul>
53<li class=fn>QNPlugin * <a href="#create"><b>create</b></a> ()</li>
54<li class=fn>QNPlugin * <a href="#actual"><b>actual</b></a> ()</li>
55</ul>
56<h2>Protected Members</h2>
57<ul>
58<li class=fn><a href="#QNPlugin"><b>QNPlugin</b></a> ()</li>
59</ul>
60<hr><a name="details"></a><h2>Detailed Description</h2>
61<p> This class is defined in the <b>Qt <a href="netscape-plugin.html#Netscape">Netscape</a> Extension</b>, which can be found in the <tt>qt/extensions</tt> directory. It is not included in the main Qt API.
62<p>
63
64The QNPlugin class provides the main factory for plugin objects.
65<p>
66<p> This class is the heart of the plugin. One instance of this object
67is created when the plugin is <em>first</em> needed, by calling
68<a href="#create">QNPlugin::create</a>(), which must be implemented in your plugin code
69to return some derived class of QNPlugin. The one QNPlugin object
70creates all <a href="qnpinstance.html">QNPInstance</a> instances for a web browser running in a
71single process.
72<p> Additionally, if Qt is linked to the plugin as a dynamic library,
73only one instance of <a href="qapplication.html">QApplication</a> will exist <em>across all plugins that have been made with Qt</em>. So, your plugin should tread lightly
74on global settings. Do not, for example, use
75<a href="qapplication.html#setFont">QApplication::setFont</a>() - that will change the font in every
76widget of every Qt-based plugin currently loaded!
77
78<hr><h2>Member Function Documentation</h2>
79<h3 class=fn><a name="QNPlugin"></a>QNPlugin::QNPlugin ()<tt> [protected]</tt>
80</h3>
81Creates a QNPlugin. This may only be used by the constructor
82of the class, derived from QNPlugin, that is returned by your
83plugin's implementation of the <a href="#create">QNPlugin::create</a>() function.
84
85<h3 class=fn><a name="~QNPlugin"></a>QNPlugin::~QNPlugin ()<tt> [virtual]</tt>
86</h3>
87Destroys the QNPlugin. This is called by the plugin binding code
88just before the plugin is about to be unloaded from memory. If
89newWindow() has been called, a <a href="qapplication.html">QApplication</a> will still exist at
90this time, but will be deleted shortly after, just before the plugin
91is deleted.
92
93<h3 class=fn><a href="qnplugin.html">QNPlugin</a>&nbsp;* <a name="actual"></a>QNPlugin::actual ()<tt> [static]</tt>
94</h3>
95Returns the plugin most recently returned by <a href="#create">QNPlugin::create</a>().
96
97<h3 class=fn><a href="qnplugin.html">QNPlugin</a>&nbsp;* <a name="create"></a>QNPlugin::create ()<tt> [static]</tt>
98</h3>
99
100<p> This function must be implemented by your plugin code. It should return a
101derived class of QNPlugin.
102
103<h3 class=fn>void * <a name="getJavaClass"></a>QNPlugin::getJavaClass ()<tt> [virtual]</tt>
104</h3>
105Override this function to return a reference to the Java class that represents
106the plugin. The default returns 0, indicating no class.
107<p> If you override this class, you must also override
108<a href="#unuseJavaClass">QNPlugin::unuseJavaClass</a>().
109<p> The return value is actually a <tt>jref</tt>; we use <tt>void*</tt> so as to
110avoid burdening plugins which do not require Java.
111<p> <p>See also <a href="#getJavaEnv">getJavaEnv</a>() and <a href="qnpinstance.html#getJavaPeer">QNPInstance::getJavaPeer</a>().
112
113<h3 class=fn>void * <a name="getJavaEnv"></a>QNPlugin::getJavaEnv () const
114</h3>
115Returns a pointer to the Java execution environment, or 0 if
116either Java is disabled or an error occurred.
117<p> The return value is actually a <tt>JRIEnv*</tt>; we use <tt>void*</tt> so as
118to avoid burdening plugins which do not require Java.
119<p> <p>See also <a href="#getJavaClass">getJavaClass</a>() and <a href="qnpinstance.html#getJavaPeer">QNPInstance::getJavaPeer</a>().
120
121<h3 class=fn>const char * <a name="getMIMEDescription"></a>QNPlugin::getMIMEDescription () const<tt> [pure virtual]</tt>
122</h3>
123
124<p> Override this function to return the MIME description of the data formats
125supported by your plugin. The format of this string is shown by
126the following example:
127<p> <pre>
128 const char* getMIMEDescription() const
129 {
130 return "image/x-png:png:PNG Image;"
131 "image/png:png:PNG Image;"
132 "image/x-portable-bitmap:pbm:PBM Image;"
133 "image/x-portable-graymap:pgm:PGM Image;"
134 "image/x-portable-pixmap:ppm:PPM Image;"
135 "image/bmp:bmp:BMP Image;"
136 "image/x-ms-bmp:bmp:BMP Image;"
137 "image/x-xpixmap:xpm:XPM Image;"
138 "image/xpm:xpm:XPM Image";
139 }
140</pre>
141
142
143<h3 class=fn>const char * <a name="getPluginDescriptionString"></a>QNPlugin::getPluginDescriptionString () const<tt> [pure virtual]</tt>
144</h3>
145
146<p> Returns a pointer to the plain-text description of the plugin.
147
148<h3 class=fn>const char * <a name="getPluginNameString"></a>QNPlugin::getPluginNameString () const<tt> [pure virtual]</tt>
149</h3>
150
151<p> Returns a pointer to the plain-text name of the plugin.
152
153<h3 class=fn>void <a name="getVersionInfo"></a>QNPlugin::getVersionInfo ( int&nbsp;&amp;&nbsp;plugin_major, int&nbsp;&amp;&nbsp;plugin_minor, int&nbsp;&amp;&nbsp;browser_major, int&nbsp;&amp;&nbsp;browser_minor )
154</h3>
155Populates <em>*</em><em>plugin_major</em> and <em>*</em><em>plugin_minor</em> with the
156version of the plugin API and populates <em>*</em><em>browser_major</em> and
157<em>*</em><em>browser_minor</em> with the version of the web browser.
158
159<h3 class=fn><a href="qnpinstance.html">QNPInstance</a>&nbsp;* <a name="newInstance"></a>QNPlugin::newInstance ()<tt> [pure virtual]</tt>
160</h3>
161
162<p> Override this function to return an appropriate derived class of
163<a href="qnpinstance.html">QNPInstance</a>.
164
165<h3 class=fn>void <a name="unuseJavaClass"></a>QNPlugin::unuseJavaClass ()<tt> [virtual]</tt>
166</h3>
167This function is called when the plugin is shutting down. The
168function should <em>unuse</em> the Java class returned earlier by
169<a href="#getJavaClass">getJavaClass</a>().
170
171<!-- eof -->
172<hr><p>
173This file is part of the <a href="index.html">Qt toolkit</a>.
174Copyright &copy; 1995-2007
175<a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
176<table width=100% cellspacing=0 border=0><tr>
177<td>Copyright &copy; 2007
178<a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
179<td align=right><div align=right>Qt 3.3.8</div>
180</table></div></address></body>
181</html>
Note: See TracBrowser for help on using the repository browser.