43 #ifndef QT_NO_WIN_ACTIVEQT 52 #include "../shared/qaxtypes.h" 64 typeInfo->GetIDsOfNames((BSTR*)&names, 1, &memId);
66 if (memId != DISPID_UNKNOWN) {
67 BSTR docStringBstr, helpFileBstr;
69 HRESULT hres = typeInfo->GetDocumentation(memId, 0, &docStringBstr, &helpContext, &helpFileBstr);
72 SysFreeString(docStringBstr);
73 SysFreeString(helpFileBstr);
93 for (
int p = 0; p < parameterTypes.
count(); ++p) {
97 if (p < parameterNames.
count())
98 prototype +=
' ' + parameterNames.
at(p);
100 if (numDefArgs >= parameterTypes.
count() - p)
102 if (p < parameterTypes.
count() - 1)
117 if (type.
at(0) ==
'Q')
119 type[0] = toupper(type.
at(0));
120 if (type ==
"VariantList")
122 else if (type ==
"Map<QVariant,QVariant>")
124 else if (type ==
"Uint")
127 return "to" + type +
"()";
137 ITypeInfo *typeInfo = 0;
138 IDispatch *dispatch = 0;
141 dispatch->GetTypeInfo(0, LOCALE_SYSTEM_DEFAULT, &typeInfo);
149 stream <<
"<h1 align=center>" << coClass <<
" Reference</h1>" <<
endl;
151 stream <<
" with the CLSID " << that->
control() <<
".</p>" <<
endl;
153 stream <<
"<h3>Interfaces</h3>" <<
endl;
154 stream <<
"<ul>" <<
endl;
155 const char *inter = 0;
158 stream <<
"<li>" << inter <<
endl;
161 stream <<
"</ul>" <<
endl;
163 stream <<
"<h3>Event Interfaces</h3>" <<
endl;
164 stream <<
"<ul>" <<
endl;
167 stream <<
"<li>" << inter <<
endl;
170 stream <<
"</ul>" <<
endl;
176 stream <<
"<h2>Public Slots:</h2>" <<
endl;
177 stream <<
"<ul>" <<
endl;
180 for (
int islot = mo->
methodOffset(); islot < slotCount; ++islot) {
191 if (returntype.isEmpty())
196 stream <<
"<li>" << returntype <<
" <a href=\"#" << name <<
"\"><b>" << name <<
"</b></a>" << prototype <<
";</li>" <<
endl;
205 detail +=
QLatin1String(
"<p>Connect a signal to this slot:<pre>\n");
212 detail +=
QLatin1String(
"<p>Or call the function directly:<pre>\n");
219 if (returntype ==
"IDispatch*" || returntype ==
"IUnknown*") {
220 functionToCall =
"querySubObject";
221 returntype =
"QAxObject *";
223 if (returntype !=
"void")
230 if (returntype !=
"void" && returntype !=
"QAxObject *" && returntype !=
"QVariant")
234 detail +=
QLatin1String(
"<p>This function has parameters of unsupported types and cannot be called directly.");
237 methodDetails << detail;
241 stream <<
"</ul>" <<
endl;
245 ITypeLib *typeLib = 0;
248 typeInfo->GetContainingTypeLib(&typeLib, &index);
253 stream <<
"<h2>Signals:</h2>" <<
endl;
254 stream <<
"<ul>" <<
endl;
256 for (
int isignal = mo->
methodOffset(); isignal < signalCount; ++isignal) {
264 stream <<
"<li>void <a href=\"#" << name <<
"\"><b>" << name <<
"</b></a>" << prototype <<
";</li>" <<
endl;
275 typeLib->GetTypeInfo(++interCount, &typeInfo);
278 detail += typeLibDocu;
284 detail +=
QLatin1String(
"<p>Connect a slot to this signal:<pre>\n");
290 methodDetails << detail;
295 stream <<
"</ul>" <<
endl;
304 dispatch->GetTypeInfo(0, LOCALE_SYSTEM_DEFAULT, &typeInfo);
305 stream <<
"<h2>Properties:</h2>" <<
endl;
306 stream <<
"<ul>" <<
endl;
308 for (
int iprop = 0; iprop < propCount; ++iprop) {
313 stream <<
"<li>" <<
type <<
" <a href=\"#" <<
name <<
"\"><b>" <<
name <<
"</b></a>;</li>" <<
endl;
326 detail +=
QLatin1String(
"<p>Read this property's value using QObject::property:<pre>\n");
334 }
else if (
type ==
"IDispatch*" ||
type ==
"IUnknown*") {
335 detail +=
QLatin1String(
"<p>Get the subobject using querySubObject:<pre>\n");
340 detail +=
QLatin1String(
"<p>This property is of an unsupported type.\n");
343 detail +=
QLatin1String(
"Set this property' value using QObject::setProperty:<pre>\n");
345 detail +=
QLatin1String(
"\tint newValue = ... // string representation of values also supported\n");
353 if (isupper(
name.at(0))) {
354 setterSlot =
"Set" +
name;
357 nameUp[0] = toupper(nameUp.
at(0));
358 setterSlot =
"set" + nameUp;
368 propDetails << detail;
370 stream <<
"</ul>" <<
endl;
375 stream <<
"<hr><h2>Member Type Documentation</h2>" <<
endl;
376 for (
int i = 0; i < enumCount; ++i) {
378 stream <<
"<h3><a name=" << enumdata.
name() <<
"></a>" << enumdata.
name() <<
"</h3>" <<
endl;
379 stream <<
"<ul>" <<
endl;
380 for (
int e = 0; e < enumdata.
keyCount(); ++e) {
381 stream <<
"<li>" << enumdata.
key(e) <<
"\t=" << enumdata.
value(e) <<
"</li>" <<
endl;
383 stream <<
"</ul>" <<
endl;
386 if (methodDetails.
count()) {
387 stream <<
"<hr><h2>Member Function Documentation</h2>" <<
endl;
388 for (
int i = 0; i < methodDetails.
count(); ++i)
389 stream << methodDetails.
at(i) <<
endl;
391 if (propDetails.
count()) {
392 stream <<
"<hr><h2>Property Documentation</h2>" <<
endl;
393 for (
int i = 0; i < propDetails.
count(); ++i)
394 stream << propDetails.
at(i) <<
endl;
405 #endif // QT_NO_WIN_ACTIVEQT static QString fromWCharArray(const wchar_t *, int size=-1)
Returns a copy of the string, where the encoding of string depends on the size of wchar...
QTextStream & endl(QTextStream &stream)
Writes ' ' to the stream and flushes the stream.
bool isNull() const
Returns true if there is no COM object loaded by this wrapper; otherwise return false.
#define QT_END_NAMESPACE
This macro expands to.
virtual const QMetaObject * metaObject() const
The metaobject is generated on the fly from the information provided by the IDispatch and ITypeInfo i...
QString control() const
the name of the COM object wrapped by this QAxBase object.
virtual QObject * qObject() const =0
The QByteArray class provides an array of bytes.
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
int count(const T &t) const
Returns the number of occurrences of value in the list.
The QString class provides a Unicode character string.
QString qax_docuFromName(ITypeInfo *typeInfo, const QString &name)
QString qax_generateDocumentation(QAxBase *that)
#define QT_BEGIN_NAMESPACE
This macro expands to.
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
const T & at(int i) const
Returns the item at index position i in the list.
Type
This enum type defines the types of variable that a QVariant can contain.
QByteArray mid(int index, int len=-1) const
Returns a byte array containing len bytes from this byte array, starting at position pos...
const char * constData() const
Returns a pointer to the data stored in the byte array.
static QByteArray prototype(const QList< QByteArray > ¶meterTypes, const QList< QByteArray > ¶meterNames, bool *ok)
QString arg(qlonglong a, int fieldwidth=0, int base=10, const QChar &fillChar=QLatin1Char(' ')) const Q_REQUIRED_RESULT
The QTextStream class provides a convenient interface for reading and writing text.
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
static BSTR QStringToBSTR(const QString &str)
static QString docuFromName(ITypeInfo *typeInfo, const QString &name)
static QByteArray namedPrototype(const QList< QByteArray > ¶meterTypes, const QList< QByteArray > ¶meterNames, int numDefArgs=0)
char at(int i) const
Returns the character at index position i in the byte array.
static Type nameToType(const char *name)
Converts the string representation of the storage type given in name, to its enum representation...
long queryInterface(const QUuid &, void **) const
Requests the interface uuid from the COM object and sets the value of iface to the provided interface...
The QAxBase class is an abstract class that provides an API to initialize and access a COM object...
static QByteArray number(int, int base=10)
Returns a byte array containing the string equivalent of the number n to base base (10 by default)...
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
static QByteArray toType(const QByteArray &t)
virtual const QMetaObject * metaObject() const
Returns a pointer to the meta-object of this object.