summaryrefslogtreecommitdiffstats
path: root/doc/man/man3/qaxbindable.3qt
blob: 756b1514feffded6ac4e890c061d3203fd3fa029 (plain)
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
148
149
150
151
152
'\" 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 Qt 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
        Q_OBJECT
.br
        Q_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 Qt documentation is provided in HTML format; it is
located at $QTDIR/doc/html and can be read using Qt 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 (qaxbindable.3qt) and the Qt
version (3.3.8).