You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tqt3/doc/man/man3/tqaxbindable.3qt

153 lines
5.9 KiB

'\" t
.TH QAxBindable 3qt "2 February 2007" "Trolltech AS" \" -*- nroff -*-
.\" Copyright 1992-2007 Trolltech ASA. All rights reserved. See the
.\" license file included in the distribution for a complete license
.\" statement.
.\"
.ad l
.nh
.SH NAME
QAxBindable \- Interface between a QWidget and an ActiveX client
.SH SYNOPSIS
This class is part of the \fBQt ActiveQt Extension\fR.
.PP
\fC#include <qaxbindable.h>\fR
.PP
.SS "Public Members"
.in +1c
.ti -1c
.BI "\fBQAxBindable\fR ()"
.br
.ti -1c
.BI "virtual \fB~QAxBindable\fR ()"
.br
.ti -1c
.BI "virtual QAxAggregated * \fBcreateAggregate\fR ()"
.br
.in -1c
.SS "Static Public Members"
.in +1c
.ti -1c
.BI "void \fBreportError\fR ( int code, const QString & src, const QString & desc, const QString & context = QString::null )"
.br
.in -1c
.SS "Protected Members"
.in +1c
.ti -1c
.BI "bool \fBrequestPropertyChange\fR ( const char * property )"
.br
.ti -1c
.BI "void \fBpropertyChanged\fR ( const char * property )"
.br
.ti -1c
.BI "IUnknown * \fBclientSite\fR () const"
.br
.in -1c
.SH DESCRIPTION
This class is defined in the \fBQt ActiveQt Extension\fR, which can be found in the \fCqt/extensions\fR directory. It is not included in the main TQt API.
.PP
The QAxBindable class provides an interface between a QWidget and an ActiveX client.
.PP
The functions provided by this class allow an ActiveX control to communicate property changes to a client application. Inherit your control class from both QWidget (directly or indirectly) and this class to get access to this class's functions. The meta object compiler requires you to inherit from QWidget \fIfirst\fR.
.PP
.nf
.br
class MyActiveX : public QWidget, public QAxBindable
.br
{
.br
TQ_OBJECT
.br
TQ_PROPERTY( int value READ value WRITE setValue )
.br
public:
.br
MyActiveX( QWidget *parent = 0, const char *name = 0 );
.br
...
.br
.br
int value() const;
.br
void setValue( int );
.br
};
.br
.fi
.PP
When implementing the property write function, use requestPropertyChange() to get permission from the ActiveX client application to change this property. When the property changes, call propertyChanged() to notify the ActiveX client application about the change. If a fatal error occurs in the control, use the static reportError() function to notify the client.
.PP
Use the interface returned by clientSite() to call the ActiveX client. To implement additional COM interfaces in your ActiveX control, reimplement createAggregate() to return a new object of a QAxAggregated subclass.
.SH MEMBER FUNCTION DOCUMENTATION
.SH "QAxBindable::QAxBindable ()"
Constructs an empty QAxBindable object.
.SH "QAxBindable::~QAxBindable ()\fC [virtual]\fR"
Destroys the QAxBindable object.
.SH "IUnknown * QAxBindable::clientSite () const\fC [protected]\fR"
Returns a pointer to the client site interface for this ActiveX object, or null if no client site has been set.
.PP
Call QueryInterface() on the returned interface to get the interface you want to call.
.SH "QAxAggregated * QAxBindable::createAggregate ()\fC [virtual]\fR"
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 QAxAggregated subclass.
.PP
The default implementation returns the null pointer.
.SH "void QAxBindable::propertyChanged ( const char * property )\fC [protected]\fR"
Call this function to notify the client that is hosting this ActiveX control that the property \fIproperty\fR has been changed.
.PP
This function is usually called at the end of the property's write function.
.PP
See also requestPropertyChange().
.SH "void QAxBindable::reportError ( int code, const QString & src, const QString & desc, const QString & context = QString::null )\fC [static]\fR"
Reports an error to the client application. \fIcode\fR is a control-defined error code. \fIdesc\fR is a human-readable description of the error intended for the application user. \fIsrc\fR is the name of the source for the error, typically the ActiveX server name. \fIcontext\fR can be the location of a help file with more information about the error. If \fIcontext\fR ends with a number in brackets, e.g. [12], this number will be interpreted as the context ID in the help file.
.SH "bool QAxBindable::requestPropertyChange ( const char * property )\fC [protected]\fR"
Call this function to request permission to change the property \fIproperty\fR from the client that is hosting this ActiveX control. Returns TRUE if the client allows the change; otherwise returns FALSE.
.PP
This function is usually called first in the write function for \fIproperty\fR, and writing is abandoned if the function returns FALSE.
.PP
.nf
.br
void MyActiveQt::setText( const QString &text )
.br
{
.br
if ( !requestPropertyChange( "text" ) )
.br
return;
.br
.br
// update property
.br
.br
propertyChanged( "text" );
.br
}
.br
.fi
.PP
See also propertyChanged().
.SH "SEE ALSO"
.BR http://doc.trolltech.com/qaxbindable.html
.BR http://www.trolltech.com/faq/tech.html
.SH COPYRIGHT
Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the
license file included in the distribution for a complete license
statement.
.SH AUTHOR
Generated automatically from the source code.
.SH BUGS
If you find a bug in Qt, please report it as described in
.BR http://doc.trolltech.com/bughowto.html .
Good bug reports help us to help you. Thank you.
.P
The definitive TQt documentation is provided in HTML format; it is
located at $QTDIR/doc/html and can be read using TQt Assistant or with
a web browser. This man page is provided as a convenience for those
users who prefer man pages, although this format is not officially
supported by Trolltech.
.P
If you find errors in this manual page, please report them to
.BR qt-bugs@trolltech.com .
Please include the name of the manual page (tqaxbindable.3qt) and the Qt
version (3.3.8).