diff --git a/doc/editions.doc b/doc/editions.doc index 2f6f5e43..0ed203a9 100644 --- a/doc/editions.doc +++ b/doc/editions.doc @@ -118,13 +118,6 @@ Editions.
- -Home - | -All Classes - | -Main Classes - | -Annotated - | -Grouped Classes - | -Functions - | -
These modules are part of the TQt - Enterprise Edition and are not part of the Free or -Non-Commercial Editions. -
TQt's ActiveX support allows TQt/Windows developers to: -
The framework consists of two modules. -
The TQAxContainer module is a static -library implementing TQObject and TQWidget subclasses, TQAxObject and -TQAxWidget, that act as a containers for COM objects and ActiveX -controls. If built against a shared TQt library TQAxWidget integrates -as a widget plugin into TQt Designer. -
The module also provides classes TQAxScript, TQAxScriptManager and -TQAxScriptEngine that allow using Windows Script Host technologies to -script COM objects embedded in the TQt applications. -
Examples include a -web browser application embedding Microsoft Internet Explorer, and an -address book example synchronizing the contents with Microsoft -Outlook. -
The TQAxServer module is a -static library that implements functionality for in-process and -executable COM servers. This module provides the TQAxAggregated, -TQAxBindable and TQAxFactory classes. -
Examples include in- and -out-of-process servers providing different TQWidget subclasses as -ActiveX controls, as well as a walkthrough how to use those objects in a .NET environment. -
Copyright © 2007 -Trolltech | Trademarks - | TQt 3.3.8
- |
- -Home - | -All Classes - | -Main Classes - | -Annotated - | -Grouped Classes - | -Functions - | -
In the following walkthrough we will show how TQt objects can be used -in a .NET environment, and how .NET objects can be used in a TQt -environment. -
TQt is a C++ library and is compiled into traditional, native -binaries that make full use of the performance provided by the -runtime environment. -
One of the key concepts of .NET is the idea of "intermediate language -code" - the source code is compiled into a bytecode format, and at -runtime, that bytecode is executed in a virtual machine - the Common Language Runtime (CLR). -
Another key concept is that of managed code. This is essentially -intermediate language code written in such a way that the CLR can take -care of the memory management, i.e. the CLR will do automatic garbage -collection, so the application code does not need to explicitly free -the memory for unused objects. -
The MS compilers for C# and VB.NET will only produce managed -code. Such programs cannot directly call normal, native functions -or classes. (1) -
The MS C++ compiler for .NET on the other hand, can produce both -normal and managed code. To write a C++ class that can be compiled -into managed code, the developer must flag the class as managed using -the __gc keyword, and restrict the code to only use the subset of -C++ known as "Managed Extensions for C++", or MC++ for short. The -advantage is that MC++ code can freely call and use normal C++ -functions and classes. And it also works the other way around: normal -C++ code can call managed functions and use managed classes (e.g. the -entire .NET framework class library), including managed functions and -classes implemented in C# or VB.NET. This feature of mixing managed -and normal C++ code immensely eases the interoperability with .NET, -and is by Microsoft referred to as the "It Just Works" (IJW) feature. -
This document demonstrates two different ways of integrating normal -C++ code (that uses TQt) with managed .NET code. First, the manual way -is presented, which includes using a thin MC++ wrapper class around -the normal TQt/C++ class. Then, the automated way is presented, which -utilizes the ActiveTQt framework as a generic bridge. The advantage of -the first method is that it gives the application developer full -control, while the second method requires less coding and relieves the -developer of dealing with the conversion between managed and normal -data objects. -
The impatient reader, who right away wants to see a TQPushButton and a -custom TQt widget (TQAxWidget2) run in a .NET GUI application is referred to the example -directory of ActiveTQt. It contains the result of this walkthrough -using both C# and VB.NET, created with Visual Studio.NET (not 2003). -Load examples/dotnet/walkthrough/csharp.csproj, -examples/dotnet/walkthrough/vb.vbproj -(2) -or examples/dotnet/wrapper/wrapper.sln into the IDE and run -the solution. -
Normal C++ classes and functions can be used from managed .NET code by -providing thin wrapper classes written in MC++. The wrapper class will -take care of forwarding the calls to the normal C++ functions or -methods, and converting parameter data as necessary. Since the wrapper -class is a managed class, it can be used without further ado in any -managed .NET application, whether written in C#, VB.NET, MC++ or other -managed programming language. -
- -
// native TQt/C++ class - class Worker : public TQObject - { - TQ_OBJECT - TQ_PROPERTY(TQString statusString READ statusString WRITE setStatusString) - public: - Worker(); - - TQString statusString() const; - - public slots: - void setStatusString(const TQString &string); - - signals: - void statusStringChanged(const TQString &string); - - private: - TQString status; - }; --
The TQt class has nothing unusual for TQt users, and as even the TQt -specialities like TQ_PROPERTY, slots and signals are -implemented with straight C++ they don't cause any trouble when -compiling this class with any C++ compiler. -
- -
class Worker; - - // .NET class - public __gc class netWorker - { - public: - netWorker(); - ~netWorker(); - - __property String *get_StatusString(); - __property void set_StatusString(String *string); - - __event void statusStringChanged(String *args); - - private: - Worker *workerObject; - }; --
The .NET wrapper class uses keywords that are part of MC++ to indicate -that the class is managed/garbage collected (__gc), and that StatusString should be accessible as a property in languages that -support this concept (__property). We also declare an event -function statusStringChanged(String*) (__event), the -equivalent of the respective signal in the TQt class. -
Before we can start implementing the wrapper class we need a way to -convert TQt's datatypes (and potentionally your own) into .NET -datatypes, e.g. TQString objects need to be converted into objects -of type String*. -
When operating on managed objects in normal C++ code, a little extra -care must be taken because of the CLR's garbage collection. A normal -pointer variable should not (3) be used to refer to a managed -object. The reason is that the garbage collection can kick in at any -time and move the object to another place on the heap, leaving you -with an invalid pointer. -
However, two methods are provided that solves this problem easily. The -first is to use a pinned pointer, i.e. declare the pointer variable -with the __pin keyword. This guarantees that the object pointed to -will not be moved by the garbage collector. It is recommended that -this method not be used to keep a references to managed objects for a -long time, since it will decrease the efficiency of the garbage -collector. The second way is to use the gcroot smartpointer -template type. This lets you create safe pointers to managed -objects. E.g. a variable of type gcroot<String> will always point -to the String object, even if it has been moved by the garbage -collector, and it can be used just like a normal pointer. -
- -
#include <tqstring.h> - - #using <mscorlib.dll> - #include <vcclr.h> - - using namespace System; - - String *TQStringToString(const TQString &tqstring) - { - return new String(tqstring.ucs2()); - } --
TQString StringToTQString(String *string) - { - wchar_t __pin *chars = PtrToStringChars(string); - return TQString::fromUcs2(chars); - } --
The convertor functions can then be used in the wrapper class -implementation to call the functions in the native C++ class. -
- -
#include "networker.h" - #include "worker.h" - #include "tools.h" - - netWorker::netWorker() - { - workerObject = new Worker(); - } --
netWorker::~netWorker() - { - delete workerObject; - } --
The constructor and destructor simply create and destroy the TQt -object wrapped using the C++ operators new and delete. -
String *netWorker::get_StatusString() - { - return TQStringToString(workerObject->statusString()); - } --
The netWorker class delegates calls from the .NET code to the native -code. Although the transition between those two worlds implies a small -performance hit for each function call, and for the type conversion, -this should be negligible since we are anyway going to run within the -CLR. -
void netWorker::set_StatusString(String *string) - { - workerObject->setStatusString(StringToTQString(string)); - __raise statusStringChanged(string); - } --
The property setter calls the native TQt class before firing the -event using the __raise keyword. -
This wrapper class can now be used in .NET code, e.g. using C++, C#, -Visual Basic or any other programming language available for .NET. -
- -
using System; - - namespace WrapperApp - { - class App - { - void Run() - { - netWorker worker = new netWorker(); - - worker.statusStringChanged += new netWorker.__Delegate_statusStringChanged(onStatusStringChanged); - - System.Console.Out.WriteLine(worker.StatusString); - - System.Console.Out.WriteLine("Working cycle begins..."); - worker.StatusString = "Working"; - worker.StatusString = "Lunch Break"; - worker.StatusString = "Working"; - worker.StatusString = "Idle"; - System.Console.Out.WriteLine("Working cycle ends..."); - } - - private void onStatusStringChanged(string str) - { - System.Console.Out.WriteLine(str); - } - - [STAThread] - static void Main(string[] args) - { - App app = new App(); - app.Run(); - } - } - } --
Fortunately .NET provides a generic wrapper for COM objects, the -Runtime Callable Wrapper (RCW). This RCW is a proxy for the -COM object and is generated by the CLR when a .NET Framework client -activates a COM object. This provides a generic way to reuse COM -objects in a .NET Framework project. -
Making a TQObject class into a COM object is easily achieved with -ActiveTQt and demonstrated in the examples. The walkthrough will use the TQt classes implemented -in those examples, so the first thing to do is to make sure that those -examples have been built correctly, e.g. by opening the demonstration pages in Internet -Explorer to verify that the controls are functional. -
Start Visual Studio.NET, and create a new C# project for writing a -Windows application. This will present you with an empty form in -Visual Studio's dialog editor. You should see the toolbox, which -presents you with a number of available controls and objects in -different categories. If you right-click on the toolbox it allows -you to add new tabs. We will add the tab "TQt". -
The category only has a pointer tool by default, and we have to add -the TQt objects we want to use in our form. Right-click on the empty -space, and select "Customize". This opens a dialog that has two -tabs, "COM Components" and ".NET Framework Components". We used -ActiveTQt to wrap TQWidgets into COM objects, so we select the "COM -Components" page, and look for the classes we want to use, e.g. -"TQPushButton" and "TQAxWidget2". -
When we select those widgets and close the dialog the two widgets -will now be available from the toolbox as grey squares with their -name next to it (4) . -
We can now add an instance of TQAxWidget2 and a TQPushButton to -the form. Visual Studio will automatically generate the RCW for the -object servers. The TQAxWidget2 instance takes most of the upper -part of the form, with the TQPushButton in the lower right corner. -
In the property editor of Visual Studio we can modify the properties -of our controls - TQPushButton exposes the TQWidget API and has many -properties, while TQAxWidget2 has only the Visual Studio standard -properties in addition to its own property "lineWidth" in the -"Miscellaneous" category. The objects are named "axTQPushButton1" and -"axTQAxWidget21", and since especially the last name is a bit -confusing we rename the objects to "resetButton" and "circleWidget". -
We can also change the TQt properties, e.g. set the "text" property -of the resetButton to "Reset", and the "lineWidth" property of the -circleWidget to 5. We can also put those objects into the layout -system that Visual Studio's dialog editor provides, e.g. by setting -the anchors of the circleWidget to "Left, Top, Right, Bottom", and -the anchors of the resetButton to "Bottom, Right". -
Now we can compile and start the project, which will open a user -interface with our two TQt widgets. If we can resize the dialog, -the widgets will resize appropriately. -
We will now implement event handlers for the widgets. Select the -circleWidget and select the "Events" page in the property -editor. The widget exposes events because the TQAxWidget2 class has -the "StockEvents" attribute set in its class definition. We implement -the event handler circleClicked for the ClickEvent to increase -the line width by one for every click: -
- -
private void circleClicked(object sender, System.EventArgs e) - { - this.circleWidget.lineWidth++; - } --
In general we can implement a default event handler by double -clicking on the widget in the form, but the default events for -our widgets are right now not defined. -
We will also implement an event handler for the clicked signal -emitted by TQPushButton. Add the event handler resetLineWidth to -the clicked event, and implement the generated function: -
private void resetLineWidth(object sender, System.EventArgs e) - { - this.circleWidget.lineWidth = 1; - this.resetButton.setFocus(); - } --
We reset the property to 1, and also call the setFocus() slot -to simulate the user style on Windows, where a button grabs focus -when you click it (so that you can click it again with the spacebar). -
If we now compile and run the project we can click on the circle -widget to increase its line width, and press the reset button to -set the line width back to 1. -
Using ActiveTQt as a universal interoperability bridge between the -.NET world and the native world of TQt is very easy, and makes it -often unnecessary to implement a lot of handwritten wrapper classes. -Instead, the TQAxFactory implementation in the otherwise completely -cross-platform TQt project provides the glue that .NET needs to to -generate the RCW. -
If this is not sufficient we can implement our own wrapper classes -thanks to the C++ extensions provided by Microsoft. -
All the limitations when using ActiveTQt are implied when using this -technique to interoperate with .NET, e.g. the datatypes we can use -in the APIs can only be those supported by ActiveTQt and COM. However, -since this includes subclasses of TQObject and TQWidget we can wrap -any of our datatypes into a TQObject subclass to make its API -available to .NET. This has the positive side effect that the same -API is automatically available in TQSA, the cross platform -scripting solution for TQt applications, and to COM clients in general. -
When using the "IJW" method, in priciple the only limitation is the -time required to write the wrapper classes and data type conversion -functions. -
Every call from CLR bytecode to native code implies a small -performance hit, and necessary type conversions introduce an -additional delay with every layer that exists between the two -frameworks. Consequently every approach to mix .NET and native -code should try to minimize the communication necessary between -the different worlds. -
As ActiveTQt introduces three layers at once - the RCW, COM and finally -ActiveTQt itself - the performance penalty when using the generic -TQt/ActiveTQt/COM/RCW/.NET bridge is larger than when using a -hand-crafted IJW-wrapper class. The execution speed however is still -sufficient for connecting to and modifying interactive elements in a -user interface, and as soon as the benefit of using TQt and C++ to -implement and compile performance critical algorithms into native code -kicks in, ActiveTQt becomes a valid choice for making even non-visual -parts of your application accessible to .NET. -
-
- ' VB is case insensitive, but our C++ controls are not. - ' Me.resetButton.enabled = True -- -This line is regenerated without comment whenever you change the -dialog, in which case you have to comment it out again to be able -to run the project. This is a bug in the original version of -Visual Studio.NET, and is fixed in the 2003 edition. - Back...
See also The TQAxServer Examples. - - -
Copyright © 2007 -Trolltech | Trademarks - | TQt 3.3.8
- |
- -Home - | -All Classes - | -Main Classes - | -Annotated - | -Grouped Classes - | -Functions - | -
- - -
Copyright © 2007 -Trolltech | Trademarks - | TQt 3.3.8
- |
- -Home - | -All Classes - | -Main Classes - | -Annotated - | -Grouped Classes - | -Functions - | -
Call dumpdoc with the following command line parameters: -
Option - | Result - |
---|---|
-o file - | Writes output to file - |
object - | Generate documentation for object - |
-v - | Print version information - |
-h - | Print help - |
object must be an object installed on the local machine (ie. -remote objects are not supported), and can include subobjects -accessible through properties, ie. -Outlook.Application/Session/CurrentUser -
The generated file will be an HTML file using TQt documentation -style. -
To build the tool you must first build the -TQAxContainer library. -Then run your make tool in tools/dumpdoc. -
See also ActiveTQt Tools. - - -
Copyright © 2007 -Trolltech | Trademarks - | TQt 3.3.8
- |
- -Home - | -All Classes - | -Main Classes - | -Annotated - | -Grouped Classes - | -Functions - | -
IDC understands the following command line parameters: -
Option - | Result - |
---|---|
dll -idl idl -version x.y - | Writes the IDL of the server dll to the file idl. The -type library wll have version x.y. - |
dll -tlb tlb - | Replaces the type library in dll with tlb - |
-v - | Print version information - |
-regserver dll - | Register the COM server dll - |
-unregserver - | Unregister the COM server dll - |
It is usually never necessary to invoke IDC manually, as the -qmake build system takes care of adding the required post -processing steps to the build process. See the -ActiveTQt build system -documentation for details. -
See also ActiveTQt Tools. - - -
Copyright © 2007 -Trolltech | Trademarks - | TQt 3.3.8
- |
- -Home - | -All Classes - | -Main Classes - | -Annotated - | -Grouped Classes - | -Functions - | -
The GUI has been implemented utilizing the TQt Designer integration -of the TQAxContainer module. Parts of the code use internals of the TQt -meta object and ActiveTQt framework and are not recommended to be used in -application code. -
Use the application to view the slots, signals and porperties -available through the TQAxWidget class when instantiated with a -certain ActiveX, and to test ActiveX controls you implement or -want to use in your TQt application. -
The application can load and execute script files in JavaScript, -VBScript, Perl and Python to program the controls loaded. Example -script files using the TQAxWidget2 class are available in the scripts -subdirectory. -
Note that the qmake project of this example includes a resource file -testcon.rc with a version resource. This is required by some -ActiveX controls (ie. Shockwave ActiveX Controls), which might crash -or misbehave otherwise if such version information is missing. -
To build the tool you must first build the -TQAxContainer library. -Then run your make tool in tools/testcon and -run the resulting testcon.exe. -
See also ActiveTQt Tools. - - -
Copyright © 2007 -Trolltech | Trademarks - | TQt 3.3.8
- |
- -Home - | -All Classes - | -Main Classes - | -Annotated - | -Grouped Classes - | -Functions - | -
The DumpDoc Tool - |
The IDC Tool - |
An ActiveX Test Container - |
Copyright © 2007 -Trolltech | Trademarks - | TQt 3.3.8
- |
* Extension classes of TQt/Embedded, ActiveTQt, Motif, and Netscape. +
* Extension classes of TQt/Embedded, Motif, and Netscape. diff --git a/doc/html/editions.html b/doc/html/editions.html index f863ec37..38ceaa0a 100644 --- a/doc/html/editions.html +++ b/doc/html/editions.html @@ -108,8 +108,6 @@ Well-formed XML parser with SAX interface and DOM Level 1.
The TQt Netscape Plugin software makes it easy to write browser plugins that can be used on both Unix/Linux and MS-Windows, in Netscape, Mozilla, and any other web browser supporting Netscape's LiveConnect -protocol. Modern versions of MSIE do not support this protocol. Use -the ActiveTQt Framework to develop plugins for these browsers. +protocol. Modern versions of MSIE do not support this protocol. +
The Netscape Plugin Extension consists of the follow classes: diff --git a/doc/html/ntqapplication.html b/doc/html/ntqapplication.html index 80800e19..2e096fa3 100644 --- a/doc/html/ntqapplication.html +++ b/doc/html/ntqapplication.html @@ -817,7 +817,7 @@ special function whenever there are no pending events, use a be achieved using processEvents().
See also quit(), exit(), processEvents(), and setMainWidget(). -
Examples: helpsystem/main.cpp, life/main.cpp, network/archivesearch/main.cpp, network/ftpclient/main.cpp, opengl/main.cpp, t1/main.cpp, and t4/main.cpp. +
Examples: helpsystem/main.cpp, life/main.cpp, network/archivesearch/main.cpp, network/ftpclient/main.cpp, t1/main.cpp, and t4/main.cpp.
See also colorSpec(), TQColor::numBitPlanes(), and TQColor::enterAllocContext(). -
Examples: helpviewer/main.cpp, opengl/main.cpp, showimg/main.cpp, t9/main.cpp, tetrax/tetrax.cpp, tetrix/tetrix.cpp, and themes/main.cpp. +
Examples: helpviewer/main.cpp, showimg/main.cpp, t9/main.cpp, tetrix/tetrix.cpp, and themes/main.cpp.
See also mainWidget(), exec(), and quit(). -
Examples: chart/main.cpp, helpsystem/main.cpp, life/main.cpp, network/ftpclient/main.cpp, opengl/main.cpp, t1/main.cpp, and t4/main.cpp. +
Examples: chart/main.cpp, helpsystem/main.cpp, life/main.cpp, network/ftpclient/main.cpp, t1/main.cpp, and t4/main.cpp.
See also autoAdd(). -
Examples: hierarchy/objects.cpp and i18n/main.cpp. +
Examples: i18n/main.cpp.
This signal is emitted whenever the text changes. The argument is the new text. -
Examples: simple/main.cpp, wizard/wizard.cpp, and xform/xform.cpp. +
Examples: wizard/wizard.cpp, and xform/xform.cpp.
Note that the currentChanged() signal is not emitted when this slot is invoked.
See also triggerUpdate(). -
Examples: addressbook/centralwidget.cpp, checklists/checklists.cpp, listviews/listviews.cpp, and qutlook/centralwidget.cpp. +
Examples: addressbook/centralwidget.cpp, checklists/checklists.cpp and listviews/listviews.cpp.
See also setCurrentItem(). -
Examples: addressbook/centralwidget.cpp, listviews/listviews.cpp, and qutlook/centralwidget.cpp. +
Examples: addressbook/centralwidget.cpp and listviews/listviews.cpp.
Returns what action to perform when the editor loses focus during renaming. See the "defaultRenameAction" property for details. diff --git a/doc/html/ntqmessagebox.html b/doc/html/ntqmessagebox.html index 1525fe6f..575e83f9 100644 --- a/doc/html/ntqmessagebox.html +++ b/doc/html/ntqmessagebox.html @@ -508,7 +508,7 @@ modal dialog box. If parent is a widget, the message box becomes modal relative to parent.
See also question(), warning(), and critical(). -
Examples: action/application.cpp, application/application.cpp, dirview/dirview.cpp, fileiconview/qfileiconview.cpp, picture/picture.cpp, qwerty/qwerty.cpp, and simple/main.cpp. +
Examples: action/application.cpp, application/application.cpp, dirview/dirview.cpp, fileiconview/qfileiconview.cpp, picture/picture.cpp and qwerty/qwerty.cpp.
Examples: drawdemo/drawdemo.cpp, multiple/ax2.h, picture/picture.cpp, and tictac/tictac.cpp. +
Examples: drawdemo/drawdemo.cpp, picture/picture.cpp, and tictac/tictac.cpp.
See also drawRect(). -
Examples: listboxcombo/listboxcombo.cpp, multiple/ax1.h, progress/progress.cpp, qdir/qdir.cpp, qfd/fontdisplayer.cpp, themes/metal.cpp, and themes/wood.cpp. +
Examples: listboxcombo/listboxcombo.cpp, progress/progress.cpp, qdir/qdir.cpp, qfd/fontdisplayer.cpp, themes/metal.cpp, and themes/wood.cpp.
Returns the painter's current pen.
See also setPen(). -
Examples: multiple/ax2.h, progress/progress.cpp, and themes/wood.cpp. +
Examples: progress/progress.cpp, and themes/wood.cpp.
See also pen(). -
Examples: desktop/desktop.cpp, drawdemo/drawdemo.cpp, multiple/ax2.h, progress/progress.cpp, t9/cannon.cpp, themes/metal.cpp, and themes/wood.cpp. +
Examples: desktop/desktop.cpp, drawdemo/drawdemo.cpp, progress/progress.cpp, t9/cannon.cpp, themes/metal.cpp, and themes/wood.cpp.
See also width(). -
Examples: multiple/ax2.h, progress/progress.cpp, and scribble/scribble.h. +
Examples: progress/progress.cpp, and scribble/scribble.h.
Examples: multiple/ax1.h and multiple/ax2.h.
This signal is emitted when the slider value is changed, with the new slider value as its argument. -
Examples: rangecontrols/rangecontrols.cpp, simple/main.cpp, t12/lcdrange.cpp, t5/main.cpp, t6/main.cpp, t7/lcdrange.cpp, and xform/xform.cpp. +
Examples: rangecontrols/rangecontrols.cpp, t12/lcdrange.cpp, t5/main.cpp, t6/main.cpp, t7/lcdrange.cpp, and xform/xform.cpp.
This property holds the current line step. diff --git a/doc/html/overviews-list.html b/doc/html/overviews-list.html index b6e4d255..1cf238cb 100644 --- a/doc/html/overviews-list.html +++ b/doc/html/overviews-list.html @@ -79,7 +79,6 @@ body { background: #ffffff; color: black; }
These classes deal with shared libraries, (e.g. .so and DLL files), and with TQt plugins.
See the plugins documentation. -
See also the ActiveTQt framework for -Windows.
TQGfxDriverPlugin | Abstract base for TQt/Embedded graphics driver plugins
diff --git a/doc/html/propertydocs b/doc/html/propertydocs
index 931a617f..efed087f 100644
--- a/doc/html/propertydocs
+++ b/doc/html/propertydocs
@@ -189,63 +189,6 @@ calls to their <a href="ntqaction.html#setVisible">QAction::setVisible<
<p>Get this property's value with <a href="ntqassistantclient.html#isOpen">isOpen</a>().
-
Complete Member List for TQAxAggregated- -This is the complete list of member functions for -TQAxAggregated, including inherited members. - -
-
-
diff --git a/doc/html/qaxaggregated.html b/doc/html/qaxaggregated.html
deleted file mode 100644
index 167feb5b..00000000
--- a/doc/html/qaxaggregated.html
+++ /dev/null
@@ -1,155 +0,0 @@
-
-
-
-
-
-
TQAxAggregated Class Reference
-
- |
Copyright © 2007 -Trolltech | Trademarks - | TQt 3.3.8
- |
- -Home - | -All Classes - | -Main Classes - | -Annotated - | -Grouped Classes - | -Functions - | -
This is the verbatim text of the qaxbase.h include file. It is provided only for illustration; the copyright remains with Trolltech. -
-/**************************************************************************** -** $Id: qt/qaxbase.h 3.3.8 edited Jan 11 14:46 $ -** -** Declaration of the TQAxBase class -** -** Copyright (C) 2001-2007 Trolltech ASA. All rights reserved. -** -** This file is part of the Active TQt integration. -** -** Licensees holding valid TQt Enterprise Edition -** licenses for Windows may use this file in accordance with the TQt Commercial -** License Agreement provided with the Software. -** -** This file is not available for use under any other license without -** express written permission from the copyright holder. -** -** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -** -** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for -** information about TQt Commercial License Agreements. -** -** Contact info@trolltech.com if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ - -#ifndef UNICODE -#define UNICODE -#endif - -#ifndef TQAXBASE_H -#define TQAXBASE_H - -#include <ntqvariant.h> -#include <tqobject.h> - -struct IUnknown; -struct TQUuid; -class TQAxEventSink; -class TQAxObject; -class TQAxBasePrivate; - -class TQAxBase -{ -#ifdef Q_QDOC -#error "The Symbol Q_QDOC is reserved for documentation purposes." - TQ_PROPERTY( TQString control READ control WRITE setControl ) -#endif -public: -#ifndef Q_QDOC - typedef TQMap<TQCString, TQVariant> PropertyBag; -#endif - - TQAxBase( IUnknown *iface = 0 ); - virtual ~TQAxBase(); - - TQString control() const; - - long queryInterface( const TQUuid &, void** ) const; - - TQVariant dynamicCall( const TQCString&, const TQVariant &v1 = TQVariant(), - const TQVariant &v2 = TQVariant(), - const TQVariant &v3 = TQVariant(), - const TQVariant &v4 = TQVariant(), - const TQVariant &v5 = TQVariant(), - const TQVariant &v6 = TQVariant(), - const TQVariant &v7 = TQVariant(), - const TQVariant &v8 = TQVariant() ); - TQVariant dynamicCall( const TQCString&, TQValueList<TQVariant> &vars ); - TQAxObject *querySubObject( const TQCString &name, const TQVariant &v1 = TQVariant(), - const TQVariant &v2 = TQVariant(), - const TQVariant &v3 = TQVariant(), - const TQVariant &v4 = TQVariant(), - const TQVariant &v5 = TQVariant(), - const TQVariant &v6 = TQVariant(), - const TQVariant &v7 = TQVariant(), - const TQVariant &v8 = TQVariant() ); - - virtual TQMetaObject *metaObject() const; - virtual bool tqt_invoke( int, TQUObject* ); - virtual bool tqt_property( int, int, TQVariant* ); - virtual bool tqt_emit( int, TQUObject* ) = 0; - virtual const char *className() const = 0; - virtual TQObject *qObject() = 0; - - PropertyBag propertyBag() const; - void setPropertyBag( const PropertyBag& ); - - TQString generateDocumentation(); - - virtual bool propertyWritable( const char* ) const; - virtual void setPropertyWritable( const char*, bool ); - - bool isNull() const; - - TQVariant asVariant() const; - -#ifdef Q_QDOC -#error "The Symbol Q_QDOC is reserved for documentation purposes." - enum PropertyBag {}; -signals: - void signal(const TQString&,int,void*); - void propertyChanged(const TQString&); - void exception(int,const TQString&,const TQString&,const TQString&); -#endif - -public: - virtual void clear(); - bool setControl( const TQString& ); - - void disableMetaObject(); - void disableClassInfo(); - void disableEventSink(); - -protected: - virtual bool initialize( IUnknown** ptr ); - bool initializeRemote(IUnknown** ptr); - bool initializeLicensed(IUnknown** ptr); - bool initializeActive(IUnknown** ptr); - -private: - bool initializeLicensedHelper(void *factory, const TQString &key, IUnknown **ptr); - TQAxBasePrivate *d; - - static TQMetaObject *staticMetaObject() { return 0; } - virtual TQMetaObject *parentMetaObject() const = 0; - bool internalInvoke( const TQCString &name, void *out, TQVariant var[], TQCString &type ); - - TQString ctrl; -}; - -inline TQString TQAxBase::generateDocumentation() -{ - extern TQString qax_generateDocumentation(TQAxBase *, TQAxBasePrivate *); - return qax_generateDocumentation(this, d); -} - -#ifndef TQT_NO_DATASTREAM -inline TQDataStream &operator >>( TQDataStream &s, TQAxBase &c ) -{ - TQAxBase::PropertyBag bag; - c.qObject()->blockSignals( TRUE ); - TQString control; - s >> control; - c.setControl( control ); - s >> bag; - c.setPropertyBag( bag ); - c.qObject()->blockSignals( FALSE ); - - return s; -} - -inline TQDataStream &operator <<( TQDataStream &s, const TQAxBase &c ) -{ - TQAxBase::PropertyBag bag = c.propertyBag(); - s << c.control(); - s << bag; - - return s; -} -#endif // TQT_NO_DATASTREAM - -#endif // TQAXBASE_H -- -
Copyright © 2007 -Trolltech | Trademarks - | TQt 3.3.8
- |
- -Home - | -All Classes - | -Main Classes - | -Annotated - | -Grouped Classes - | -Functions - | -
This is the complete list of member functions for -TQAxBase, including inherited members. - -
Copyright © 2007 -Trolltech | Trademarks - | TQt 3.3.8
- |
- -Home - | -All Classes - | -Main Classes - | -Annotated - | -Grouped Classes - | -Functions - | -
The TQAxBase class is an abstract class that provides an API -to initalize and access a COM object. -More... -
This class is part of the TQt ActiveTQt Extension. -
#include <qaxbase.h> -
Inherited by TQAxObject and TQAxWidget. -
List of all member functions. -
This class is defined in the TQt ActiveTQt Extension, which can be found in the qt/extensions directory. It is not included in the main TQt API. -
- -
The TQAxBase class is an abstract class that provides an API -to initalize and access a COM object. - -
- -
TQAxBase is an abstract class that cannot be used directly, and is -instantiated through the subclasses TQAxObject and TQAxWidget. This -class provides the API to access the COM object directly -through its IUnknown implementation. If the COM object implements -the IDispatch interface, the properties and methods of that object -become available as TQt properties and slots. -
- connect( buttonBack, TQ_SIGNAL(clicked()), webBrowser, TQ_SLOT(GoBack()) ); -- -
Properties exposed by the object's IDispatch implementation can be -read and written through the property system provided by the TQt -Object Model (both subclasses are TQObjects, so you can use setProperty() and property() as with TQObject). Properties -with multiple parameters are not supported. -
- activeX->setProperty( "text", "some text" ); - int value = activeX->property( "value" ); -- -
Write-functions for properties and other methods exposed by the -object's IDispatch implementation can be called directly using -dynamicCall(), or indirectly as slots connected to a signal. -
- webBrowser->dynamicCall( "GoHome()" ); -- -
Outgoing events supported by the COM object are emitted as -standard TQt signals. -
- connect( webBrowser, TQ_SIGNAL(TitleChanged(const TQString&)), - this, TQ_SLOT(setCaption(const TQString&)) ); -- -
TQAxBase transparently converts between COM data types and the -equivalent TQt data types. Some COM types have no equivalent TQt data structure. -
Supported COM datatypes are listed in the first column of following table. -The second column is the TQt type that can be used with the TQObject property -functions. The third column is the TQt type that is used in the prototype of -generated signals and slots for in-parameters, and the last column is the TQt -type that is used in the prototype of signals and slots for out-parameters. -
COM type - | TQt property - | in-parameter - | out-parameter - |
---|---|---|---|
VARIANT_BOOL - | bool - | bool - | bool& - |
BSTR - | TQString - | const TQString& - | TQString& - |
char, short, int, long - | int - | int - | int& - |
uchar, ushort, uint, ulong - | uint - | uint - | uint& - |
float, double - | double - | double - | double& - |
DATE - | TQDateTime - | const TQDateTime& - | TQDateTime& - |
CY - | TQ_LLONG - | TQ_LLONG - | TQ_LLONG& - |
OLE_COLOR - | TQColor - | const TQColor& - | TQColor& - |
SAFEARRAY(VARIANT) - | TQValueList<TQVariant> - | const TQValueList<TQVariant>& - | TQValueList<TQVariant>& - |
SAFEARRAY(BYTE) - | TQByteArray - | const TQByteArray& - | TQByteArray& - |
SAFEARRAY(BSTR) - | TQStringList - | const TQStringList& - | TQStringList& - |
VARIANT - | type-dependent - | const TQVariant& - | TQVariant& - |
IFontDisp* - | TQFont - | const TQFont& - | TQFont& - |
IPictureDisp* - | TQPixmap - | const TQPixmap& - | TQPixmap& - |
IDispatch* - | TQAxObject* (read-only) - | TQAxBase::asVariant() - | TQAxObject* (return value) - |
IUnknown* - | TQAxObject* (read-only) - | TQAxBase::asVariant() - | TQAxObject* (return value) - |
SCODE, DECIMAL - | unsupported - | unsupported - | unsupported - |
Supported are also enumerations, and typedefs to supported types. -
To call the methods of a COM interface described by the following IDL -
- dispinterface IControl - { - properties: - [id(1)] BSTR text; - [id(2)] IFontDisp *font; - - methods: - [id(6)] void showColumn( [in] int i ); - [id(3)] bool addColumn( [in] BSTR t ); - [id(4)] int fillList( [in, out] SAFEARRAY(VARIANT) *list ); - [id(5)] IDispatch *item( [in] int i ); - }; -- -use the TQAxBase API like this: -
- TQAxObject object( "<CLSID>" ); - - TQString text = object.property( "text" ).toString(); - object.setProperty( "font", TQFont( "Times New Roman", 12 ) ); - - connect( this, TQ_SIGNAL(clicked(int)), &object, TQ_SLOT(showColumn(int)) ); - bool ok = object.dynamicCall( "addColumn(const TQString&)", "Column 1" ).toBool(); - - TQValueList<TQVariant> varlist; - TQValueList<TQVariant> parameters; - parameters << TQVariant( varlist ); - int n = object.dynamicCall( "fillList(TQValueList<TQVariant>&)", parameters ).toInt(); - - TQAxObject *item = object.querySubItem( "item(int)", 5 ); -- -
Note that the TQValueList the object should fill has to be provided as an -element in the parameter list of TQVariants. -
If you need to access properties or pass parameters of unsupported -datatypes you must access the COM object directly through its -IDispatch implementation or other interfaces. Those interfaces can be -retrieved through queryInterface(). -
- IUnknown *iface = 0; - activeX->queryInterface( IID_IUnknown, (void**)&iface ); - if ( iface ) { - // use the interface - iface->Release(); - } -- -
To get the definition of the COM interfaces you will have to use the header -files provided with the component you want to use. Some compilers can also -import type libraries using the #import compiler directive. See the component -documentation to find out which type libraries you have to import, and how to use -them. -
If you need to react to events that pass parameters of unsupported -datatypes you can use the generic signal that delivers the event -data as provided by the COM event. - -
A TQMap See also clear().
-
- If you reimplement this function you must also reimplement the
-destructor to call clear(), and call this implementation at the
-end of your clear() function.
-
- Returns the name of the COM object wrapped by this TQAxBase object.
-See the "control" property for details.
- Note that this function must be called immediately after
-construction of the object (without passing an object identifier),
-and before calling TQAxWidget->setControl().
-
- Some ActiveX controls might be unstable when connected to an event
-sink. To get OLE events you must use standard COM methods to
-register your own event sink. Use queryInterface() to get access
-to the raw COM object.
- Note that this function should be called immediately after
-construction of the object (without passing an object identifier),
-and before calling TQAxWidget->setControl().
-
- Some ActiveX controls might be unstable when used with OLE
-automation. Use standard COM methods to use those controls through
-the COM interfaces provided by queryInterface().
- Note that this function must be called immediately after
-construction of the object (without passing an object identifier),
-and before calling TQAxWidget->setControl().
-
- If function is a method of the object the string must be provided
-as the full prototype, for example as it would be written in a
-TQObject::connect() call.
- Alternatively a function can be called passing the parameters embedded
-in the string, e.g. above function can also be invoked using
- If function is a property the string has to be the name of the
-property. The property setter is called when var1 is a valid TQVariant,
-otherwise the getter is called.
- It is only possible to call functions through dynamicCall() that
-have parameters or return values of datatypes supported by
-TQVariant. See the TQAxBase class documentation for a list of
-supported and unsupported datatypes. If you want to call functions
-that have unsupported datatypes in the parameter list, use
-queryInterface() to retrieve the appropriate COM interface, and
-use the function directly.
- This is also more efficient.
-
- Example: qutlook/centralwidget.cpp.
- Calls the COM object's method function, passing the
-parameters in vars, and returns the value returned by
-the method. If the method does not return a value or when
-the function call failed this function returns an invalid
-TQVariant object.
- The TQVariant objects in vars are updated when the method has
-out-parameters.
-
- This signal is emitted when the COM object throws an exception while called using the OLE automation
-interface IDispatch. code, source, desc and help provide information about the exception as
-provided by the COM server and can be used to provide useful feedback to the end user. help includes
-the help file, and the help context ID in brackets, e.g. "filename [id]".
-
- Returns a rich text string with documentation for the
-wrapped COM object. Dump the string to an HTML-file,
-or use it in e.g. a TQTextBrowser widget.
-
- The default implementation interprets the string returned by
-control(), and calls initializeRemote(), initializeLicensed()
-or initializeActive() if the string matches the respective
-patterns. If no pattern is matched, or if remote or licensed
-initialization fails, CoCreateInstance is used directly to create
-the object.
- See the control property documentation for details about
-supported patterns.
- The interface returned in ptr must be referenced exactly once
-when this function returns. The interface provided by e.g.
-CoCreateInstance is already referenced, and there is no need to
-reference it again.
-
- This function is called by initialize() if the control string contains the
-substring "}&".
- See also initialize().
-
- This function is called by initialize() if the control string contains the
-substring "}:". The license key needs to follow this substring.
- See also initialize().
-
- This function is called by initialize() if the control string contains the
-substring "/{". The information about the remote machine needs to be provided
-in front of the substring.
- See also initialize().
-
- See also control.
-
- This is more efficient than getting multiple properties
-individually if the COM object supports property bags.
- Warning: It is not guaranteed that the property bag implementation
-of the COM object returns all properties, or that the properties
-returned are the same as those available through the IDispatch
-interface.
-
- If the COM object supports property notification, this signal gets
-emitted when the property called name is changed.
-
- Warning:
-Depending on the control implementation this setting might be
-ignored for some properties.
- See also setPropertyWritable() and propertyChanged().
-
- Returns the result of the QueryInterface implementation of the COM object.
- See also control.
-
- If name is provided by a method the string must include the
-full function prototype.
- If name is a property the string must be the name of the property,
-and var1, ... var8 are ignored.
- The returned TQAxObject is a child of this object (which is either of
-type TQAxObject or TQAxWidget), and is deleted when this object is
-deleted. It is however safe to delete the returned object yourself,
-and you should do so when you iterate over lists of subobjects.
- COM enabled applications usually have an object model publishing
-certain elements of the application as dispatch interfaces. Use
-this method to navigate the hierarchy of the object model, e.g.
- Example: qutlook/centralwidget.cpp.
- Sets the name of the COM object wrapped by this TQAxBase object.
-See the "control" property for details.
- Warning:
-You should only set property bags that have been returned by the
-propertyBag function, as it cannot be guaranteed that the property
-bag implementation of the COM object supports the same properties
-that are available through the IDispatch interface.
- See also propertyBag().
-
- Warning:
-Depending on the control implementation this setting might be
-ignored for some properties.
- See also propertyWritable() and propertyChanged().
-
- This generic signal gets emitted when the COM object issues the
-event name. argc is the number of parameters provided by the
-event (DISPPARAMS.cArgs), and argv is the pointer to the
-parameter values (DISPPARAMS.rgvarg). Note that the order of parameter
-values is turned around, ie. the last element of the array is the first
-parameter in the function.
- Use this signal if the event has parameters of unsupported data
-types. Otherwise, connect directly to the signal name.
-
- This property holds the name of the COM object wrapped by this TQAxBase object.
- Setting this property initilializes the COM object. Any COM object
-previously set is shut down.
- The most efficient way to set this property is by using the
-registered component's UUID, e.g.
- If the component's UUID is used the following patterns can be used
-to initialize the control on a remote machine, to initialize a
-licensed control or to connect to a running object:
- The control's read function always returns the control's UUID, if provided including the license
-key, and the name of the server, but not including the username, the domain or the password.
-
- Set this property's value with setControl() and get this property's value with control().
-
-
-This file is part of the TQt toolkit.
-Copyright © 1995-2007
-Trolltech. All Rights Reserved. This is the verbatim text of the qaxbindable.h include file. It is provided only for illustration; the copyright remains with Trolltech.
- This is the complete list of member functions for
-TQAxBindable, including inherited members.
-
- The TQAxBindable class provides an interface between a
-TQWidget and an ActiveX client.
-More...
- This class is part of the TQt ActiveTQt Extension.
- #include <qaxbindable.h>
- List of all member functions.
- This class is defined in the TQt ActiveTQt Extension, which can be found in the qt/extensions directory. It is not included in the main TQt API.
-
-
-The TQAxBindable class provides an interface between a
-TQWidget and an ActiveX client.
-
-
-
- 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 meta object compiler requires you to inherit from
-TQWidget first.
- 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.
- 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
-TQAxAggregated subclass.
-
- Call QueryInterface() on the returned interface to get the interface you
-want to call.
-
- The default implementation returns the null pointer.
-
- This function is usually called at the end of the property's write
-function.
- See also requestPropertyChange().
-
- Reports an error to the client application. code is a
-control-defined error code. desc is a human-readable description
-of the error intended for the application user. src is the name
-of the source for the error, typically the ActiveX server name. context can be the location of a help file with more information
-about the error. If context ends with a number in brackets,
-e.g. [12], this number will be interpreted as the context ID in
-the help file.
-
- This function is usually called first in the write function for property, and writing is abandoned if the function returns FALSE.
- See also propertyChanged().
-
-
-
-This file is part of the TQt toolkit.
-Copyright © 1995-2007
-Trolltech. All Rights Reserved. It demonstrates the use of TQAxObject and querySubObject to instantiate and
-navigate the Outlook Object Model, and the use of the TQt property system to
-read and write values of items in the Outlook contact folder.
-
-
-The modifications in the class declaration of the central widget are
-a forward declaration of the TQAxObject class and the IDispatch interface,
-and a new TQListViewItem subclass ABListViewItem that implements a
-constructor and a destructor and has a member contact_item of type
-TQAxObject.
- The ABCentralWidget gets a destructor, a new protected function setupOutlook,
-a new protected slot updateOutlook, and also three members of type TQAxObject.
-
-
-The implementation of the ABListViewItem class is trivial:
- The implementation of the updateOutlook slot clears the listview, and uses
-querySubObject to iterate through the list of items. For every item provided a new
-ABListViewItem object is created and filled with the properties of the item
-object. The object returned by querySubObject is a child of the callee (ie. "contactItems"),
-but the list view item should take ownership to provide a cleaner relation between
-entries, so the item has to be removed from its parent object.
- The addEntry implementation calls the CreateItem method of the Outlook.Application
-object to create a new contact item, and creates a new ABListViewItem if the call
-succeeds.
- The changeEntry implementation updates the values in the contact item of the current
-listview item as well as the values of the listview item itself.
- To build the example you must first build the TQAxContainer
-library. Then run your make tool in examples/qutlook and run the resulting qutlok.exe.
- See also The TQAxContainer Examples.
-
-
- The code demonstrates how the TQt application can communicate
-with the embedded ActiveX controls using signals, slots and the
-dynamicCall() function. Most signal and slot connections have
-already been set up within TQt Designer.
-
-
- Finally the GoHome() function of Internet Explorer is invoked
-using the TQAxBase::dynamicCall() dynamicCall() API.
- The rest of the implementation is not related to ActiveTQt and
-omitted for brevity.
- To build the example you must first build the
-TQAxContainer library.
-Then run your make tool in examples/webbrowser and
-run the resulting webbrowser.exe.
- See also The TQAxContainer Examples.
-
-
- For more information see the TQAxContainer documentation.
-
-
-
- The TQAxContainer module provides a library implementing a TQWidget
-subclass, TQAxWidget, that acts as a container for ActiveX
-controls, and a TQObject subclass, TQAxObject, that can be used to
-easily access non-visual COM objects. Scripting COM objects embedded
-using these classes is possible through the TQAxScript, TQAxScriptManager
-and TQAxScriptEngine classes.
- This module is part of the ActiveTQt
- framework. (To make an application into an ActiveX server
-see the TQAxServer module.)
- The module consists of six classes
- Some example applications
-that use standard ActiveX controls to provide high level user
-interface functionality are provided.
- In the activeqt directory (usually TQTDIR/extensions/activeqt)
-enter the container subdirectory and run qmake to generate the
-makefile, and use the make tool (nmake for VC++, make for Borland)
-to build the library. The library qaxcontainer.lib will be linked
-into TQTDIR/lib.
- If you have a shared configuration of TQt enter the plugin subdirectory
-and run qmake and your make tool to build a plugin that integrates the
-TQAxWidget class into TQt Designer.
- To build TQt applications that can host COM objects and ActiveX controls
-link the application against the TQAxContainer module by adding
- to the application's .pro file.
- The TQAxContainer library is static, so there is no need to redistribute
-any additional files when using this module. Note however that the
-ActiveX server binaries you are using might not be installed on the
-target system, so you have to ship them with your package and register
-them during the installation process of your application.
- To instantiate a COM object use the TQAxBase::setControl() API, or pass
-the name of the object directly into the constructor of the TQAxBase
-subclass you are using.
- The control can be specified in a variety of formats, but the fastest
-and most powerful format is to use the class ID (CLSID) of the object
-directly. The class ID can be prepended with information about a remote
-machine that the object should run on, and can include a license key
-for licensed controls.
- ActiveTQt provides a TQt API to the COM object, and replaces COM
-datatypes with TQt equivalents. Use the dumpdoc tool to get the
-documentation of the TQt API for any COM object and it's subobjects.
- See the TQAxWidget and TQAxObject API documentation about how to
-use this class to use ActiveX controls and COM objects in TQt
-applications. To access the COM object with scripting languages use
-the TQAxScript class.
- To call functions of the COM object that can not be accessed via
-ActiveTQt it is possible to request the COM interface directly using
-TQAxBase::queryInterface(). To get a C++ definition of the respective
-interface classes use the #import directive with the type library
-provided with the control.
- ActiveTQt prints error messages to the debug output when it
-encounters error situations at runtime. Usually you must run
-your program in the debugger to see these messages (e.g. in Visual
-Studio's Debug output).
- The control requested in TQAxBase::setControl() is not installed
-on this system, or is not accessible for the current user.
- The control might require administrator rights, or a license key.
-If the control is licensed, reimplement initialize() and use the
-COM APIs to call the IClassFactory2 interface functions.
- A dynamicCall() failed - the function prototype did not
-match any function available in the object's API.
- A dynamicCall() failed - the function prototype was correct,
-but too few parameters were provided.
- A dynamicCall() failed - the function prototype was correct,
-but the paramter at index n was of the wrong type and could
-not be coerced to the correct type.
- You try to call a function that is provided through an engine
-that doesn't provide introspection (ie. ActivePython or
-ActivePerl). You need to call the function directly on the
-respective TQAxScript object.
-
-
- This is the verbatim text of the qaxfactory.h include file. It is provided only for illustration; the copyright remains with Trolltech.
- This is the complete list of member functions for
-TQAxFactory, including inherited members.
-
- The TQAxFactory class defines a factory for the creation of COM components.
-More...
- This class is part of the TQt ActiveTQt Extension.
- #include <qaxfactory.h>
- List of all member functions.
- This class is defined in the TQt ActiveTQt Extension, which can be found in the qt/extensions directory. It is not included in the main TQt API.
-
-
-The TQAxFactory class defines a factory for the creation of COM components.
-
- Implement this factory once in your ActiveX server to provide
-information about the components the server can create. If your
-server supports just a single ActiveX control, you can use the
-default factory implementation instead of implementing the factory
-yourself. Use the TQAXFACTORY_DEFAULT macro in any
-implementation file (e.g. main.cpp) to instantiate and export the
-default factory:
- If you implement your own factory reimplement the pure virtual
-functions, provide the unique identifiers for the ActiveX
-controls, and use the TQAXFACTORY_EXPORT macro to instantiate
-and export it:
- If you use the TQ_CLASSINFO macro to provide the unique identifiers
-or other attributes for your class you can use the TQAXFACTORY_BEGIN,
-TQAXCLASS and TQAXFACTORY_END macros to expose one or more classes
-as COM objects.
- Only one TQAxFactory implementation may be instantiated and
-exported by an ActiveX server application. This instance is accessible
-through the global qAxFactory() function.
- A factory can also reimplement the registerClass() and
-unregisterClass() functions to set additional flags for an ActiveX
-control in the registry. To limit the number of methods or
-properties a widget class exposes from its parent classes
-reimplement exposeToSuperClass().
-
- This enum specifies the different types of servers that can be
-started with startServer.
- Reimplement this function to return the ActiveX server's
-application identifier.
-
- The default implementation interprets key as the class name,
-and returns the value of the TQ_CLASSINFO entry "ClassID".
-
- The returned widget will be exposed as an ActiveX control, e.g.
-a COM object that can be embedded as a control into applications.
- The default implementation returns 0.
-
- If the object returned is a TQWidget it will be exposed as an ActiveX
-control, otherwise the returned object will be exposed as a COM object.
- The default implementation returns the result TQAxFactory::create() if
-parent is 0 or a widget, otherwise returns 0.
-
- Reimplement this function to provide the COM object for object
-in wrapper. Return TRUE if the function was successfull, otherwise
-return FALSE.
- The default implementation creates a generic automation wrapper based
-on the meta object information of object.
-
- The default implementation interprets key as the class name,
-and returns the value of the TQ_CLASSINFO entry "EventsID".
-
- The default implementation interprets key as the class name,
-and returns the value of the TQ_CLASSINFO entry "ToSuperClass". If
-no such value is set the null-string is returned, and the functions
-and properties of all the super classes including TQWidget will be
-exposed.
- To only expose the functions and properties of the class itself,
-reimplement this function to return key.
-
- Reimplement this function to return a list of the widgets (class
-names) supported by this factory.
-
- The default implementation interprets key as the class name,
-and returns TRUE if the value of the TQ_CLASSINFO entry "StockEvents"
-is "yes". Otherwise this function returns FALSE.
-
- The default implementation interprets key as the class name,
-and returns the value of the TQ_CLASSINFO entry "InterfaceID".
-
- The default implementation returns FALSE.
-
- The default implementation returns the TQMetaObject for the class
-key.
-
- If you reimplement this function you must also reimplement
-unregisterClass() to remove the additional registry values.
- See also TQSettings.
-
- For out-of-process servers this is the same as
-TQApplication::applicationDirPath(). For in-process servers
-that function returns the directory that contains the hosting
-application.
-
- For out-of-process servers this is the same as
-TQApplication::applicationFilePath(). For in-process servers
-that function returns the file path of the hosting application.
-
- Starts the COM server with type and returns TRUE if successful,
-otherwise returns FALSE.
- Calling this function if the server is already running (or for an
-in-process server) does nothing and returns TRUE.
- The server is started automatically with type set to MultipleUse
-if the server executable has been started with the -activex
-command line parameter.
-
- Stops the COM server and returns TRUE if successful, otherwise
-returns FALSE.
- Calling this function if the server is not running (or for an
-in-process server) does nothing and returns TRUE.
- Stopping the server will not invalidate existing objects, but no
-new objects can be created from the existing server process. Usually
-COM will start a new server process if additional objects are requested.
- The server is stopped automatically when the main() function returns.
-
- Reimplement this function to return the ActiveX server's type
-library identifier.
-
- See also registerClass() and TQSettings.
-
- The default implementation returns TRUE if the class key is not
-licensed (ie. no TQ_CLASSINFO attribute "LicenseKey"), or if
-licenseKey matches the value of the "LicenseKey" attribute, or
-if the machine is licensed through a .LIC file with the same filename
-as this COM server.
-
-
-
-This file is part of the TQt toolkit.
-Copyright © 1995-2007
-Trolltech. All Rights Reserved. This is the verbatim text of the qaxobject.h include file. It is provided only for illustration; the copyright remains with Trolltech.
- This is the complete list of member functions for
-TQAxObject, including inherited members.
-
- The TQAxObject class provides a TQObject that wraps a COM object.
-More...
- This class is part of the TQt ActiveTQt Extension.
- #include <qaxobject.h>
- Inherits TQObject and TQAxBase.
- Inherited by TQAxScriptEngine.
- List of all member functions.
- This class is defined in the TQt ActiveTQt Extension, which can be found in the qt/extensions directory. It is not included in the main TQt API.
-
-
-The TQAxObject class provides a TQObject that wraps a COM object.
-
-
-
- A TQAxObject can be instantiated as an empty object, with the name
-of the COM object it should wrap, or with a pointer to the
-IUnknown that represents an existing COM object. If the COM object
-implements the IDispatch interface, the properties, methods and
-events of that object become available as TQt properties, slots and
-signals. The base class, TQAxBase, provides an API to access the
-COM object directly through the IUnknown pointer.
- TQAxObject is a TQObject and can be used as such, e.g. it can be
-organized in an object hierarchy, receive events and connect to
-signals and slots.
- Warning:
-You can subclass TQAxObject, but you cannot use the TQ_OBJECT macro
-in the subclass (the generated moc-file will not compile), so you
-cannot add further signals, slots or properties. This limitation is
-due to the metaobject information generated in runtime.
-To work around this problem, aggregate the TQAxObject as a member of
-the TQObject subclass.
-
- See also control.
-
- If function is a method of the object the string must be provided
-as the full prototype, for example as it would be written in a
-TQObject::connect() call.
- Alternatively a function can be called passing the parameters embedded
-in the string, e.g. above function can also be invoked using
- If function is a property the string has to be the name of the
-property. The property setter is called when var1 is a valid TQVariant,
-otherwise the getter is called.
- It is only possible to call functions through dynamicCall() that
-have parameters or return values of datatypes supported by
-TQVariant. See the TQAxBase class documentation for a list of
-supported and unsupported datatypes. If you want to call functions
-that have unsupported datatypes in the parameter list, use
-queryInterface() to retrieve the appropriate COM interface, and
-use the function directly.
- This is also more efficient.
-
- Example: qutlook/centralwidget.cpp.
- Calls the COM object's method function, passing the
-parameters in vars, and returns the value returned by
-the method. If the method does not return a value or when
-the function call failed this function returns an invalid
-TQVariant object.
- The TQVariant objects in vars are updated when the method has
-out-parameters.
-
- If name is provided by a method the string must include the
-full function prototype.
- If name is a property the string must be the name of the property,
-and var1, ... var8 are ignored.
- The returned TQAxObject is a child of this object (which is either of
-type TQAxObject or TQAxWidget), and is deleted when this object is
-deleted. It is however safe to delete the returned object yourself,
-and you should do so when you iterate over lists of subobjects.
- COM enabled applications usually have an object model publishing
-certain elements of the application as dispatch interfaces. Use
-this method to navigate the hierarchy of the object model, e.g.
- Example: qutlook/centralwidget.cpp.
-
-
-This file is part of the TQt toolkit.
-Copyright © 1995-2007
-Trolltech. All Rights Reserved. This is the verbatim text of the qaxscript.h include file. It is provided only for illustration; the copyright remains with Trolltech.
- This is the complete list of member functions for
-TQAxScript, including inherited members.
-
- The TQAxScript class provides a wrapper around script code.
-More...
- This class is part of the TQt ActiveTQt Extension.
- #include <qaxscript.h>
- Inherits TQObject.
- List of all member functions.
- This class is defined in the TQt ActiveTQt Extension, which can be found in the qt/extensions directory. It is not included in the main TQt API.
-
-
-The TQAxScript class provides a wrapper around script code.
-
-
- Every instance of the TQAxScript class represents a piece of
-scripting code in a particular scripting language. The code is
-loaded into the script engine using load(). Functions declared
-in the code can be called using call().
- The script provides scriptEngine() provides feedback to the
-application through signals. The most important signal is the
-error() signal. Direct access to the TQAxScriptEngine is provided
-through the scriptEngine() function.
- Warning: This class is not available with the bcc5.5 and MingW
-compilers.
-
- This FunctionFlags enum describes formatting for function introspection.
- A script should always have a name. A manager is necessary to allow
-the script code to reference objects in the application. The manager
-takes ownership of the object.
-
- See TQAxScriptManager::call() for more information about how to call
-script functions.
-
- Calls function passing arguments as parameters, and returns
-the result. Returns when the script's execution has finished.
- See TQAxScriptManager::call() for more information about how to call
-script functions.
-
- This signal is emitted when a script engine has started executing code.
-
- This signal is emitted when an execution error occured while
-running a script.
- code, description, sourcePosition and sourceText
-contain information about the execution error.
-
- This signal is emitted when a script engine has finished executing code.
-
- result contains the script's result. This will be an invalid
-TQVariant if the script has no return value.
-
- code, source, description and help contain exception information
-when the script terminated.
-
- See also TQAxScriptEngine::hasIntrospection().
-
- If language is empty (the default) it will be determined
-heuristically. If code contains the string End Sub it will
-be interpreted as VBScript, otherwise as JScript. Additional
-scripting languages can be registered using
-TQAxScript::registerEngine().
- This function can only be called once for each TQAxScript object,
-which is done automatically when using TQAxScriptManager::load().
-
- See also load().
-
- You can use the object returned to connect signals to the
-script functions, or to access the script engine directly.
-
- This signal is emitted when a script engine changes state.
-state can be any value in the TQAxScriptEngineState enumeration.
-
-
-
-This file is part of the TQt toolkit.
-Copyright © 1995-2007
-Trolltech. All Rights Reserved. This is the complete list of member functions for
-TQAxScriptEngine, including inherited members.
-
- The TQAxScriptEngine class provides a wrapper around a script engine.
-More...
- This class is part of the TQt ActiveTQt Extension.
- #include <qaxscript.h>
- Inherits TQAxObject.
- List of all member functions.
- This class is defined in the TQt ActiveTQt Extension, which can be found in the qt/extensions directory. It is not included in the main TQt API.
-
-
-The TQAxScriptEngine class provides a wrapper around a script engine.
-
-
- Every instance of the TQAxScriptEngine class represents an interpreter
-for script code in a particular scripting language. The class is usually
-not used directly. The TQAxScript and TQAxScriptManager classes provide
-convenient functions to handle and call script code.
- Direct access to the script engine is provided through
-queryInterface().
- Warning: This class is not available with the bcc5.5 and MingW
-compilers.
-
- The State enumeration defines the different states a script
-engine can be in.
- Instances of TQAxScriptEngine should always have both a language and a
-script.
-
- Returns TRUE if the script engine has been initialized
-correctly; otherwise returns FALSE.
-
- Returns the result of the QueryInterface implementation of the COM
-object.
-
-
-This file is part of the TQt toolkit.
-Copyright © 1995-2007
-Trolltech. All Rights Reserved. This is the complete list of member functions for
-TQAxScriptManager, including inherited members.
-
- The TQAxScriptManager class provides a bridge between application objects
-and script code.
-More...
- This class is part of the TQt ActiveTQt Extension.
- #include <qaxscript.h>
- Inherits TQObject.
- List of all member functions.
- This class is defined in the TQt ActiveTQt Extension, which can be found in the qt/extensions directory. It is not included in the main TQt API.
-
-
-The TQAxScriptManager class provides a bridge between application objects
-and script code.
-
-
- The TQAxScriptManager acts as a bridge between the COM objects embedded
-in the TQt application through TQAxObject or TQAxWidget, and the scripting
-languages available through the Windows Script technologies, usually JScript
-and VBScript.
- Create one TQAxScriptManager for each separate document in your
-application, and add the COM objects the scripts need to access
-using addObject(). Then load() the script sources and invoke the
-functions using call().
- Warning: This class is not available with the bcc5.5 and MingW
-compilers.
-
- It is usual to create one TQAxScriptManager for each document in an
-application.
-
- You must add all the necessary objects before loading any scripts.
-
- Adds a generic COM wrapper for object to the manager. object
-must be exposed as a COM object using the functionality provided
-by the TQAxServer module.. Applications
-using this function you must link against the qaxserver library.
-
- In most script engines the only supported parameter type is "const
-TQVariant&", for example, to call a JavaScript function
- Functions provided by script engines that don't support
-introspection are not available and must be called directly
-using TQAxScript::call() on the respective script object.
- Note that calling this function can be significantely slower than
-using call() on the respective TQAxScript directly.
-
- Calls function passing arguments as parameters, and returns
-the result. Returns when the script's execution has finished.
-
- This signal is emitted when an execution error occured while
-running script.
- code, description, sourcePosition and sourceText
-contain information about the execution error.
-
- The function returns a pointer to the script for the given
-code if the code was loaded successfully; otherwise it
-returns 0.
- If language is empty it will be determined heuristically. If code contains the string "End Sub" it will be interpreted as
-VBScript, otherwise as JScript. Additional script engines can be
-registered using registerEngine().
- You must add all the objects necessary (using addObject()) before loading any scripts. If code declares a function that is
-already available (no matter in which language) the first function
-is overloaded and can no longer be called via call(); but it will
-still be available by calling its script
-directly.
- See also addObject(), scriptNames(), and functions().
-
- Loads the source code from the file. The script can later be
-referred to using its name which should not be empty.
- The function returns a pointer to the script engine for the code
-in file if file was loaded successfully; otherwise it
-returns 0.
- The script engine used is determined from the file's extension. By
-default ".js" files are interpreted as JScript files, and ".vbs"
-and ".dsm" files are interpreted as VBScript. Additional script
-engines can be registered using registerEngine().
-
- The script engine will be used when loading files with the given
-extension, or when loading source code that contains the string
-code.
-
- You can use the returned pointer to call functions directly
-through TQAxScript::call(), to access the script engine directly, or
-to delete and thus unload the script.
-
-
-This file is part of the TQt toolkit.
-Copyright © 1995-2007
-Trolltech. All Rights Reserved.
-
-
-
-This widget can have many children! This documentation is under development and is subject to change.
- This example is not full functional at the moment.
-
-
-
-
-
-
-
-
-This is one TQWidget subclass:
-This is another TQWidget subclass:
-
-
-
-An OpenGL scene:
-
-
-
-
-
-
-
-
-A TQPushButton:
-A TQCheckBox:
-A TQToolButton:
-A TQRadioButton:
-
-
-
-
-
-
-
-
-
- To build the example you must first build the TQAxServer library. Then run qmake and your make tool in
-examples/multiple.
- The demonstration requires your
-WebBrowser to support ActiveX controls, and scripting to be enabled.
-
-
- See also The TQAxServer Examples.
-
-
- This documentation is under development and is subject to change.
- This example demonstrates the use of TQMenuBar and TQStatusBar in
-a TQMainWindow to implement an in-place active control.
- To build the example you must first build the TQAxServer library. Then run qmake and your make tool in
-examples/menus.
- The demonstration requires your
-WebBrowser to support ActiveX controls, and scripting to be enabled.
-
-
- See also The TQAxServer Examples.
-
-
- The example demonstrates the use of the TQ_CLASSINFO macro to set
-ActiveTQt-specific attributes for TQObject sub classes, and the use of
-the TQAXFACTORY_BEGIN, TQAXCLASS and TQAXFACTORY_END macros.
-
-
-
-
- The controls are exposed by the implementation of TQAxFactory as provided
-by the TQAXFACTORY_BEGIN and TQAXFACTORY_END macros.
-
-
- To build the example you must first build the TQAxServer library. Then run qmake and your make tool in
-examples/multiple.
- The demonstration requires your
-WebBrowser to support ActiveX controls, and scripting to be enabled.
-
-
- See also The TQAxServer Examples.
-
-
- The example demonstrates the use of the default factory and
-TQAxFactory::isServer(), and the implementation of an additional COM
-interface using TQAxBindable and TQAxAggregated. The server executable
-can run both as an ActiveX server and as a stand alone application.
-
-
-The application uses the default factory as provided by the
-TQAXFACTORY_DEFAULT macro to expose the GLBox widget as an ActiveX
-control.
-
-
-The GLBox class inherits from both the TQGLWidget class to be able
-to render OpenGL, and from TQAxBindable.
-
-
-The implementation file of the GLBox class includes the objsafe.h
-system header, in which the IObjectSafety COM interface is defined.
- To build the example you must first build the TQAxServer library. Then run qmake and your make tool in
-examples/wrapper.
- The demonstration requires your
-WebBrowser to support ActiveX controls, and scripting to be enabled.
- In contrast to the other TQAxServer examples Internet Explorer will not
-open a dialog box to ask the user whether or not the scripting of the GLBox
-control should be allowed (the exact browser behaviour depends on the security
-settings in the Internet Options dialog).
-
-
- See also The TQAxServer Examples.
-
-
- It demonstrates the use of TQAxBindable::requestPropertyChange()
-and TQAxBindable::propertyChanged(), and the use of the default
-TQAxFactory through the TQAXFACTORY_DEFAULT macro.
-
-
- The TQt implementation of the ActiveX for this example is
- The control is exported using the default TQAxFactory
- To build the example you must first build the TQAxServer library. Then run qmake and your make tool in
-examples/simple.
- The demonstration requires your
-WebBrowser to support ActiveX controls, and scripting to be enabled.
- The simple ActiveX control is embedded using the <object> tag.
-
-
- A simple HTML button is connected to the ActiveTQt's about() slot.
- A second ActiveX control - the standard Calendar Control - is instantiated
- Events from the ActiveX controls are handled using both Visual Basic Script
-and JavaScript.
- See also The TQAxServer Examples.
-
-
- It demonstrates the use of the default factory provied by the
-TQAXFACTORY_DEFAULT macro, and of TQAxFactory::isServer().
- The code changes for the tetrix GUI are minimal (a property score,
-a signal gameOver and a slot startGame) and provide a better scripting
-interface for the use of the control in a web environment.
- The implementation of the ActiveX server functionality is only in the
-tetrax.cpp file.
-
-
-The default implementation of the TQAxFactory is used through the
-TQAXFACTORY_DEFAULT macro, and exports the TQTetrax object specifying
-the five unique IDs required by COM to instantiate and communicate with
-the server.
- To build the example you must first build the TQAxServer library. Then run qmake and your make tool in
-examples/tetrix.
- The demonstration requires your
-Web browser to support ActiveX controls, and scripting to be enabled.
-
-
-The "Tetrix" control is embedded using the <object> tag. Note that the
-dimensions of the control are provided explicitely, as the control itself
-does not use TQt's layout engine.
- See also The TQAxServer Examples.
-
-
- It demonstrates how to export existing TQWidget classes as ActiveX
-controls, and the use of TQAxFactory together with the TQAXFACTORY_EXPORT
-macro.
-
-
- To build the example you must first build the TQAxServer library. Then run qmake and your make tool in
-examples/wrapper.
- The demonstration requires your
-WebBrowser to support ActiveX controls, and scripting to be enabled.
-
-
- See also The TQAxServer Examples.
-
-
- For more information see the TQAxServer
-documentation.
-
-
-
- The TQAxServer module provides a static library implementing the
-functions required to turn a standard TQt binary into an ActiveX
-control server.
- This module is part of the ActiveTQt
- framework. (To incorporate ActiveX controls in a TQt
-application see the TQAxContainer
- module.)
- The module consists of three classes
- Some example implementations
-of ActiveX controls are provided.
- In the activeqt directory (usually TQTDIR/extensions/activeqt)
-enter the control subdirectory and run qmake to generate the
-makefile, and use the make tool (nmake for VC++, make for Borland)
-to build the library. The library qaxserver.lib will be linked into
-TQTDIR/lib.
- To turn a standard TQt application into an ActiveX server using the
-TQAxServer library you must add activeqt as a CONFIG setting
-in your .pro file.
- An out-of-process executable server is generated from a .pro
-file like this:
- To build an in-process server, use a .pro file like this:
- The files qaxserver.rc and qaxserver.def are part of the
-framework and can be used from their usual location (specify a
-path in the .pro file), or copied into the project directory.
-You can modify these files as long as it includes any file as the
-type library entry, ie. you can add version information or use a
-different toolbox icon.
- The activeqt configuration will cause the qmake tool to add the
-required build steps to the build system:
- Additionally you can specify a version number using the VERSION
-variable, e.g.
- Whether your ActiveX server should run as a stand-alone executable
-or as a shared library in the client process depends mainly on the
-type of controls you want to provide in the server.
- An executable server has the advantage of being able to run as a
-stand-alone application, but adds considerable overhead to the
-communication between the ActiveX client and the control. If the
-control has a programming error only the server process running
-the control will crash, and the client application will probably
-continue to run.
- An in-process server is usually smaller and has faster startup
-time. The communication between client and server is done directly
-through virtual function calls and does not introduce the overhead
-required for remote procedure calls. But if the server crashes the
-client application is likely to crash as well.
- Both server types can use TQt either as a shared library, or
-statically linked into the server binary.
- To be able to build ActiveX controls with TQt, the build system
-must be extended to include some additional build steps that are
-used when the .pro file includes activeqt in the CONFIG
-settings. The resulting makefile will:
- Attaching resources to an executable is not supported by
-Windows 95/98/ME, but a server built on
-Windows NT/2000/XP will work on those versions.
- The compiler/linker errors listed are based on those issued by the
-Microsoft Visual C++ 6.0 compiler.
- When the error occurs in code that uses the TQAXFACTORY_DEFAULT
-macro, the widget class had no constructor that can be used by the
-default factory. Either add a standard widget constructor or
-implement a custom factory that doesn't require one.
- When the error occurs in code that uses the TQAXFACTORY_EXPORT
-macro, the TQAxFactory subclass had no appropriate constructor.
-Provide a public class constructor like
- The unique identifiers have not been passed as strings into the
-TQAXFACTORY_EXPORT or TQAXFACTORY_DEFAULT macro.
- The server does not export an implementation of a TQAxFactory. Use
-the TQAXFACTORY_EXPORT macro in one of the project's
-implementation files to instantiate and export a factory, or use
-the TQAXFACTORY_DEFAULT macro to use the default factory.
- The server exports more than one implementation of a TQAxFactory,
-or exports the same implementation twice. If you use the default
-factory, the TQAXFACTORY_DEFAULT macro must only be used once in
-the project. Use a custom TQAxFactory implementation and the TQAXFACTORY_EXPORT macro if the server provides multiple ActiveX
-controls.
- The ActiveX server could not shut down properly when the last
-client stopped using it. It usually takes about two seconds for
-the application to terminate, but you might have to use the task
-manager to kill the process (e.g. when a client doesn't release
-the controls properly).
- The ActiveTQt build system performs four commands after the linking
-of the binary to make it into an ActiveX server.
- For this to work the server has to meet some requirements:
- If those requirements are not met one ore more of the following
-errors are likely to occure:
- To generate the IDL the widgets exposed as ActiveX controls need to
-be instantiated (the constructor is called). At this point, nothing
-else but a TQApplication object exists. Your widget constructor must
-not rely on any other objects to be created, e.g. it should check for
-null-pointers.
- To debug your server run it with -dumpidl outputfile and check where
-it crashes.
- Note that no functions of the control are called.
- Attaching the type library corrupted the server binary. This is a
-bug in Windows and happens only with release builds.
- The first linking step has to link a dummy type library into the
-executable that can later be replaced by idc. Add a resource file
-with a type library to your project as demonstrated in the examples.
- The build system needs to run the server executable to generate
-the interface definition, and to register the server. If a dynamic
-link library the server links against is not in the path this
-might fail (e.g. Visual Studio calls the server using the
-enivronment settings specified in the "Directories" option). Make
-sure that all DLLs required by your server are located in a
-directory that is listed in the path as printed in the error
-message box.
- If the system is unable to start the server (check with the task
-manager whether the server runs a process), make sure that no DLL
-the server depends on is missing from the system path (e.g. the TQt
-DLL!). Use a dependency walker to view all dependencies of the server
-binary.
- If the server runs (e.g. the task manager lists a process), see
-the following section for information on debugging your server.
- If the server could be built and registered correctly during the build
-process, but the object cannot be initiliazed e.g. by the OLE/COM Object
-Viewer application, make sure that no DLL the server depends on is
-missing from the system path (e.g. the TQt DLL). Use a dependency walker
-to view all dependencies of the server binary.
- If the server runs, see the following section for information on
-debugging your server.
- To debug an in-process server in Visual Studio, set the server project
-as the active project, and specify a client "executable for debug
-session" in the project settings (e.g. use the ActiveX Test Container).
-You can set breakpoints in your code, and also step into ActiveTQt and
-TQt code if you installed the debug version.
- To debug an executable server, run the application in a debugger
-and start with the command line parameter "-activex". Then start
-your client and create an instance of your ActiveX control. COM
-will use the existing process for the next client trying to create
-an ActiveX control.
- To implement an ActiveX control with TQt, create a subclass of TQWidget
-or any existing TQWidget subclass:
- The TQ_OBJECT macro is required to provide the meta object information
-about the widget to the ActiveTQt framework.
-Use the TQ_PROPERTY macro to declare properties for the ActiveX control:
- Declare a standard TQWidget constructor taking a parent widget and a name,
-and functions, signals and slots like any normal TQWidget.
-(1)
- The ActiveTQt framework will expose properties and public slots as ActiveX
-properties and methods, and signals as ActiveX events, and convert between
-the TQt data types and the equivalent COM data types.
- The TQt data types that are supported for properties are:
- The TQt data types that are supported for parameters in signals and
-slots are:
- Also supported are exported enums and sets (see TQ_ENUMS and TQ_SETS).
-The in-parameter types are also supported as return values.
- Properties and signals/slots that have parameters using any other
-data types are ignored by the TQActiveX framework.
- COM objects can have multiple sub-objects that can represent a sub element
-of the COM object. A COM object representing a multi-document spread sheet
-application can for example provide one sub-object for each spread sheet.
- Any TQObject subclass can be used as the type for a sub object in ActiveX. The
-TQAxFactory implementation (see below) needs to return the classname of the
-sub type as one key in the featureList() implementation, as well as the IDs
-for the COM class, the interface and event interface of that type. Then the
-type can be used as e.g. the return value or paramter of a slot.
- To make the properties bindable for the ActiveX client, use multiple
-inheritance from the TQAxBindable class:
-
- To make an ActiveX control available to the COM system it must
-be registered in the system registry using five unique
-identifiers. These identifiers are provided by tools like guidgen or uuidgen. The registration information allows COM to
-localize the binary providing a requested ActiveX control,
-marshall remote procedure calls to the control and read type
-information about the methods and properties exposed by the
-control.
- To create the ActiveX control when the client asks for it the
-server must export an implementation of a TQAxFactory. Use the
-default factory when the server provides only a single ActiveX
-control, and implement a subclass of TQAxFactory to provide
-multiple ActiveX controls. The default factory is available
-through a macro that takes the identifiers COM requires to locate
-the ActiveX control on the target system:
- The TQAxFactory class documentation explains
-how to use this macro, and how to implement and use custom factories.
- For out-of-process executable servers you can implement a main()
-function to instantiate a TQApplication object and enter the event
-loop just like any normal TQt application. By default the
-application will start as a standard TQt application, but if you
-pass -activex on the command line it will start as an ActiveX
-server. Use TQAxFactory::isServer() to create and run a standard
-application interface, or to prevent a stand-alone execution:
-
- To build the ActiveX server executable run qmake to generate the makefile, and use your compiler's
-make tool as for any other TQt application. The make process will
-also register the controls in the system registry by calling the
-resulting executable with the -regserver command line option.
- If the ActiveX server is an executable, the following command line
-options are supported:
- In-process servers can be registered using the regsvr32 tool available
-on all Windows systems.
- ActiveX servers written with TQt can use TQt either as a shared
-library, or have TQt linked statically into the binary. Both ways
-will produce rather large packages (either the server binary
-itself becomes large, or you have to ship the TQt DLL).
- When your ActiveX server can also run as a stand-alone application,
-run the server executable with the -regserver command line
-parameter after installing the executable on the target system.
-After that the controls provided by the server will be available to
-ActiveX clients.
- When your ActiveX server is part of an installation package, use the
-regsvr32 tool provided by Microsoft to register the controls on
-the target system. If this tool is not present, load the DLL into
-your installer process, resolve the DllRegisterServer symbol and
-call the function:
- If you want to use controls in your server in web-pages you need to
-make the server available to the browser used to view your page, and
-you need to specify the location of the server package in your page.
- To specify the location of a server, use the CODEBASE attribute in
-the OBJECT tag of your web-site. The value can point to the server
-file itself, to an INF file listing other files the server requires
-(e.g. the TQt DLL), or a compressed CAB archive.
- INF and CAB files are documented in almost every book available about
-ActiveX and COM programming as well as in the MSDN library and various
-other Online resources. The examples include INF files that can be used
-to build CAB archives:
-
-
- The CABARC tool from Microsoft can easily generate CAB archives:
- The INF files assume a static build of TQt, so no dependencies to other DLLs
-are listed in the INF files. To distribute an ActiveX server depending on
-DLLs you must add the dependencies, and provide the library files
-with the archive.
- To use the ActiveX controls, e.g. to embed them in a web page, use
-the <object> HTML tag.
- To initialize the control's properties, use
- If the web browser supports scripting use JavaScript, VBScript and
-forms to script the control. The examples include demonstration HTML pages for the
-example controls.
- The following is largly based on our own experiements with ActiveX
-controls and client applications, and is by no means complete.
- These standard applications work with ActiveX controls developed with
-ActiveTQt. Note that some clients support only in-process controls.
- Microsoft Office applications are supported, but you need to register
-the controls as "Insertable" objects. Reimplement TQAxFactory::registerClass
-to add this attribute to the COM class, or set the "Insertable" class info
-for your class to "yes" using the TQ_CLASSINFO macro.
- We have not managed to make ActiveTQt based COM objects work with the
-following client applications.
- By default all ActiveX controls expose not only their own methods
-and properties to ActiveX clients, but also those of all super
-classes, including TQWidget.
- This can be controlled by reimplementing TQAxFactory's
-exposeToSuperClass() function. Reimplement the function to return
-the last (furthest up the inheritance hierarchy) super class that
-should be exposed:
- The SmallActiveX control will only expose its own functions and
-properties to clients, while all other ActiveX controls provided
-by this factory will expose their own functions and properties and
-also those of all their super classes including TQWidget. The
-SmallActiveX class can of course propagate some of the TQWidget
-functions and properties into its own interface.
- An alternative way to reimplementing TQAxFactory to have more control
-about how objects are registered or exposed is to provide class
-specific information using the TQ_CLASSINFO macro, which is part of
-TQt's meta object system.
- Note that both keys and values are case sensitive.
- The following declares version 2.0 of a class that exposes only its
-own API, and is available in the "Insert Objects" dialog of Microsoft
-Office applications.
-
- If you develop components you might want to control who is able to instantiate
-those components. Since the server binary can be shipped to and registered on
-any client machine it is possible for anybody to use those components in his
-own software.
- Licensing components can be done using a variety of techniques, e.g. the code
-creating the control can provide a license key, or the machine on which the
-control is supposed to run needs to be licensed.
- To mark a TQt class as licensed specify a "LicenseKey" using the TQ_CLASSINFO
-macro.
-
- If a single license key for the control is not sufficient (ie. you want
-differnet developers to receive different license keys) you can specify an
-empty key to indicate that the control requires a license, and reimplement
-TQAxFactory::validateLicenseKey() to verify that a license exists on the
-system (ie. through a license file).
- ActiveX controls provided by ActiveTQt servers support a minimal set of COM
-interfaces to implement the OLE specifications. When the ActiveX class inherits
-from the TQAxBindable class it can also implement additional COM interfaces.
- Create a new subclass of TQAxAggregated and use multiple inheritance
-to subclass additional COM interface classes.
- Reimplement the queryInterface() function to support the additional
-COM interfaces.
- Since ISomeCOMInterface is a subclass of IUnknown you will have
-to implement the QueryInterface, AddRef and Release functions.
-Use the TQAXAGG_IUNKNOWN macro in your class definition to do that. If
-you implement the IUnknown functions manually, delegate the calls to the
-interface pointer returned by the controllingUnknown() function, e.g.
- Implement the methods of the COM interfaces, and use TQAxAggregated::Object()
-if you need to make calls to the TQObject subclass implementing the control.
- In your TQAxBindable subclass, implement createAggregate() to return
-a new object of the TQAxAggregated subclass.
-
- This is the verbatim text of the qaxwidget.h include file. It is provided only for illustration; the copyright remains with Trolltech.
- This is the complete list of member functions for
-TQAxWidget, including inherited members.
-
- The TQAxWidget class is a TQWidget that wraps an ActiveX control.
-More...
- This class is part of the TQt ActiveTQt Extension.
- #include <qaxwidget.h>
- Inherits TQWidget and TQAxBase.
- List of all member functions.
- This class is defined in the TQt ActiveTQt Extension, which can be found in the qt/extensions directory. It is not included in the main TQt API.
-
-
-The TQAxWidget class is a TQWidget that wraps an ActiveX control.
-
-
-
- A TQAxWidget can be instantiated as an empty object, with the name
-of the ActiveX control it should wrap, or with an existing
-interface pointer to the ActiveX control. The ActiveX control's
-properties, methods and events which only use supported data types, become available as TQt properties,
-slots and signals. The base class TQAxBase provides an API to
-access the ActiveX directly through the IUnknown pointer.
- TQAxWidget is a TQWidget and can be used as such, e.g. it can be
-organized in a widget hierarchy, receive events or act as an event
-filter. Standard widget properties, e.g. enabled are supported, but it depends on the ActiveX
-control to implement support for ambient properties like e.g.
-palette or font. TQAxWidget tries to provide the necessary hints.
- Warning:
-You can subclass TQAxWidget, but you cannot use the TQ_OBJECT macro
-in the subclass (the generated moc-file will not compile), so you
-cannot add further signals, slots or properties. This limitation
-is due to the metaobject information generated in runtime. To work
-around this problem, aggregate the TQAxWidget as a member of the
-TQObject subclass.
-
- See also control.
-
- See also clear().
-
- This function is called by initialize(). If you reimplement initialize
-to customize the actual control instantiation, call this function in your
-reimplementation to have the control embedded by the default client side.
-Creates the client site for the ActiveX control, and returns TRUE if
-the control could be embedded successfully, otherwise returns FALSE.
-
- If function is a method of the object the string must be provided
-as the full prototype, for example as it would be written in a
-TQObject::connect() call.
- Alternatively a function can be called passing the parameters embedded
-in the string, e.g. above function can also be invoked using
- If function is a property the string has to be the name of the
-property. The property setter is called when var1 is a valid TQVariant,
-otherwise the getter is called.
- It is only possible to call functions through dynamicCall() that
-have parameters or return values of datatypes supported by
-TQVariant. See the TQAxBase class documentation for a list of
-supported and unsupported datatypes. If you want to call functions
-that have unsupported datatypes in the parameter list, use
-queryInterface() to retrieve the appropriate COM interface, and
-use the function directly.
- This is also more efficient.
-
- Example: qutlook/centralwidget.cpp.
- Calls the COM object's method function, passing the
-parameters in vars, and returns the value returned by
-the method. If the method does not return a value or when
-the function call failed this function returns an invalid
-TQVariant object.
- The TQVariant objects in vars are updated when the method has
-out-parameters.
-
- If name is provided by a method the string must include the
-full function prototype.
- If name is a property the string must be the name of the property,
-and var1, ... var8 are ignored.
- The returned TQAxObject is a child of this object (which is either of
-type TQAxObject or TQAxWidget), and is deleted when this object is
-deleted. It is however safe to delete the returned object yourself,
-and you should do so when you iterate over lists of subobjects.
- COM enabled applications usually have an object model publishing
-certain elements of the application as dispatch interfaces. Use
-this method to navigate the hierarchy of the object model, e.g.
- Example: qutlook/centralwidget.cpp.
- If the function returns TRUE the key event is passed on to the
-ActiveX control, which then either processes the event or passes
-the event on to TQt.
- If the function returns FALSE the processing of the key event is
-ignored by ActiveTQt, ie. the ActiveX control might handle it or
-not.
- The default implementation returns TRUE for the following cases:
- This table is the result of experimenting with popular ActiveX controls,
-ie. Internet Explorer and Microsoft Office applications, but for some
-controls it might require modification.
-
-
-
-This file is part of the TQt toolkit.
-Copyright © 1995-2007
-Trolltech. All Rights Reserved. See also rowStretch(), setRowSpacing(), and setColStretch().
- Examples: addressbook/centralwidget.cpp and qutlook/centralwidget.cpp.
+ Examples: addressbook/centralwidget.cpp.
See also firstChild() and nextSibling().
- Examples: dirview/dirview.cpp and qutlook/centralwidget.cpp.
+ Examples: dirview/dirview.cpp.
If text() has been reimplemented, this function may be a no-op.
Examples: addressbook/centralwidget.cpp, qutlook/centralwidget.cpp, and xml/outliner/outlinetree.cpp.
+ Examples: addressbook/centralwidget.cpp and xml/outliner/outlinetree.cpp.
All the functions in this class are reentrant when TQt is built with thread support. #include <tqobject.h>
Inherits TQt.
- Inherited by TQAccel, TQAccessibleObject, TQAction, TQApplication, TQAssistantClient, TQDataPump, TQAxObject, TQAxScript, TQAxScriptManager, TQWidget, TQCanvas, TQStyle, TQClipboard, TQCopChannel, TQDns, TQLayout, TQDragObject, TQEditorFactory, TQEventLoop, TQFileIconProvider, TQNetworkProtocol, TQWSKeyboardHandler, TQNetworkOperation, TQNPInstance, TQObjectCleanupHandler, TQProcess, TQServerSocket, TQSessionManager, TQSignal, TQSignalMapper, TQSocket, TQSocketNotifier, TQSound, TQSqlDatabase, TQSqlDriver, TQSqlForm, TQStyleSheet, TQTimer, TQToolTipGroup, TQTranslator, TQUrlOperator, and TQValidator.
+- Inherited by TQAccel, TQAccessibleObject, TQAction, TQApplication, TQAssistantClient, TQDataPump, TQWidget, TQCanvas, TQStyle, TQClipboard, TQCopChannel, TQDns, TQLayout, TQDragObject, TQEditorFactory, TQEventLoop, TQFileIconProvider, TQNetworkProtocol, TQWSKeyboardHandler, TQNetworkOperation, TQNPInstance, TQObjectCleanupHandler, TQProcess, TQServerSocket, TQSessionManager, TQSignal, TQSignalMapper, TQSocket, TQSocketNotifier, TQSound, TQSqlDatabase, TQSqlDriver, TQSqlForm, TQStyleSheet, TQTimer, TQToolTipGroup, TQTranslator, TQUrlOperator, and TQValidator.
Examples: rot13/rot13.cpp and simple/main.cpp.
+- Examples: rot13/rot13.cpp.
See also setProperty(), TQVariant::isValid(), metaObject(), TQMetaObject::propertyNames(), and TQMetaObject::property().
- Example: qutlook/centralwidget.cpp.
See also property(), metaObject(), TQMetaObject::propertyNames(), and TQMetaObject::property().
- Example: qutlook/centralwidget.cpp.
The result remains valid so long as one unmodified
copy of the source string exists.
- Example: dotnet/wrapper/lib/tools.cpp.
#include <tqwidget.h>
Inherits TQObject and TQPaintDevice.
- Inherited by TQAxWidget, TQButton, TQFrame, TQDialog, TQComboBox, TQDataBrowser, TQDataView, TQDateTimeEditBase, TQDateTimeEdit, TQDesktopWidget, TQDial, TQDockArea, TQGLWidget, TQHeader, TQMainWindow, TQMotifWidget, TQNPWidget, TQScrollBar, TQSizeGrip, TQSlider, TQSpinBox, TQSplashScreen, TQStatusBar, TQTabBar, TQTabWidget, TQWorkspace, and TQXtWidget.
+- Inherited by TQButton, TQFrame, TQDialog, TQComboBox, TQDataBrowser, TQDataView, TQDateTimeEditBase, TQDateTimeEdit, TQDesktopWidget, TQDial, TQDockArea, TQGLWidget, TQHeader, TQMainWindow, TQMotifWidget, TQNPWidget, TQScrollBar, TQSizeGrip, TQSlider, TQSpinBox, TQSplashScreen, TQStatusBar, TQTabBar, TQTabWidget, TQWorkspace, and TQXtWidget.
See also hideEvent(), hidden, show(), showMinimized(), visible, and close().
- Examples: mdi/application.cpp, popup/popup.cpp, progress/progress.cpp, scrollview/scrollview.cpp, webbrowser/mainwindow.ui.h, and xform/xform.cpp.
+- Examples: mdi/application.cpp, popup/popup.cpp, progress/progress.cpp, scrollview/scrollview.cpp and xform/xform.cpp.
Reimplemented in TQMenuBar.
Member Function Documentation
-TQAxBase::TQAxBase ( IUnknown * iface = 0 )
-
-Creates a TQAxBase object that wraps the COM object iface. If iface is 0 (the default), use setControl() to instantiate a COM
-object.
-
-TQAxBase::~TQAxBase () [virtual]
-
-Shuts down the COM object and destroys the TQAxBase object.
-TQVariant TQAxBase::asVariant () const
-
-Returns a TQVariant that wraps the COM object. The variant can
-then be used as a parameter in e.g. dynamicCall().
-
-void TQAxBase::clear () [virtual]
-
-Disconnects and destroys the COM object.
-TQString TQAxBase::control () const
-
void TQAxBase::disableClassInfo ()
-
-Disables the class info generation for this ActiveX container. If
-you don't require any class information about the ActiveX control
-use this function to speed up the meta object generation.
-void TQAxBase::disableEventSink ()
-
-Disables the event sink implementation for this ActiveX container.
-If you don't intend to listen to the ActiveX control's events use
-this function to speed up the meta object generation.
-void TQAxBase::disableMetaObject ()
-
-Disables the meta object generation for this ActiveX container.
-This also disables the event sink and class info generation. If
-you don't intend to use the TQt meta object implementation call
-this function to speed up the meta object generation.
-TQVariant TQAxBase::dynamicCall ( const TQCString & function, const TQVariant & var1 = TQVariant ( ), const TQVariant & var2 = TQVariant ( ), const TQVariant & var3 = TQVariant ( ), const TQVariant & var4 = TQVariant ( ), const TQVariant & var5 = TQVariant ( ), const TQVariant & var6 = TQVariant ( ), const TQVariant & var7 = TQVariant ( ), const TQVariant & var8 = TQVariant ( ) )
-
-Calls the COM object's method function, passing the
-parameters var1, var1, var2, var3, var4, var5,
-var6, var7 and var8, and returns the value returned by
-the method, or an invalid TQVariant if the method does not return
-a value or when the function call failed.
-
- activeX->dynamicCall( "Navigate(const TQString&)", "www.trolltech.com" );
-
-
-
- activeX->dynamicCall("Navigate(\"www.trolltech.com\");
-
-
-All parameters are passed as strings; it depends on the control whether
-they are interpreted correctly, and is slower than using the prototype
-with correctly typed parameters.
-
- activeX->dynamicCall( "Value", 5 );
- TQString text = activeX->dynamicCall( "Text" ).toString();
-
-
-Note that it is faster to get and set properties using
-TQObject::property() and TQObject::setProperty().
-
- IWebBrowser2 *webBrowser = 0;
- activeX->queryInterface( IID_IWebBrowser2, (void**)&webBrowser );
- if ( webBrowser ) {
- webBrowser->Navigate2( pvarURL );
- webBrowser->Release();
- }
-
-
-TQVariant TQAxBase::dynamicCall ( const TQCString & function, TQValueList<TQVariant> & vars )
-
-This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
-void TQAxBase::exception ( int code, const TQString & source, const TQString & desc, const TQString & help ) [signal]
-
-
-TQString TQAxBase::generateDocumentation ()
-
-
-bool TQAxBase::initialize ( IUnknown ** ptr ) [virtual protected]
-
-This virtual function is called by setControl() and creates the
-requested COM object. ptr is set to the object's IUnknown
-implementation. The function returns TRUE if the object
-initialization succeeded; otherwise the function returns FALSE.
-bool TQAxBase::initializeActive ( IUnknown ** ptr ) [protected]
-
-Returns an active instance running on the current machine, and returns the
-IUnknown interface to the running object in ptr. This function returns TRUE
-if successful, otherwise returns FALSE.
-bool TQAxBase::initializeLicensed ( IUnknown ** ptr ) [protected]
-
-Creates an instance of a licensed control, and returns the IUnknown interface
-to the object in ptr. This functions returns TRUE if successful, otherwise
-returns FALSE.
-bool TQAxBase::initializeRemote ( IUnknown ** ptr ) [protected]
-
-Creates the instance on a remote server, and returns the IUnknown interface
-to the object in ptr. This function returns TRUE if successful, otherwise
-returns FALSE.
-bool TQAxBase::isNull () const
-
-Returns TRUE if there is no COM object loaded by this wrapper;
-otherwise return FALSE.
-PropertyBag TQAxBase::propertyBag () const
-
-Returns a name:value map of all the properties exposed by the COM
-object.
-void TQAxBase::propertyChanged ( const TQString & name ) [signal]
-
-
-bool TQAxBase::propertyWritable ( const char * prop ) const [virtual]
-
-Returns TRUE if the property prop is writable; otherwise
-returns FALSE. By default, all properties are writable.
-long TQAxBase::queryInterface ( const TQUuid & uuid, void ** iface ) const
-
-Requests the interface uuid from the COM object and sets the
-value of iface to the provided interface, or to 0 if the
-requested interface could not be provided.
-TQAxObject * TQAxBase::querySubObject ( const TQCString & name, const TQVariant & var1 = TQVariant ( ), const TQVariant & var2 = TQVariant ( ), const TQVariant & var3 = TQVariant ( ), const TQVariant & var4 = TQVariant ( ), const TQVariant & var5 = TQVariant ( ), const TQVariant & var6 = TQVariant ( ), const TQVariant & var7 = TQVariant ( ), const TQVariant & var8 = TQVariant ( ) )
-
-Returns a pointer to a TQAxObject wrapping the COM object provided
-by the method or property name, passing passing the parameters
-var1, var1, var2, var3, var4, var5, var6,
-var7 and var8.
-
- TQAxWidget outlook( "Outlook.Application" );
- TQAxObject *session = outlook.querySubObject( "Session" );
- if ( session ) {
- TQAxObject *defFolder = session->querySubObject(
- "GetDefaultFolder(OlDefaultFolders)",
- "olFolderContacts" );
- //...
- }
-
-
-
-bool TQAxBase::setControl ( const TQString & )
-
void TQAxBase::setPropertyBag ( const PropertyBag & bag )
-
-Sets the properties of the COM object to the corresponding values
-in bag.
-void TQAxBase::setPropertyWritable ( const char * prop, bool ok ) [virtual]
-
-Sets the property prop to writable if ok is TRUE, otherwise
-sets prop to be read-only. By default, all properties are
-writable.
-void TQAxBase::signal ( const TQString & name, int argc, void * argv ) [signal]
-
-
-
- void Receiver::slot( const TQString &name, int argc, void *argv )
- {
- VARIANTARG *params = (VARIANTARG*)argv;
- if ( name.startsWith( "BeforeNavigate2(" ) ) {
- IDispatch *pDisp = params[argc-1].pdispVal;
- VARIANTARG URL = *params[argc-2].pvarVal;
- VARIANTARG Flags = *params[argc-3].pvarVal;
- VARIANTARG TargetFrameName = *params[argc-4].pvarVal;
- VARIANTARG PostData = *params[argc-5].pvarVal;
- VARIANTARG Headers = *params[argc-6].pvarVal;
- bool *Cancel = params[argc-7].pboolVal;
- }
- }
-
-
-Property Documentation
-TQString control
-
- ctrl->setControl( "{8E27C92B-1264-101C-8A2F-040224009C02}" );
-
-
-The second fastest way is to use the registered control's class
-name (with or without version number), e.g.
-
- ctrl->setControl( "MSCal.Calendar" );
-
-
-The slowest, but easiest way to use is to use the control's full
-name, e.g.
-
- ctrl->setControl( "Calendar Control 9.0" );
-
-
-
-
-The first two patterns can be combined, e.g. to initialize a licensed
-control on a remote machine:
-
- <domain/username>:<password>@server/{8E27C92B-1264-101C-8A2F-040224009C02}
-
-
-
- {8E27C92B-1264-101C-8A2F-040224009C02}:<LicenseKey>
-
-
-
- {8E27C92B-1264-101C-8A2F-040224009C02}&
-
-
-
- ctrl->setControl("DOMAIN/user:password@server/{8E27C92B-1264-101C-8A2F-040224009C02}:LicenseKey");
-
-
-
- Copyright © 2007
-Trolltech Trademarks
-
-
-
-
-Home
- |
-All Classes
- |
-Main Classes
- |
-Annotated
- |
-Grouped Classes
- |
-Functions
-
-qaxbindable.h
-
-
-
-/****************************************************************************
-** $Id: qt/qaxbindable.h 3.3.8 edited Jan 11 14:46 $
-**
-** Declaration of the TQAxBindable class
-**
-** Copyright (C) 2001-2007 Trolltech ASA. All rights reserved.
-**
-** This file is part of the Active TQt integration.
-**
-** Licensees holding valid TQt Enterprise Edition
-** licenses for Windows may use this file in accordance with the TQt Commercial
-** License Agreement provided with the Software.
-**
-** This file is not available for use under any other license without
-** express written permission from the copyright holder.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about TQt Commercial License Agreements.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
-#ifndef TQAXBINDABLE_H
-#define TQAXBINDABLE_H
-
-#include <tqwidget.h>
-#include <private/qcom_p.h>
-
-struct IAxServerBase;
-struct IUnknown;
-
-class TQAxAggregated
-{
- friend class TQAxServerBase;
-public:
- virtual long queryInterface( const TQUuid &iid, void **iface ) = 0;
-
-protected:
- virtual ~TQAxAggregated();
-
- IUnknown *controllingUnknown() const
- { return controlling_unknown; }
- TQWidget *widget() const
- {
- if ( the_object && the_object->isWidgetType() )
- return (TQWidget*)the_object;
- return 0;
- }
- TQObject *object() const { return the_object; }
-
-private:
- IUnknown *controlling_unknown;
- TQObject *the_object;
-};
-
-#define TQAXAGG_IUNKNOWN \
- HRESULT WINAPI QueryInterface( REFIID iid, LPVOID *iface ) { \
- return controllingUnknown()->QueryInterface( iid, iface ); } \
- ULONG WINAPI AddRef() {return controllingUnknown()->AddRef(); } \
- ULONG WINAPI Release() {return controllingUnknown()->Release(); } \
-
-
-class TQAxBindable
-{
- friend class TQAxServerBase;
-public:
- TQAxBindable();
- virtual ~TQAxBindable();
-
- virtual TQAxAggregated *createAggregate();
- static void reportError( int code, const TQString &src, const TQString &desc, const TQString &help = TQString::null );
-
-protected:
- bool requestPropertyChange( const char *property );
- void propertyChanged( const char *property );
-
- IUnknown *clientSite() const;
-
-private:
- IAxServerBase *activex;
-};
-
-#endif // TQAXBINDABLE_H
-
-
-
- Copyright © 2007
-Trolltech Trademarks
-
-
-
-
-Home
- |
-All Classes
- |
-Main Classes
- |
-Annotated
- |
-Grouped Classes
- |
-Functions
-
-Complete Member List for TQAxBindable
-
-
-
-
-
- Copyright © 2007
-Trolltech Trademarks
-
-
-
-
-Home
- |
-All Classes
- |
-Main Classes
- |
-Annotated
- |
-Grouped Classes
- |
-Functions
-
-TQAxBindable Class Reference
-
-
[TQAxServer module]Public Members
-
-
-Static Public Members
-
-
-Protected Members
-
-
-Detailed Description
-
- class MyActiveX : public TQWidget, public TQAxBindable
- {
- TQ_OBJECT
- TQ_PROPERTY( int value READ value WRITE setValue )
- public:
- MyActiveX( TQWidget *parent = 0, const char *name = 0 );
- ...
-
- int value() const;
- void setValue( int );
- };
-
-
-Member Function Documentation
-TQAxBindable::TQAxBindable ()
-
-Constructs an empty TQAxBindable object.
-
-TQAxBindable::~TQAxBindable () [virtual]
-
-Destroys the TQAxBindable object.
-
-IUnknown * TQAxBindable::clientSite () const [protected]
-
-Returns a pointer to the client site interface for this ActiveX object,
-or null if no client site has been set.
-TQAxAggregated * TQAxBindable::createAggregate () [virtual]
-
-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 TQAxAggregated subclass.
-void TQAxBindable::propertyChanged ( const char * property ) [protected]
-
-Call this function to notify the client that is hosting this
-ActiveX control that the property property has been changed.
-void TQAxBindable::reportError ( int code, const TQString & src, const TQString & desc, const TQString & context = TQString::null ) [static]
-
-
-bool TQAxBindable::requestPropertyChange ( const char * property ) [protected]
-
-Call this function to request permission to change the property
-property from the client that is hosting this ActiveX control.
-Returns TRUE if the client allows the change; otherwise returns
-FALSE.
-
- void MyActiveTQt::setText( const TQString &text )
- {
- if ( !requestPropertyChange( "text" ) )
- return;
-
- // update property
-
- propertyChanged( "text" );
- }
-
-
-
- Copyright © 2007
-Trolltech Trademarks
-
-
-
-
-Home
- |
-All Classes
- |
-Main Classes
- |
-Annotated
- |
-Grouped Classes
- |
-Functions
-
-In Sync with Outlook
-
-
-
-This example is a modified version of the standard
-TQt addressbook example.
- class TQAxObject;
- struct IDispatch;
-
- class ABListViewItem : public TQListViewItem
- {
- public:
- ABListViewItem( TQListView *listview, TQString firstName, TQString lastName, TQString address, TQString eMail, TQAxObject *contact );
- ~ABListViewItem();
-
- TQAxObject *contactItem() const;
-
- private:
- TQAxObject *contact_item;
- };
-
- void findEntries();
-
- void updateOutlook();
-
- protected:
- void setupTabWidget();
- void setupListView();
- void setupOutlook();
-
- TQAxObject *outlook, *outlookSession, *contactItems;
-
- TQGridLayout *mainGrid;
-
- ABListViewItem::ABListViewItem( TQListView *listview,
- TQString firstName,
- TQString lastName,
- TQString address,
- TQString eMail,
- TQAxObject *contact )
- : TQListViewItem( listview, firstName, lastName, address, eMail ), contact_item( contact )
- {
- }
-
- ABListViewItem::~ABListViewItem()
- {
- delete contact_item;
- }
-
- TQAxObject *ABListViewItem::contactItem() const
- {
- return contact_item;
- }
-
The ABCentralWidget constructor initializes the TQAxObject pointers to zero and
-calls the setupOutlook function. The ABCentralWidget destructor calls the
-Logoff method of the outlookSession object.
- ABCentralWidget::ABCentralWidget( TQWidget *parent, const char *name )
- : TQWidget( parent, name ), outlook( 0 ), outlookSession( 0 ), contactItems( 0 )
- {
- mainGrid = new TQGridLayout( this, 2, 1, 5, 5 );
-
- setupTabWidget();
- setupListView();
- setupOutlook();
-
- mainGrid->setRowStretch( 0, 0 );
- mainGrid->setRowStretch( 1, 1 );
- }
-
- ABCentralWidget::~ABCentralWidget()
- {
- if ( outlookSession )
- outlookSession->dynamicCall( "Logoff()" );
- }
-
The setupOutlook implementation creates a TQAxObject to wrap the
-Outlook.Application COM object.
- void ABCentralWidget::setupOutlook()
- {
- outlook = new TQAxObject( "Outlook.Application", this );
-
The call to querySubObject returns a new TQAxObject wrapper around the
-"Session" object of the Outlook Object hierarchy. If the call fails for
-some reason setupOutlook returns, otherwise it calls the "Logon" method
-of the Session object.
- // Get a session object
- outlookSession = outlook->querySubObject( "Session" );
- if ( !outlookSession )
- return;
- // Login; doesn't hurt if you are already running and logged on...
- outlookSession->dynamicCall( "Logon()" );
-
The following call to querySubObject returns a new TQAxObject wrapper
-around the default folder for "contacts".
- // Get the default folder for contacts
- TQAxObject *defFolder = outlookSession->querySubObject( "GetDefaultFolder(OlDefaultFolders)", "olFolderContacts" );
-
querySubObject is then used again to get the list of all items in the
-folder. The connect statement connects the new ABCentralWidget slot
-to the signals provided by the "Items" COM object. Finally, it calls the
-updateOutlook function to populate the listview.
- // Get all items
- if ( defFolder ) {
- contactItems = defFolder->querySubObject( "Items" );
- connect( contactItems, TQ_SIGNAL(ItemAdd(IDispatch*)), this, TQ_SLOT(updateOutlook()) );
- connect( contactItems, TQ_SIGNAL(ItemChange(IDispatch*)), this, TQ_SLOT(updateOutlook()) );
- connect( contactItems, TQ_SIGNAL(ItemRemove()), this, TQ_SLOT(updateOutlook()) );
- }
-
- updateOutlook();
- }
-
- void ABCentralWidget::updateOutlook()
- {
- listView->clear();
- if ( !contactItems )
- return;
-
- TQAxObject *item = contactItems->querySubObject( "GetFirst()" );
- while ( item ) {
- TQString firstName = item->property( "FirstName" ).toString();
- TQString lastName = item->property( "LastName" ).toString();
- TQString address = item->property( "HomeAddress" ).toString();
- TQString email = item->property( "Email1Address" ).toString();
-
- (void)new ABListViewItem( listView, firstName, lastName, address, email, item );
- // the listviewitem takes ownership
- item->parent()->removeChild( item );
-
- item = contactItems->querySubObject( "GetNext()" );
- }
- }
-
- void ABCentralWidget::addEntry()
- {
- if ( !iFirstName->text().isEmpty() || !iLastName->text().isEmpty() ||
- !iAddress->text().isEmpty() || !iEMail->text().isEmpty() ) {
- TQAxObject *contactItem = outlook->querySubObject( "CreateItem(OlItemType)", "olContactItem" );
- if ( contactItem ) {
- contactItem->setProperty( "FirstName", iFirstName->text() );
- contactItem->setProperty( "LastName", iLastName->text() );
- contactItem->setProperty( "HomeAddress", iAddress->text() );
- contactItem->setProperty( "Email1Address", iEMail->text() );
- contactItem->dynamicCall( "Save()" );
-
- new ABListViewItem( listView, iFirstName->text(),
- iLastName->text(), iAddress->text(), iEMail->text(), contactItem );
- }
- }
-
- iFirstName->setText( "" );
- iLastName->setText( "" );
- iAddress->setText( "" );
- iEMail->setText( "" );
- }
-
- void ABCentralWidget::changeEntry()
- {
- ABListViewItem *item = (ABListViewItem*)listView->currentItem();
-
- if ( item &&
- ( !iFirstName->text().isEmpty() || !iLastName->text().isEmpty() ||
- !iAddress->text().isEmpty() || !iEMail->text().isEmpty() ) ) {
-
- TQAxObject *contactItem = item->contactItem();
- contactItem->setProperty( "FirstName", iFirstName->text() );
- contactItem->setProperty( "LastName", iLastName->text() );
- contactItem->setProperty( "HomeAddress", iAddress->text() );
- contactItem->setProperty( "Email1Address", iEMail->text() );
- contactItem->dynamicCall( "Save()" );
-
- item->setText( 0, iFirstName->text() );
- item->setText( 1, iLastName->text() );
- item->setText( 2, iAddress->text() );
- item->setText( 3, iEMail->text() );
- }
- }
-
-
- Copyright © 2007
-Trolltech Trademarks
-
-
-
-
-Home
- |
-All Classes
- |
-Main Classes
- |
-Annotated
- |
-Grouped Classes
- |
-Functions
-
-A Web Browser
-
-
-
-This example utilizes the Microsoft Web Browser ActiveX control
-to implement a fully functional Web Browser application. The
-user interface has been developed using the TQt Designer
-integration of the TQAxWidget class.
- void MainWindow::init()
- {
- pb = new TQProgressBar( statusBar() );
- pb->setPercentageVisible( FALSE );
- pb->hide();
- statusBar()->addWidget( pb, 0, TRUE );
-
- connect( WebBrowser, TQ_SIGNAL(ProgressChange(int,int)), this, TQ_SLOT(setProgress(int,int)) );
- connect( WebBrowser, TQ_SIGNAL(StatusTextChange(const TQString&)), statusBar(), TQ_SLOT(message(const TQString&)) );
-
- WebBrowser->dynamicCall( "GoHome()" );
- }
-
The init() function is implemented to create a progress bar as
-the child of the status bar, and to connect Internet Explorer's
-ProgressChange() and StatusTextChange() signals to the
-respective displays.
- void MainWindow::go()
- {
- actionStop->setEnabled( TRUE );
- WebBrowser->dynamicCall( "Navigate(const TQString&)", addressEdit->text() );
- }
-
The go() function calls the NavigateTo() function of Internet
-Explorer, passing the text of the address bar as the argument.
- void MainWindow::setTitle( const TQString &title )
- {
- setCaption( "TQt WebBrowser - " + title );
- }
-
The setTitle() slot is connected to the TitleChange() signal
-of Internet Explorer, and updates the caption of the window
-using the provided title string.
- void MainWindow::setProgress( int a, int b )
- {
- if ( a <= 0 || b <= 0 ) {
- pb->hide();
- return;
- }
- pb->show();
- pb->setTotalSteps( b );
- pb->setProgress( a );
- }
-
- void MainWindow::setCommandState( int cmd, bool on )
- {
- switch ( cmd ) {
- case 1:
- actionForward->setEnabled( on );
- break;
- case 2:
- actionBack->setEnabled( on );
- break;
- }
- }
-
- void MainWindow::navigateBegin()
- {
- actionStop->setEnabled( TRUE );
- }
-
- void MainWindow::navigateComplete()
- {
- actionStop->setEnabled( FALSE );
- }
-
The setProgress(), setCommandState(), navigateBegin() and
-navigateComplete() slots are connected to the respective
-signals of Internet Explorer and update the user interface.
-
- Copyright © 2007
-Trolltech Trademarks
-
-
-
-
-Home
- |
-All Classes
- |
-Main Classes
- |
-Annotated
- |
-Grouped Classes
- |
-Functions
-
-The TQAxContainer Examples
-
-
-
-The following example programs illustrate the embedding of ActiveX
-controls using the TQAxContainer module.
-
-
-
-In Sync with Outlook
- A Web Browser
-
- Copyright © 2007
-Trolltech Trademarks
-
-
-
-
-Home
- |
-All Classes
- |
-Main Classes
- |
-Annotated
- |
-Grouped Classes
- |
-Functions
-
-The TQAxContainer Module
-
-
-
-
-
-
-
-
- Introduction
-
-
-
- Building the library
-
- Using the library
-
-
- LIBS += qaxcontainer.lib
-
-
- Distributing TQAxContainer applications
-
- Instantiating COM objects
-
- Accessing the object API
-
- Typical error messages
-
- Requested control could not be instantiated
-
- TQAxBase::internalInvoke: No such method
-
- Error calling IDispatch member: Non-optional parameter
-missing
-
- Error calling IDispatch member: Type mismatch in
-parameter n
-
- TQAxScriptManager::call(): No script provides this function
-
-
- Copyright © 2007
-Trolltech Trademarks
-
-
-
-
-Home
- |
-All Classes
- |
-Main Classes
- |
-Annotated
- |
-Grouped Classes
- |
-Functions
-
-qaxfactory.h
-
-
-
-/****************************************************************************
-** $Id: qt/qaxfactory.h 3.3.8 edited Jan 11 14:46 $
-**
-** Declaration of the TQAxFactory class
-**
-** Copyright (C) 2001-2007 Trolltech ASA. All rights reserved.
-**
-** This file is part of the Active TQt integration.
-**
-** Licensees holding valid TQt Enterprise Edition
-** licenses for Windows may use this file in accordance with the TQt Commercial
-** License Agreement provided with the Software.
-**
-** This file is not available for use under any other license without
-** express written permission from the copyright holder.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about TQt Commercial License Agreements.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
-#ifndef TQAXFACTORY_H
-#define TQAXFACTORY_H
-
-#include <ntqdict.h>
-#include <ntquuid.h>
-#include <private/qcom_p.h>
-#include <ntqmetaobject.h>
-
-// {22B230F6-8722-4051-ADCB-E7C9CE872EB3}
-#ifndef IID_QAxFactory
-#define IID_QAxFactory TQUuid( 0x22b230f6, 0x8722, 0x4051, 0xad, 0xcb, 0xe7, 0xc9, 0xce, 0x87, 0x2e, 0xb3 )
-#endif
-
-class TQWidget;
-class TQMetaObject;
-class TQSettings;
-struct IDispatch;
-
-struct TQAxFactoryInterface : public TQFeatureListInterface
-{
-public:
-#ifndef Q_QDOC
- virtual TQWidget *create( const TQString &key, TQWidget *parent = 0, const char *name = 0 ) = 0;
- virtual TQObject *createObject( const TQString &key, TQObject *parent = 0, const char *name = 0 ) = 0;
- virtual TQMetaObject *metaObject( const TQString &key ) const = 0;
- virtual bool createObjectWrapper(TQObject *object, IDispatch **wrapper) = 0;
-
- virtual TQUuid classID( const TQString &key ) const = 0;
- virtual TQUuid interfaceID( const TQString &key ) const = 0;
- virtual TQUuid eventsID( const TQString &key ) const = 0;
- virtual TQUuid typeLibID() const = 0;
- virtual TQUuid appID() const = 0;
-
- virtual void registerClass( const TQString &key, TQSettings * ) const = 0;
- virtual void unregisterClass( const TQString &key, TQSettings * ) const = 0;
-
- virtual bool validateLicenseKey( const TQString &key, const TQString &licenseKey) const = 0;
-
- virtual TQString exposeToSuperClass( const TQString &key ) const = 0;
- virtual bool stayTopLevel( const TQString &key ) const = 0;
- virtual bool hasStockEvents( const TQString &key ) const = 0;
- virtual bool isService() const = 0;
-#endif
-};
-
-extern TQAxFactoryInterface *qAxFactory();
-
-class TQAxFactory : public TQAxFactoryInterface
-{
-public:
- TQAxFactory( const TQUuid &, const TQUuid &);
- virtual ~TQAxFactory();
- TQ_REFCOUNT;
-
- TQRESULT queryInterface( const TQUuid &iid, TQUnknownInterface **iface );
-
-#ifdef Q_QDOC
- virtual TQStringList featureList() const = 0;
-#endif
- virtual TQWidget *create( const TQString &key, TQWidget *parent = 0, const char *name = 0 );
- virtual TQObject *createObject( const TQString &key, TQObject *parent = 0, const char *name = 0 );
- virtual TQMetaObject *metaObject( const TQString &key ) const;
- virtual bool createObjectWrapper(TQObject *object, IDispatch **wrapper);
-
- virtual TQUuid classID( const TQString &key ) const;
- virtual TQUuid interfaceID( const TQString &key ) const;
- virtual TQUuid eventsID( const TQString &key ) const;
-
- virtual TQUuid typeLibID() const;
- virtual TQUuid appID() const;
-
- virtual void registerClass( const TQString &key, TQSettings * ) const;
- virtual void unregisterClass( const TQString &key, TQSettings * ) const;
-
- virtual bool validateLicenseKey( const TQString &key, const TQString &licenseKey) const;
-
- virtual TQString exposeToSuperClass( const TQString &key ) const;
- virtual bool stayTopLevel( const TQString &key ) const;
- virtual bool hasStockEvents( const TQString &key ) const;
- virtual bool isService() const;
-
- enum ServerType {
- SingleInstance,
- MultipleInstances
- };
-
- static bool isServer();
- static TQString serverDirPath();
- static TQString serverFilePath();
- static bool startServer(ServerType type = MultipleInstances);
- static bool stopServer();
-
-private:
- TQUuid typelib;
- TQUuid app;
-};
-
-inline bool TQAxFactory::startServer(ServerType type)
-{
- // implementation in qaxservermain.cpp
- extern bool qax_startServer(ServerType);
- return qax_startServer(type);
-}
-
-inline bool TQAxFactory::stopServer()
-{
- // implementation in qaxservermain.cpp
- extern bool qax_stopServer();
- return qax_stopServer();
-}
-
-#define TQAXFACTORY_EXPORT( IMPL, TYPELIB, APPID ) \
- TQUnknownInterface *ucm_instantiate() \
- { \
- IMPL *impl = new IMPL( TQUuid(TYPELIB), TQUuid(APPID) ); \
- TQUnknownInterface* iface = 0; \
- impl->queryInterface( IID_QUnknown, &iface ); \
- return iface; \
- }
-
-#define TQAXFACTORY_DEFAULT( Class, IIDClass, IIDInterface, IIDEvents, IIDTypeLib, IIDApp ) \
- class TQAxDefaultFactory : public TQAxFactory \
- { \
- public: \
- TQAxDefaultFactory( const TQUuid &app, const TQUuid &lib) \
- : TQAxFactory( app, lib ) {} \
- TQStringList featureList() const \
- { \
- TQStringList list; \
- list << #Class; \
- return list; \
- } \
- TQMetaObject *metaObject( const TQString &key ) const \
- { \
- if ( key == #Class ) \
- return Class::staticMetaObject(); \
- return 0; \
- } \
- TQWidget *create( const TQString &key, TQWidget *parent, const char *name ) \
- { \
- if ( key == #Class ) \
- return new Class( parent, name ); \
- return 0; \
- } \
- TQUuid classID( const TQString &key ) const \
- { \
- if ( key == #Class ) \
- return TQUuid( IIDClass ); \
- return TQUuid(); \
- } \
- TQUuid interfaceID( const TQString &key ) const \
- { \
- if ( key == #Class ) \
- return TQUuid( IIDInterface ); \
- return TQUuid(); \
- } \
- TQUuid eventsID( const TQString &key ) const \
- { \
- if ( key == #Class ) \
- return TQUuid( IIDEvents ); \
- return TQUuid(); \
- } \
- }; \
- TQAXFACTORY_EXPORT( TQAxDefaultFactory, IIDTypeLib, IIDApp ) \
-
-template<class T>
-class TQAxClass : public TQAxFactory
-{
-public:
- TQAxClass(const TQString &appId, const TQString &libId)
- : TQAxFactory(appId, libId)
- {}
-
- TQMetaObject *metaObject(const TQString &key) const { return T::staticMetaObject(); }
- TQStringList featureList() const { return TQString(T::staticMetaObject()->className()); }
- TQWidget *create(const TQString &key, TQWidget *parent, const char *name)
- {
- if (key != TQString(T::staticMetaObject()->className())) return 0;
- if (!qstrcmp(T::staticMetaObject()->classInfo("Creatable", TRUE), "no")) return 0;
- return new T(parent, name);
- }
-};
-
-#define TQAXFACTORY_BEGIN(IDTypeLib, IDApp) \
- class TQAxFactoryList : public TQAxFactory \
- { \
- TQStringList factoryKeys; \
- TQDict<TQAxFactoryInterface> factories; \
- public: \
- TQAxFactoryList() \
- : TQAxFactory(IDApp, IDTypeLib) \
- { \
- factories.setAutoDelete(TRUE); \
- TQAxFactoryInterface *factory = 0; \
- TQStringList keys; \
- TQStringList::Iterator it; \
-
-#define TQAXCLASS(Class) \
- factory = new TQAxClass<Class>(appID(), typeLibID()); \
- keys = factory->featureList(); \
- for (it = keys.begin(); it != keys.end(); ++it) { \
- factoryKeys += *it; \
- factories.insert(*it, factory); \
- }\
-
-#define TQAXFACTORY_END() \
- } \
- TQStringList featureList() const { return factoryKeys; } \
- TQWidget *create(const TQString &key, TQWidget *parent, const char *name) { \
- TQAxFactoryInterface *f = factories[key]; \
- return f ? f->create(key, parent, name) : 0; \
- } \
- TQUuid classID(const TQString &key) { \
- TQAxFactoryInterface *f = factories[key]; \
- return f ? f->classID(key) : TQUuid(); \
- } \
- TQUuid interfaceID(const TQString &key) { \
- TQAxFactoryInterface *f = factories[key]; \
- return f ? f->interfaceID(key) : TQUuid(); \
- } \
- TQUuid eventsID(const TQString &key) { \
- TQAxFactoryInterface *f = factories[key]; \
- return f ? f->eventsID(key) : TQUuid(); \
- } \
- void registerClass( const TQString &key, TQSettings *s ) const { \
- TQAxFactoryInterface *f = factories[key]; \
- if (f) f->registerClass(key, s); \
- } \
- void unregisterClass( const TQString &key, TQSettings *s ) const { \
- TQAxFactoryInterface *f = factories[key]; \
- if (f) f->unregisterClass(key, s); \
- } \
- TQString exposeToSuperClass( const TQString &key ) const { \
- TQAxFactoryInterface *f = factories[key]; \
- return f ? f->exposeToSuperClass(key) : TQString(); \
- } \
- bool stayTopLevel( const TQString &key ) const { \
- TQAxFactoryInterface *f = factories[key]; \
- return f ? f->stayTopLevel(key) : FALSE; \
- } \
- bool hasStockEvents( const TQString &key ) const { \
- TQAxFactoryInterface *f = factories[key]; \
- return f ? f->hasStockEvents(key) : FALSE; \
- } \
- }; \
- TQUnknownInterface *ucm_instantiate() \
- { \
- TQAxFactoryList *impl = new TQAxFactoryList(); \
- TQUnknownInterface* iface = 0; \
- impl->queryInterface( IID_QUnknown, &iface ); \
- return iface; \
- }
-
-
-#endif // TQAXFACTORY_H
-
-
-
- Copyright © 2007
-Trolltech Trademarks
-
-
-
-
-Home
- |
-All Classes
- |
-Main Classes
- |
-Annotated
- |
-Grouped Classes
- |
-Functions
-
-Complete Member List for TQAxFactory
-
-
-
-
-
- Copyright © 2007
-Trolltech Trademarks
-
-
-
-
-Home
- |
-All Classes
- |
-Main Classes
- |
-Annotated
- |
-Grouped Classes
- |
-Functions
-
-TQAxFactory Class Reference
-
-
[TQAxServer module]Public Members
-
-
-Static Public Members
-
-
-Detailed Description
-
- #include <ntqapplication.h>
- #include <qaxfactory.h>
-
- #include "theactivex.h"
-
- TQAXFACTORY_DEFAULT(
- TheActiveX, // widget class
- "{01234567-89AB-CDEF-0123-456789ABCDEF}", // class ID
- "{01234567-89AB-CDEF-0123-456789ABCDEF}", // interface ID
- "{01234567-89AB-CDEF-0123-456789ABCDEF}", // event interface ID
- "{01234567-89AB-CDEF-0123-456789ABCDEF}", // type library ID
- "{01234567-89AB-CDEF-0123-456789ABCDEF}" // application ID
- )
-
-
-
- TQStringList ActiveTQtFactory::featureList() const
- {
- TQStringList list;
- list << "ActiveX1";
- list << "ActiveX2";
- ...
- return list;
- }
-
- TQWidget *ActiveTQtFactory::create( const TQString &key, TQWidget *parent, const char *name )
- {
- if ( key == "ActiveX1" )
- return new ActiveX1( parent, name );
- if ( key == "ActiveX2" )
- return new ActiveX2( parent, name );
- ...
- return 0;
- }
-
- TQUuid ActiveTQtFactory::classID( const TQString &key ) const
- {
- if ( key == "ActiveX1" )
- return "{01234567-89AB-CDEF-0123-456789ABCDEF}";
- ...
- return TQUuid();
- }
-
- TQUuid ActiveTQtFactory::interfaceID( const TQString &key ) const
- {
- if ( key == "ActiveX1" )
- return "{01234567-89AB-CDEF-0123-456789ABCDEF}";
- ...
- return TQUuid();
- }
-
- TQUuid ActiveTQtFactory::eventsID( const TQString &key ) const
- {
- if ( key == "ActiveX1" )
- return "{01234567-89AB-CDEF-0123-456789ABCDEF}";
- ...
- return TQUuid();
- }
-
- TQAXFACTORY_EXPORT(
- MyFactory, // factory class
- "{01234567-89AB-CDEF-0123-456789ABCDEF}", // type library ID
- "{01234567-89AB-CDEF-0123-456789ABCDEF}" // application ID
- )
-
-
-
- TQAXFACTORY_BEGIN(
- "{01234567-89AB-CDEF-0123-456789ABCDEF}", // type library ID
- "{01234567-89AB-CDEF-0123-456789ABCDEF}" // application ID
- )
- TQAXCLASS(Class1)
- TQAXCLASS(Class2)
- TQAXFACTORY_END()
-
-
-Member Type Documentation
-TQAxFactory::ServerType
-
-
-
-Member Function Documentation
-TQAxFactory::TQAxFactory ( const TQUuid & libid, const TQUuid & appid )
-
-Constructs a TQAxFactory object that returns libid and appid
-in the implementation of the respective interface functions.
-
-TQAxFactory::~TQAxFactory () [virtual]
-
-Destroys the TQAxFactory object.
-
-TQUuid TQAxFactory::appID () const [virtual]
-
-
-TQUuid TQAxFactory::classID ( const TQString & key ) const [virtual]
-
-Reimplement this function to return the class identifier for each
-key returned by the featureList() implementation, or an empty
-TQUuid if this factory doesn't support the value of key.
-TQWidget * TQAxFactory::create ( const TQString & key, TQWidget * parent = 0, const char * name = 0 ) [virtual]
-
-Reimplement this function to return a new widget for key.
-Propagate parent and name to the TQWidget constructor. Return
-0 if this factory doesn't support the value of key.
-TQObject * TQAxFactory::createObject ( const TQString & key, TQObject * parent = 0, const char * name = 0 ) [virtual]
-
-Reimplement this function to return a new object for key.
-Propagate parent and name to the TQWidget constructor. Return
-0 if this factory doesn't support the value of key.
-bool TQAxFactory::createObjectWrapper ( TQObject * object, IDispatch ** wrapper ) [virtual]
-
-
-TQUuid TQAxFactory::eventsID ( const TQString & key ) const [virtual]
-
-Reimplement this function to return the identifier of the event
-interface for each key returned by the featureList()
-implementation, or an empty TQUuid if this factory doesn't support
-the value of key.
-TQString TQAxFactory::exposeToSuperClass ( const TQString & key ) const [virtual]
-
-Reimplement this function to return the name of the super class of
-key up to which methods and properties should be exposed by the
-ActiveX control.
-TQStringList TQAxFactory::featureList () const [pure virtual]
-
-
-bool TQAxFactory::hasStockEvents ( const TQString & key ) const [virtual]
-
-Reimplement this function to return TRUE if the ActiveX control
-key should support the standard ActiveX events
-
-
-TQUuid TQAxFactory::interfaceID ( const TQString & key ) const [virtual]
-
-Reimplement this function to return the interface identifier for
-each key returned by the featureList() implementation, or an
-empty TQUuid if this factory doesn't support the value of key.
-bool TQAxFactory::isServer () [static]
-
-Returns TRUE if the application has been started (by COM) as an ActiveX
-server, otherwise returns FALSE.
-
- int main( int argc, char**argv )
- {
- TQApplication app( argc, argv );
-
- if ( !TQAxFactory::isServer() ) {
- // initialize for stand-alone execution
- }
-
- return app.exec() // standard event processing
- }
-
-
-
-bool TQAxFactory::isService () const [virtual]
-
-Reimplement this function to return TRUE if the server is
-running as a persistent service (e.g. an NT service) and should
-not terminate even when all objects provided have been released.
-TQMetaObject * TQAxFactory::metaObject ( const TQString & key ) const [virtual]
-
-Reimplement this function to return the TQMetaObject corresponding to
-key, or 0 if this factory doesn't support the value of key.
-void TQAxFactory::registerClass ( const TQString & key, TQSettings * settings ) const [virtual]
-
-Registers additional values for the class key in the system
-registry using the settings object. The standard values have
-already been registed by the framework, but additional values,
-e.g. implemented categories, can be added in an implementation of
-this function.
-
- settings->writeEntry( "/CLSID/" + classID(key) + "/Implemented Categories/{00000000-0000-0000-000000000000}/.", TQString::null );
-
-
-TQString TQAxFactory::serverDirPath () [static]
-
-Returns the directory that contains the server binary.
-TQString TQAxFactory::serverFilePath () [static]
-
-Returns the file path of the server binary.
-bool TQAxFactory::startServer ( ServerType type = MultipleInstances ) [static]
-
-
-bool TQAxFactory::stayTopLevel ( const TQString & key ) const [virtual]
-
-Reimplement this function to return TRUE if the ActiveX control key
-should be a top level window, e.g. a dialog. The default implementation
-returns FALSE.
-
-bool TQAxFactory::stopServer () [static]
-
-
-TQUuid TQAxFactory::typeLibID () const [virtual]
-
-
-void TQAxFactory::unregisterClass ( const TQString & key, TQSettings * settings ) const [virtual]
-
-Unregisters any additional values for the class key from the
-system registry using the settings object.
-
- settings->removeEntry( "/CLSID/" + classID(key) + "/Implemented Categories/{00000000-0000-0000-000000000000}/." );
-
-
-bool TQAxFactory::validateLicenseKey ( const TQString & key, const TQString & licenseKey ) const [virtual]
-
-Reimplement this function to return TRUE if licenseKey is a valid
-license for the class key, or if the current machine is licensed.
-
- Copyright © 2007
-Trolltech Trademarks
-
-
-
-
-Home
- |
-All Classes
- |
-Main Classes
- |
-Annotated
- |
-Grouped Classes
- |
-Functions
-
-qaxobject.h
-
-
-
-/****************************************************************************
-** $Id: qt/qaxobject.h 3.3.8 edited Jan 11 14:46 $
-**
-** Declaration of the TQAxObject class
-**
-** Copyright (C) 2001-2007 Trolltech ASA. All rights reserved.
-**
-** This file is part of the Active TQt integration.
-**
-** Licensees holding valid TQt Enterprise Edition
-** licenses for Windows may use this file in accordance with the TQt Commercial
-** License Agreement provided with the Software.
-**
-** This file is not available for use under any other license without
-** express written permission from the copyright holder.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about TQt Commercial License Agreements.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
-#ifndef UNICODE
-#define UNICODE
-#endif
-
-#ifndef TQAXOBJECT_H
-#define TQAXOBJECT_H
-
-#include "qaxbase.h"
-#include <tqobject.h>
-
-class TQAxObject : public TQObject, public TQAxBase
-{
- friend class TQAxEventSink;
-public:
- TQMetaObject *metaObject() const;
- const char *className() const;
- void* tqt_cast( const char* );
- bool tqt_invoke( int, TQUObject* );
- bool tqt_emit( int, TQUObject* );
- bool tqt_property( int, int, TQVariant* );
- TQObject* qObject() { return (TQObject*)this; }
-
- TQAxObject( TQObject *parent = 0, const char *name = 0 );
- TQAxObject( const TQString &c, TQObject *parent = 0, const char *name = 0 );
- TQAxObject( IUnknown *iface, TQObject *parent = 0, const char *name = 0 );
- ~TQAxObject();
-
-private:
- TQMetaObject *parentMetaObject() const;
-};
-
-#endif //TQAXOBJECT_H
-
-
-
- Copyright © 2007
-Trolltech Trademarks
-
-
-
-
-Home
- |
-All Classes
- |
-Main Classes
- |
-Annotated
- |
-Grouped Classes
- |
-Functions
-
-Complete Member List for TQAxObject
-
-
-
-
-
- Copyright © 2007
-Trolltech Trademarks
-
-
-
-
-Home
- |
-All Classes
- |
-Main Classes
- |
-Annotated
- |
-Grouped Classes
- |
-Functions
-
-TQAxObject Class Reference
-
-
[TQAxContainer module]Public Members
-
-
-Important Inherited Members
-
-
-Detailed Description
-Member Function Documentation
-TQAxObject::TQAxObject ( TQObject * parent = 0, const char * name = 0 )
-
-Creates an empty COM object and propagates parent and name
-to the TQObject constructor. To initialize the object, call setControl.
-
-TQAxObject::TQAxObject ( const TQString & c, TQObject * parent = 0, const char * name = 0 )
-
-Creates a TQAxObject that wraps the COM object c. parent and
-name are propagated to the TQWidget contructor.
-TQAxObject::TQAxObject ( IUnknown * iface, TQObject * parent = 0, const char * name = 0 )
-
-Creates a TQAxObject that wraps the COM object referenced by iface. parent and name are propagated to the TQObject
-contructor.
-
-TQAxObject::~TQAxObject ()
-
-Releases the COM object and destroys the TQAxObject,
-cleaning up all allocated resources.
-
-TQVariant TQAxBase::dynamicCall ( const TQCString & function, const TQVariant & var1 = TQVariant ( ), const TQVariant & var2 = TQVariant ( ), const TQVariant & var3 = TQVariant ( ), const TQVariant & var4 = TQVariant ( ), const TQVariant & var5 = TQVariant ( ), const TQVariant & var6 = TQVariant ( ), const TQVariant & var7 = TQVariant ( ), const TQVariant & var8 = TQVariant ( ) )
-
-Calls the COM object's method function, passing the
-parameters var1, var1, var2, var3, var4, var5,
-var6, var7 and var8, and returns the value returned by
-the method, or an invalid TQVariant if the method does not return
-a value or when the function call failed.
-
- activeX->dynamicCall( "Navigate(const TQString&)", "www.trolltech.com" );
-
-
-
- activeX->dynamicCall("Navigate(\"www.trolltech.com\");
-
-
-All parameters are passed as strings; it depends on the control whether
-they are interpreted correctly, and is slower than using the prototype
-with correctly typed parameters.
-
- activeX->dynamicCall( "Value", 5 );
- TQString text = activeX->dynamicCall( "Text" ).toString();
-
-
-Note that it is faster to get and set properties using
-TQObject::property() and TQObject::setProperty().
-
- IWebBrowser2 *webBrowser = 0;
- activeX->queryInterface( IID_IWebBrowser2, (void**)&webBrowser );
- if ( webBrowser ) {
- webBrowser->Navigate2( pvarURL );
- webBrowser->Release();
- }
-
-
-TQVariant TQAxBase::dynamicCall ( const TQCString & function, TQValueList<TQVariant> & vars )
-
-This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
-TQAxObject * TQAxBase::querySubObject ( const TQCString & name, const TQVariant & var1 = TQVariant ( ), const TQVariant & var2 = TQVariant ( ), const TQVariant & var3 = TQVariant ( ), const TQVariant & var4 = TQVariant ( ), const TQVariant & var5 = TQVariant ( ), const TQVariant & var6 = TQVariant ( ), const TQVariant & var7 = TQVariant ( ), const TQVariant & var8 = TQVariant ( ) )
-
-Returns a pointer to a TQAxObject wrapping the COM object provided
-by the method or property name, passing passing the parameters
-var1, var1, var2, var3, var4, var5, var6,
-var7 and var8.
-
- TQAxWidget outlook( "Outlook.Application" );
- TQAxObject *session = outlook.querySubObject( "Session" );
- if ( session ) {
- TQAxObject *defFolder = session->querySubObject(
- "GetDefaultFolder(OlDefaultFolders)",
- "olFolderContacts" );
- //...
- }
-
-
-
-
- Copyright © 2007
-Trolltech Trademarks
-
-
-
-
-Home
- |
-All Classes
- |
-Main Classes
- |
-Annotated
- |
-Grouped Classes
- |
-Functions
-
-qaxscript.h
-
-
-
-/****************************************************************************
-** $Id: qt/qaxscript.h 3.3.8 edited Jan 11 14:46 $
-**
-** Declaration of the TQAxScriptEngine, TQAxScript and TQAxScriptManager classes
-**
-** Copyright (C) 2002-2007 Trolltech ASA. All rights reserved.
-**
-** This file is part of the Active TQt integration.
-**
-** Licensees holding valid TQt Enterprise Edition
-** licenses for Windows may use this file in accordance with the TQt Commercial
-** License Agreement provided with the Software.
-**
-** This file is not available for use under any other license without
-** express written permission from the copyright holder.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about TQt Commercial License Agreements.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
-#ifndef TQAXSCRIPT_H
-#define TQAXSCRIPT_H
-
-#include <qaxobject.h>
-
-class TQAxBase;
-class TQAxScript;
-class TQAxScriptSite;
-class TQAxScriptEngine;
-class TQAxScriptManager;
-class TQAxScriptManagerPrivate;
-struct IActiveScript;
-
-class TQAxScriptEngine : public TQAxObject
-{
-public:
- enum State {
- Uninitialized = 0,
- Initialized = 5,
- Started = 1,
- Connected = 2,
- Disconnected = 3,
- Closed = 4
- };
-
- TQAxScriptEngine(const TQString &language, TQAxScript *script);
- ~TQAxScriptEngine();
-
- bool isValid() const;
- bool hasIntrospection() const;
-
- TQString scriptLanguage() const;
-
- State state() const;
- void setState(State st);
-
- void addItem(const TQString &name);
-
- long queryInterface( const TQUuid &, void** ) const;
-
-protected:
- bool initialize(IUnknown** ptr);
-
-private:
- TQAxScript *script_code;
- IActiveScript *engine;
-
- TQString script_language;
-};
-
-class TQAxScript : public TQObject
-{
- TQ_OBJECT
-
-public:
- enum FunctionFlags {
- FunctionNames = 0,
- FunctionSignatures
- };
-
- TQAxScript(const TQString &name, TQAxScriptManager *manager);
- ~TQAxScript();
-
- bool load(const TQString &code, const TQString &language = TQString::null);
-
- TQStringList functions(FunctionFlags = FunctionNames) const;
-
- TQString scriptCode() const;
- TQString scriptName() const;
- TQAxScriptEngine *scriptEngine() const;
-
- TQVariant call(const TQString &function, const TQVariant &v1 = TQVariant(),
- const TQVariant &v2 = TQVariant(),
- const TQVariant &v3 = TQVariant(),
- const TQVariant &v4 = TQVariant(),
- const TQVariant &v5 = TQVariant(),
- const TQVariant &v6 = TQVariant(),
- const TQVariant &v7 = TQVariant(),
- const TQVariant &v8 = TQVariant());
- TQVariant call(const TQString &function, TQValueList<TQVariant> &arguments);
-
-signals:
- void entered();
- void finished();
- void finished(const TQVariant &result);
- void finished(int code, const TQString &source,const TQString &description, const TQString &help);
- void stateChanged(int state);
- void error(int code, const TQString &description, int sourcePosition, const TQString &sourceText);
-
-private:
- friend class TQAxScriptSite;
- friend class TQAxScriptEngine;
-
- void updateObjects();
- TQAxBase *findObject(const TQString &name);
-
- TQString script_name;
- TQString script_code;
- TQAxScriptManager *script_manager;
- TQAxScriptEngine *script_engine;
- TQAxScriptSite *script_site;
-};
-
-class TQAxScriptManager : public TQObject
-{
- TQ_OBJECT
-
-public:
- TQAxScriptManager( TQObject *parent = 0, const char *name = 0 );
- ~TQAxScriptManager();
-
- void addObject(TQAxBase *object);
- void addObject(TQObject *object);
-
- TQStringList functions(TQAxScript::FunctionFlags = TQAxScript::FunctionNames) const;
- TQStringList scriptNames() const;
- TQAxScript *script(const TQString &name) const;
-
- TQAxScript* load(const TQString &code, const TQString &name, const TQString &language);
- TQAxScript* load(const TQString &file, const TQString &name);
-
- TQVariant call(const TQString &function, const TQVariant &v1 = TQVariant(),
- const TQVariant &v2 = TQVariant(),
- const TQVariant &v3 = TQVariant(),
- const TQVariant &v4 = TQVariant(),
- const TQVariant &v5 = TQVariant(),
- const TQVariant &v6 = TQVariant(),
- const TQVariant &v7 = TQVariant(),
- const TQVariant &v8 = TQVariant());
- TQVariant call(const TQString &function, TQValueList<TQVariant> &arguments);
-
- static bool registerEngine(const TQString &name, const TQString &extension, const TQString &code = TQString());
- static TQString scriptFileFilter();
-
-signals:
- void error(TQAxScript *script, int code, const TQString &description, int sourcePosition, const TQString &sourceText);
-
-private slots:
- void objectDestroyed(TQObject *o);
- void scriptError(int code, const TQString &description, int sourcePosition, const TQString &sourceText);
-
-private:
- friend class TQAxScript;
- TQAxScriptManagerPrivate *d;
-
- void updateScript(TQAxScript*);
- TQAxScript *scriptForFunction(const TQString &function) const;
-};
-
-
-// TQAxScript inlines
-
-inline TQString TQAxScript::scriptCode() const
-{
- return script_code;
-}
-
-inline TQString TQAxScript::scriptName() const
-{
- return script_name;
-}
-
-inline TQAxScriptEngine *TQAxScript::scriptEngine() const
-{
- return script_engine;
-}
-
-// TQAxScriptEngine inlines
-
-inline bool TQAxScriptEngine::isValid() const
-{
- return engine != 0;
-}
-
-inline TQString TQAxScriptEngine::scriptLanguage() const
-{
- return script_language;
-}
-
-// TQAxScriptManager inlines
-
-inline void TQAxScriptManager::addObject(TQObject *object)
-{
- extern TQAxBase *qax_create_object_wrapper(TQObject*);
- TQAxBase *wrapper = qax_create_object_wrapper(object);
- addObject(wrapper);
-}
-
-#endif // TQAXSCRIPT_H
-
-
-
- Copyright © 2007
-Trolltech Trademarks
-
-
-
-
-Home
- |
-All Classes
- |
-Main Classes
- |
-Annotated
- |
-Grouped Classes
- |
-Functions
-
-Complete Member List for TQAxScript
-
-
-
-
-
- Copyright © 2007
-Trolltech Trademarks
-
-
-
-
-Home
- |
-All Classes
- |
-Main Classes
- |
-Annotated
- |
-Grouped Classes
- |
-Functions
-
-TQAxScript Class Reference
-
-
[TQAxContainer module]Public Members
-
-
-Signals
-
-
-Detailed Description
-Member Type Documentation
-TQAxScript::FunctionFlags
-
-
-
-Member Function Documentation
-TQAxScript::TQAxScript ( const TQString & name, TQAxScriptManager * manager )
-
-Constructs a TQAxScript object called name and registers
-it with the TQAxScriptManager manager. This is usually done by the
-TQAxScriptManager class when loading a
- script.
-TQAxScript::~TQAxScript ()
-
-Destroys the object, releasing all allocated resources.
-
-TQVariant TQAxScript::call ( const TQString & function, const TQVariant & var1 = TQVariant ( ), const TQVariant & var2 = TQVariant ( ), const TQVariant & var3 = TQVariant ( ), const TQVariant & var4 = TQVariant ( ), const TQVariant & var5 = TQVariant ( ), const TQVariant & var6 = TQVariant ( ), const TQVariant & var7 = TQVariant ( ), const TQVariant & var8 = TQVariant ( ) )
-
-Calls function, passing the parameters var1, var1,
-var2, var3, var4, var5, var6, var7 and var8
-as arguments and returns the value returned by the function, or an
-invalid TQVariant if the function does not return a value or when
-the function call failed.
-TQVariant TQAxScript::call ( const TQString & function, TQValueList<TQVariant> & arguments )
-
-This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
-void TQAxScript::entered () [signal]
-
-void TQAxScript::error ( int code, const TQString & description, int sourcePosition, const TQString & sourceText ) [signal]
-
-
-void TQAxScript::finished () [signal]
-
-void TQAxScript::finished ( const TQVariant & result ) [signal]
-
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
-void TQAxScript::finished ( int code, const TQString & source, const TQString & description, const TQString & help ) [signal]
-
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
-TQStringList TQAxScript::functions ( FunctionFlags flags = FunctionNames ) const
-
-Returns a list of all the functions in this script if the respective
-script engine supports introspection; otherwise returns an empty list.
-The functions are either provided with full prototypes or only as
-names, depending on the value of flags.
-bool TQAxScript::load ( const TQString & code, const TQString & language = TQString::null )
-
-Loads the script source code written in language language
-into the script engine. Returns TRUE if code was successfully
-entered into the script engine; otherwise returns FALSE.
-TQString TQAxScript::scriptCode () const
-
-Returns the script's code, or the null-string if no
-code has been loaded yet.
-TQAxScriptEngine * TQAxScript::scriptEngine () const
-
-Returns a pointer to the script engine.
-TQString TQAxScript::scriptName () const
-
-Returns the name of the script.
-
-void TQAxScript::stateChanged ( int state ) [signal]
-
-
- Copyright © 2007
-Trolltech Trademarks
-
-
-
-
-Home
- |
-All Classes
- |
-Main Classes
- |
-Annotated
- |
-Grouped Classes
- |
-Functions
-
-Complete Member List for TQAxScriptEngine
-
-
-
-
-
- Copyright © 2007
-Trolltech Trademarks
-
-
-
-
-Home
- |
-All Classes
- |
-Main Classes
- |
-Annotated
- |
-Grouped Classes
- |
-Functions
-
-TQAxScriptEngine Class Reference
-
-
[TQAxContainer module]Public Members
-
-
-Detailed Description
-Member Type Documentation
-TQAxScriptEngine::State
-
-
-
-Member Function Documentation
-TQAxScriptEngine::TQAxScriptEngine ( const TQString & language, TQAxScript * script )
-
-Constructs a TQAxScriptEngine object interpreting script code in language
-provided by the code in script. This is usually done by the TQAxScript
-class when loading a script.
-TQAxScriptEngine::~TQAxScriptEngine ()
-
-Destroys the TQAxScriptEngine object, releasing all allocated
-resources.
-
-void TQAxScriptEngine::addItem ( const TQString & name )
-
-Registers an item with the script engine. Script code can
-refer to this item using name.
-
-bool TQAxScriptEngine::hasIntrospection () const
-
-Returns TRUE if the script engine supports introspection;
-otherwise returns FALSE.
-
-bool TQAxScriptEngine::isValid () const
-
-
-long TQAxScriptEngine::queryInterface ( const TQUuid & uuid, void ** iface ) const
-
-Requests the interface uuid from the script engine object and
-sets the value of iface to the provided interface, or to 0 if
-the requested interface could not be provided.
-TQString TQAxScriptEngine::scriptLanguage () const
-
-Returns the scripting language, for example "VBScript",
-or "JScript".
-
-void TQAxScriptEngine::setState ( State st )
-
-Sets the state of the script engine to st.
-Calling this function is usually not necessary.
-
-State TQAxScriptEngine::state () const
-
-Returns the state of the script engine.
-
-
-
- Copyright © 2007
-Trolltech Trademarks
-
-
-
-
-Home
- |
-All Classes
- |
-Main Classes
- |
-Annotated
- |
-Grouped Classes
- |
-Functions
-
-Complete Member List for TQAxScriptManager
-
-
-
-
-
- Copyright © 2007
-Trolltech Trademarks
-
-
-
-
-Home
- |
-All Classes
- |
-Main Classes
- |
-Annotated
- |
-Grouped Classes
- |
-Functions
-
-TQAxScriptManager Class Reference
-
-
[TQAxContainer module]Public Members
-
-
-Signals
-
-
-Static Public Members
-
-
-Detailed Description
-Member Function Documentation
-TQAxScriptManager::TQAxScriptManager ( TQObject * parent = 0, const char * name = 0 )
-
-Creates a TQAxScriptManager object. parent and name are passed
-on to the TQObject constructor.
-TQAxScriptManager::~TQAxScriptManager ()
-
-Destroys the objects, releasing all allocated resources.
-
-void TQAxScriptManager::addObject ( TQAxBase * object )
-
-Adds object to the manager. Scripts handled by this
-manager can access the object in the code using the object's name property.
-void TQAxScriptManager::addObject ( TQObject * object )
-
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
-TQVariant TQAxScriptManager::call ( const TQString & function, const TQVariant & var1 = TQVariant ( ), const TQVariant & var2 = TQVariant ( ), const TQVariant & var3 = TQVariant ( ), const TQVariant & var4 = TQVariant ( ), const TQVariant & var5 = TQVariant ( ), const TQVariant & var6 = TQVariant ( ), const TQVariant & var7 = TQVariant ( ), const TQVariant & var8 = TQVariant ( ) )
-
-Calls function, passing the parameters var1, var1,
-var2, var3, var4, var5, var6, var7 and var8
-as arguments and returns the value returned by the function, or an
-invalid TQVariant if the function does not return a value or when
-the function call failed. The call returns when the script's
-execution has finished.
-
- function setNumber(number)
- {
- n = number;
- }
-
-
-use
-
- TQValueList args;
- args << 5;
- script->call("setNumber(const TQVariant&)", args);
-
-
-As with dynamicCall the
-parameters can directly be embedded in the function string.
-
- script->call("setNumber(5)");
-
-
-However, this is slower.
-TQVariant TQAxScriptManager::call ( const TQString & function, TQValueList<TQVariant> & arguments )
-
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
-void TQAxScriptManager::error ( TQAxScript * script, int code, const TQString & description, int sourcePosition, const TQString & sourceText ) [signal]
-
-
-TQStringList TQAxScriptManager::functions ( TQAxScript::FunctionFlags flags = TQAxScript::FunctionNames ) const
-
-Returns a list with all the functions that are available.
-Functions provided by script engines that don't support
-introspection are not included in the list.
-The functions are either provided with full prototypes or
-only as names, depending on the value of flags.
-
-TQAxScript * TQAxScriptManager::load ( const TQString & code, const TQString & name, const TQString & language )
-
-Loads the script source code using the script engine for language. The script can later be referred to using its name
-which should not be empty.
-TQAxScript * TQAxScriptManager::load ( const TQString & file, const TQString & name )
-
-This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
-bool TQAxScriptManager::registerEngine ( const TQString & name, const TQString & extension, const TQString & code = TQString ( ) ) [static]
-
-Registers the script engine called name and returns TRUE if the
-engine was found; otherwise does nothing and returns FALSE.
-TQAxScript * TQAxScriptManager::script ( const TQString & name ) const
-
-Returns the script called name.
-TQString TQAxScriptManager::scriptFileFilter () [static]
-
-Returns a file filter listing all the supported script languages.
-This filter string is convenient for use with TQFileDialog.
-
-TQStringList TQAxScriptManager::scriptNames () const
-
-Returns a list with the names of all the scripts.
-
-
-
- Copyright © 2007
-Trolltech Trademarks
-
-
-
-
-Home
- |
-All Classes
- |
-Main Classes
- |
-Annotated
- |
-Grouped Classes
- |
-Functions
-
-TQt Widget Hierarchy
-
-
-
-
-
- Copyright © 2007
-Trolltech Trademarks
-
-
-
-
-Home
- |
-All Classes
- |
-Main Classes
- |
-Annotated
- |
-Grouped Classes
- |
-Functions
-
-Menubar merging
-
-
-
- Copyright © 2007
-Trolltech Trademarks
-
-
-
-
-Home
- |
-All Classes
- |
-Main Classes
- |
-Annotated
- |
-Grouped Classes
- |
-Functions
-
-Two simple TQt widgets
-
-
-
-
-
-
-
- Copyright © 2007
-Trolltech Trademarks
-
-
-
-
-Home
- |
-All Classes
- |
-Main Classes
- |
-Annotated
- |
-Grouped Classes
- |
-Functions
-
-OpenGL in an HTML page
-
-
-
-
-
-
- Copyright © 2007
-Trolltech Trademarks
-
-
-
-
-Home
- |
-All Classes
- |
-Main Classes
- |
-Annotated
- |
-Grouped Classes
- |
-Functions
-
-A standard ActiveX and the "simple" ActiveTQt widget.
-
-
-
- Copyright © 2007
-Trolltech Trademarks
-
-
-
-
-Home
- |
-All Classes
- |
-Main Classes
- |
-Annotated
- |
-Grouped Classes
- |
-Functions
-
-Play Tetrix!
-
-
-
- Copyright © 2007
-Trolltech Trademarks
-
-
-
-
-Home
- |
-All Classes
- |
-Main Classes
- |
-Annotated
- |
-Grouped Classes
- |
-Functions
-
-Standard TQt widgets in an HTML page
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Copyright © 2007
-Trolltech Trademarks
-
-
-
-
-Home
- |
-All Classes
- |
-Main Classes
- |
-Annotated
- |
-Grouped Classes
- |
-Functions
-
-TQt Widget Hierarchy (in-process)
-
-
-
-The ActiveX control in this example is a TQWidget
-subclass with child widgets that are accessible as sub types.
- class TQParentWidget : public TQWidget
- {
- TQ_OBJECT
- public:
- TQParentWidget( TQWidget *parent = 0, const char *name = 0, WFlags f = 0 );
-
- TQSize sizeHint() const;
-
- public slots:
- void createSubWidget( const TQString &name );
-
- TQSubWidget *subWidget( const TQString &name );
-
- private:
- TQVBoxLayout *vbox;
- };
-
The TQParentWidget class provides slots to create a widget
-with a name, and to return a pointer to a named widget.
- TQParentWidget::TQParentWidget( TQWidget *parent, const char *name, WFlags f )
- : TQWidget( parent, name, f )
- {
- vbox = new TQVBoxLayout( this );
- vbox->setAutoAdd( TRUE );
- }
-
The constructor of TQParentWidget creates a vertical box layout.
-New child widgets are automatically added to the layout.
- void TQParentWidget::createSubWidget( const TQString &name )
- {
- TQSubWidget *sw = new TQSubWidget( this, name );
- sw->setLabel( name );
- sw->show();
- }
-
The createSubWidget slot creates a new TQSubWidget with
-the name provided in the parameter, and sets the label to that
-name. The widget is also shown explicitly.
- TQSubWidget *TQParentWidget::subWidget( const TQString &name )
- {
- return (TQSubWidget*)child( name, "TQSubWidget" );
- }
-
The subWidget slot uses the TQObject::child() function and
-returns the first child of type TQSubWidget that has the requested
-name.
- class TQSubWidget : public TQWidget
- {
- TQ_OBJECT
- TQ_PROPERTY( TQString label READ label WRITE setLabel )
- public:
- TQSubWidget( TQWidget *parent = 0, const char *name = 0, WFlags f = 0 );
-
- void setLabel( const TQString &text );
- TQString label() const;
-
- TQSize sizeHint() const;
-
- protected:
- void paintEvent( TQPaintEvent *e );
-
- private:
- TQString lbl;
- };
-
The TQSubWidget class has a single string-property label,
-and implements the paintEvent to draw the label.
- TQSubWidget::TQSubWidget( TQWidget *parent, const char *name, WFlags f )
- : TQWidget( parent, name, f )
- {
- }
-
- void TQSubWidget::setLabel( const TQString &text )
- {
- lbl = text;
- setName( text );
- update();
- }
-
- TQString TQSubWidget::label() const
- {
- return lbl;
- }
-
- TQSize TQSubWidget::sizeHint() const
- {
- TQFontMetrics fm( font() );
- return TQSize( fm.width(lbl), fm.height() );
- }
-
- void TQSubWidget::paintEvent( TQPaintEvent * )
- {
- TQPainter painter(this);
- painter.setPen( colorGroup().text() );
- painter.drawText( rect(), AlignCenter, lbl );
- }
-
The implementation of the TQSubWidget class is self-explanatory.
- class ActiveTQtFactory : public TQAxFactory
- {
- public:
- ActiveTQtFactory( const TQUuid &lib, const TQUuid &app )
- : TQAxFactory( lib, app )
- {}
- TQStringList featureList() const
- {
- TQStringList list;
- list << "TQParentWidget";
- list << "TQSubWidget";
- return list;
- }
-
The ActiveTQtFactory class implements a TQAxFactory. It returns
-the class names of all supported types, TQParentWidget and
-TQSubWidget, from the featureList() reimplementation.
- TQWidget *create( const TQString &key, TQWidget *parent, const char *name )
- {
- if ( key == "TQParentWidget" )
- return new TQParentWidget( parent, name );
-
- return 0;
- }
-
The factory can however only create objects of the TQParentWidget
-type directly - objects of subtypes can only be created through the
-interface of TQParentWidget objects.
- TQUuid classID( const TQString &key ) const
- {
- if ( key == "TQParentWidget" )
- return TQUuid( "{d574a747-8016-46db-a07c-b2b4854ee75c}" );
- if ( key == "TQSubWidget" )
- return TQUuid( "{850652f4-8f71-4f69-b745-bce241ccdc30}" );
-
- return TQUuid();
- }
- TQUuid interfaceID( const TQString &key ) const
- {
- if ( key == "TQParentWidget" )
- return TQUuid( "{4a30719d-d9c2-4659-9d16-67378209f822}" );
- if ( key == "TQSubWidget" )
- return TQUuid( "{2d76cc2f-3488-417a-83d6-debff88b3c3f}" );
-
- return TQUuid();
- }
- TQUuid eventsID( const TQString &key ) const
- {
- if ( key == "TQParentWidget" )
- return TQUuid( "{aac9f855-c3dc-4cae-b747-c77f4d509f4c}" );
- if ( key == "TQSubWidget" )
- return TQUuid( "{25fac47e-c723-4696-8c74-6185903bdf65}" );
-
- return TQUuid();
- }
-
COM however requires the IDs for the interfaces of the sub types as
-well to be able to marshal calls correctly.
- TQString exposeToSuperClass( const TQString &key ) const
- {
- if ( key == "TQSubWidget" )
- return key;
- return TQAxFactory::exposeToSuperClass(key);
- }
- };
-
Objects of the TQSubWidget type should not expose the full
-functionality of e.g. TQWidget. Only those properties and slots
-explicitly declared in the type are accessible.
- TQAXFACTORY_EXPORT( ActiveTQtFactory, "{9e626211-be62-4d18-9483-9419358fbb03}", "{75c276de-1df5-451f-a004-e4fa1a587df1}" )
-
The factory is then exported using the TQAXFACTORY_EXPORT
-macro.
-
- <script language=javascript>
- function createSubWidget( form )
- {
- ParentWidget.createSubWidget( form.nameEdit.value );
- }
-
- function renameSubWidget( form )
- {
- var SubWidget = ParentWidget.subWidget( form.nameEdit.value );
- if ( !SubWidget ) {
- alert( "No such widget " + form.nameEdit.value + "!" );
- return;
- }
- SubWidget.label = form.labelEdit.value;
- form.nameEdit.value = SubWidget.label;
- }
-
- function setFont( form )
- {
- ParentWidget.font = form.fontEdit.value;
- }
- </script>
-
- <p>
- This widget can have many children!<br>
- <object ID="ParentWidget" CLASSID="CLSID:d574a747-8016-46db-a07c-b2b4854ee75c"
- CODEBASE=http://www.trolltech.com/demos/hierarchy.cab>
- [Object not available! Did you forget to build and register the server?]
- </object><br>
- <form>
- <input type="edit" ID="nameEdit" value = "<enter object name>">
- <input type="button" value = "Create" onClick="createSubWidget(this.form)">
- <input type="edit" ID="labelEdit">
- <input type="button" value = "Rename" onClick="renameSubWidget(this.form)">
- <br>
- <input type="edit" ID="fontEdit" value = "MS Sans Serif">
- <input type="button" value = "Set Font" onClick="setFont(this.form)">
- </form>
-
- Copyright © 2007
-Trolltech Trademarks
-
-
-
-
-Home
- |
-All Classes
- |
-Main Classes
- |
-Annotated
- |
-Grouped Classes
- |
-Functions
-
-Menubar merging
-
-
-
-
- <object ID="TQMenus" CLASSID="CLSID:4dc3f340-a6f7-44e4-a79b-3e9217695fbd"
- CODEBASE=http://www.trolltech.com/demos/menusax.cab>
- [Object not available! Did you forget to build and register the server?]
- </object>
-
- Copyright © 2007
-Trolltech Trademarks
-
-
-
-
-Home
- |
-All Classes
- |
-Main Classes
- |
-Annotated
- |
-Grouped Classes
- |
-Functions
-
-Two simple TQt widgets (in-process)
-
-
-
-The ActiveX controls in this example are simple TQWidget
-subclasses reimplementing the paintEvent() method. The classes use
-the TQ_CLASSINFO macro to
- class TQAxWidget1 : public TQWidget
- {
- TQ_OBJECT
- TQ_CLASSINFO("ClassID", "{1D9928BD-4453-4bdd-903D-E525ED17FDE5}")
- TQ_CLASSINFO("InterfaceID", "{99F6860E-2C5A-42ec-87F2-43396F4BE389}")
- TQ_CLASSINFO("EventsID", "{0A3E9F27-E4F1-45bb-9E47-63099BCCD0E3}")
-
The class declaration includes the TQ_OBJECT macro to activate TQt's meta object system, and sets COM identifiers for the class using the
-TQ_CLASSINFO macro.
- TQ_PROPERTY( TQColor fillColor READ fillColor WRITE setFillColor )
- public:
- TQAxWidget1( TQWidget *parent = 0, const char *name = 0, WFlags f = 0 )
- : TQWidget( parent, name, f ), fill_color( red )
- {
- }
-
- TQColor fillColor() const
- {
- return fill_color;
- }
- void setFillColor( const TQColor &fc )
- {
- fill_color = fc;
- repaint();
- }
-
- protected:
- void paintEvent( TQPaintEvent *e )
- {
- TQPainter paint( this );
- TQRect r = rect();
- r.addCoords( 10, 10, -10, -10 );
- paint.fillRect( r, fill_color );
- }
-
- private:
- TQColor fill_color;
- };
-
The control draws a filled rectangle. The fill color is exposed as a
-property using the TQ_PROPERTY macro.
- class TQAxWidget2 : public TQWidget
- {
- TQ_OBJECT
- TQ_CLASSINFO("ClassID", "{58139D56-6BE9-4b17-937D-1B1EDEDD5B71}")
- TQ_CLASSINFO("InterfaceID", "{B66280AB-08CC-4dcc-924F-58E6D7975B7D}")
- TQ_CLASSINFO("EventsID", "{D72BACBA-03C4-4480-B4BB-DE4FE3AA14A0}")
- TQ_CLASSINFO("ToSuperClass", "TQAxWidget2")
- TQ_CLASSINFO("StockEvents", "yes")
-
The declaration of the second control class uses the TQ_CLASSINFO macro
-to set the COM identifiers as well as additional COM attributes for the
-class. Objects of that class will not expose the TQWidget API, and provide
-the ActiveX stock events (ie. Click, KeyDown etc.).
- TQ_PROPERTY( int lineWidth READ lineWidth WRITE setLineWidth )
- public:
- TQAxWidget2( TQWidget *parent = 0, const char *name = 0, WFlags f = 0 )
- : TQWidget( parent, name, f ), line_width( 1 )
- {
- }
-
- int lineWidth() const
- {
- return line_width;
- }
- void setLineWidth( int lw )
- {
- line_width = lw;
- repaint();
- }
-
- protected:
- void paintEvent( TQPaintEvent *e )
- {
- TQPainter paint( this );
- TQPen pen = paint.pen();
- pen.setWidth( line_width );
- paint.setPen( pen );
-
- TQRect r = rect();
- r.addCoords( 10, 10, -10, -10 );
- paint.drawEllipse( r );
- }
-
- private:
- int line_width;
- };
-
The control draws a circle. The line width is exposed as a property
-using the TQ_PROPERTY macro.
- #include <qaxfactory.h>
-
- #include "ax1.h"
- #include "ax2.h"
-
- TQAXFACTORY_BEGIN("{98DE28B6-6CD3-4e08-B9FA-3D1DB43F1D2F}", "{05828915-AD1C-47ab-AB96-D6AD1E25F0E2}")
-
The factory is initialied using the TQAXFACTORY_BEGIN macro, providing
-the IDs for the application and the type library.
- TQAXCLASS(TQAxWidget1)
- TQAXCLASS(TQAxWidget2)
-
The classes exposed are listed using the TQAXCLASS macro.
- TQAXFACTORY_END()
-
Finally the factory declaration is closed using the TQAXFACTORY_END
-macro.
-
- <script language=javascript>
- function setColor( form )
- {
- Ax1.fillColor = form.colorEdit.value;
- }
-
- function setWidth( form )
- {
- Ax2.lineWidth = form.widthEdit.value;
- }
- </script>
-
- <p>
- This is one TQWidget subclass:<br>
- <object ID="Ax1" CLASSID="CLSID:1D9928BD-4453-4bdd-903D-E525ED17FDE5"
- CODEBASE=http://www.trolltech.com/demos/multipleax.cab>
- [Object not available! Did you forget to build and register the server?]
- </object><br>
- <form>
- Fill Color: <input type="edit" ID="colorEdit" value = "red">
- <input type="button" value = "Set" onClick="setColor(this.form)">
- <input type="button" value = "Hide" onClick="Ax1.hide()">
- <input type="button" value = "Show" onClick="Ax1.show()">
- </form>
-
- <p>
- This is another TQWidget subclass:<br>
- <object ID="Ax2" CLASSID="CLSID:58139D56-6BE9-4b17-937D-1B1EDEDD5B71"
- CODEBASE=http://www.trolltech.com/demos/multipleax.cab>
- [Object not available! Did you forget to build and register the server?]
- </object><br>
- <form>
- Line width: <input type="edit" ID="widthEdit" value = "1">
- <input type="button" value = "Set" onClick="setWidth(this.form)">
- </form>
-
- Copyright © 2007
-Trolltech Trademarks
-
-
-
-
-Home
- |
-All Classes
- |
-Main Classes
- |
-Annotated
- |
-Grouped Classes
- |
-Functions
-
-TQt' OpenGL widgets as an ActiveX (executable)
-
-
-
-The ActiveX control in this example uses the TQGlWidget class in
-TQt to render an OpenGL scene in an ActiveX. The control exposes a few
-methods to change the scene. The example is based on the
-"box" example from the standard
-TQt distribution.
- #include <qaxfactory.h>
-
- TQAXFACTORY_DEFAULT( GLBox,
- "{5fd9c22e-ed45-43fa-ba13-1530bb6b03e0}",
- "{33b051af-bb25-47cf-a390-5cfd2987d26a}",
- "{8c996c29-eafa-46ac-a6f9-901951e765b5}",
- "{2c3c183a-eeda-41a4-896e-3d9c12c3577d}",
- "{83e16271-6480-45d5-aaf1-3f40b7661ae4}"
- )
-
The implementation of main initializes the TQApplication object,
-and uses TQAxFactory::isServer() to determine whether or not it is
-appropriate to create and show the application interface.
- /*
- The main program is here.
- */
-
- int main( int argc, char **argv )
- {
- TQApplication::setColorSpec( TQApplication::CustomColor );
- TQApplication a(argc,argv);
-
- if ( !TQGLFormat::hasOpenGL() ) {
- tqWarning( "This system has no OpenGL support. Exiting." );
- return -1;
- }
-
- if ( !TQAxFactory::isServer() ) {
- GLObjectWindow w;
- w.resize( 400, 350 );
- a.setMainWidget( &w );
- w.show();
- return a.exec();
- }
- return a.exec();
- }
-
- #include <qaxbindable.h>
-
- class GLBox : public TQGLWidget,
- public TQAxBindable
- {
- TQ_OBJECT
-
The class reimplements the TQAxBindable::createAggregate() function from TQAxBindable
-to return the pointer to a TQAxAggregated object.
- public:
-
- GLBox( TQWidget* parent, const char* name );
- ~GLBox();
-
- TQAxAggregated *createAggregate();
-
- public slots:
-
- void setXRotation( int degrees );
-
The rest of the class declaration and the implementation of the OpenGL
-rendering is identical to the original "box" example.
- #include <objsafe.h>
-
A class ObjectSafetyImpl is declared using multiple inheritance
-to subclass the TQAxAggregated class, and to implement the IObjectSafety
-interface.
- class ObjectSafetyImpl : public TQAxAggregated,
- public IObjectSafety
- {
- public:
-
The class declares a default constructor, and implements the queryInterface
-function to support the IObjectSafety interface.
- ObjectSafetyImpl() {}
-
- long queryInterface( const TQUuid &iid, void **iface )
- {
- *iface = 0;
- if ( iid == IID_IObjectSafety )
- *iface = (IObjectSafety*)this;
- else
- return E_NOINTERFACE;
-
- AddRef();
- return S_OK;
- }
-
Since every COM interface inherits IUnknown the TQAXAGG_IUNKNOWN macro
-is used to provide the default implementation of the IUnknown interface.
-The macro is defined to delegate all calls to QueryInterface, AddRef
-and Release to the interface returned by the controllingUnknown() function.
- TQAXAGG_IUNKNOWN;
-
The implementation of the IObjectSafety interface provides the caller
-with information about supported and enabled safety options, and returns
-S_OK for all calls to indicate that the ActiveX control is safe.
- HRESULT WINAPI GetInterfaceSafetyOptions( REFIID riid, DWORD *pdwSupportedOptions, DWORD *pdwEnabledOptions )
- {
- *pdwSupportedOptions = INTERFACESAFE_FOR_UNTRUSTED_DATA | INTERFACESAFE_FOR_UNTRUSTED_CALLER;
- *pdwEnabledOptions = INTERFACESAFE_FOR_UNTRUSTED_DATA | INTERFACESAFE_FOR_UNTRUSTED_CALLER;
- return S_OK;
- }
- HRESULT WINAPI SetInterfaceSafetyOptions( REFIID riid, DWORD pdwSupportedOptions, DWORD pdwEnabledOptions )
- {
- return S_OK;
- }
- };
-
The implementation of the createAggregate() function just returns a new
-ObjectSafetyImpl object.
- TQAxAggregated *GLBox::createAggregate()
- {
- return new ObjectSafetyImpl();
- }
-
-
- <SCRIPT LANGUAGE=JavaScript>
- function setRot( form )
- {
- GLBox.setXRotation( form.XEdit.value );
- GLBox.setYRotation( form.YEdit.value );
- GLBox.setZRotation( form.ZEdit.value );
- }
- </SCRIPT>
-
- <p>
- An OpenGL scene:<br>
- <object ID="GLBox" CLASSID="CLSID:5fd9c22e-ed45-43fa-ba13-1530bb6b03e0"
- CODEBASE=http://www.trolltech.com/demos/openglax.cab>
- [Object not available! Did you forget to build and register the server?]
- </object><br>
-
- <form>
- Rotate the scene:<br>
- X:<input type="edit" ID="XEdit" value="0"><br>
- Y:<input type="edit" name="YEdit" value="0"><br>
- Z:<input type="edit" name="ZEdit" value="0"><br>
- <input type="button" value="Set" onClick="setRot(this.form)">
- </form>
-
- Copyright © 2007
-Trolltech Trademarks
-
-
-
-
-Home
- |
-All Classes
- |
-Main Classes
- |
-Annotated
- |
-Grouped Classes
- |
-Functions
-
-A simple ActiveTQt control (executable)
-
-
-
-The ActiveX control in this example is a layouted TQWidget
-with a TQSlider, a TQLCDNumber and a TQLineEdit.
-It provides a signal/slot/property interface to change the
-values of the slider and the line edit, and to get notified
-of any property changes.
- class TQSimpleAX : public TQWidget, public TQAxBindable
- {
- TQ_OBJECT
- TQ_PROPERTY( TQString text READ text WRITE setText )
- TQ_PROPERTY( int value READ value WRITE setValue )
- public:
- TQSimpleAX( TQWidget *parent = 0, const char *name = 0 )
- : TQWidget( parent, name )
- {
- TQVBoxLayout *vbox = new TQVBoxLayout( this );
-
- slider = new TQSlider( 0, 100, 1, 0, TQSlider::Horizontal, this );
- LCD = new TQLCDNumber( 3, this );
- edit = new TQLineEdit( this );
-
- connect( slider, TQ_SIGNAL( valueChanged( int ) ), this, TQ_SLOT( setValue(int) ) );
- connect( edit, TQ_SIGNAL(textChanged(const TQString&)), this, TQ_SLOT(setText(const TQString&)) );
-
- vbox->addWidget( slider );
- vbox->addWidget( LCD );
- vbox->addWidget( edit );
- }
-
- TQString text() const
- {
- return edit->text();
- }
- int value() const
- {
- return slider->value();
- }
-
- signals:
- void someSignal();
- void valueChanged(int);
- void textChanged(const TQString&);
-
- public slots:
- void setText( const TQString &string )
- {
- if ( !requestPropertyChange( "text" ) )
- return;
-
- edit->blockSignals( TRUE );
- edit->setText( string );
- edit->blockSignals( FALSE );
- emit someSignal();
- emit textChanged( string );
-
- propertyChanged( "text" );
- }
- void about()
- {
- TQMessageBox::information( this, "About TQSimpleAX", "This is a TQt widget, and this slot has been\n"
- "called through ActiveX/OLE automation!" );
- }
- void setValue( int i )
- {
- if ( !requestPropertyChange( "value" ) )
- return;
- slider->blockSignals( TRUE );
- slider->setValue( i );
- slider->blockSignals( FALSE );
- LCD->display( i );
- emit valueChanged( i );
-
- propertyChanged( "value" );
- }
-
- private:
- TQSlider *slider;
- TQLCDNumber *LCD;
- TQLineEdit *edit;
- };
-
- TQAXFACTORY_DEFAULT(TQSimpleAX,
- "{DF16845C-92CD-4AAB-A982-EB9840E74669}",
- "{616F620B-91C5-4410-A74E-6B81C76FFFE0}",
- "{E1816BBA-BF5D-4A31-9855-D6BA432055FF}",
- "{EC08F8FC-2754-47AB-8EFE-56A54057F34E}",
- "{A095BA0C-224F-4933-A458-2DD7F6B85D8F}")
-
-
- <object ID="TQSimpleAX" CLASSID="CLSID:DF16845C-92CD-4AAB-A982-EB9840E74669"
- CODEBASE=http://www.trolltech.com/demos/simpleax.cab>
- <PARAM NAME="text" VALUE="A simple control">
- <PARAM NAME="value" VALUE="1">
- [Object not available! Did you forget to build and register the server?]
- </object>
-
- <FORM>
- <INPUT TYPE="BUTTON" VALUE="About..." onClick="TQSimpleAX.about()">
- </FORM>
-
- <object ID="Calendar" CLASSID="CLSID:8E27C92B-1264-101C-8A2F-040224009C02">
- [Standard Calendar control not available!]
- <PARAM NAME="day" VALUE="1">
- </object>
-
- <SCRIPT LANGUAGE=VBScript>
- Sub Calendar_Click()
- MsgBox( "Calendar Clicked!" )
- End Sub
-
- Sub TQSimpleAX_TextChanged( str )
- document.title = str
- End Sub
- </SCRIPT>
- <SCRIPT LANGUAGE=JavaScript>
- function TQSimpleAX::ValueChanged( Newvalue )
- {
- Calendar.Day = Newvalue;
- }
- </SCRIPT>
-
- Copyright © 2007
-Trolltech Trademarks
-
-
-
-
-Home
- |
-All Classes
- |
-Main Classes
- |
-Annotated
- |
-Grouped Classes
- |
-Functions
-
-A TQt example as a scriptable ActiveX control (executable)
-
-
-
-This example shows how to turn an existing TQt application
-into an ActiveX control server. The ActiveX control is based
-on the TQt tetrix example.
- #include "qtetrax.h"
- #include "qdragapp.h"
- #include "ntqfont.h"
-
- #include <qaxfactory.h>
-
- TQAXFACTORY_DEFAULT( TQTetrax,
- "{852558AD-CBD6-4f07-844C-D1E8983CD6FC}",
- "{2F5D0068-772C-4d1e-BCD2-D3F6BC7FD315}",
- "{769F4820-9F28-490f-BA50-5545BD381DCB}",
- "{5753B1A8-53B9-4abe-8690-6F14EC5CA8D0}",
- "{DE2F7CE3-CFA7-4938-A9FC-867E2FEB63BA}" )
-
The main entry point method instantiates a TQApplication object, and
-creates the GUI only if the program is not running as an ActiveX server (ie.
-the program has been started by the user, not by COM).
- int main( int argc, char **argv )
- {
- TQApplication::setColorSpec( TQApplication::CustomColor );
- TQDragApplication a(argc,argv);
-
- TQTetrax *tetrax = 0;
- if ( !TQAxFactory::isServer() ) {
- tetrax = new TQTetrax;
- tetrax->setCaption("Tetrax");
- a.setMainWidget(tetrax);
- tetrax->setCaption("TQt Example - Tetrax");
- tetrax->show();
- }
-
The server enters the application event loop, and destroys the GUI before exiting.
- int res = a.exec();
- delete tetrax;
- return res;
- }
-
-
- <object ID="TQTetrax" width=550 height=370
- CLASSID="CLSID:852558AD-CBD6-4f07-844C-D1E8983CD6FC"
- CODEBASE=http://www.trolltech.com/demos/tetrax.cab>
- <PARAM NAME="score" VALUE="0">
- [Object not available! Did you forget to build and register the server?]
- </object>
-
An HTML button is added to start the game.
- <form>
- <input type="button" value="Start Game..."
- onClick="TQTetrax.startGame()">
- </form>
-
And an event handler for the gameOver() event is implemented in JavaScript
-to display a simple message box.
- <SCRIPT LANGUAGE=JavaScript>
- function TQTetrax::gameOver()
- {
- alert( "GameOver!" );
- }
- </SCRIPT>
-
- Copyright © 2007
-Trolltech Trademarks
-
-
-
-
-Home
- |
-All Classes
- |
-Main Classes
- |
-Annotated
- |
-Grouped Classes
- |
-Functions
-
-Standard TQt widgets as ActiveX controls (in-process)
-
-
-
-The ActiveX controls in this example are the standard button
-classes TQPushButton, TQCheckBox and TQRadioButton as provided by
-TQt.
- class ActiveTQtFactory : public TQAxFactory
- {
- public:
- ActiveTQtFactory( const TQUuid &lib, const TQUuid &app )
- : TQAxFactory( lib, app )
- {}
- TQStringList featureList() const
- {
- TQStringList list;
- list << "TQButton";
- list << "TQCheckBox";
- list << "TQRadioButton";
- list << "TQPushButton";
- list << "TQToolButton";
- return list;
- }
- TQWidget *create( const TQString &key, TQWidget *parent, const char *name )
- {
- if ( key == "TQButton" )
- return new TQButton( parent, name );
- if ( key == "TQCheckBox" )
- return new TQCheckBox( parent, name );
- if ( key == "TQRadioButton" )
- return new TQRadioButton( parent, name );
- if ( key == "TQPushButton" )
- return new TQPushButton( parent, name );
- if ( key == "TQToolButton" ) {
- TQToolButton *tb = new TQToolButton( parent, name );
- tb->setPixmap( TQPixmap(fileopen) );
- return tb;
- }
-
- return 0;
- }
- TQMetaObject *metaObject( const TQString &key ) const
- {
- if ( key == "TQButton" )
- return TQButton::staticMetaObject();
- if ( key == "TQCheckBox" )
- return TQCheckBox::staticMetaObject();
- if ( key == "TQRadioButton" )
- return TQRadioButton::staticMetaObject();
- if ( key == "TQPushButton" )
- return TQPushButton::staticMetaObject();
- if ( key == "TQToolButton" )
- return TQToolButton::staticMetaObject();
-
- return 0;
- }
- TQUuid classID( const TQString &key ) const
- {
- if ( key == "TQButton" )
- return "{23F5012A-7333-43D3-BCA8-836AABC61B4A}";
- if ( key == "TQCheckBox" )
- return "{6E795DE9-872D-43CF-A831-496EF9D86C68}";
- if ( key == "TQRadioButton" )
- return "{AFCF78C8-446C-409A-93B3-BA2959039189}";
- if ( key == "TQPushButton" )
- return "{2B262458-A4B6-468B-B7D4-CF5FEE0A7092}";
- if ( key == "TQToolButton" )
- return "{7c0ffe7a-60c3-4666-bde2-5cf2b54390a1}";
-
- return TQUuid();
- }
- TQUuid interfaceID( const TQString &key ) const
- {
- if ( key == "TQButton" )
- return "{6DA689FB-928F-423C-8632-678C3D3606DB}";
- if ( key == "TQCheckBox" )
- return "{4FD39DD7-2DE0-43C1-A8C2-27C51A052810}";
- if ( key == "TQRadioButton" )
- return "{7CC8AE30-206C-48A3-A009-B0A088026C2F}";
- if ( key == "TQPushButton" )
- return "{06831CC9-59B6-436A-9578-6D53E5AD03D3}";
- if ( key == "TQToolButton" )
- return "{6726080f-d63d-4950-a366-9bf33e5cdf84}";
-
- return TQUuid();
- }
- TQUuid eventsID( const TQString &key ) const
- {
- if ( key == "TQButton" )
- return "{73A5D03F-8ADE-4D84-9AE0-A93B4F85A130}";
- if ( key == "TQCheckBox" )
- return "{FDB6FFBE-56A3-4E90-8F4D-198488418B3A}";
- if ( key == "TQRadioButton" )
- return "{73EE4860-684C-4A66-BF63-9B9EFFA0CBE5}";
- if ( key == "TQPushButton" )
- return "{3CC3F17F-EA59-4B58-BBD3-842D467131DD}";
- if ( key == "TQToolButton" )
- return "{f4d421fd-4ead-4fd9-8a25-440766939639}";
-
- return TQUuid();
- }
- };
-
The factory implementation returns the list of supported controls,
-creates controls on request and provides information about the unique
-IDs of the COM classes and interfaces for each control.
- TQAXFACTORY_EXPORT( ActiveTQtFactory, "{3B756301-0075-4E40-8BE8-5A81DE2426B7}", "{AB068077-4924-406a-BBAF-42D91C8727DD}" )
-
The factory is exported using the TQAXFACTORY_EXPORT macro.
-
- <SCRIPT LANGUAGE=VBScript>
- Sub ToolButton_Clicked()
- RadioButton.text = InputBox( "Enter something", "Wrapper Demo" )
- End Sub
-
- Sub PushButton_clicked()
- MsgBox( "Thank you!" )
- End Sub
-
- Sub CheckBox_toggled( state )
- if state = 0 then
- CheckBox.text = "Check me!"
- else
- CheckBox.text = "Uncheck me!"
- end if
- End Sub
- </SCRIPT>
- <p>
- A TQPushButton:<br>
- <object ID="PushButton" CLASSID="CLSID:2B262458-A4B6-468B-B7D4-CF5FEE0A7092"
- CODEBASE=http://www.trolltech.com/demos/wrapperax.cab>
- <PARAM NAME="text" VALUE="Click me!">
- [Object not available! Did you forget to build and register the server?]
- </object><br>
-
- <p>
- A TQCheckBox:<br>
- <object ID="CheckBox" CLASSID="CLSID:6E795de9-872d-43cf-a831-496ef9d86c68"
- CODEBASE=http://www.trolltech.com/demos/wrapperax.cab>
- <PARAM NAME="text" VALUE="Check me!">
- [Object not available! Did you forget to build and register the server?]
- </object><br>
-
- <p>
- A TQToolButton:<br>
- <object ID="ToolButton" CLASSID="CLSID:7c0ffe7a-60c3-4666-bde2-5cf2b54390a1"
- CODEBASE=http://www.trolltech.com/demos/wrapperax.cab>
- [Object not available! Did you forget to build and register the server?]
- </object><br>
-
- <p>
- A TQRadioButton:<br>
- <object ID="RadioButton" CLASSID="CLSID:afcf78c8-446c-409a-93b3-ba2959039189"
- CODEBASE=http://www.trolltech.com/demos/wrapperax.cab>
- <PARAM NAME="text" VALUE="Tune me!">
- [Object not available! Did you forget to build and register the server?]
- </object><br>
-
- Copyright © 2007
-Trolltech Trademarks
-
-
-
-
-Home
- |
-All Classes
- |
-Main Classes
- |
-Annotated
- |
-Grouped Classes
- |
-Functions
-
-The TQAxServer Examples
-
-
-
-The following example programs illustrate the development of ActiveX
-controls using the the TQAxServer module.
-
- Copyright © 2007
-Trolltech Trademarks
-
-
-
-
-Home
- |
-All Classes
- |
-Main Classes
- |
-Annotated
- |
-Grouped Classes
- |
-Functions
-
-The TQAxServer Module
-
-
-
-
-
-
- Introduction
-
-
-
- Building the library
-
- Using the library
-
-
- TEMPLATE = app
- CONFIG += qt activeqt
-
- RC_FILE = qaxserver.rc
- ...
-
-
-
- TEMPLATE = lib
- CONFIG += qt activeqt dll
-
- DEF_FILE = qaxserver.def
- RC_FILE = qaxserver.rc
- ...
-
-
-
-
-
- TEMPLATE = lib
- VERSION = 2.5
- ...
-
-
-The version number specified will be used as the version of the type
-library and of the server when registering.
- Out-of-process vs. In-process
-
- The TQAxServer build system
-
-
-
- Typical build problems
-
- Compiler errors
-
- "No overloaded function takes 2 parameters"
-
-
- MyFactory( const TQUuid &, const TQUuid & );
-
-
-for your factory class.
- "syntax error: bad suffix on number"
-
- Linker errors
-
- "unresolved external symbol _ucm_instantiate"
-
- "_ucm_initialize already defined in ..."
-
- "cannot open file ... "
-
- Postprocessing and runtime errors
-
-
-
-
-
- The server executable crashes
-
- The server executable is not a valid Win32 application
-
- "Unable to Locate DLL"
-
- The Server does not respond
-
- The Object cannot be created
-
- Debugging runtime errors
-
- Implementing Controls
-
-
- #include <tqwidget.h>
-
- class MyActiveX : public TQWidget
- {
- TQ_OBJECT
-
-
-
- TQ_PROPERTY( int value READ value WRITE setValue )
-
-
-
- public:
- MyActiveX( TQWidget *parent = 0, const char *name = 0 )
- ...
-
- int value() const;
-
- public slots:
- void setValue( int );
- ...
-
- signals:
- void valueChange( int );
- ...
-
- };
-
-
- Data Types
-
-
-
- TQt data type
- COM property
-
- bool
- VARIANT_BOOL
-
- TQString
- BSTR
-
- TQCString
- BSTR
-
- int
- int
-
- uint
- unsigned int
-
- double
- double
-
- TQ_LLONG
- CY
-
- TQ_ULLONG
- CY
-
- TQColor
- OLE_COLOR
-
- TQDate
- DATE
-
- TQDateTime
- DATE
-
- TQTime
- DATE
-
- TQFont
- IFontDisp*
-
- TQPixmap
- IPictureDisp*
-(2)
-
- TQVariant
- VARIANT
-
- TQValueList<TQVariant>
- SAFEARRAY(VARIANT)
-
- TQStringList
- SAFEARRAY(BSTR)
-
- TQByteArray
- SAFEARRAY(BYTE)
-
- TQRect
- User defined type
-
- TQSize
- User defined type
-
- TQPoint
- User defined type
-
-
- TQt data type
- COM parameter
-
- bool
- [in] VARIANT_BOOL
-
- bool&
- [in, out] VARIANT_BOOL*
-
- TQString, const TQString&
- [in] BSTR
-
- TQString&
- [in, out] BSTR*
-
- TQCString, const TQCString&
- [in] BSTR
-
- TQString&
- [in, out] BSTR*
-
- int
- [in] int
-
- int&
- [in,out] int
-
- uint
- [in] unsigned int
-
- uint&
- [in, out] unsigned int*
-
- double
- [in] double
-
- double&
- [in, out] double*
-
- TQColor, const TQColor&
- [in] OLE_COLOR
-
- TQColor&
- [in, out] OLE_COLOR*
-
- TQDate, const TQDate&
- [in] DATE
-
- TQDate&
- [in, out] DATE*
-
- TQDateTime, const TQDateTime&
- [in] DATE
-
- TQDateTime&
- [in, out] DATE*
-
- TQFont, const TQFont&
- [in] IFontDisp*
-
- TQFont&
- [in, out] IFontDisp**
-
- TQPixmap, const TQPixmap&
- [in] IPictureDisp*
-
- TQPixmap&
- [in, out] IPictureDisp**
-
- TQValueList<TQVariant>, const TQValueList<TQVariant>&
- [in] SAFEARRAY(VARIANT)
-
- TQValueList<TQVariant>&
- [in, out] SAFEARRAY(VARIANT)*
-
- TQStringList, const TQStringList&
- [in] SAFEARRAY(BSTR)
-
- TQStringList&
- [in, out] SAFEARRAY(BSTR)*
-
- TQByteArray, const TQByteArray&
- [in] SAFEARRAY(BYTE)
-
- TQByteArray&
- [in, out] SAFEARRAY(BYTE)*
-
- TQObject*
- [in] IDispatch*
-
- TQRect&
-(3)
- [in, out] struct TQRect (user defined)
-
- TQSize&
- [in, out] struct TQSize (user defined)
-
- TQPoint&
- [in, out] struct TQPoint (user defined)
- Sub-Objects
-
- Property Notification
-
-
- #include <tqwidget.h>
- #include <qaxbindable.h>
-
- class MyActiveX : public TQWidget, public TQAxBindable
- {
- TQ_OBJECT
-
-
-When implementing the property write functions, use the
-TQAxBindable class's requestPropertyChange() and propertyChanged()
-functions to allow ActiveX clients to bind to the control
-properties.
-(4)
- Serving Controls
-
-
- TQAXFACTORY_DEFAULT ( MyActiveX,
- "{ad90301a-849e-4e8b-9a91-0a6dc5f6461f}",
- "{87a5b65e-7fa9-4dc6-a176-47295988dcbd}",
- "{a6130ae9-8327-47ec-815b-d0b45a0d6e5e}",
- "{26c4e136-4e23-4347-af37-faf933b027e9}",
- "{a8f21901-7ff7-4f6a-b939-789620c03d83}" )
-
-
-
- #include <ntqapplication.h>
- #include <qaxfactory.h>
-
- int main( int argc, char **argv )
- {
- TQApplication app( argc, argv );
- if ( !TQAxFactory::isServer() ) {
- // create and show main window...
- }
- return app.exec();
- }
-
-
-This is however not necessary as ActiveTQt provides a default implementation
-of a main function. The default implemenation calls TQAxFactory::startServer(),
-creates a TQApplication instance and calls exec().
-
-
Option Result
- -regserver Registers the server in the system registry
- -unregserver Unregisters the server from the system registry
- -activex Starts the application as an ActiveX server
- -dumpidl <file> -version x.y Writes the server's IDL to the
-specified file. The type library will have version x.y
- Distributing TQAxServer binaries
-
- Installing stand-alone Servers
-
- Installing In-process Servers
-
-
- HMODULE dll = LoadLibrary( "myserver.dll" );
- typedef HRESULT(__stdcall *DllRegisterServerProc)();
- DllRegisterServerProc DllRegisterServer =
- (DllRegisterServerProc)GetProcAddress( dll, "DllRegisterServer" );
-
- HRESULT res = E_FAIL;
- if ( DllRegisterServer )
- res = DllRegisterServer();
- if ( res != S_OK )
- // error handling
-
-
- Distributing Servers over the Internet
-
- [version]
- signature="$CHICAGO$"
- AdvancedINF=2.0
- [Add.Code]
- simpleax.exe=simpleax.exe
- [simpleax.exe]
- file-win32-x86=thiscab
- clsid={DF16845C-92CD-4AAB-A982-EB9840E74669}
- RegisterServer=yes
-
- cabarc N simpleax.cab simpleax.exe simple.inf
-
- Using the Controls
-
-
- <object ID="MyActiveX1" CLASSID="CLSID:ad90301a-849e-4e8b-9a91-0a6dc5f6461f">
- ...
- <\object>
-
-
-
- <object ID=...>
- <param name="name" value="value">
- <\object>
-
-
- Supported and Unsupported ActiveX clients
-
- Supported Clients
-
-
-
- Unsupported Clients
-
-
-
- Enhanced features
-
- Fewer methods and properties
-
-
- TQString MyFactory::exposeToSuperClass( const TQString &key ) const
- {
- if ( key == "SmallActiveX" )
- return key;
- return TQAxFactory::exposeToSuperClass( key );
- }
-
-
- Class Information and Tuning
-
-
-
- Key
- Meaning of value
-
- Version
- The version of the class (1.0 is default)
-
- Description
- A string describing the class.
-
- ClassID
- The class ID.
-You must reimplement TQAxFactory::classID if not specified.
-
- InterfaceID
- The interface ID.
-You must reimplement TQAxFactory::interfaceID if not specified.
-
- EventsID
- The event interface ID.
-No signals are exposed as COM events if not specified.
-
- DefaultProperty
- The property specified represents the default property of this class.
-Ie. the default property of a push button would be "text".
-
- DefaultSignal
- The signal specified respresents the default signal of this class.
-Ie. the default signal of a push button would be "clicked".
-
- LicenseKey
- Object creation requires the specified license key. The key can be
-empty to require a licensed machine. By default classes are not
-licensed. Also see the following section.
-
- StockEvents
- Objects expose stock events if value is "yes".
-See TQAxFactory::hasStockEvents()
-
- ToSuperClass
- Objects expose functionality of all super classes up to and
-including the class name in value.
-See TQAxFactory::exposeToSuperClass()
-
- Insertable
- If the value is "yes" the class is registered to be "Insertable"
-and will be listed in OLE 2 containers (ie. Microsoft Office). This
-attribute is not be set by default.
-
- Aggregatable
- If the value is "no" the class does not support aggregation. By
-default aggregation is supported.
-
- Creatable
- If the value is "no" the class cannot be created by the client,
-and is only available through the API of another class (ie. the
-class is a sub-type).
-
- RegisterObject
- If the value is "yes" objects of this class are registered with
-OLE and accessible from the running object table (ie. clients
-can connect to an already running instance of this class). This
-attribute is only supported in out-of-process servers.
-
- class MyActiveX : public TQWidget
- {
- TQ_OBJECT
- TQ_CLASSINFO("Version", "2.0")
- TQ_CLASSINFO("ClassID", "{7a4cffd8-cbcd-4ae9-ae7e-343e1e5710df}")
- TQ_CLASSINFO("InterfaceID", "{6fb035bf-8019-48d8-be51-ef05427d8994}")
- TQ_CLASSINFO("EventsID", "{c42fffdf-6557-47c9-817a-2da2228bc29c}")
- TQ_CLASSINFO("Insertable", "yes")
- TQ_CLASSINFO("ToSuperClass", "MyActiveX")
-
- TQ_PROPERTY( ...
- public:
- MyActiveX(TQWidget *parent = 0, const char *name = 0);
-
- ...
- };
-
-
- Developing licensed components
-
-
- class MyLicensedControl : public TQWidget
- {
- TQ_OBJECT
- TQ_CLASSINFO("LicenseKey", "<key string>")
- ...
- };
-
-
-The key is required to be able to create an instance of MyLicensedControl
-on a machine that is not licensed itself. The licensed developer can now
-redistributes the server binary with his application, which creates the control
-using the value of "LicenseKey", while users of the application cannot create
-the control without the license key.
- More Interfaces
-
-
- class AxImpl : public TQAxAggregated, public ISomeCOMInterface
- {
- public:
- AxImpl() {}
-
- long queryInterface( const TQUuid &iid, void **iface );
-
- // IUnknown
- TQAXAGG_IUNKNOWN
-
- // ISomeCOMInterface
- ...
- }
-
-
-
- long AxImpl::queryInterface( const TQUuid &iid, void **iface )
- {
- *iface = 0;
- if ( iid == IID_ISomeCOMInterface )
- *iface = (ISomeCOMInterface*)this;
- else
- return E_NOINTERFACE;
-
- AddRef();
- return S_OK;
- }
-
-
-
- HRESULT AxImpl::QueryInterface( REFIID iid, void **iface )
- {
- return controllingUnknown()->QueryInterface( iid, iface );
- }
-
-
-Do not support the IUnknown interface itself in your queryInterface()
-implementation.
-
- class MyActiveX : public TQWidget,
- public TQAxBindable
- {
- TQ_OBJECT
- public:
- MyActiveX( TQWidget *parent, const char *name = 0 );
-
- TQAxAggregated *createAggregate()
- {
- return new AxImpl();
- }
-
- };
-
-
-
-
-
-
-
- Copyright © 2007
-Trolltech Trademarks
-
-
-
-
-Home
- |
-All Classes
- |
-Main Classes
- |
-Annotated
- |
-Grouped Classes
- |
-Functions
-
-qaxwidget.h
-
-
-
-/****************************************************************************
-** $Id: qt/qaxwidget.h 3.3.8 edited Jan 11 14:46 $
-**
-** Declaration of the TQAxWidget class
-**
-** Copyright (C) 2001-2007 Trolltech ASA. All rights reserved.
-**
-** This file is part of the Active TQt integration.
-**
-** Licensees holding valid TQt Enterprise Edition
-** licenses for Windows may use this file in accordance with the TQt Commercial
-** License Agreement provided with the Software.
-**
-** This file is not available for use under any other license without
-** express written permission from the copyright holder.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about TQt Commercial License Agreements.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
-#ifndef TQAXWIDGET_H
-#define TQAXWIDGET_H
-
-#include "qaxbase.h"
-#include <tqwidget.h>
-
-class TQAxHostWindow;
-
-class TQAxWidget : public TQWidget, public TQAxBase
-{
-public:
- TQMetaObject *metaObject() const;
- const char *className() const;
- void* tqt_cast( const char* );
- bool tqt_invoke( int, TQUObject* );
- bool tqt_emit( int, TQUObject* );
- bool tqt_property( int, int, TQVariant* );
- TQObject* qObject() { return (TQObject*)this; }
-
- TQAxWidget( TQWidget* parent = 0, const char* name = 0, WFlags f = 0 );
- TQAxWidget( const TQString &c, TQWidget *parent = 0, const char *name = 0, WFlags f = 0 );
- TQAxWidget( IUnknown *iface, TQWidget *parent = 0, const char *name = 0, WFlags f = 0 );
- ~TQAxWidget();
-
- void clear();
-
- TQSize sizeHint() const;
- TQSize minimumSizeHint() const;
-
-protected:
- bool initialize( IUnknown** );
- virtual bool createHostWindow( bool );
-
- void enabledChange( bool old );
- void paletteChange( const TQPalette &old );
- void fontChange( const TQFont &old );
- void windowActivationChange( bool old );
-
- void resizeEvent( TQResizeEvent * );
- virtual bool translateKeyEvent(int message, int keycode) const;
-private:
- friend class TQAxHostWindow;
-
- TQMetaObject *parentMetaObject() const;
-
- TQAxHostWindow *container;
-};
-
-#endif // TQAXWIDGET_H
-
-
-
- Copyright © 2007
-Trolltech Trademarks
-
-
-
-
-Home
- |
-All Classes
- |
-Main Classes
- |
-Annotated
- |
-Grouped Classes
- |
-Functions
-
-Complete Member List for TQAxWidget
-
-
-
-
-
- Copyright © 2007
-Trolltech Trademarks
-
-
-
-
-Home
- |
-All Classes
- |
-Main Classes
- |
-Annotated
- |
-Grouped Classes
- |
-Functions
-
-TQAxWidget Class Reference
-
-
[TQAxContainer module]Public Members
-
-
-Important Inherited Members
-
-
-Protected Members
-
-
-Detailed Description
-Member Function Documentation
-TQAxWidget::TQAxWidget ( TQWidget * parent = 0, const char * name = 0, WFlags f = 0 )
-
-Creates an empty TQAxWidget widget and propagates parent, name and f to the TQWidget constructor. To initialize a control,
-call setControl.
-
-TQAxWidget::TQAxWidget ( const TQString & c, TQWidget * parent = 0, const char * name = 0, WFlags f = 0 )
-
-Creates an TQAxWidget widget and initializes the ActiveX control c.
-parent, name and f are propagated to the TQWidget contructor.
-TQAxWidget::TQAxWidget ( IUnknown * iface, TQWidget * parent = 0, const char * name = 0, WFlags f = 0 )
-
-Creates a TQAxWidget that wraps the COM object referenced by iface.
-parent, name and f are propagated to the TQWidget contructor.
-
-TQAxWidget::~TQAxWidget ()
-
-Shuts down the ActiveX control and destroys the TQAxWidget widget,
-cleaning up all allocated resources.
-bool TQAxWidget::createHostWindow ( bool initialized ) [virtual protected]
-
-Creates the client site for the ActiveX control, and returns TRUE if
-the control could be embedded successfully, otherwise returns FALSE.
-If initialized is TRUE the control has already been initialized.
-TQVariant TQAxBase::dynamicCall ( const TQCString & function, const TQVariant & var1 = TQVariant ( ), const TQVariant & var2 = TQVariant ( ), const TQVariant & var3 = TQVariant ( ), const TQVariant & var4 = TQVariant ( ), const TQVariant & var5 = TQVariant ( ), const TQVariant & var6 = TQVariant ( ), const TQVariant & var7 = TQVariant ( ), const TQVariant & var8 = TQVariant ( ) )
-
-Calls the COM object's method function, passing the
-parameters var1, var1, var2, var3, var4, var5,
-var6, var7 and var8, and returns the value returned by
-the method, or an invalid TQVariant if the method does not return
-a value or when the function call failed.
-
- activeX->dynamicCall( "Navigate(const TQString&)", "www.trolltech.com" );
-
-
-
- activeX->dynamicCall("Navigate(\"www.trolltech.com\");
-
-
-All parameters are passed as strings; it depends on the control whether
-they are interpreted correctly, and is slower than using the prototype
-with correctly typed parameters.
-
- activeX->dynamicCall( "Value", 5 );
- TQString text = activeX->dynamicCall( "Text" ).toString();
-
-
-Note that it is faster to get and set properties using
-TQObject::property() and TQObject::setProperty().
-
- IWebBrowser2 *webBrowser = 0;
- activeX->queryInterface( IID_IWebBrowser2, (void**)&webBrowser );
- if ( webBrowser ) {
- webBrowser->Navigate2( pvarURL );
- webBrowser->Release();
- }
-
-
-TQVariant TQAxBase::dynamicCall ( const TQCString & function, TQValueList<TQVariant> & vars )
-
-This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
-TQAxObject * TQAxBase::querySubObject ( const TQCString & name, const TQVariant & var1 = TQVariant ( ), const TQVariant & var2 = TQVariant ( ), const TQVariant & var3 = TQVariant ( ), const TQVariant & var4 = TQVariant ( ), const TQVariant & var5 = TQVariant ( ), const TQVariant & var6 = TQVariant ( ), const TQVariant & var7 = TQVariant ( ), const TQVariant & var8 = TQVariant ( ) )
-
-Returns a pointer to a TQAxObject wrapping the COM object provided
-by the method or property name, passing passing the parameters
-var1, var1, var2, var3, var4, var5, var6,
-var7 and var8.
-
- TQAxWidget outlook( "Outlook.Application" );
- TQAxObject *session = outlook.querySubObject( "Session" );
- if ( session ) {
- TQAxObject *defFolder = session->querySubObject(
- "GetDefaultFolder(OlDefaultFolders)",
- "olFolderContacts" );
- //...
- }
-
-
-
-bool TQAxWidget::translateKeyEvent ( int message, int keycode ) const [virtual protected]
-
-Reimplement this function to pass certain key events to the
-ActiveX control. message is the Window message identifier
-specifying the message type (ie. WM_KEYDOWN), and keycode is
-the virtual keycode (ie. VK_TAB).
-
-
- WM_SYSKEYDOWN
- WM_SYSKEYUP
- WM_KEYDOWN
-
- All keycodes
- VK_MENU
- VK_TAB, VK_DELETE and all non-arrow-keys in combination with VK_SHIFT,
-VK_CONTROL or VK_MENU
-
- Copyright © 2007
-Trolltech Trademarks
- TQSize TQGridLayout::sizeHint () const [virtual]
Returns the preferred size of this grid.
diff --git a/doc/html/qlistviewitem.html b/doc/html/qlistviewitem.html
index 7c73a18c..7d30fa0a 100644
--- a/doc/html/qlistviewitem.html
+++ b/doc/html/qlistviewitem.html
@@ -567,7 +567,7 @@ and colors cg.
Returns the parent of this item, or 0 if this item has no parent.
const TQPixmap * TQListViewItem::pixmap ( int column ) const [virtual]
Returns the pixmap for column, or 0 if there is no pixmap for
@@ -694,7 +694,7 @@ text.
void TQListViewItem::setVisible ( bool b )
If b is TRUE, the item is made visible; otherwise it is hidden.
diff --git a/doc/html/qt.dcf b/doc/html/qt.dcf
index 08728527..09f47100 100644
--- a/doc/html/qt.dcf
+++ b/doc/html/qt.dcf
@@ -346,146 +346,6 @@
-Public Members
@@ -203,7 +203,7 @@ Blocks signals if block is TRUE, or unblocks signals if block
Note that the destroyed() signals will be emitted even if the signals
for this object have been blocked.
-
bool TQObject::checkConnectArgs ( const char * signal, const TQObject * receiver, const char * member ) [virtual protected]
@@ -728,7 +728,6 @@ Returns the value of the object's name property.
the metaObject().
TQObjectList * TQObject::queryList ( const char * inheritsClass = 0, const char * objName = 0, bool regexpMatch = TRUE, bool recursiveSearch = TRUE ) const
Searches the children and optionally grandchildren of this object,
@@ -816,7 +815,6 @@ FALSE.
metaObject().
bool TQObject::signalsBlocked () const
diff --git a/doc/html/tqstring.html b/doc/html/tqstring.html
index 353f7216..478935b9 100644
--- a/doc/html/tqstring.html
+++ b/doc/html/tqstring.html
@@ -2206,7 +2206,6 @@ if the string is not null; otherwise returns zero.
const TQChar * TQString::unicode () const
diff --git a/doc/html/tqwidget.html b/doc/html/tqwidget.html
index 964ee839..d841575e 100644
--- a/doc/html/tqwidget.html
+++ b/doc/html/tqwidget.html
@@ -35,7 +35,7 @@ body { background: #ffffff; color: black; }
More...
Public Members
@@ -1243,7 +1243,7 @@ Hides the widget.
do something after a widget is hidden, use hideEvent() instead.
void TQWidget::hideEvent ( TQHideEvent * ) [virtual protected]
diff --git a/doc/html/whatsthis b/doc/html/whatsthis
index 45f01294..8558157a 100644
--- a/doc/html/whatsthis
+++ b/doc/html/whatsthis
@@ -2,7 +2,6 @@
2D transformations of a coordinate system. | QWMatrix
Abstract base class for accessing SQL databases. | TQSqlDriver
Abstract base class for custom menu items in popup menus. | QCustomMenuItem
-Abstract base class for implementations of additional COM interfaces. | QAxAggregated
Abstract base class of internal layout iterators. | QGLayoutIterator
Abstract base for Qt/Embedded graphics driver plugins. | QGfxDriverPlugin
Abstract base for Qt/Embedded keyboard driver plugins. | QKbdDriverPlugin
@@ -13,7 +12,6 @@ Abstract base for custom TQTextCodec plugins. | TQTextCodecPlugin
Abstract base for custom TQWidget plugins. | TQWidgetPlugin
Abstract base for custom image format plugins. | TQImageFormatPlugin
Abstract base for fixed-size grids. | QGridView
-Abstract class that provides an API to initalize and access a COM object. | QAxBase
Abstract graphic object on a TQCanvas. | TQCanvasItem
Abstract interface for accessing data from SQL databases. | TQSqlResult
Abstract item that a QLayout manipulates. | QLayoutItem
@@ -46,7 +44,6 @@ Base class for QMenuBar and QPopupMenu. | QMenuData
Base class for implementing TQTextEdit syntax highlighters. | QSyntaxHighlighter
Basic functions for reading and writing text using a TQIODevice. | TQTextStream
Blank space in a layout. | QSpacerItem
-Bridge between application objects and script code. | QAxScriptManager
Browsing and editing of SQL tables and views. | TQSqlCursor
Browsing of general SQL SELECT statements. | TQSqlSelectCursor
Buffered TCP connection. | QSocket
@@ -100,7 +97,6 @@ Date editor. | QDateEdit
Date functions. | QDate
Default implementation of all the XML handler classes. | TQXmlDefaultHandler
Defines a Universally Unique Identifier (UUID). | QUuid
-Defines a factory for the creation of COM components. | QAxFactory
Defines a point in the plane. | QPoint
Defines a rectangle in the plane. | QRect
Defines an interface that exposes information about accessible objects. | QAccessibleInterface
@@ -189,7 +185,6 @@ Information about a paint device. | QPaintDeviceMetrics
Information about the features of the DOM implementation. | TQDomImplementation
Information about the fonts available in the underlying window system. | QFontDatabase
Integer value within a range. | QRangeControl
-Interface between a TQWidget and an ActiveX client. | QAxBindable
Interface for XML readers (i.e. parsers). | TQXmlReader
Interface to report DTD content of XML data. | TQXmlDTDHandler
Interface to report declaration content of XML data. | TQXmlDeclHandler
@@ -284,10 +279,8 @@ Polygonal canvas item on a TQCanvas. | TQCanvasPolygonalItem
Popup menu widget. | QPopupMenu
Powerful single-page rich text editor. | TQTextEdit
TQObject that is a web browser plugin. | QNPInstance
-TQObject that wraps a COM object. | QAxObject
TQPtrList of TQObjects. | TQObjectList
TQWidget that is a web browser plugin window. | QNPWidget
-TQWidget that wraps an ActiveX control. | QAxWidget
Quick-access button to commands or options, usually used inside a QToolBar. | QToolButton
Radio button with a text or pixmap label. | QRadioButton
Range checking of floating-point numbers. | QDoubleValidator
@@ -410,7 +403,5 @@ Watches the lifetime of multiple TQObjects. | TQObjectCleanupHandler
Widget for rendering OpenGL graphics. | QGLWidget
Widget which can be docked inside a QDockArea or floated as a top level window on the desktop. | QDockWindow
Workspace window that can contain decorated windows, e.g. for MDI. | QWorkspace
-Wrapper around a script engine. | QAxScriptEngine
-Wrapper around script code. | QAxScript
Wrapper for handling shared libraries. | QLibrary
XML attributes. | TQXmlAttributes
diff --git a/doc/indices.doc b/doc/indices.doc
index 4e5ac260..dd139ad3 100644
--- a/doc/indices.doc
+++ b/doc/indices.doc
@@ -150,7 +150,6 @@ Licenses & Credits
\list
\i \link winsystem.html Window system specific notes\endlink
-\i \link activentqt.html ActiveQt Framework\endlink
\i \link motif-extension.html Motif Extension\endlink
\i \link mac-differences.html Mac OS X development\endlink
\i \link porting.html Porting from TQt 2.x to TQt 3.x\endlink
@@ -359,7 +358,6 @@ in a line-by-line coverage please refer to the tutorials
\section1 TQt Extensions: Assorted Examples
\list
-\i \link activeqt-examples.html ActiveX support extension \endlink
\i \link motif-examples.html QMotif support extension \endlink
\omit \i \link xt-motif-examples.html Xt/Motif support extension \endlink \endomit
\i \link nsplugin-examples.html Qt-based plugins for web browsers \endlink
@@ -569,11 +567,6 @@ These classes deal with shared libraries, (e.g. .so and DLL files),
and with TQt plugins.
See the \link plugins-howto.html plugins documentation\endlink.
-
-
-See also the \link activentqt.html ActiveQt framework\endlink for
-Windows.
-
*/
/*! \defgroup organizers
diff --git a/doc/man/man3/TQAxAggregated.3qt b/doc/man/man3/TQAxAggregated.3qt
deleted file mode 100644
index d05590c3..00000000
--- a/doc/man/man3/TQAxAggregated.3qt
+++ /dev/null
@@ -1 +0,0 @@
-.so man3/tqaxaggregated.3qt
diff --git a/doc/man/man3/TQAxBase.3qt b/doc/man/man3/TQAxBase.3qt
deleted file mode 100644
index 84be9769..00000000
--- a/doc/man/man3/TQAxBase.3qt
+++ /dev/null
@@ -1 +0,0 @@
-.so man3/tqaxbase.3qt
diff --git a/doc/man/man3/TQAxBindable.3qt b/doc/man/man3/TQAxBindable.3qt
deleted file mode 100644
index affde1f6..00000000
--- a/doc/man/man3/TQAxBindable.3qt
+++ /dev/null
@@ -1 +0,0 @@
-.so man3/tqaxbindable.3qt
diff --git a/doc/man/man3/TQAxFactory.3qt b/doc/man/man3/TQAxFactory.3qt
deleted file mode 100644
index c1881659..00000000
--- a/doc/man/man3/TQAxFactory.3qt
+++ /dev/null
@@ -1 +0,0 @@
-.so man3/tqaxfactory.3qt
diff --git a/doc/man/man3/TQAxObject.3qt b/doc/man/man3/TQAxObject.3qt
deleted file mode 100644
index f9979275..00000000
--- a/doc/man/man3/TQAxObject.3qt
+++ /dev/null
@@ -1 +0,0 @@
-.so man3/tqaxobject.3qt
diff --git a/doc/man/man3/TQAxScript.3qt b/doc/man/man3/TQAxScript.3qt
deleted file mode 100644
index 4e66e409..00000000
--- a/doc/man/man3/TQAxScript.3qt
+++ /dev/null
@@ -1 +0,0 @@
-.so man3/tqaxscript.3qt
diff --git a/doc/man/man3/TQAxScriptEngine.3qt b/doc/man/man3/TQAxScriptEngine.3qt
deleted file mode 100644
index 61f57d54..00000000
--- a/doc/man/man3/TQAxScriptEngine.3qt
+++ /dev/null
@@ -1 +0,0 @@
-.so man3/tqaxscriptengine.3qt
diff --git a/doc/man/man3/TQAxScriptManager.3qt b/doc/man/man3/TQAxScriptManager.3qt
deleted file mode 100644
index fdc82943..00000000
--- a/doc/man/man3/TQAxScriptManager.3qt
+++ /dev/null
@@ -1 +0,0 @@
-.so man3/tqaxscriptmanager.3qt
diff --git a/doc/man/man3/TQAxWidget.3qt b/doc/man/man3/TQAxWidget.3qt
deleted file mode 100644
index 5c02f767..00000000
--- a/doc/man/man3/TQAxWidget.3qt
+++ /dev/null
@@ -1 +0,0 @@
-.so man3/tqaxwidget.3qt
diff --git a/doc/man/man3/tqaxaggregated.3qt b/doc/man/man3/tqaxaggregated.3qt
deleted file mode 100644
index e963957c..00000000
--- a/doc/man/man3/tqaxaggregated.3qt
+++ /dev/null
@@ -1,143 +0,0 @@
-'\" t
-.TH QAxAggregated 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
-QAxAggregated \- Abstract base class for implementations of additional COM interfaces
-.SH SYNOPSIS
-This class is part of the \fBQt ActiveQt Extension\fR.
-.PP
-\fC#include