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
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Qt Toolkit - QNPlugin Class</title><style type="text/css"><!--
h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }body { background: white; color: black; }
--></style>
</head><body bgcolor="#ffffff">
<table width="100%">
<tr><td><a href="index.html">
<img width="100" height="100" src="qtlogo.png"
alt="Home" border="0"><img width="100"
height="100" src="face.png" alt="Home" border="0">
</a><td valign=top><div align=right><img src="dochead.png" width="472" height="27"><br>
<a href="classes.html"><b>Classes</b></a>
-<a href="annotated.html">Annotated</a>
- <a href="hierarchy.html">Tree</a>
-<a href="functions.html">Functions</a>
-<a href="index.html">Home</a>
-<a href="topicals.html"><b>Structure</b></a>
</div>
</table>
<h1 align=center>QNPlugin Class Reference</h1><br clear="all">
<p>
The plugin central factory.
<p>This class is part of the <b>Qt NSPlugin Extension.</b>
<a href="#details">More...</a>
<p>
<code>#include <<a href="qnp-h.html">qnp.h</a>></code>
<p><a href="qnplugin-members.html">List of all member functions.</a>
<h2>Public Members</h2>
<ul>
<li><div class="fn">virtual<a href="#1a94aa"><b>~QNPlugin</b></a>()</div>
<li><div class="fn">void<a href="#b80226"><b>getVersionInfo</b></a>(int&plugin_major, int&plugin_minor, int&browser_major, int&browser_minor)</div>
<li><div class="fn">virtualQNPInstance*<a href="#41f769"><b>newInstance</b></a>()</div>
<li><div class="fn">virtualconstchar*<a href="#be2dc5"><b>getMIMEDescription</b></a>()const</div>
<li><div class="fn">virtualconstchar*<a href="#99a2af"><b>getPluginNameString</b></a>()const</div>
<li><div class="fn">virtualconstchar*<a href="#9b9280"><b>getPluginDescriptionString</b></a>()const</div>
<li><div class="fn">virtualvoid*<a href="#a36de2"><b>getJavaClass</b></a>()</div>
<li><div class="fn">virtualvoid<a href="#e0b0ba"><b>unuseJavaClass</b></a>()</div>
<li><div class="fn">void*<a href="#515079"><b>getJavaEnv</b></a>()const</div>
</ul>
<h2>Static Public Members</h2>
<ul>
<li><div class="fn">QNPlugin*<a href="#f32031"><b>create</b></a>()</div>
<li><div class="fn">QNPlugin*<a href="#74633f"><b>actual</b></a>()</div>
</ul>
<h2>Protected Members</h2>
<ul>
<li><div class="fn"><a href="#4e8e1b"><b>QNPlugin</b></a>()</div>
</ul>
<hr><h2><a name="details"></a>Detailed Description</h2>
This class is defined in the <b>Qt NSPlugin Extension</b>, which can be found in the <tt>qt/extensions</tt> directory.
It is not included in the main Qt API.
<p>
The plugin central factory.
<p>
This class is the heart of the plugin. One instance of this object is
created when the plugin is <em>first</em> needed, by calling
<a href="#f32031">QNPlugin::create</a>(), which must be implemented in your plugin code to
return some derived class of QNPlugin. The one QNPlugin object creates
all instances for a single running Web-browser process.
<p>Additionally, if Qt is linked to the plugin as
a dynamic library, only 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 on global settings - do not for
example, use <a href="qapplication.html#3d926a">QApplication::setFont</a>() - that will change the font in
every widget of every Qt-based plugin currently loaded!.
<p>Examples:
<a href="qtimage-qtimage-cpp.html#QNPlugin">qtimage/qtimage.cpp</a>
<a href="grapher-grapher-cpp.html#QNPlugin">grapher/grapher.cpp</a>
<a href="trivial-trivial-cpp.html#QNPlugin">trivial/trivial.cpp</a>
<hr><h2>Member Function Documentation</h2>
<h3 class="fn"><a name="4e8e1b"></a>QNPlugin::QNPlugin() <code>[protected]</code></h3>
<p>Creates a QNPlugin. This may only be used by the constructor
derived class
returned by plugin's implementation of the <a href="#f32031">QNPlugin::create</a>() function.
<h3 class="fn"><a name="1a94aa"></a>QNPlugin::~QNPlugin() <code>[virtual]</code></h3>
<p>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 <a href="qapplication.html">QApplication</a> will still exist at this time, but will
be deleted shortly after before the plugin is deleted.
<h3 class="fn">QNPlugin*<a name="74633f"></a>QNPlugin::actual() <code>[static]</code></h3>
<p>Returns the plugin most recently returns by <a href="#f32031">QNPlugin::create</a>().
<h3 class="fn">QNPlugin*<a name="f32031"></a>QNPlugin::create() <code>[static]</code></h3>
<p>This must be implemented by your plugin code. It should return a derived
class of QNPlugin.
<h3 class="fn">void*<a name="a36de2"></a>QNPlugin::getJavaClass() <code>[virtual]</code></h3>
<p>Override to return a reference to the Java class that represents
the plugin. The default returns 0, indicating no class.
<p>If you override this class, you must also override
<a href="#e0b0ba">QNPlugin::unuseJavaClass</a>().
<p>The return value is actually a <tt>jref</tt> we use <tt>void*</tt> so
as to avoid burdening plugins which do not require Java.
<p>See also <a href="#515079">getJavaEnv</a>() and <a href="qnpinstance.html#d20a99">QNPInstance::getJavaPeer</a>().
<h3 class="fn">void*<a name="515079"></a>QNPlugin::getJavaEnv()const</h3>
<p>Returns a pointer to the Java execution environment, or 0 if
Java is disabled or an error occurred.
<p>The return value is actually a <tt>JRIEnv*</tt> we use <tt>void*</tt> so
as to avoid burdening plugins which do not require Java.
<p>See also <a href="#a36de2">getJavaClass</a>() and <a href="qnpinstance.html#d20a99">QNPInstance::getJavaPeer</a>().
<h3 class="fn">constchar*<a name="be2dc5"></a>QNPlugin::getMIMEDescription()const <code>[virtual]</code></h3>
<p>Override this to return the MIME description of the data formats
supported by your plugin. The format of this string is described
by the following example:
<p><pre> const char* getMIMEDescription() const
{
return "image/x-png:png:PNG Image;"
"image/png:png:PNG Image;"
"image/x-portable-bitmap:pbm:PBM Image;"
"image/x-portable-graymap:pgm:PGM Image;"
"image/x-portable-pixmap:ppm:PPM Image;"
"image/bmp:bmp:BMP Image;"
"image/x-ms-bmp:bmp:BMP Image;"
"image/x-xpixmap:xpm:XPM Image;"
"image/xpm:xpm:XPM Image";
}
</pre>
<h3 class="fn">constchar*<a name="9b9280"></a>QNPlugin::getPluginDescriptionString()const <code>[virtual]</code></h3>
<p>Returns a plain-text description of the plugin.
<h3 class="fn">constchar*<a name="99a2af"></a>QNPlugin::getPluginNameString()const <code>[virtual]</code></h3>
<p>Returns the plain-text name of the plugin.
<h3 class="fn">void<a name="b80226"></a>QNPlugin::getVersionInfo(int&plugin_major, int&plugin_minor, int&browser_major, int&browser_minor)</h3>
<p>Returns the version information - the version of the plugin API, and
the version of the browser.
<h3 class="fn"><a href="qnpinstance.html">QNPInstance</a>*<a name="41f769"></a>QNPlugin::newInstance() <code>[virtual]</code></h3>
<p>Override this to return an appropriate derived class of <a href="qnpinstance.html">QNPInstance</a>.
<h3 class="fn">void<a name="e0b0ba"></a>QNPlugin::unuseJavaClass() <code>[virtual]</code></h3>
<p>This function is called when the plugin is shutting down,
with <em>jc</em> set to the value returned earlier by <a href="#a36de2">getJavaClass</a>().
The function should <em>unuse</em> the Java class and return 0.
<hr><p>
Search the documentation, FAQ, qt-interest archive and more (uses
<a href="http://www.trolltech.com">www.trolltech.com</a>):<br>
<form method=post action="http://www.trolltech.com/search.cgi">
<input type=hidden name="version" value="2.3.2"><nobr>
<input size="50" name="search"><input type=submit value="Search">
</nobr></form><hr><p>
This file is part of the <a href="index.html">Qt toolkit</a>,
copyright © 1995-2001
<a href="http://www.trolltech.com">Trolltech</a>, all rights reserved.<p><address><hr><div align="center">
<table width="100%" cellspacing="0" border="0"><tr>
<td>Copyright 2001 Trolltech<td><a href="http://www.trolltech.com/trademarks.html">Trademarks</a>
<td align="right"><div align="right">Qt version 2.3.2</div>
</table></div></address></body></html>
|