<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/extensions/activeqt/control/qaxbindable.cpp:36 --> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>TQAxBindable Class</title> <style type="text/css"><!-- fn { margin-left: 1cm; text-indent: -1cm; } a:link { color: #004faf; text-decoration: none } a:visited { color: #672967; text-decoration: none } body { background: #ffffff; color: black; } --></style> </head> <body> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr bgcolor="#E5E5E5"> <td valign=center> <a href="index.html"> <font color="#004faf">Home</font></a> | <a href="classes.html"> <font color="#004faf">All Classes</font></a> | <a href="mainclasses.html"> <font color="#004faf">Main Classes</font></a> | <a href="annotated.html"> <font color="#004faf">Annotated</font></a> | <a href="groups.html"> <font color="#004faf">Grouped Classes</font></a> | <a href="functions.html"> <font color="#004faf">Functions</font></a> </td> <td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>TQAxBindable Class Reference<br><small>[<a href="qaxserver.html">TQAxServer module</a>]</small></h1> <p>The TQAxBindable class provides an interface between a TQWidget and an ActiveX client. <a href="#details">More...</a> <p>This class is part of the <b>TQt ActiveTQt Extension</b>. <p><tt>#include <<a href="qaxbindable-h.html">qaxbindable.h</a>></tt> <p><a href="qaxbindable-members.html">List of all member functions.</a> <h2>Public Members</h2> <ul> <li class=fn><a href="#TQAxBindable"><b>TQAxBindable</b></a> ()</li> <li class=fn>virtual <a href="#~TQAxBindable"><b>~TQAxBindable</b></a> ()</li> <li class=fn>virtual TQAxAggregated * <a href="#createAggregate"><b>createAggregate</b></a> ()</li> </ul> <h2>Static Public Members</h2> <ul> <li class=fn>void <a href="#reportError"><b>reportError</b></a> ( int code, const TQString & src, const TQString & desc, const TQString & context = TQString::null )</li> </ul> <h2>Protected Members</h2> <ul> <li class=fn>bool <a href="#requestPropertyChange"><b>requestPropertyChange</b></a> ( const char * property )</li> <li class=fn>void <a href="#propertyChanged"><b>propertyChanged</b></a> ( const char * property )</li> <li class=fn>IUnknown * <a href="#clientSite"><b>clientSite</b></a> () const</li> </ul> <hr><a name="details"></a><h2>Detailed Description</h2> <p> This class is defined in the <b>TQt <a href="activentqt.html#ActiveTQt">ActiveTQt</a> Extension</b>, which can be found in the <tt>qt/extensions</tt> directory. It is not included in the main TQt API. <p> The TQAxBindable class provides an interface between a <a href="ntqwidget.html">TQWidget</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 TQWidget (directly or indirectly) and this class to get access to this class's functions. The <a href="moc.html">meta object compiler</a> requires you to inherit from TQWidget <em>first</em>. <p> <pre> class MyActiveX : public <a href="ntqwidget.html">TQWidget</a>, public TQAxBindable { <a href="metaobjects.html#TQ_OBJECT">TQ_OBJECT</a> TQ_PROPERTY( int value READ value WRITE setValue ) public: MyActiveX( <a href="ntqwidget.html">TQWidget</a> *parent = 0, const char *name = 0 ); ... int value() const; void setValue( int ); }; </pre> <p> When implementing the property write function, use <a href="#requestPropertyChange">requestPropertyChange</a>() to get permission from the ActiveX client application to change this property. When the property changes, call <a href="#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="#reportError">reportError</a>() function to notify the client. <p> Use the interface returned by <a href="#clientSite">clientSite</a>() to call the ActiveX client. To implement additional COM interfaces in your ActiveX control, reimplement <a href="#createAggregate">createAggregate</a>() to return a new object of a <a href="qaxaggregated.html">TQAxAggregated</a> subclass. <hr><h2>Member Function Documentation</h2> <h3 class=fn><a name="TQAxBindable"></a>TQAxBindable::TQAxBindable () </h3> Constructs an empty TQAxBindable object. <h3 class=fn><a name="~TQAxBindable"></a>TQAxBindable::~TQAxBindable ()<tt> [virtual]</tt> </h3> Destroys the TQAxBindable object. <h3 class=fn>IUnknown * <a name="clientSite"></a>TQAxBindable::clientSite () const<tt> [protected]</tt> </h3> Returns a pointer to the client site interface for this ActiveX object, or null if no client site has been set. <p> Call QueryInterface() on the returned interface to get the interface you want to call. <h3 class=fn><a href="qaxaggregated.html">TQAxAggregated</a> * <a name="createAggregate"></a>TQAxBindable::createAggregate ()<tt> [virtual]</tt> </h3> 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">TQAxAggregated</a> subclass. <p> The default implementation returns the null pointer. <h3 class=fn>void <a name="propertyChanged"></a>TQAxBindable::propertyChanged ( const char * property )<tt> [protected]</tt> </h3> Call this function to notify the client that is hosting this ActiveX control that the property <em>property</em> has been changed. <p> This function is usually called at the end of the property's write function. <p> <p>See also <a href="#requestPropertyChange">requestPropertyChange</a>(). <h3 class=fn>void <a name="reportError"></a>TQAxBindable::reportError ( int code, const <a href="ntqstring.html">TQString</a> & src, const <a href="ntqstring.html">TQString</a> & desc, const <a href="ntqstring.html">TQString</a> & context = TQString::null )<tt> [static]</tt> </h3> <p> Reports an error to the client application. <em>code</em> is a control-defined error code. <em>desc</em> is a human-readable description of the error intended for the application user. <em>src</em> is the name of the source for the error, typically the ActiveX server name. <em>context</em> can be the location of a help file with more information about the error. If <em>context</em> ends with a number in brackets, e.g. [12], this number will be interpreted as the context ID in the help file. <h3 class=fn>bool <a name="requestPropertyChange"></a>TQAxBindable::requestPropertyChange ( const char * property )<tt> [protected]</tt> </h3> Call this function to request permission to change the property <em>property</em> from the client that is hosting this ActiveX control. Returns TRUE if the client allows the change; otherwise returns FALSE. <p> This function is usually called first in the write function for <em>property</em>, and writing is abandoned if the function returns FALSE. <p> <pre> void MyActiveTQt::setText( const <a href="ntqstring.html">TQString</a> &text ) { if ( !requestPropertyChange( "text" ) ) return; // update property <a href="#propertyChanged">propertyChanged</a>( "text" ); } </pre> <p> <p>See also <a href="#propertyChanged">propertyChanged</a>(). <!-- eof --> <hr><p> This file is part of the <a href="index.html">TQt toolkit</a>. Copyright © 1995-2007 <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 © 2007 <a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a> <td align=right><div align=right>TQt 3.3.8</div> </table></div></address></body> </html>