Sophie

Sophie

distrib > Mandriva > current > i586 > media > main-updates > by-pkgid > 8e6051afcdb111a0317a58fb64c2abf5 > files > 3718

qt4-doc-4.6.3-0.2mdv2010.2.i586.rpm

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- qaxbindable.cpp -->
<head>
  <title>Qt 4.6: QAxBindable Class Reference</title>
  <link href="classic.css" rel="stylesheet" type="text/css" />
</head>
<body>
<a name="//apple_ref/cpp/cl//QAxBindable"></a>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left" valign="top" width="32"><a href="http://qt.nokia.com/"><img src="images/qt-logo.png" align="left" border="0" /></a></td>
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">All&nbsp;Functions</font></a>&nbsp;&middot; <a href="overviews.html"><font color="#004faf">Overviews</font></a></td></tr></table><h1 class="title">QAxBindable Class Reference<br /><span class="small-subtitle">[<a href="qaxserver.html">QAxServer</a> module]</span>
</h1>
<p>The QAxBindable class provides an interface between a <a href="qwidget.html">QWidget</a> and an ActiveX client. <a href="#details">More...</a></p>
<pre> #include &lt;QAxBindable&gt;</pre><p><b>This class is not part of the Qt GUI Framework Edition.</b></p>
<ul>
<li><a href="qaxbindable-members.html">List of all members, including inherited members</a></li>
</ul>
<hr />
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qaxbindable.html#QAxBindable">QAxBindable</a></b> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual </td><td class="memItemRight" valign="bottom"><b><a href="qaxbindable.html#dtor.QAxBindable">~QAxBindable</a></b> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual QAxAggregated * </td><td class="memItemRight" valign="bottom"><b><a href="qaxbindable.html#createAggregate">createAggregate</a></b> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual bool </td><td class="memItemRight" valign="bottom"><b><a href="qaxbindable.html#readData">readData</a></b> ( QIODevice * <i>source</i>, const QString &amp; <i>format</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qaxbindable.html#reportError">reportError</a></b> ( int <i>code</i>, const QString &amp; <i>src</i>, const QString &amp; <i>desc</i>, const QString &amp; <i>context</i> = QString() )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual bool </td><td class="memItemRight" valign="bottom"><b><a href="qaxbindable.html#writeData">writeData</a></b> ( QIODevice * <i>sink</i> )</td></tr>
</table>
<hr />
<a name="protected-functions"></a>
<h2>Protected Functions</h2>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">IUnknown * </td><td class="memItemRight" valign="bottom"><b><a href="qaxbindable.html#clientSite">clientSite</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qaxbindable.html#propertyChanged">propertyChanged</a></b> ( const char * <i>property</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b><a href="qaxbindable.html#requestPropertyChange">requestPropertyChange</a></b> ( const char * <i>property</i> )</td></tr>
</table>
<a name="details"></a>
<hr />
<h2>Detailed Description</h2>
<p>The QAxBindable class provides an interface between a <a href="qwidget.html">QWidget</a> and an ActiveX client.</p>
<p>The functions provided by this class allow an ActiveX control to communicate property changes to a client application. Inherit your control class from both <a href="qwidget.html">QWidget</a> (directly or indirectly) and this class to get access to this class's functions. The <a href="moc.html#moc">meta-object compiler</a> requires you to inherit from <a href="qwidget.html">QWidget</a> first.</p>
<pre> class MyActiveX : public QWidget, public QAxBindable
 {
     Q_OBJECT
     Q_PROPERTY(int value READ value WRITE setValue)

 public:
     MyActiveX(QWidget *parent = 0);
     ...

     int value() const;
     void setValue(int);
 };</pre>
<p>When implementing the property write function, use <a href="qaxbindable.html#requestPropertyChange">requestPropertyChange</a>() to get permission from the ActiveX client application to change this property. When the property changes, call <a href="qaxbindable.html#propertyChanged">propertyChanged</a>() to notify the ActiveX client application about the change. If a fatal error occurs in the control, use the static <a href="qaxbindable.html#reportError">reportError</a>() function to notify the client.</p>
<p>Use the interface returned by <a href="qaxbindable.html#clientSite">clientSite</a>() to call the ActiveX client. To implement additional COM interfaces in your ActiveX control, reimplement <a href="qaxbindable.html#createAggregate">createAggregate</a>() to return a new object of a <a href="qaxaggregated.html">QAxAggregated</a> subclass.</p>
<p>The <a href="activeqt.html#activeqt">ActiveQt</a> <a href="activeqt-opengl.html">OpenGL</a> example shows how to use QAxBindable to implement additional COM interfaces.</p>
<p>See also <a href="qaxaggregated.html">QAxAggregated</a>, <a href="qaxfactory.html">QAxFactory</a>, and <a href="activeqt.html">ActiveQt Framework</a>.</p>
<hr />
<h2>Member Function Documentation</h2>
<a name="//apple_ref/cpp/instm/QAxBindable/QAxBindable"></a>
<h3 class="fn"><a name="QAxBindable"></a>QAxBindable::QAxBindable ()</h3>
<p>Constructs an empty <a href="qaxbindable.html">QAxBindable</a> object.</p>
<a name="//apple_ref/cpp/instm/QAxBindable/~QAxBindable"></a>
<h3 class="fn"><a name="dtor.QAxBindable"></a>QAxBindable::~QAxBindable ()&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Destroys the <a href="qaxbindable.html">QAxBindable</a> object.</p>
<a name="//apple_ref/cpp/instm/QAxBindable/clientSite"></a>
<h3 class="fn"><a name="clientSite"></a>IUnknown * QAxBindable::clientSite () const&nbsp;&nbsp;<tt> [protected]</tt></h3>
<p>Returns a pointer to the client site interface for this ActiveX object, or null if no client site has been set.</p>
<p>Call <tt>QueryInterface()</tt> on the returned interface to get the interface you want to call.</p>
<a name="//apple_ref/cpp/instm/QAxBindable/createAggregate"></a>
<h3 class="fn"><a name="createAggregate"></a><a href="qaxaggregated.html">QAxAggregated</a> * QAxBindable::createAggregate ()&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Reimplement this function when you want to implement additional COM interfaces in the ActiveX control, or when you want to provide alternative implementations of COM interfaces. Return a new object of a <a href="qaxaggregated.html">QAxAggregated</a> subclass.</p>
<p>The default implementation returns the null pointer.</p>
<a name="//apple_ref/cpp/instm/QAxBindable/propertyChanged"></a>
<h3 class="fn"><a name="propertyChanged"></a>void QAxBindable::propertyChanged ( const char * <i>property</i> )&nbsp;&nbsp;<tt> [protected]</tt></h3>
<p>Call this function to notify the client that is hosting this ActiveX control that the property <i>property</i> has been changed.</p>
<p>This function is usually called at the end of the property's write function.</p>
<p>See also <a href="qaxbindable.html#requestPropertyChange">requestPropertyChange</a>().</p>
<a name="//apple_ref/cpp/instm/QAxBindable/readData"></a>
<h3 class="fn"><a name="readData"></a>bool QAxBindable::readData ( <a href="qiodevice.html">QIODevice</a> * <i>source</i>, const <a href="qstring.html">QString</a> &amp; <i>format</i> )&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>If the COM object supports a MIME type then this function is called to initialize the COM object from the data <i>source</i> in <i>format</i>. You have to open <i>source</i> for reading before you can read from it.</p>
<p>Returns true to indicate success. If the function returns false, then <a href="activeqt.html#activeqt">ActiveQt</a> will process the data by setting the properties through the meta object system.</p>
<p>If you reimplement this function you also have to implement <a href="qaxbindable.html#writeData">writeData</a>(). The default implementation does nothing and returns false.</p>
<p><b>Warning:</b> ActiveX controls embedded in HTML can use either the <tt>type</tt> and <tt>data</tt> attribute of the <tt>object</tt> tag to read data, or use a list of <tt>param</tt> tags to initialize properties. If <tt>param</tt> tags are used, then Internet Explorer will ignore the <tt>data</tt> attribute, and readData will not be called.</p>
<p>This function was introduced in Qt 4.1.</p>
<p>See also <a href="qaxbindable.html#writeData">writeData</a>().</p>
<a name="//apple_ref/cpp/instm/QAxBindable/reportError"></a>
<h3 class="fn"><a name="reportError"></a>void QAxBindable::reportError ( int <i>code</i>, const <a href="qstring.html">QString</a> &amp; <i>src</i>, const <a href="qstring.html">QString</a> &amp; <i>desc</i>, const <a href="qstring.html">QString</a> &amp; <i>context</i> = QString() )</h3>
<p>Reports an error to the client application. <i>code</i> is a control-defined error code. <i>desc</i> is a human-readable description of the error intended for the application user. <i>src</i> is the name of the source for the error, typically the ActiveX server name. <i>context</i> can be the location of a help file with more information about the error. If <i>context</i> ends with a number in brackets, e.g&#x2e; [12], this number will be interpreted as the context ID in the help file.</p>
<a name="//apple_ref/cpp/instm/QAxBindable/requestPropertyChange"></a>
<h3 class="fn"><a name="requestPropertyChange"></a>bool QAxBindable::requestPropertyChange ( const char * <i>property</i> )&nbsp;&nbsp;<tt> [protected]</tt></h3>
<p>Call this function to request permission to change the property <i>property</i> from the client that is hosting this ActiveX control. Returns true if the client allows the change; otherwise returns false.</p>
<p>This function is usually called first in the write function for <i>property</i>, and writing is abandoned if the function returns false.</p>
<pre> void MyActiveQt::setText(const QString &amp;text)
 {
     if (!requestPropertyChange(&quot;text&quot;))
         return;

     <span class="comment">// update property</span>

     propertyChanged(&quot;text&quot;);
 }</pre>
<p>See also <a href="qaxbindable.html#propertyChanged">propertyChanged</a>().</p>
<a name="//apple_ref/cpp/instm/QAxBindable/writeData"></a>
<h3 class="fn"><a name="writeData"></a>bool QAxBindable::writeData ( <a href="qiodevice.html">QIODevice</a> * <i>sink</i> )&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>If the COM object supports a MIME type then this function is called to store the COM object into <i>sink</i>. You have to open <i>sink</i> for writing before you can write to it.</p>
<p>Returns true to indicate success. If the function returns false, then <a href="activeqt.html#activeqt">ActiveQt</a> will serialize the object by storing the property values.</p>
<p>If you reimplement this function you also have to implement <a href="qaxbindable.html#readData">readData</a>(). The default implementation does nothing and returns false.</p>
<p>This function was introduced in Qt 4.1.</p>
<p>See also <a href="qaxbindable.html#readData">readData</a>().</p>
<p /><address><hr /><div align="center">
<table width="100%" cellspacing="0" border="0"><tr class="address">
<td width="40%" align="left">Copyright &copy; 2010 Nokia Corporation and/or its subsidiary(-ies)</td>
<td width="20%" align="center"><a href="trademarks.html">Trademarks</a></td>
<td width="40%" align="right"><div align="right">Qt 4.6.3</div></td>
</tr></table></div></address></body>
</html>