[190] | 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:750 -->
|
---|
| 3 | <html>
|
---|
| 4 | <head>
|
---|
| 5 | <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
---|
| 6 | <title>QNPWidget Class</title>
|
---|
| 7 | <style type="text/css"><!--
|
---|
| 8 | fn { margin-left: 1cm; text-indent: -1cm; }
|
---|
| 9 | a:link { color: #004faf; text-decoration: none }
|
---|
| 10 | a:visited { color: #672967; text-decoration: none }
|
---|
| 11 | body { 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 Classes</font></a>
|
---|
| 23 | | <a href="mainclasses.html">
|
---|
| 24 | <font color="#004faf">Main 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 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>QNPWidget Class Reference</h1>
|
---|
| 33 |
|
---|
| 34 | <p>The QNPWidget class provides a QWidget that is a web browser plugin window.
|
---|
| 35 | <a href="#details">More...</a>
|
---|
| 36 | <p>This class is part of the <b>Qt Netscape Extension</b>.
|
---|
| 37 | <p><tt>#include <<a href="qnp-h.html">qnp.h</a>></tt>
|
---|
| 38 | <p>Inherits <a href="qwidget.html">QWidget</a>.
|
---|
| 39 | <p><a href="qnpwidget-members.html">List of all member functions.</a>
|
---|
| 40 | <h2>Public Members</h2>
|
---|
| 41 | <ul>
|
---|
| 42 | <li class=fn><a href="#QNPWidget"><b>QNPWidget</b></a> ()</li>
|
---|
| 43 | <li class=fn><a href="#~QNPWidget"><b>~QNPWidget</b></a> ()</li>
|
---|
| 44 | <li class=fn>virtual void <a href="#enterInstance"><b>enterInstance</b></a> ()</li>
|
---|
| 45 | <li class=fn>virtual void <a href="#leaveInstance"><b>leaveInstance</b></a> ()</li>
|
---|
| 46 | <li class=fn>QNPInstance * <a href="#instance"><b>instance</b></a> ()</li>
|
---|
| 47 | </ul>
|
---|
| 48 | <hr><a name="details"></a><h2>Detailed Description</h2>
|
---|
| 49 | <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.
|
---|
| 50 | <p>
|
---|
| 51 |
|
---|
| 52 | The QNPWidget class provides a <a href="qwidget.html">QWidget</a> that is a web browser plugin window.
|
---|
| 53 | <p>
|
---|
| 54 | <p> Derive from QNPWidget to create a widget that can be used as a
|
---|
| 55 | web browser plugin window, or create one and add child widgets.
|
---|
| 56 | Instances of QNPWidget may only be created when
|
---|
| 57 | <a href="qnpinstance.html#newWindow">QNPInstance::newWindow</a>() is called by the browser.
|
---|
| 58 | <p> A common way to develop a plugin widget is to develop it as a
|
---|
| 59 | stand-alone application window, then make it a <em>child</em> of a
|
---|
| 60 | plugin widget to use it as a browser plugin. The technique is:
|
---|
| 61 | <p> <pre>
|
---|
| 62 | class MyPluginWindow : public QNPWidget
|
---|
| 63 | {
|
---|
| 64 | <a href="qwidget.html">QWidget</a>* child;
|
---|
| 65 | public:
|
---|
| 66 | MyPluginWindow()
|
---|
| 67 | {
|
---|
| 68 | // Some widget that is normally used as a top-level widget
|
---|
| 69 | child = new MyIndependentlyDevelopedWidget();
|
---|
| 70 |
|
---|
| 71 | // Use the background color of the web page
|
---|
| 72 | child-><a href="qwidget.html#setBackgroundColor">setBackgroundColor</a>( <a href="qwidget.html#backgroundColor">backgroundColor</a>() );
|
---|
| 73 |
|
---|
| 74 | // Fill the plugin widget
|
---|
| 75 | child-><a href="qwidget.html#setGeometry">setGeometry</a>( 0, 0, width(), height() );
|
---|
| 76 | }
|
---|
| 77 |
|
---|
| 78 | void resizeEvent(QResizeEvent*)
|
---|
| 79 | {
|
---|
| 80 | // Fill the plugin widget
|
---|
| 81 | child-><a href="qwidget.html#resize">resize</a>(<a href="qwidget.html#size">size</a>());
|
---|
| 82 | }
|
---|
| 83 | };
|
---|
| 84 | </pre>
|
---|
| 85 |
|
---|
| 86 | <p> The default implementation is an empty window.
|
---|
| 87 |
|
---|
| 88 | <hr><h2>Member Function Documentation</h2>
|
---|
| 89 | <h3 class=fn><a name="QNPWidget"></a>QNPWidget::QNPWidget ()
|
---|
| 90 | </h3>
|
---|
| 91 | Creates a QNPWidget.
|
---|
| 92 |
|
---|
| 93 | <h3 class=fn><a name="~QNPWidget"></a>QNPWidget::~QNPWidget ()
|
---|
| 94 | </h3>
|
---|
| 95 | Destroys the window. This will be called by the plugin binding
|
---|
| 96 | code when the window is no longer required. The web browser will
|
---|
| 97 | delete windows when they leave the page. The bindings will change
|
---|
| 98 | the <a href="qwidget.html#winId">QWidget::winId</a>() of the window when the window is resized, but
|
---|
| 99 | this should not affect normal widget behavior.
|
---|
| 100 |
|
---|
| 101 | <h3 class=fn>void <a name="enterInstance"></a>QNPWidget::enterInstance ()<tt> [virtual]</tt>
|
---|
| 102 | </h3>
|
---|
| 103 | Called when the mouse enters the plugin window. Does nothing by
|
---|
| 104 | default.
|
---|
| 105 |
|
---|
| 106 | <p>Example: <a href="grapher-nsplugin-example.html#x2753">grapher/grapher.cpp</a>.
|
---|
| 107 | <h3 class=fn><a href="qnpinstance.html">QNPInstance</a> * <a name="instance"></a>QNPWidget::instance ()
|
---|
| 108 | </h3>
|
---|
| 109 | Returns the instance for which this widget is the plugin window.
|
---|
| 110 |
|
---|
| 111 | <h3 class=fn>void <a name="leaveInstance"></a>QNPWidget::leaveInstance ()<tt> [virtual]</tt>
|
---|
| 112 | </h3>
|
---|
| 113 | Called when the mouse leaves the plugin window. Does nothing by
|
---|
| 114 | default.
|
---|
| 115 |
|
---|
| 116 | <p>Example: <a href="grapher-nsplugin-example.html#x2754">grapher/grapher.cpp</a>.
|
---|
| 117 | <!-- eof -->
|
---|
| 118 | <hr><p>
|
---|
| 119 | This file is part of the <a href="index.html">Qt toolkit</a>.
|
---|
| 120 | Copyright © 1995-2007
|
---|
| 121 | <a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
|
---|
| 122 | <table width=100% cellspacing=0 border=0><tr>
|
---|
| 123 | <td>Copyright © 2007
|
---|
| 124 | <a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
|
---|
| 125 | <td align=right><div align=right>Qt 3.3.8</div>
|
---|
| 126 | </table></div></address></body>
|
---|
| 127 | </html>
|
---|