summaryrefslogtreecommitdiffstats
path: root/kexi/plugins/macros/lib
diff options
context:
space:
mode:
Diffstat (limited to 'kexi/plugins/macros/lib')
-rw-r--r--kexi/plugins/macros/lib/action.cpp54
-rw-r--r--kexi/plugins/macros/lib/action.h45
-rw-r--r--kexi/plugins/macros/lib/context.cpp52
-rw-r--r--kexi/plugins/macros/lib/context.h17
-rw-r--r--kexi/plugins/macros/lib/exception.cpp16
-rw-r--r--kexi/plugins/macros/lib/exception.h12
-rw-r--r--kexi/plugins/macros/lib/macro.cpp26
-rw-r--r--kexi/plugins/macros/lib/macro.h29
-rw-r--r--kexi/plugins/macros/lib/macroitem.cpp64
-rw-r--r--kexi/plugins/macros/lib/macroitem.h24
-rw-r--r--kexi/plugins/macros/lib/manager.cpp54
-rw-r--r--kexi/plugins/macros/lib/manager.h50
-rw-r--r--kexi/plugins/macros/lib/metamethod.cpp130
-rw-r--r--kexi/plugins/macros/lib/metamethod.h50
-rw-r--r--kexi/plugins/macros/lib/metaobject.cpp44
-rw-r--r--kexi/plugins/macros/lib/metaobject.h26
-rw-r--r--kexi/plugins/macros/lib/metaparameter.cpp36
-rw-r--r--kexi/plugins/macros/lib/metaparameter.h36
-rw-r--r--kexi/plugins/macros/lib/variable.cpp76
-rw-r--r--kexi/plugins/macros/lib/variable.h86
-rw-r--r--kexi/plugins/macros/lib/xmlhandler.cpp52
-rw-r--r--kexi/plugins/macros/lib/xmlhandler.h16
22 files changed, 499 insertions, 496 deletions
diff --git a/kexi/plugins/macros/lib/action.cpp b/kexi/plugins/macros/lib/action.cpp
index e2dc0b64..db5596b4 100644
--- a/kexi/plugins/macros/lib/action.cpp
+++ b/kexi/plugins/macros/lib/action.cpp
@@ -37,21 +37,21 @@ namespace KoMacro {
/**
* The name this @a Action has.
*/
- QString name;
+ TQString name;
/**
* The i18n-caption text this @a Action has.
*/
- QString text;
+ TQString text;
/**
* The comment the user is able to define for each action.
*/
- QString comment;
+ TQString comment;
/**
* A map of @a Variable instances this @a Action
- * provides accessible by there QString name.
+ * provides accessible by there TQString name.
*/
Variable::Map varmap;
@@ -60,14 +60,14 @@ namespace KoMacro {
* sorted order for the @a Variable instances
* defined in the map above.
*/
- QStringList varnames;
+ TQStringList varnames;
};
}
-Action::Action(const QString& name, const QString& text)
- : QObject()
+Action::Action(const TQString& name, const TQString& text)
+ : TQObject()
, KShared()
, d( new Private() ) // create the private d-pointer instance.
{
@@ -81,55 +81,55 @@ Action::Action(const QString& name, const QString& text)
Action::~Action()
{
- //kdDebug() << QString("Action::~Action() name=\"%1\"").arg(name()) << endl;
+ //kdDebug() << TQString("Action::~Action() name=\"%1\"").tqarg(name()) << endl;
// destroy the private d-pointer instance.
delete d;
}
-const QString Action::toString() const
+const TQString Action::toString() const
{
- return QString("Action:%1").arg(name());
+ return TQString("Action:%1").tqarg(name());
}
-const QString Action::name() const
+const TQString Action::name() const
{
return d->name;
}
-void Action::setName(const QString& name)
+void Action::setName(const TQString& name)
{
d->name = name;
}
-const QString Action::text() const
+const TQString Action::text() const
{
return d->text;
}
-void Action::setText(const QString& text)
+void Action::setText(const TQString& text)
{
d->text = text;
}
-const QString Action::comment() const
+const TQString Action::comment() const
{
return d->comment;
}
-void Action::setComment(const QString& comment)
+void Action::setComment(const TQString& comment)
{
d->comment = comment;
}
-bool Action::hasVariable(const QString& name) const
+bool Action::hasVariable(const TQString& name) const
{
- return d->varmap.contains(name);
+ return d->varmap.tqcontains(name);
}
-KSharedPtr<Variable> Action::variable(const QString& name) const
+KSharedPtr<Variable> Action::variable(const TQString& name) const
{
- return d->varmap.contains(name) ? d->varmap[name] : KSharedPtr<Variable>(0);
+ return d->varmap.tqcontains(name) ? d->varmap[name] : KSharedPtr<Variable>(0);
}
Variable::Map Action::variables() const
@@ -137,21 +137,21 @@ Variable::Map Action::variables() const
return d->varmap;
}
-QStringList Action::variableNames() const
+TQStringList Action::variableNames() const
{
return d->varnames;
}
void Action::setVariable(KSharedPtr<Variable> variable)
{
- const QString name = variable->name();
- if(! d->varmap.contains(name)) {
+ const TQString name = variable->name();
+ if(! d->varmap.tqcontains(name)) {
d->varnames.append(name);
}
- d->varmap.replace(name, variable);
+ d->varmap.tqreplace(name, variable);
}
-void Action::setVariable(const QString& name, const QString& text, const QVariant& variant)
+void Action::setVariable(const TQString& name, const TQString& text, const TQVariant& variant)
{
Variable* variable = new Variable(variant);
variable->setName(name);
@@ -159,9 +159,9 @@ void Action::setVariable(const QString& name, const QString& text, const QVarian
setVariable( KSharedPtr<Variable>(variable) );
}
-void Action::removeVariable(const QString& name)
+void Action::removeVariable(const TQString& name)
{
- if(d->varmap.contains(name)) {
+ if(d->varmap.tqcontains(name)) {
d->varmap.remove(name);
d->varnames.remove(name);
}
diff --git a/kexi/plugins/macros/lib/action.h b/kexi/plugins/macros/lib/action.h
index 5200c1a4..51e97869 100644
--- a/kexi/plugins/macros/lib/action.h
+++ b/kexi/plugins/macros/lib/action.h
@@ -25,9 +25,9 @@
#include "context.h"
#include "variable.h"
-#include <qobject.h>
+#include <tqobject.h>
#include <ksharedptr.h>
-#include <qstringlist.h>
+#include <tqstringlist.h>
namespace KoMacro {
@@ -36,26 +36,27 @@ namespace KoMacro {
* functionality KAction doesn't provide.
*/
class KOMACRO_EXPORT Action
- : public QObject // Qt functionality like signals and slots
+ : public TQObject // TQt functionality like signals and slots
, public KShared // shared reference-counting
{
Q_OBJECT
+ TQ_OBJECT
/// Property to get/set the name.
- Q_PROPERTY(QString name READ name WRITE setName)
+ TQ_PROPERTY(TQString name READ name WRITE setName)
/// Property to get/set the text.
- Q_PROPERTY(QString text READ text WRITE setText)
+ TQ_PROPERTY(TQString text READ text WRITE setText)
/// Property to get/set the comment.
- Q_PROPERTY(QString comment READ comment WRITE setComment)
+ TQ_PROPERTY(TQString comment READ comment WRITE setComment)
public:
/**
* Shared pointer to implement reference-counting.
*/
- typedef QMap<QString, KSharedPtr<Action> > Map;
+ typedef TQMap<TQString, KSharedPtr<Action> > Map;
/**
* Constructor.
@@ -63,7 +64,7 @@ namespace KoMacro {
* @param name The unique name this @a Action has.
* @param text The i18n-caption text this @a Action has.
*/
- explicit Action(const QString& name, const QString& text = QString::null);
+ explicit Action(const TQString& name, const TQString& text = TQString());
/**
* Destructor.
@@ -74,50 +75,50 @@ namespace KoMacro {
* @return a string representation of the functionality
* this action provides.
*/
- virtual const QString toString() const;
+ virtual const TQString toString() const;
/**
* The name this @a Action has.
*/
- const QString name() const;
+ const TQString name() const;
/**
* Set the name of the @a Action to @p name .
*/
- void setName(const QString& name);
+ void setName(const TQString& name);
/**
* @return the i18n-caption text this @a Action has.
*/
- const QString text() const;
+ const TQString text() const;
/**
* Set the i18n-caption text this @a Action has.
*/
- void setText(const QString& text);
+ void setText(const TQString& text);
/**
* @return the comment associated with this action.
*/
- const QString comment() const;
+ const TQString comment() const;
/**
* Set the @p comment associated with this action.
*/
- void setComment(const QString& comment);
+ void setComment(const TQString& comment);
/**
* @return true if there exists a variable with the
* name @p name else false is returned.
*/
- bool hasVariable(const QString& name) const;
+ bool hasVariable(const TQString& name) const;
/**
* @return the variable @a Variable defined for the
* name @p name . If there exists no @a Variable with
* such a name, NULL is returned.
*/
- KSharedPtr<Variable> variable(const QString& name) const;
+ KSharedPtr<Variable> variable(const TQString& name) const;
/**
* @return the map of variables this @a Action provides.
@@ -127,7 +128,7 @@ namespace KoMacro {
/**
* @return a list of variablenames this @a Action provides.s
*/
- QStringList variableNames() const;
+ TQStringList variableNames() const;
/**
* Append the @a Variable @p variable to list of variables
@@ -140,15 +141,15 @@ namespace KoMacro {
*
* @param name The name the variable should have.
* @param text The i18n-caption used for display.
- * @param variant The QVariant value.
+ * @param variant The TQVariant value.
*/
- void setVariable(const QString& name, const QString& text, const QVariant& variant);
+ void setVariable(const TQString& name, const TQString& text, const TQVariant& variant);
/**
* Remove the variable defined with @p name . If there exists
* no such variable, nothing is done.
*/
- void removeVariable(const QString& name);
+ void removeVariable(const TQString& name);
/**
* This function is called, when the @a KoMacro::Variable
@@ -161,7 +162,7 @@ namespace KoMacro {
* @return true if the update was successfully else false
* is returned.
*/
- virtual bool notifyUpdated(const KSharedPtr<MacroItem> &macroitem, const QString& name) {
+ virtual bool notifyUpdated(const KSharedPtr<MacroItem> &macroitem, const TQString& name) {
Q_UNUSED(macroitem);
Q_UNUSED(name);
return true; // The default implementation does nothing.
diff --git a/kexi/plugins/macros/lib/context.cpp b/kexi/plugins/macros/lib/context.cpp
index 135c10c9..6e2fb2e4 100644
--- a/kexi/plugins/macros/lib/context.cpp
+++ b/kexi/plugins/macros/lib/context.cpp
@@ -23,7 +23,7 @@
#include "macroitem.h"
#include "exception.h"
-//#include <qtimer.h>
+//#include <tqtimer.h>
#include <kdebug.h>
using namespace KoMacro;
@@ -44,10 +44,10 @@ namespace KoMacro {
KSharedPtr<Macro> macro;
/**
- * List of @a Action instances that are children of the
+ * List of @a Action instances that are tqchildren of the
* macro.
*/
- QValueList<KSharedPtr<MacroItem > > items;
+ TQValueList<KSharedPtr<MacroItem > > items;
/**
* The currently selected @a MacroItem or NULL if there
@@ -59,7 +59,7 @@ namespace KoMacro {
* Map of all @a Variable instance that are defined within
* this context.
*/
- QMap<QString, KSharedPtr<Variable > > variables;
+ TQMap<TQString, KSharedPtr<Variable > > variables;
/**
* The @a Exception instance thrown at the last @a activate()
@@ -70,7 +70,7 @@ namespace KoMacro {
/// Constructor.
explicit Private(KSharedPtr<Macro> m)
: macro(m) // remember the macro
- , items(m->items()) // set d-pointer children to macro children
+ , items(m->items()) // set d-pointer tqchildren to macro tqchildren
, exception(0) // no exception yet.
{
}
@@ -85,7 +85,7 @@ namespace KoMacro {
}
//Constructor with initialization of our Private.object (d-pointer)
Context::Context(KSharedPtr<Macro> macro)
- : QObject()
+ : TQObject()
, d( new Private(macro) ) // create the private d-pointer instance.
{
}
@@ -97,17 +97,17 @@ Context::~Context()
}
//return if we have (d-pointer) variables
-bool Context::hasVariable(const QString& name) const
+bool Context::hasVariable(const TQString& name) const
{
- //Use QMap?s contains to check if a variable with name exists
- return d->variables.contains(name);
+ //Use TQMap?s contains to check if a variable with name exists
+ return d->variables.tqcontains(name);
}
//return variable with name or throw an exception if none is found in variables
-KSharedPtr<Variable> Context::variable(const QString& name) const
+KSharedPtr<Variable> Context::variable(const TQString& name) const
{
- //Use QMap?s contains to check if a variable with name exists in context
- if (d->variables.contains(name)) {
+ //Use TQMap?s contains to check if a variable with name exists in context
+ if (d->variables.tqcontains(name)) {
//return it
return d->variables[name];
}
@@ -119,7 +119,7 @@ KSharedPtr<Variable> Context::variable(const QString& name) const
}
}
//none found throw exception
- throw Exception(QString("Variable name='%1' does not exist.").arg(name));
+ throw Exception(TQString("Variable name='%1' does not exist.").tqarg(name));
}
//return a map of our (d-pointer) variables
@@ -129,12 +129,12 @@ Variable::Map Context::variables() const
}
//set a variable
-void Context::setVariable(const QString& name, KSharedPtr<Variable> variable)
+void Context::setVariable(const TQString& name, KSharedPtr<Variable> variable)
{
//debuging infos
- kdDebug() << QString("KoMacro::Context::setVariable name='%1' variable='%2'").arg(name).arg(variable->toString()) << endl;
- //Use QMap?s replace to set/replace the variable named name
- d->variables.replace(name, variable);
+ kdDebug() << TQString("KoMacro::Context::setVariable name='%1' variable='%2'").tqarg(name).tqarg(variable->toString()) << endl;
+ //Use TQMap?s replace to set/replace the variable named name
+ d->variables.tqreplace(name, variable);
}
//return the associated Macro
@@ -162,14 +162,14 @@ Exception* Context::exception() const
}
//try to activate all action?s in this context
-void Context::activate(QValueList<KSharedPtr<MacroItem > >::ConstIterator it)
+void Context::activate(TQValueList<KSharedPtr<MacroItem > >::ConstIterator it)
{
//debuging infos
kdDebug() << "Context::activate()" << endl;
- //Q_ASSIGN(d->macro);
+ //TQ_ASSIGN(d->macro);
//set end to constEnd
- QValueList<KSharedPtr<MacroItem > >::ConstIterator end(d->items.constEnd());
+ TQValueList<KSharedPtr<MacroItem > >::ConstIterator end(d->items.constEnd());
//loop through actions
for(;it != end; ++it) {
// fetch the MacroItem we are currently pointing to.
@@ -198,14 +198,14 @@ void Context::activate(QValueList<KSharedPtr<MacroItem > >::ConstIterator it)
d->exception = new Exception(e);
//add new tracemessages
//the macro name
- d->exception->addTraceMessage( QString("macro=%1").arg(d->macro->name()) );
+ d->exception->addTraceMessage( TQString("macro=%1").tqarg(d->macro->name()) );
//the action name
- d->exception->addTraceMessage( QString("action=%1").arg(action->name()) );
+ d->exception->addTraceMessage( TQString("action=%1").tqarg(action->name()) );
//and all variables wich belong to the action/macro
- QStringList variables = action->variableNames();
- for(QStringList::Iterator vit = variables.begin(); vit != variables.end(); ++vit) {
+ TQStringList variables = action->variableNames();
+ for(TQStringList::Iterator vit = variables.begin(); vit != variables.end(); ++vit) {
KSharedPtr<Variable> v = d->macroitem->variable(*vit, true);
- d->exception->addTraceMessage( QString("%1=%2").arg(*vit).arg(v->toString()) );
+ d->exception->addTraceMessage( TQString("%1=%2").tqarg(*vit).tqarg(v->toString()) );
}
return; // abort execution
}
@@ -252,7 +252,7 @@ void Context::activateNext()
}
//find the macroitem from which to continue
- QValueList<KSharedPtr<MacroItem > >::ConstIterator it = d->items.find(d->macroitem);
+ TQValueList<KSharedPtr<MacroItem > >::ConstIterator it = d->items.tqfind(d->macroitem);
if (it != d->items.constEnd()) {
activate(++it); // try to continue the execution.
}
diff --git a/kexi/plugins/macros/lib/context.h b/kexi/plugins/macros/lib/context.h
index dd467dad..558ff0aa 100644
--- a/kexi/plugins/macros/lib/context.h
+++ b/kexi/plugins/macros/lib/context.h
@@ -20,7 +20,7 @@
#ifndef KOMACRO_CONTEXT_H
#define KOMACRO_CONTEXT_H
-#include <qobject.h>
+#include <tqobject.h>
#include <ksharedptr.h>
#include "variable.h"
@@ -35,14 +35,15 @@ namespace KoMacro {
/**
* The context of an execution. If a @a Macro got executed it creates
- * an instance of this class and passes it around all it's children
+ * an instance of this class and passes it around all it's tqchildren
* as local execution context.
*/
class KOMACRO_EXPORT Context
- : public QObject
+ : public TQObject
, public KShared
{
Q_OBJECT
+ TQ_OBJECT
public:
/**
@@ -61,13 +62,13 @@ namespace KoMacro {
* @return true if there exists a variable with name @p name
* else false got returned.
*/
- bool hasVariable(const QString& name) const;
+ bool hasVariable(const TQString& name) const;
/**
* @return the @a Variable defined with name @p name or
* NULL if there exists no such variable.
*/
- KSharedPtr<Variable> variable(const QString& name) const;
+ KSharedPtr<Variable> variable(const TQString& name) const;
/**
* @return a map of all @a Variable instance that are defined
@@ -79,7 +80,7 @@ namespace KoMacro {
* Set the variable @p variable defined with name @p name . If
* there exists already a variable with that name replace it.
*/
- void setVariable(const QString& name, KSharedPtr<Variable> variable);
+ void setVariable(const TQString& name, KSharedPtr<Variable> variable);
/**
* @return the associated macro
@@ -113,14 +114,14 @@ namespace KoMacro {
* remembers what @a Action should be executed next and
* calling this slot just activates those @a Action .
*/
- virtual void activate(QValueList<KSharedPtr <MacroItem> >::ConstIterator it);
+ virtual void activate(TQValueList<KSharedPtr <MacroItem> >::ConstIterator it);
public slots:
/**
* This slot extends the slot above with the passed
* @a Context @p context which will be used as
- * parent context for this context.
+ * tqparent context for this context.
*/
virtual void activate(KSharedPtr<Context> context);
diff --git a/kexi/plugins/macros/lib/exception.cpp b/kexi/plugins/macros/lib/exception.cpp
index 7cfc7d71..91cfa03c 100644
--- a/kexi/plugins/macros/lib/exception.cpp
+++ b/kexi/plugins/macros/lib/exception.cpp
@@ -34,15 +34,15 @@ namespace KoMacro {
public:
/// A describing errormessage.
- const QString errormessage;
+ const TQString errormessage;
/// A more detailed list of tracemessages.
- QString tracemessages;
+ TQString tracemessages;
/**
* Constructor.
*/
- Private(const QString& errormessage)
+ Private(const TQString& errormessage)
: errormessage(errormessage)
{
}
@@ -52,11 +52,11 @@ namespace KoMacro {
}
//constructor
-Exception::Exception(const QString& errormessage)
+Exception::Exception(const TQString& errormessage)
: d( new Private(errormessage) ) // create the private d-pointer instance.
{
//debuging infos
- kdDebug() << QString("Exception errormessage=\"%1\"").arg(errormessage) << endl;
+ kdDebug() << TQString("Exception errormessage=\"%1\"").tqarg(errormessage) << endl;
}
//copy constructor
@@ -73,19 +73,19 @@ Exception::~Exception()
}
//get d-pointer errormessage
-const QString Exception::errorMessage() const
+const TQString Exception::errorMessage() const
{
return d->errormessage;
}
//get d-pointer tracemessages
-const QString Exception::traceMessages() const
+const TQString Exception::traceMessages() const
{
return d->tracemessages;
}
//add a Qstring to d-pointer tracemessages
-void Exception::addTraceMessage(const QString& tracemessage)
+void Exception::addTraceMessage(const TQString& tracemessage)
{
//no tracemessages till now
if(d->tracemessages.isEmpty())
diff --git a/kexi/plugins/macros/lib/exception.h b/kexi/plugins/macros/lib/exception.h
index 73504de0..bcf4abff 100644
--- a/kexi/plugins/macros/lib/exception.h
+++ b/kexi/plugins/macros/lib/exception.h
@@ -20,8 +20,8 @@
#ifndef KOMACRO_EXCEPTION_H
#define KOMACRO_EXCEPTION_H
-#include <qstring.h>
-#include <qstringlist.h>
+#include <tqstring.h>
+#include <tqstringlist.h>
#include "komacro_export.h"
@@ -41,7 +41,7 @@ namespace KoMacro {
* @param errormessage A describing errormessage why the
* exception got thrown.
*/
- explicit Exception(const QString& errormessage);
+ explicit Exception(const TQString& errormessage);
/**
* Copy-constructor.
@@ -56,7 +56,7 @@ namespace KoMacro {
/**
* @return a describing errormessage.
*/
- const QString errorMessage() const;
+ const TQString errorMessage() const;
/**
* @return a stringlist of traces. This are normaly just
@@ -65,12 +65,12 @@ namespace KoMacro {
* we finally catched the error to display it to the
* user.
*/
- const QString traceMessages() const;
+ const TQString traceMessages() const;
/**
* Add the message @p tracemessage to the list of traces.
*/
- void addTraceMessage(const QString& tracemessage);
+ void addTraceMessage(const TQString& tracemessage);
private:
/// @internal d-pointer class.
diff --git a/kexi/plugins/macros/lib/macro.cpp b/kexi/plugins/macros/lib/macro.cpp
index 688cc7b0..6bcdc21d 100644
--- a/kexi/plugins/macros/lib/macro.cpp
+++ b/kexi/plugins/macros/lib/macro.cpp
@@ -23,7 +23,7 @@
#include "context.h"
#include "variable.h"
-#include <qdom.h>
+#include <tqdom.h>
#include <kdebug.h>
using namespace KoMacro;
@@ -41,20 +41,20 @@ namespace KoMacro {
/**
* A list of @a MacroItem instances.
*/
- QValueList<KSharedPtr<MacroItem > > itemlist;
+ TQValueList<KSharedPtr<MacroItem > > itemlist;
/**
* The name the @a Macro has.
*/
- QString name;
+ TQString name;
};
}
//constructor, initalize internal (d-pointer) name
-Macro::Macro(const QString& name)
- : QObject()
+Macro::Macro(const TQString& name)
+ : TQObject()
, KShared()
, XMLHandler(this)
, d( new Private() ) // create the private d-pointer instance.
@@ -70,25 +70,25 @@ Macro::~Macro()
}
//get internal (d-pointer) name
-const QString Macro::name() const
+const TQString Macro::name() const
{
return d->name;
}
//set internal (d-pointer) name
-void Macro::setName(const QString& name)
+void Macro::setName(const TQString& name)
{
d->name = name;
}
//get an "extended" name
-const QString Macro::toString() const
+const TQString Macro::toString() const
{
- return QString("Macro:%1").arg(name());
+ return TQString("Macro:%1").tqarg(name());
}
//get (d-pointer) itemlist
-QValueList<KSharedPtr<MacroItem > >& Macro::items() const
+TQValueList<KSharedPtr<MacroItem > >& Macro::items() const
{
return d->itemlist;
}
@@ -105,17 +105,17 @@ void Macro::clearItems()
}
//run our macro
-KSharedPtr<Context> Macro::execute(QObject* sender)
+KSharedPtr<Context> Macro::execute(TQObject* sender)
{
kdDebug() << "Macro::execute(KSharedPtr<Context>)" << endl;
//create context in which macro can/should run
KSharedPtr<Context> c = KSharedPtr<Context>( new Context(this) );
if(sender) {
- // set the sender-variable if we got a sender QObject.
+ // set the sender-variable if we got a sender TQObject.
c->setVariable("[sender]", KSharedPtr<Variable>( new Variable(sender) ));
}
- //connect(context, SIGNAL(activated()), this, SIGNAL(activated()));
+ //connect(context, TQT_SIGNAL(activated()), this, TQT_SIGNAL(activated()));
//call activate in the context of the macro
c->activate( c );
diff --git a/kexi/plugins/macros/lib/macro.h b/kexi/plugins/macros/lib/macro.h
index da38e05b..86e0122a 100644
--- a/kexi/plugins/macros/lib/macro.h
+++ b/kexi/plugins/macros/lib/macro.h
@@ -20,7 +20,7 @@
#ifndef KOMACRO_MACRO_H
#define KOMACRO_MACRO_H
-#include <qobject.h>
+#include <tqobject.h>
#include <ksharedptr.h>
#include "action.h"
@@ -39,20 +39,21 @@ namespace KoMacro {
* of them points to an @a Action instance.
*/
class KOMACRO_EXPORT Macro
- : public QObject // Qt functionality like signals and slots
+ : public TQObject // TQt functionality like signals and slots
, public KShared // shared reference-counting
, public XMLHandler // to (un-)serialize from/to XML
{
Q_OBJECT
+ TQ_OBJECT
public:
/**
- * A QMap of @a Macro instances accessible by there unique name. Each
- * class should use this typemap rather then the QMap direct. That
+ * A TQMap of @a Macro instances accessible by there unique name. Each
+ * class should use this typemap rather then the TQMap direct. That
* way we are more flexible on future changes.
*/
- typedef QMap<QString, KSharedPtr<Macro > > Map;
+ typedef TQMap<TQString, KSharedPtr<Macro > > Map;
/**
* Constructor.
@@ -60,7 +61,7 @@ namespace KoMacro {
* @param name The internal name this @a Macro has. This
* name will be used as unique identifier.
*/
- explicit Macro(const QString& name);
+ explicit Macro(const TQString& name);
/**
* Destructor.
@@ -70,23 +71,23 @@ namespace KoMacro {
/**
* @return the name this @a Macro instance has.
*/
- const QString name() const;
+ const TQString name() const;
/**
* Set the @p name this @a Macro instance has.
*/
- void setName(const QString& name);
+ void setName(const TQString& name);
/**
* @return a string-representation of the macro.
*/
- virtual const QString toString() const;
+ virtual const TQString toString() const;
/**
* @return a list of @a MacroItem instances which
- * are children of this @a Macro .
+ * are tqchildren of this @a Macro .
*/
- QValueList< KSharedPtr<MacroItem> >& items() const;
+ TQValueList< KSharedPtr<MacroItem> >& items() const;
/**
* Add the @a MacroItem @p item to the list of items
@@ -100,13 +101,13 @@ namespace KoMacro {
void clearItems();
/**
- * Connect the Qt signal @p signal of the QObject @p sender
+ * Connect the TQt signal @p signal of the TQObject @p sender
* with this @a Macro . If the signal got emitted this
* @a Macro instance will be activated and the in the
* signal passed arguments are transfered into the
* activation @a Context .
*/
- //void connectSignal(const QObject* sender, const char* signal);
+ //void connectSignal(const TQObject* sender, const char* signal);
public slots:
@@ -116,7 +117,7 @@ namespace KoMacro {
* @param context The @a Context this @a Macro should
* be executed in.
*/
- virtual KSharedPtr<Context> execute(QObject* sender);
+ virtual KSharedPtr<Context> execute(TQObject* sender);
private:
/// @internal d-pointer class.
diff --git a/kexi/plugins/macros/lib/macroitem.cpp b/kexi/plugins/macros/lib/macroitem.cpp
index 4027f2cc..471f9660 100644
--- a/kexi/plugins/macros/lib/macroitem.cpp
+++ b/kexi/plugins/macros/lib/macroitem.cpp
@@ -40,62 +40,62 @@ namespace KoMacro {
/**
* The comment this @a MacroItem has.
*/
- QString comment;
+ TQString comment;
/**
- * The @a QMap of @a Variable this @a MacroItem has.
+ * The @a TQMap of @a Variable this @a MacroItem has.
*/
Variable::Map variables;
/**
- * define a @a QVariant -cast as inline for better performance
- * @return the casted @a QVariant by passing a @param variant and its
- * expected QVariant::Type @param type.
+ * define a @a TQVariant -cast as inline for better performance
+ * @return the casted @a TQVariant by passing a @param variant and its
+ * expected TQVariant::Type @param type.
*/
- inline const QVariant cast(const QVariant& variant, QVariant::Type type) const
+ inline const TQVariant cast(const TQVariant& variant, TQVariant::Type type) const
{
- // If ok is true the QVariant v holds our new and to the correct type
+ // If ok is true the TQVariant v holds our new and to the correct type
// casted variant value. If ok is false the as argument passed variant
- // QVariant contains the (maybe uncasted string to prevent data-loosing
+ // TQVariant contains the (maybe uncasted string to prevent data-loosing
// what would happen if we e.g. would expect an integer and cast it to
// an incompatible non-int string) value.
bool ok = false;
- QVariant v;
+ TQVariant v;
// Try to cast the passed variant to the expected variant-type.
switch(type) {
- case QVariant::Bool: {
- const QString s = variant.toString();
+ case TQVariant::Bool: {
+ const TQString s = variant.toString();
ok = (s == "true" || s == "false" || s == "0" || s == "1" || s == "-1");
- v = QVariant( variant.toBool(), 0 );
+ v = TQVariant( variant.toBool(), 0 );
} break;
- case QVariant::Int: {
+ case TQVariant::Int: {
v = variant.toInt(&ok);
// Check if the cast is correct.
Q_ASSERT(!ok || v.toString() == variant.toString());
} break;
- case QVariant::UInt: {
+ case TQVariant::UInt: {
v = variant.toUInt(&ok);
Q_ASSERT(!ok || v.toString() == variant.toString());
} break;
- case QVariant::LongLong: {
+ case TQVariant::LongLong: {
v = variant.toLongLong(&ok);
Q_ASSERT(!ok || v.toString() == variant.toString());
} break;
- case QVariant::ULongLong: {
+ case TQVariant::ULongLong: {
v = variant.toULongLong(&ok);
Q_ASSERT(!ok || v.toString() == variant.toString());
} break;
- case QVariant::Double: {
+ case TQVariant::Double: {
v = variant.toDouble(&ok);
Q_ASSERT(!ok || v.toString() == variant.toString());
} break;
- case QVariant::String: {
+ case TQVariant::String: {
ok = true; // cast will always be successfully
v = variant.toString();
} break;
default: {
- // If we got another type we try to let Qt handle it...
+ // If we got another type we try to let TQt handle it...
ok = v.cast(type);
kdWarning()<<"MacroItem::Private::cast() Unhandled ok="<<ok<<" type="<<type<<" value="<<v<<endl;
} break;
@@ -119,12 +119,12 @@ MacroItem::~MacroItem()
delete d;
}
-QString MacroItem::comment() const
+TQString MacroItem::comment() const
{
return d->comment;
}
-void MacroItem::setComment(const QString& comment)
+void MacroItem::setComment(const TQString& comment)
{
d->comment = comment;
}
@@ -139,15 +139,15 @@ void MacroItem::setAction(KSharedPtr<Action> action)
d->action = action;
}
-QVariant MacroItem::variant(const QString& name, bool checkaction) const
+TQVariant MacroItem::variant(const TQString& name, bool checkaction) const
{
KSharedPtr<Variable> v = variable(name, checkaction);
- return v.data() ? v->variant() : QVariant();
+ return v.data() ? v->variant() : TQVariant();
}
-KSharedPtr<Variable> MacroItem::variable(const QString& name, bool checkaction) const
+KSharedPtr<Variable> MacroItem::variable(const TQString& name, bool checkaction) const
{
- if(d->variables.contains(name))
+ if(d->variables.tqcontains(name))
return d->variables[name];
if(checkaction && d->action.data())
return d->action->variable(name);
@@ -159,7 +159,7 @@ Variable::Map MacroItem::variables() const
return d->variables;
}
-bool MacroItem::setVariant(const QString& name, const QVariant& variant)
+bool MacroItem::setVariant(const TQString& name, const TQVariant& variant)
{
// Let's look if there is an action defined for the variable. If that's
// the case, we try to use that action to preserve the type of the variant.
@@ -167,7 +167,7 @@ bool MacroItem::setVariant(const QString& name, const QVariant& variant)
// If we know the expected type, we try to cast the variant to the expected
// type else the variant stays untouched (so, it will stay a string).
- const QVariant v = actionvariable.data()
+ const TQVariant v = actionvariable.data()
? d->cast(variant, actionvariable->variant().type()) // try to cast the variant
: variant; // don't cast anything, just leave the string-type...
@@ -179,11 +179,11 @@ bool MacroItem::setVariant(const QString& name, const QVariant& variant)
variable = KSharedPtr<Variable>( new Variable() );
variable->setName(name);
- d->variables.replace(name, variable);
+ d->variables.tqreplace(name, variable);
}
// Remember the previous value for the case we like to restore it.
- const QVariant oldvar = variable->variant();
+ const TQVariant oldvar = variable->variant();
// Set the variable.
variable->setVariant(v);
@@ -201,15 +201,15 @@ bool MacroItem::setVariant(const QString& name, const QVariant& variant)
return true;
}
-KSharedPtr<Variable> MacroItem::addVariable(const QString& name, const QVariant& variant)
+KSharedPtr<Variable> MacroItem::addVariable(const TQString& name, const TQVariant& variant)
{
- Q_ASSERT(! d->variables.contains(name) );
+ Q_ASSERT(! d->variables.tqcontains(name) );
// Create a new Variable.
KSharedPtr<Variable> variable = KSharedPtr<Variable>( new Variable() );
variable->setName(name);
// Put it into the Variable-map.
- d->variables.replace(name, variable);
+ d->variables.tqreplace(name, variable);
// Set the variant of the Variable.
this->setVariant(name, variant);
diff --git a/kexi/plugins/macros/lib/macroitem.h b/kexi/plugins/macros/lib/macroitem.h
index 8f3e1502..6b996e70 100644
--- a/kexi/plugins/macros/lib/macroitem.h
+++ b/kexi/plugins/macros/lib/macroitem.h
@@ -20,12 +20,12 @@
#ifndef KOMACRO_MACROITEM_H
#define KOMACRO_MACROITEM_H
-#include <qobject.h>
+#include <tqobject.h>
#include <ksharedptr.h>
// Forward declarations.
-class QDomElement;
+class TQDomElement;
#include "action.h"
#include "context.h"
@@ -51,7 +51,7 @@ namespace KoMacro {
/**
* A list of \a MacroItem instances.
*/
- typedef QValueList<KSharedPtr<MacroItem > > List;
+ typedef TQValueList<KSharedPtr<MacroItem > > List;
/**
* Constructor.
@@ -67,13 +67,13 @@ namespace KoMacro {
* @return the comment defined by the user for
* this @a MacroItem .
*/
- QString comment() const;
+ TQString comment() const;
/**
* Set the comment @param comment defined by the user for this
* @a MacroItem .
*/
- void setComment(const QString& comment);
+ void setComment(const TQString& comment);
/**
* @return the @a Action this @a MacroItem points
@@ -98,7 +98,7 @@ namespace KoMacro {
* such a @param name in the case this @a MacroItem
* doesn't have such a name.
*/
- QVariant variant(const QString& name, bool checkaction = false) const;
+ TQVariant variant(const TQString& name, bool checkaction = false) const;
/**
* @return the @a Variable instance identified with
@@ -110,25 +110,25 @@ namespace KoMacro {
* such a @param name in the case this @a MacroItem
* doesn't have such a name.
*/
- KSharedPtr<Variable> variable(const QString& name, bool checkaction = false) const;
+ KSharedPtr<Variable> variable(const TQString& name, bool checkaction = false) const;
/**
* @return a map of @a Variable instances.
*/
- QMap<QString, KSharedPtr<Variable> > variables() const;
+ TQMap<TQString, KSharedPtr<Variable> > variables() const;
/**
- * Set the @a QVariant @param variant as variable with the variablename
+ * Set the @a TQVariant @param variant as variable with the variablename
* @param name .
* @return a bool for successfull setting.
*/
- bool setVariant(const QString& name, const QVariant& variant);
+ bool setVariant(const TQString& name, const TQVariant& variant);
/**
* Add a new variable with the vaiablename @param name and the given
- * @a QVariant @param variant to our @a MacroItem instance.
+ * @a TQVariant @param variant to our @a MacroItem instance.
*/
- KSharedPtr<Variable> addVariable(const QString& name, const QVariant& variant);
+ KSharedPtr<Variable> addVariable(const TQString& name, const TQVariant& variant);
private:
/// @internal d-pointer class.
diff --git a/kexi/plugins/macros/lib/manager.cpp b/kexi/plugins/macros/lib/manager.cpp
index 77ad98b1..0a0d59e0 100644
--- a/kexi/plugins/macros/lib/manager.cpp
+++ b/kexi/plugins/macros/lib/manager.cpp
@@ -23,9 +23,9 @@
#include "macro.h"
#include "exception.h"
-#include <qobject.h>
-#include <qwidget.h>
-#include <qdom.h>
+#include <tqobject.h>
+#include <tqwidget.h>
+#include <tqdom.h>
#include <kxmlguibuilder.h>
#include <kdebug.h>
@@ -41,12 +41,12 @@ namespace KoMacro {
{
public:
KXMLGUIClient* const xmlguiclient;
- QMap<QString, KSharedPtr<Macro > > macros;
+ TQMap<TQString, KSharedPtr<Macro > > macros;
- QStringList actionnames;
- QMap<QString, KSharedPtr<Action> > actions;
+ TQStringList actionnames;
+ TQMap<TQString, KSharedPtr<Action> > actions;
- QMap<QString, QGuardedPtr<QObject> > objects;
+ TQMap<TQString, TQGuardedPtr<TQObject> > objects;
Private(KXMLGUIClient* const xmlguiclient)
: xmlguiclient(xmlguiclient)
@@ -83,13 +83,13 @@ Manager::Manager(KXMLGUIClient* const xmlguiclient)
: d( new Private(xmlguiclient) ) // create the private d-pointer instance.
{
kdDebug() << "Manager::Manager() Ctor" << endl;
- QObject* obj = dynamic_cast<QObject*>(xmlguiclient);
+ TQObject* obj = dynamic_cast<TQObject*>(xmlguiclient);
if(obj) {
- d->objects.replace(obj->name(), obj);
+ d->objects.tqreplace(obj->name(), obj);
}
//TESTCASE
- d->objects.replace("TestCase", new QWidget());
+ d->objects.tqreplace("TestCase", new TQWidget());
}
Manager::~Manager()
@@ -103,33 +103,33 @@ KXMLGUIClient* Manager::guiClient() const
return d->xmlguiclient;
}
-bool Manager::hasMacro(const QString& macroname)
+bool Manager::hasMacro(const TQString& macroname)
{
- return d->macros.contains(macroname);
+ return d->macros.tqcontains(macroname);
}
-KSharedPtr<Macro> Manager::getMacro(const QString& macroname)
+KSharedPtr<Macro> Manager::getMacro(const TQString& macroname)
{
return d->macros[macroname];
}
-void Manager::addMacro(const QString& macroname, KSharedPtr<Macro> macro)
+void Manager::addMacro(const TQString& macroname, KSharedPtr<Macro> macro)
{
- d->macros.replace(macroname, macro);
+ d->macros.tqreplace(macroname, macro);
}
-void Manager::removeMacro(const QString& macroname)
+void Manager::removeMacro(const TQString& macroname)
{
d->macros.remove(macroname);
}
-KSharedPtr<Macro> Manager::createMacro(const QString& macroname)
+KSharedPtr<Macro> Manager::createMacro(const TQString& macroname)
{
KSharedPtr<Macro> macro = KSharedPtr<Macro>( new Macro(macroname) );
return macro;
}
-KSharedPtr<Action> Manager::action(const QString& name) const
+KSharedPtr<Action> Manager::action(const TQString& name) const
{
return d->actions[name];
}
@@ -139,32 +139,32 @@ Action::Map Manager::actions() const
return d->actions;
}
-QStringList Manager::actionNames() const
+TQStringList Manager::actionNames() const
{
return d->actionnames;
}
void Manager::publishAction(KSharedPtr<Action> action)
{
- const QString name = action->name();
- if(! d->actions.contains(name)) {
+ const TQString name = action->name();
+ if(! d->actions.tqcontains(name)) {
d->actionnames.append(name);
}
- d->actions.replace(name, action);
+ d->actions.tqreplace(name, action);
}
-void Manager::publishObject(const QString& name, QObject* object)
+void Manager::publishObject(const TQString& name, TQObject* object)
{
- Q_ASSERT(! d->objects.contains(name));
- d->objects.replace(name, object);
+ Q_ASSERT(! d->objects.tqcontains(name));
+ d->objects.tqreplace(name, object);
}
-QGuardedPtr<QObject> Manager::object(const QString& name) const
+TQGuardedPtr<TQObject> Manager::object(const TQString& name) const
{
return d->objects[name];
}
-QMap<QString, QGuardedPtr<QObject> > Manager::objects() const
+TQMap<TQString, TQGuardedPtr<TQObject> > Manager::objects() const
{
return d->objects;
}
diff --git a/kexi/plugins/macros/lib/manager.h b/kexi/plugins/macros/lib/manager.h
index 964f9d7c..fb332f66 100644
--- a/kexi/plugins/macros/lib/manager.h
+++ b/kexi/plugins/macros/lib/manager.h
@@ -20,16 +20,16 @@
#ifndef KOMACRO_MANAGER_H
#define KOMACRO_MANAGER_H
-#include <qmap.h>
-#include <qguardedptr.h>
+#include <tqmap.h>
+#include <tqguardedptr.h>
#include <ksharedptr.h>
#include <kxmlguiclient.h>
#include <kstaticdeleter.h>
#include "komacro_export.h"
-class QObject;
-class QDomElement;
+class TQObject;
+class TQDomElement;
namespace KoMacro {
@@ -42,11 +42,11 @@ namespace KoMacro {
*
* Example how KoMacro could be used.
* @code
- * // We have a class that inheritates from QObject and
+ * // We have a class that inheritates from TQObject and
* // implements some public signals and slots that will
* // be accessible by Macros once a class-instance
* // got published.
- * class PublishedObject : public QObject {};
+ * class PublishedObject : public TQObject {};
*
* // Somewhere we have our KMainWindow.
* KMainWindow* mainwindow = new KMainWindow();
@@ -55,7 +55,7 @@ namespace KoMacro {
* // Macro-framework.
* KoMacro::Manager* manager = new KoMacro::Manager( mainwindow );
*
- * // Now we like to publish a QObject
+ * // Now we like to publish a TQObject
* PublishedObject* publishedobject = new PublishedObject();
* manager->publishObject(publishedobject);
*
@@ -64,7 +64,7 @@ namespace KoMacro {
*
* // Finally free the publishedobject instance we created. We
* // need to free it manualy cause PublishedObject doesn't
- * // got a QObject parent as argument.
+ * // got a TQObject tqparent as argument.
* delete publishedobject;
*
* // Finally free the manager-instance. It's always needed
@@ -116,32 +116,32 @@ namespace KoMacro {
* \return true if we carry a \a Macro with the
* defined \p macroname .
*/
- bool hasMacro(const QString& macroname);
+ bool hasMacro(const TQString& macroname);
/**
* \return the \a Macro defined with \p macroname
* or NULL if we don't have such a \a Macro.
*/
- KSharedPtr<Macro> getMacro(const QString& macroname);
+ KSharedPtr<Macro> getMacro(const TQString& macroname);
/**
* Add a new \a Macro to the list of known macros. If
* there exists already a \a Macro instance with the
* defined \p macroname then the already existing one
- * will be replace.
+ * will be tqreplace.
*
* \param macroname The name the \a Macro will be
* accessible as.
* \param macro The \a Macro instance.
*/
- void addMacro(const QString& macroname, KSharedPtr<Macro> macro);
+ void addMacro(const TQString& macroname, KSharedPtr<Macro> macro);
/**
* Remove the \a Macro defined with \p macroname . If
* we don't know about a \a Macro with that \p macroname
* nothing happens.
*/
- void removeMacro(const QString& macroname);
+ void removeMacro(const TQString& macroname);
/**
* Factory function to create a new \a Macro instances.
@@ -150,21 +150,21 @@ namespace KoMacro {
* like to attach the returned new \a Macro to this
* \a Manager instance.
*/
- KSharedPtr<Macro> createMacro(const QString& macroname);
+ KSharedPtr<Macro> createMacro(const TQString& macroname);
#if 0
/**
* Factory method to create @a Action instances from the
* defined @p element .
*
- * @param element The serialized QDomElement that should
+ * @param element The serialized TQDomElement that should
* be used to create the @a Action instance.
* @return A new @a Action instance or NULL if the
* defined @p element is not valid.
*
* @deprecated Moved to common XMLReader/XMLWriter classes. Use Macro::xmlHandler() !
*/
- KSharedPtr<Action> createAction(const QDomElement& element);
+ KSharedPtr<Action> createAction(const TQDomElement& element);
#endif
/**
@@ -172,17 +172,17 @@ namespace KoMacro {
* name @p name or returns an empty @a KSharedPtr<Action> object
* if there was no such @a Action published.
*/
- KSharedPtr<Action> action(const QString& name) const;
+ KSharedPtr<Action> action(const TQString& name) const;
/**
* @return a map of all published actions.
*/
- QMap<QString, KSharedPtr<Action> > actions() const;
+ TQMap<TQString, KSharedPtr<Action> > actions() const;
/**
* @return a list of all published actions.
*/
- QStringList actionNames() const;
+ TQStringList actionNames() const;
/**
* Publish the @a Action @p action . The published @a Action
@@ -191,21 +191,21 @@ namespace KoMacro {
void publishAction(KSharedPtr<Action> action);
/**
- * Publish the passed QObject @p object. Those object will
+ * Publish the passed TQObject @p object. Those object will
* provide it's slots as callable functions.
*/
- void publishObject(const QString& name, QObject* object);
+ void publishObject(const TQString& name, TQObject* object);
/**
- * @return the publish QObject defined with name @p name
+ * @return the publish TQObject defined with name @p name
* or NULL if there exists no such object.
*/
- QGuardedPtr<QObject> object(const QString& name) const;
+ TQGuardedPtr<TQObject> object(const TQString& name) const;
/**
- * @return a map of the published QObject instances.
+ * @return a map of the published TQObject instances.
*/
- QMap<QString, QGuardedPtr<QObject> > objects() const;
+ TQMap<TQString, TQGuardedPtr<TQObject> > objects() const;
private:
/// @internal d-pointer class.
diff --git a/kexi/plugins/macros/lib/metamethod.cpp b/kexi/plugins/macros/lib/metamethod.cpp
index 8aa4dc54..979202e8 100644
--- a/kexi/plugins/macros/lib/metamethod.cpp
+++ b/kexi/plugins/macros/lib/metamethod.cpp
@@ -23,12 +23,12 @@
#include "variable.h"
#include "exception.h"
-#include <qobject.h>
-#include <qmetaobject.h>
+#include <tqobject.h>
+#include <tqmetaobject.h>
-// to access the Qt3 QUObject API.
-#include <private/qucom_p.h>
-#include <private/qucomextra_p.h>
+// to access the TQt3 TQUObject API.
+#include <private/tqucom_p.h>
+#include <private/tqucomextra_p.h>
#include <kdebug.h>
@@ -47,17 +47,17 @@ namespace KoMacro {
/**
* The signature this @a MetaMethod has.
*/
- QString signature;
+ TQString signature;
/**
* The signature tagname this @a MetaMethod has.
*/
- QString signaturetag;
+ TQString signaturetag;
/**
* The signature arguments this @a MetaMethod has.
*/
- QString signaturearguments;
+ TQString signaturearguments;
/**
* Cached signature arguments parsed into a list
@@ -81,7 +81,7 @@ namespace KoMacro {
}
-MetaMethod::MetaMethod(const QString& signature, Type type, KSharedPtr<MetaObject> object)
+MetaMethod::MetaMethod(const TQString& signature, Type type, KSharedPtr<MetaObject> object)
: KShared()
, d( new Private() ) // create the private d-pointer instance.
{
@@ -89,39 +89,39 @@ MetaMethod::MetaMethod(const QString& signature, Type type, KSharedPtr<MetaObjec
d->object = object;
d->type = type;
- int startpos = d->signature.find("(");
- int endpos = d->signature.findRev(")");
+ int startpos = d->signature.tqfind("(");
+ int endpos = d->signature.tqfindRev(")");
if(startpos < 0 || startpos > endpos) {
- throw Exception(QString("Invalid signature \"%1\"").arg(d->signature));
+ throw Exception(TQString("Invalid signature \"%1\"").tqarg(d->signature));
}
d->signaturetag = d->signature.left(startpos).stripWhiteSpace();
if(d->signaturetag.isEmpty()) {
- throw Exception(QString("Invalid tagname in signature \"%1\"").arg(d->signature));
+ throw Exception(TQString("Invalid tagname in signature \"%1\"").tqarg(d->signature));
}
d->signaturearguments = d->signature.mid(startpos + 1, endpos - startpos - 1).stripWhiteSpace();
do {
- int commapos = d->signaturearguments.find(",");
- int starttemplatepos = d->signaturearguments.find("<");
+ int commapos = d->signaturearguments.tqfind(",");
+ int starttemplatepos = d->signaturearguments.tqfind("<");
if(starttemplatepos >= 0 && (commapos < 0 || starttemplatepos < commapos)) {
- int endtemplatepos = d->signaturearguments.find(">", starttemplatepos);
+ int endtemplatepos = d->signaturearguments.tqfind(">", starttemplatepos);
if(endtemplatepos <= 0) {
- throw Exception(QString("No closing template-definiton in signature \"%1\"").arg(d->signature));
+ throw Exception(TQString("No closing template-definiton in signature \"%1\"").tqarg(d->signature));
}
- commapos = d->signaturearguments.find(",", endtemplatepos);
+ commapos = d->signaturearguments.tqfind(",", endtemplatepos);
}
if(commapos > 0) {
- QString s = d->signaturearguments.left(commapos).stripWhiteSpace();
+ TQString s = d->signaturearguments.left(commapos).stripWhiteSpace();
if(! s.isEmpty()) {
d->arguments.append( new MetaParameter(s) );
}
d->signaturearguments = d->signaturearguments.right(d->signaturearguments.length() - commapos - 1);
}
else {
- QString s = d->signaturearguments.stripWhiteSpace();
+ TQString s = d->signaturearguments.stripWhiteSpace();
if(! s.isEmpty()) {
d->arguments.append( new MetaParameter(s) );
}
@@ -140,17 +140,17 @@ KSharedPtr<MetaObject> const MetaMethod::object() const
return d->object;
}
-const QString MetaMethod::signature() const
+const TQString MetaMethod::signature() const
{
return d->signature;
}
-const QString MetaMethod::signatureTag() const
+const TQString MetaMethod::signatureTag() const
{
return d->signaturetag;
}
-const QString MetaMethod::signatureArguments() const
+const TQString MetaMethod::signatureArguments() const
{
return d->signaturearguments;
}
@@ -165,71 +165,71 @@ MetaParameter::List MetaMethod::arguments() const
return d->arguments;
}
-QUObject* MetaMethod::toQUObject(Variable::List arguments)
+TQUObject* MetaMethod::toTQUObject(Variable::List arguments)
{
uint argsize = d->arguments.size();
if(arguments.size() <= argsize) {
- throw Exception(QString("To less arguments for slot with siganture \"%1\"").arg(d->signature));
+ throw Exception(TQString("To less arguments for slot with siganture \"%1\"").tqarg(d->signature));
}
- // The first item in the QUObject-array is for the returnvalue
+ // The first item in the TQUObject-array is for the returnvalue
// while everything >=1 are the passed parameters.
- QUObject* uo = new QUObject[ argsize + 1 ];
+ TQUObject* uo = new TQUObject[ argsize + 1 ];
- uo[0] = QUObject(); // empty placeholder for the returnvalue.
+ uo[0] = TQUObject(); // empty placeholder for the returnvalue.
for(uint i = 0; i < argsize; i++) {
KSharedPtr<MetaParameter> metaargument = d->arguments[i];
KSharedPtr<Variable> variable = arguments[i + 1];
if ( !variable ) {
- throw Exception(QString("Variable is undefined !"));
+ throw Exception(TQString("Variable is undefined !"));
}
if(metaargument->type() != variable->type()) {
- throw Exception(QString("Wrong variable type in method \"%1\". Expected \"%2\" but got \"%3\"").arg(d->signature).arg(metaargument->type()).arg(variable->type()));
+ throw Exception(TQString("Wrong variable type in method \"%1\". Expected \"%2\" but got \"%3\"").tqarg(d->signature).tqarg(metaargument->type()).tqarg(variable->type()));
}
switch(metaargument->type()) {
case Variable::TypeNone: {
kdDebug() << "Variable::TypeNone" << endl;
- uo[i + 1] = QUObject();
+ uo[i + 1] = TQUObject();
} break;
case Variable::TypeVariant: {
kdDebug() << "Variable::TypeVariant" << endl;
- const QVariant variant = variable->variant();
+ const TQVariant variant = variable->variant();
switch(metaargument->variantType()) {
- case QVariant::String: {
- const QString s = variant.toString();
- static_QUType_QString.set( &(uo[i + 1]), s );
+ case TQVariant::String: {
+ const TQString s = variant.toString();
+ static_TQUType_TQString.set( &(uo[i + 1]), s );
} break;
- case QVariant::Int: {
+ case TQVariant::Int: {
const int j = variant.toInt();
- static_QUType_int.set( &(uo[i + 1]), j );
+ static_TQUType_int.set( &(uo[i + 1]), j );
} break;
- case QVariant::Bool: {
+ case TQVariant::Bool: {
const bool b = variant.toBool();
- static_QUType_bool.set( &(uo[i + 1]), b );
+ static_TQUType_bool.set( &(uo[i + 1]), b );
} break;
- case QVariant::Double: {
+ case TQVariant::Double: {
const double d = variant.toDouble();
- static_QUType_double.set( &(uo[i + 1]), d );
+ static_TQUType_double.set( &(uo[i + 1]), d );
} break;
- case QVariant::Invalid: {
- static_QUType_QVariant.set( &(uo[i + 1]), variant );
+ case TQVariant::Invalid: {
+ static_TQUType_TQVariant.set( &(uo[i + 1]), variant );
}
/*FIXME
- static_QUType_charstar
- static_QUType_ptr.get(uo); QObject *qobj = (QObject *)(ptr);
+ static_TQUType_charstar
+ static_TQUType_ptr.get(uo); TQObject *qobj = (TQObject *)(ptr);
*/
default: {
- throw Exception(QString("Invalid parameter !!!!!!!!!!!!!!!!!!!!!!!"));
+ throw Exception(TQString("Invalid parameter !!!!!!!!!!!!!!!!!!!!!!!"));
} break;
}
} break;
@@ -237,15 +237,15 @@ QUObject* MetaMethod::toQUObject(Variable::List arguments)
case Variable::TypeObject: {
kdDebug() << "Variable::TypeObject" << endl;
- const QObject* obj = arguments[i + 1]->object();
+ const TQObject* obj = arguments[i + 1]->object();
if(! obj) { //FIXME: move check to MetaParameter?!
- throw Exception(QString("No QObject !"));
+ throw Exception(TQString("No TQObject !"));
}
- static_QUType_ptr.set( &(uo[i + 1]), obj );
+ static_TQUType_ptr.set( &(uo[i + 1]), obj );
} break;
default: {
- throw Exception(QString("Invalid variable type"));
+ throw Exception(TQString("Invalid variable type"));
} break;
}
@@ -254,43 +254,43 @@ QUObject* MetaMethod::toQUObject(Variable::List arguments)
return uo;
}
-KSharedPtr<Variable> MetaMethod::toVariable(QUObject* uo)
+KSharedPtr<Variable> MetaMethod::toVariable(TQUObject* uo)
{
- const QString desc( uo->type->desc() );
+ const TQString desc( uo->type->desc() );
if(desc == "null") {
return new Variable();
}
- if(desc == "QString") {
- const QString s = static_QUType_QString.get(uo);
+ if(desc == TQSTRING_OBJECT_NAME_STRING) {
+ const TQString s = static_TQUType_TQString.get(uo);
return new Variable(s);
}
if(desc == "int") {
- const int j = static_QUType_int.get(uo);
+ const int j = static_TQUType_int.get(uo);
return new Variable(j);
}
if(desc == "bool") {
- const bool b = static_QUType_bool.get(uo);
+ const bool b = static_TQUType_bool.get(uo);
return new Variable(b);
}
if(desc == "double") {
- const double d = static_QUType_double.get(uo);
+ const double d = static_TQUType_double.get(uo);
return new Variable(d);
}
- if(desc == "QVariant") {
- QVariant v = static_QUType_QVariant.get(uo);
+ if(desc == "TQVariant") {
+ TQVariant v = static_TQUType_TQVariant.get(uo);
return new Variable(v);
}
- throw Exception(QString("Invalid parameter '%1'").arg(desc));
+ throw Exception(TQString("Invalid parameter '%1'").tqarg(desc));
}
-Variable::List MetaMethod::toVariableList(QUObject* uo)
+Variable::List MetaMethod::toVariableList(TQUObject* uo)
{
Variable::List list;
@@ -311,12 +311,12 @@ KSharedPtr<Variable> MetaMethod::invoke(Variable::List arguments)
throw Exception("MetaObject is undefined.");
}
- QObject* obj = d->object->object();
+ TQObject* obj = d->object->object();
KSharedPtr<Variable> returnvalue;
- QUObject* qu = 0;
+ TQUObject* qu = 0;
try {
- qu = toQUObject(arguments);
+ qu = toTQUObject(arguments);
switch( d->type ) {
case Signal: {
@@ -334,7 +334,7 @@ KSharedPtr<Variable> MetaMethod::invoke(Variable::List arguments)
returnvalue = toVariable( &qu[0] );
}
catch(Exception& e) {
- delete [] qu; // free the QUObject array and
+ delete [] qu; // free the TQUObject array and
kdDebug() << "EXCEPTION in KoMacro::MetaMethod::invoke(Variable::List)" << endl;
throw Exception(e); // re-throw exception
}
diff --git a/kexi/plugins/macros/lib/metamethod.h b/kexi/plugins/macros/lib/metamethod.h
index df53ac60..daf7dfcb 100644
--- a/kexi/plugins/macros/lib/metamethod.h
+++ b/kexi/plugins/macros/lib/metamethod.h
@@ -20,13 +20,13 @@
#ifndef KOMACRO_METAMETHOD_H
#define KOMACRO_METAMETHOD_H
-#include <qstring.h>
-#include <qvaluelist.h>
+#include <tqstring.h>
+#include <tqvaluelist.h>
#include <ksharedptr.h>
#include "komacro_export.h"
-struct QUObject;
+struct TQUObject;
namespace KoMacro {
@@ -38,10 +38,10 @@ namespace KoMacro {
/**
* Class to provide abstract methods for the undocumented
- * Qt3 QUObject-API functionality.
+ * TQt3 TQUObject-API functionality.
*
- * The design tried to limit future porting to Qt4 by providing a
- * somewhat similar API to the Qt4 QMeta* stuff.
+ * The design tried to limit future porting to TQt4 by providing a
+ * somewhat similar API to the TQt4 TQMeta* stuff.
*/
class KOMACRO_EXPORT MetaMethod : public KShared
{
@@ -52,8 +52,8 @@ namespace KoMacro {
* access to.
*/
enum Type {
- Signal, /// The @a MetaMethod points to a Qt signal.
- Slot, /// The @a MetaMethod points to a Qt slot.
+ Signal, /// The @a MetaMethod points to a TQt signal.
+ Slot, /// The @a MetaMethod points to a TQt slot.
Unknown /// The @a MetaMethod is not known.
};
@@ -62,14 +62,14 @@ namespace KoMacro {
*
* @param signature The signature this @a MetaMethod has. This
* includes the tagname and the arguments and could look like
- * "myslot(const QString&, int)".
+ * "myslot(const TQString&, int)".
* @param type The @a MetaMethod::Type the @a MethodMethod
* has.
* @param object The @a MetaObject this @a MethodMethod
* belongs to. Each @a MethodMethod is associated with
* exactly one @a MetaObject .
*/
- explicit MetaMethod(const QString& signature, Type type = Unknown, KSharedPtr<MetaObject> object = 0);
+ explicit MetaMethod(const TQString& signature, Type type = Unknown, KSharedPtr<MetaObject> object = 0);
/**
* Destructor.
@@ -84,23 +84,23 @@ namespace KoMacro {
/**
* @return the signature this @a MetaMethod has. It could
- * be something like "mySlot(const QString&,int)".
+ * be something like "mySlot(const TQString&,int)".
*/
- const QString signature() const;
+ const TQString signature() const;
/**
* @return the signatures tagname this @a MetaMethod has.
- * At the signature "mySlot(const QString&,int)" the
+ * At the signature "mySlot(const TQString&,int)" the
* tagname would be "mySlot".
*/
- const QString signatureTag() const;
+ const TQString signatureTag() const;
/**
* @return the signatures arguments this @a MetaMethod has.
- * At the signature "mySlot(const QString&,int)" the
- * arguments are "const QString&,int".
+ * At the signature "mySlot(const TQString&,int)" the
+ * arguments are "const TQString&,int".
*/
- const QString signatureArguments() const;
+ const TQString signatureArguments() const;
/**
* @return the @a Type of method this @a MetaMethod provides
@@ -112,31 +112,31 @@ namespace KoMacro {
* @return the signature arguments as parsed list of
* @a MetaParameter instances.
*/
- QValueList< KSharedPtr<MetaParameter> > arguments() const;
+ TQValueList< KSharedPtr<MetaParameter> > arguments() const;
/**
* Translate the passed @p arguments list of @a Variable instances
- * into a Qt3 QUObject* array.
+ * into a TQt3 TQUObject* array.
*/
- QUObject* toQUObject(QValueList< KSharedPtr<Variable> > arguments);
+ TQUObject* toTQUObject(TQValueList< KSharedPtr<Variable> > arguments);
/**
- * Translate the passed @p uo QUObject reference into an internal used
+ * Translate the passed @p uo TQUObject reference into an internal used
* @a Variable instances.
*/
- KSharedPtr<Variable> toVariable(QUObject* uo);
+ KSharedPtr<Variable> toVariable(TQUObject* uo);
/**
- * Translate the passed @p uo QUObject array into an internal used
+ * Translate the passed @p uo TQUObject array into an internal used
* list of @a Variable instances.
*/
- QValueList< KSharedPtr<Variable> > toVariableList(QUObject* uo);
+ TQValueList< KSharedPtr<Variable> > toVariableList(TQUObject* uo);
/**
* Invoke the @a MetaMethod with the optional arguments
* @p arguments and return a variable.
*/
- KSharedPtr<Variable> invoke(QValueList< KSharedPtr<Variable> > arguments);
+ KSharedPtr<Variable> invoke(TQValueList< KSharedPtr<Variable> > arguments);
private:
/// @internal d-pointer class.
diff --git a/kexi/plugins/macros/lib/metaobject.cpp b/kexi/plugins/macros/lib/metaobject.cpp
index 000f4181..e9e56b44 100644
--- a/kexi/plugins/macros/lib/metaobject.cpp
+++ b/kexi/plugins/macros/lib/metaobject.cpp
@@ -22,8 +22,8 @@
#include "variable.h"
#include "exception.h"
-#include <qguardedptr.h>
-#include <qmetaobject.h>
+#include <tqguardedptr.h>
+#include <tqmetaobject.h>
#include <kdebug.h>
@@ -40,14 +40,14 @@ namespace KoMacro {
public:
/**
- * The QObject instance this @a MetaObject belongs to.
+ * The TQObject instance this @a MetaObject belongs to.
*/
- QGuardedPtr<QObject> const object;
+ TQGuardedPtr<TQObject> const object;
/**
* Constructor.
*/
- Private(QObject* const object)
+ Private(TQObject* const object)
: object(object)
{
}
@@ -55,7 +55,7 @@ namespace KoMacro {
}
-MetaObject::MetaObject(QObject* const object)
+MetaObject::MetaObject(TQObject* const object)
: KShared()
, d( new Private(object) ) // create the private d-pointer instance.
{
@@ -66,66 +66,66 @@ MetaObject::~MetaObject()
delete d;
}
-QObject* const MetaObject::object() const
+TQObject* const MetaObject::object() const
{
if(! d->object) {
- throw Exception(QString("Object is undefined."));
+ throw Exception(TQString("Object is undefined."));
}
return d->object;
}
/*
-QStrList MetaObject::signalNames() const
+TQStrList MetaObject::signalNames() const
{
- return object()->metaObject()->signalNames();
+ return object()->tqmetaObject()->signalNames();
}
-QStrList MetaObject::slotNames() const
+TQStrList MetaObject::slotNames() const
{
- return object()->metaObject()->slotNames();
+ return object()->tqmetaObject()->slotNames();
}
*/
int MetaObject::indexOfSignal(const char* signal) const
{
- QMetaObject* metaobject = object()->metaObject();
+ TQMetaObject* metaobject = object()->tqmetaObject();
int signalid = metaobject->findSignal(signal, false);
if(signalid < 0) {
- throw Exception(QString("Invalid signal \"%1\"").arg(signal));
+ throw Exception(TQString("Invalid signal \"%1\"").tqarg(signal));
}
return signalid;
}
int MetaObject::indexOfSlot(const char* slot) const
{
- QMetaObject* metaobject = object()->metaObject();
+ TQMetaObject* metaobject = object()->tqmetaObject();
int slotid = metaobject->findSlot(slot, false);
if(slotid < 0) {
- throw Exception(QString("Invalid slot \"%1\"").arg(slot));
+ throw Exception(TQString("Invalid slot \"%1\"").tqarg(slot));
}
return slotid;
}
KSharedPtr<MetaMethod> MetaObject::method(int index)
{
- QObject* obj = object();
+ TQObject* obj = object();
MetaMethod::Type type = MetaMethod::Slot;
- QMetaObject* metaobject = obj->metaObject();
+ TQMetaObject* metaobject = obj->tqmetaObject();
- const QMetaData* metadata = metaobject->slot(index, true);
+ const TQMetaData* metadata = metaobject->slot(index, true);
if(! metadata) {
// Try to get a signal with that index iff we failed to determinate
// a matching slot.
metadata = metaobject->signal(index, true);
if(! metadata) {
- throw Exception(QString("Invalid method index \"%1\" in object \"%2\"").arg(index).arg(obj->name()));
+ throw Exception(TQString("Invalid method index \"%1\" in object \"%2\"").tqarg(index).tqarg(obj->name()));
}
type = MetaMethod::Signal;
}
- if(metadata->access != QMetaData::Public) {
- throw Exception(QString("Not allowed to access method \"%1\" in object \"%2\"").arg(metadata->name).arg(obj->name()));
+ if(metadata->access != TQMetaData::Public) {
+ throw Exception(TQString("Not allowed to access method \"%1\" in object \"%2\"").tqarg(metadata->name).tqarg(obj->name()));
}
return new MetaMethod(metadata->name, type, this);
diff --git a/kexi/plugins/macros/lib/metaobject.h b/kexi/plugins/macros/lib/metaobject.h
index 8b611574..a1a52562 100644
--- a/kexi/plugins/macros/lib/metaobject.h
+++ b/kexi/plugins/macros/lib/metaobject.h
@@ -20,7 +20,7 @@
#ifndef KOMACRO_METAOBJECT_H
#define KOMACRO_METAOBJECT_H
-#include <qobject.h>
+#include <tqobject.h>
#include <ksharedptr.h>
#include "komacro_export.h"
@@ -32,11 +32,11 @@ namespace KoMacro {
class MetaMethod;
/**
- * Class to provide abstract access to extended QObject functionality
- * like the undocumented QUObject-API in Qt3.
+ * Class to provide abstract access to extended TQObject functionality
+ * like the undocumented TQUObject-API in TQt3.
*
- * The design tried to limit future porting to Qt4 by providing a
- * somewhat similar API to the Qt4 QMeta* stuff.
+ * The design tried to limit future porting to TQt4 by providing a
+ * somewhat similar API to the TQt4 TQMeta* stuff.
*/
class KOMACRO_EXPORT MetaObject : public KShared
{
@@ -45,10 +45,10 @@ namespace KoMacro {
/**
* Constructor.
*
- * @param object The QObject instance this @a MetaObject provides
+ * @param object The TQObject instance this @a MetaObject provides
* abstract access to.
*/
- explicit MetaObject(QObject* const object);
+ explicit MetaObject(TQObject* const object);
/**
* Destructor.
@@ -56,13 +56,13 @@ namespace KoMacro {
~MetaObject();
/**
- * @return the QObject this @a MetaObject provides abstract
+ * @return the TQObject this @a MetaObject provides abstract
* access to.
*/
- QObject* const object() const;
+ TQObject* const object() const;
- //QStrList signalNames() const;
- //QStrList slotNames() const;
+ //TQStrList signalNames() const;
+ //TQStrList slotNames() const;
/**
* @return the index of the signal @p signal .
@@ -91,7 +91,7 @@ namespace KoMacro {
KSharedPtr<MetaMethod> slot(const char* slot);
//KSharedPtr<MetaMethod> addSlot(const char* slot);
-//void connectSignal(QObject* obj, const char* signal);
+//void connectSignal(TQObject* obj, const char* signal);
/**
* Invoke the @a MetaMethod that has the index @p index .
@@ -104,7 +104,7 @@ namespace KoMacro {
* @return The returnvalue the method provides and that got
* returned if the execution is done.
*/
- KSharedPtr<Variable> invokeMethod(int index, QValueList< KSharedPtr<Variable> > arguments);
+ KSharedPtr<Variable> invokeMethod(int index, TQValueList< KSharedPtr<Variable> > arguments);
private:
/// @internal d-pointer class.
diff --git a/kexi/plugins/macros/lib/metaparameter.cpp b/kexi/plugins/macros/lib/metaparameter.cpp
index 7f072b2b..ed921cfe 100644
--- a/kexi/plugins/macros/lib/metaparameter.cpp
+++ b/kexi/plugins/macros/lib/metaparameter.cpp
@@ -37,10 +37,10 @@ namespace KoMacro {
/**
* The signatures argument that represents this MetaParameter.
- * This could be something like "const QString&", "int" or
- * "QMap &lt; QString, QVariant &gt; ".
+ * This could be something like "const TQString&", "int" or
+ * "TQMap &lt; TQString, TQVariant &gt; ".
*/
- QString signatureargument;
+ TQString signatureargument;
/**
* The type of the @a Variable .
@@ -48,16 +48,16 @@ namespace KoMacro {
MetaParameter::Type type;
/**
- * If the @a MetaParameter::Type is a Variant this QVariant::Type
+ * If the @a MetaParameter::Type is a Variant this TQVariant::Type
* is used to defined what kind of Variant it is.
*/
- QVariant::Type varianttype;
+ TQVariant::Type varianttype;
};
}
-MetaParameter::MetaParameter(const QString& signatureargument)
+MetaParameter::MetaParameter(const TQString& signatureargument)
: KShared()
, d( new Private() ) // create the private d-pointer instance.
{
@@ -78,7 +78,7 @@ MetaParameter::Type MetaParameter::type() const
return d->type;
}
-const QString MetaParameter::typeName() const
+const TQString MetaParameter::typeName() const
{
switch( d->type ) {
case TypeNone:
@@ -88,31 +88,31 @@ const QString MetaParameter::typeName() const
case TypeObject:
return "Object";
}
- return QString::null;
+ return TQString();
}
void MetaParameter::setType(MetaParameter::Type type)
{
d->type = type;
- d->varianttype = QVariant::Invalid;
+ d->varianttype = TQVariant::Invalid;
}
-QVariant::Type MetaParameter::variantType() const
+TQVariant::Type MetaParameter::variantType() const
{
return d->varianttype;
}
-void MetaParameter::setVariantType(QVariant::Type varianttype)
+void MetaParameter::setVariantType(TQVariant::Type varianttype)
{
d->type = TypeVariant;
d->varianttype = varianttype;
}
-void MetaParameter::setSignatureArgument(const QString& signatureargument)
+void MetaParameter::setSignatureArgument(const TQString& signatureargument)
{
d->signatureargument = signatureargument;
- QString argument = signatureargument;
+ TQString argument = signatureargument;
if(argument.startsWith("const")) {
argument = argument.mid(5).stripWhiteSpace();
}
@@ -122,14 +122,14 @@ void MetaParameter::setSignatureArgument(const QString& signatureargument)
}
if(argument.isEmpty()) {
- throw Exception(QString("Empty signature argument passed."));
+ throw Exception(TQString("Empty signature argument passed."));
}
- if(argument == "QVariant") {
- setVariantType( QVariant::Invalid );
+ if(argument == "TQVariant") {
+ setVariantType( TQVariant::Invalid );
}
- QVariant::Type type = argument.isNull() ? QVariant::Invalid : QVariant::nameToType(argument.latin1());
- if (type != QVariant::Invalid) {
+ TQVariant::Type type = argument.isNull() ? TQVariant::Invalid : TQVariant::nameToType(argument.latin1());
+ if (type != TQVariant::Invalid) {
setVariantType( type );
}
else {
diff --git a/kexi/plugins/macros/lib/metaparameter.h b/kexi/plugins/macros/lib/metaparameter.h
index ab2a4004..fa9df552 100644
--- a/kexi/plugins/macros/lib/metaparameter.h
+++ b/kexi/plugins/macros/lib/metaparameter.h
@@ -20,9 +20,9 @@
#ifndef KOMACRO_METAPARAMETER_H
#define KOMACRO_METAPARAMETER_H
-#include <qstring.h>
-#include <qvariant.h>
-#include <qobject.h>
+#include <tqstring.h>
+#include <tqvariant.h>
+#include <tqobject.h>
#include <ksharedptr.h>
#include "komacro_export.h"
@@ -34,10 +34,10 @@ namespace KoMacro {
/**
* Class to provide abstract methods for the undocumented
- * Qt3 QUObject-API functionality.
+ * TQt3 TQUObject-API functionality.
*
- * The design tried to limit future porting to Qt4 by providing a
- * somewhat similar API to the Qt4 QMeta* stuff.
+ * The design tried to limit future porting to TQt4 by providing a
+ * somewhat similar API to the TQt4 TQMeta* stuff.
*/
class KOMACRO_EXPORT MetaParameter : public KShared
{
@@ -45,29 +45,29 @@ namespace KoMacro {
/**
* Property to get the type of the variable.
*/
- Q_PROPERTY(Type type READ type)
+ TQ_PROPERTY(Type type READ type)
/**
* Property to get the type of the variable as string.
*/
- Q_PROPERTY(QString typeName READ typeName)
+ TQ_PROPERTY(TQString typeName READ typeName)
public:
/**
* List of @a MetaParameter instances.
*/
- typedef QValueList<KSharedPtr <MetaParameter > > List;
+ typedef TQValueList<KSharedPtr <MetaParameter > > List;
/**
* Constructor.
*
* @param signatureargument The signatures argument
* that will be used to determinate the arguments
- * type. This could be something like "const QString&",
- * "int" or "QMap &lt; QString, QVariant &gt; ".
+ * type. This could be something like "const TQString&",
+ * "int" or "TQMap &lt; TQString, TQVariant &gt; ".
*/
- explicit MetaParameter(const QString& signatureargument = QString::null);
+ explicit MetaParameter(const TQString& signatureargument = TQString());
/**
* Destructor.
@@ -79,8 +79,8 @@ namespace KoMacro {
*/
enum Type {
TypeNone = 0, /// None type, the @a MetaParameter is empty.
- TypeVariant, /// The @a MetaParameter is a QVariant.
- TypeObject /// The @a MetaParameter is a QObject.
+ TypeVariant, /// The @a MetaParameter is a TQVariant.
+ TypeObject /// The @a MetaParameter is a TQObject.
};
/**
@@ -92,7 +92,7 @@ namespace KoMacro {
* @return the @a MetaParameter::Type as string. The typename
* could be "None", "Variant" or "Object".
*/
- const QString typeName() const;
+ const TQString typeName() const;
/**
* Set the @a MetaParameter::Type this variable is.
@@ -102,12 +102,12 @@ namespace KoMacro {
/**
* @return the @a MetaParameter::Type this variable is.
*/
- QVariant::Type variantType() const;
+ TQVariant::Type variantType() const;
/**
* Set the @a MetaParameter::Type this variable is.
*/
- void setVariantType(QVariant::Type varianttype);
+ void setVariantType(TQVariant::Type varianttype);
/**
* @return true if the passed @a Variable @p variable is
@@ -122,7 +122,7 @@ namespace KoMacro {
* @internal used method to set the signature argument. Those
* argument will be used to determinate the arguments type.
*/
- void setSignatureArgument(const QString& signatureargument);
+ void setSignatureArgument(const TQString& signatureargument);
private:
/// @internal d-pointer class.
diff --git a/kexi/plugins/macros/lib/variable.cpp b/kexi/plugins/macros/lib/variable.cpp
index 598b8b46..f64613b0 100644
--- a/kexi/plugins/macros/lib/variable.cpp
+++ b/kexi/plugins/macros/lib/variable.cpp
@@ -37,31 +37,31 @@ namespace KoMacro {
/**
* The name this @a Variable has.
*/
- QString name;
+ TQString name;
/**
* The i18n-caption used for display purposes only
* this @a Variable has.
*/
- QString text;
+ TQString text;
/**
- * If @a Variable::Type is @a Variable::TypeVariant this QVariant
+ * If @a Variable::Type is @a Variable::TypeVariant this TQVariant
* holds the value else it's invalid.
*/
- QVariant variant;
+ TQVariant variant;
/**
- * If @a Variable::Type is @a Variable::TypeObject this QObject is
+ * If @a Variable::Type is @a Variable::TypeObject this TQObject is
* the value else it's NULL.
*/
- const QObject* object;
+ const TQObject* object;
/**
- * Optional list of children this @a Variable has.
+ * Optional list of tqchildren this @a Variable has.
*/
// TODO Dow we use this or is it for the future??
- Variable::List children;
+ Variable::List tqchildren;
/**
* Defines if the variable is enabled or disabled.
@@ -84,7 +84,7 @@ Variable::Variable()
d->object = 0;
}
-Variable::Variable(const QVariant& variant, const QString& name, const QString& text)
+Variable::Variable(const TQVariant& variant, const TQString& name, const TQString& text)
: MetaParameter()
, d( new Private() ) // create the private d-pointer instance.
{
@@ -95,7 +95,7 @@ Variable::Variable(const QVariant& variant, const QString& name, const QString&
d->text = text;
}
-Variable::Variable(const QObject* object)
+Variable::Variable(const TQObject* object)
: MetaParameter()
, d( new Private() ) // create the private d-pointer instance.
{
@@ -103,28 +103,28 @@ Variable::Variable(const QObject* object)
d->object = object;
}
-Variable::Variable(const QDomElement& element)
+Variable::Variable(const TQDomElement& element)
: MetaParameter()
, d( new Private() ) // create the private d-pointer instance.
{
- QString typesignature = element.attribute("type", "const QString&");
- QString value = element.text();
+ TQString typesignature = element.attribute("type", "const TQString&");
+ TQString value = element.text();
setSignatureArgument( typesignature );
switch( type() ) {
case KoMacro::MetaParameter::TypeVariant: {
- //kdDebug() << QString("KoMacro::Variable(QDomElement) KoMacro::MetaParameter::TypeVariant") << endl;
+ //kdDebug() << TQString("KoMacro::Variable(TQDomElement) KoMacro::MetaParameter::TypeVariant") << endl;
// Set the variant without overwritting the previously detected varianttype.
- setVariant( QVariant(value), false );
+ setVariant( TQVariant(value), false );
} break;
case KoMacro::MetaParameter::TypeObject: {
- //kdDebug() << QString("KoMacro::Variable(QDomElement) KoMacro::MetaParameter::TypeObject") << endl;
+ //kdDebug() << TQString("KoMacro::Variable(TQDomElement) KoMacro::MetaParameter::TypeObject") << endl;
//TODO setObject();
} break;
default: {
- kdWarning() << QString("KoMacro::Variable(QDomElement) KoMacro::MetaParameter::TypeNone") << endl;
+ kdWarning() << TQString("KoMacro::Variable(TQDomElement) KoMacro::MetaParameter::TypeNone") << endl;
} break;
}
}
@@ -134,35 +134,35 @@ Variable::~Variable()
delete d;
}
-QString Variable::name() const
+TQString Variable::name() const
{
return d->name;
}
-void Variable::setName(const QString& name)
+void Variable::setName(const TQString& name)
{
d->name = name;
}
-QString Variable::text() const
+TQString Variable::text() const
{
return d->text;
}
-void Variable::setText(const QString& text)
+void Variable::setText(const TQString& text)
{
d->text = text;
}
-const QVariant Variable::variant() const
+const TQVariant Variable::variant() const
{
//Q_ASSERT( type() == MetaParameter::TypeVariant );
- //Q_ASSERT( variantType() != QVariant::Invalid );
- //if(variantType() == QVariant::Invalid) return QVariant();
+ //Q_ASSERT( variantType() != TQVariant::Invalid );
+ //if(variantType() == TQVariant::Invalid) return TQVariant();
return d->variant;
}
-void Variable::setVariant(const QVariant& variant, bool detecttype)
+void Variable::setVariant(const TQVariant& variant, bool detecttype)
{
if(detecttype) {
setVariantType( variant.type() );
@@ -170,42 +170,42 @@ void Variable::setVariant(const QVariant& variant, bool detecttype)
d->variant = variant;
}
-const QObject* Variable::object() const
+const TQObject* Variable::object() const
{
Q_ASSERT( ! d->object );
return d->object;
}
-void Variable::setObject(const QObject* object)
+void Variable::setObject(const TQObject* object)
{
setType(TypeObject);
d->object = object;
}
-Variable::operator QVariant () const
+Variable::operator TQVariant () const
{
return variant();
}
-Variable::operator const QObject* () const
+Variable::operator const TQObject* () const
{
return object();
}
-const QString Variable::toString() const
+const TQString Variable::toString() const
{
switch( type() ) {
case KoMacro::MetaParameter::TypeVariant: {
return variant().toString();
} break;
case KoMacro::MetaParameter::TypeObject: {
- return QString("[%1]").arg( object()->name() );
+ return TQString("[%1]").tqarg( object()->name() );
} break;
default: {
throw Exception("Type is undefined.");
} break;
}
- return QString::null;
+ return TQString();
}
int Variable::toInt() const
@@ -213,24 +213,24 @@ int Variable::toInt() const
return variant().toInt();
}
-Variable::List Variable::children() const
+Variable::List Variable::tqchildren() const
{
- return d->children;
+ return d->tqchildren;
}
void Variable::appendChild(KSharedPtr<Variable> variable)
{
- d->children.append(variable);
+ d->tqchildren.append(variable);
}
void Variable::clearChildren()
{
- d->children.clear();
+ d->tqchildren.clear();
}
-void Variable::setChildren(const Variable::List& children)
+void Variable::setChildren(const Variable::List& tqchildren)
{
- d->children = children;
+ d->tqchildren = tqchildren;
}
/*
diff --git a/kexi/plugins/macros/lib/variable.h b/kexi/plugins/macros/lib/variable.h
index 26e9619e..108a6005 100644
--- a/kexi/plugins/macros/lib/variable.h
+++ b/kexi/plugins/macros/lib/variable.h
@@ -20,9 +20,9 @@
#ifndef KOMACRO_VARIABLE_H
#define KOMACRO_VARIABLE_H
-#include <qobject.h>
-#include <qdom.h>
-#include <qvariant.h>
+#include <tqobject.h>
+#include <tqdom.h>
+#include <tqvariant.h>
#include <ksharedptr.h>
#include "metaparameter.h"
@@ -31,7 +31,7 @@ namespace KoMacro {
/**
* A variable value used to provide abstract access to variables. The
- * class handles QVariant and QObject and provides access to them.
+ * class handles TQVariant and TQObject and provides access to them.
* Variable inherits KShared and implements reference couting. So, it's
* not needed to take care of memory-managment.
*/
@@ -39,31 +39,31 @@ namespace KoMacro {
{
/**
- * Property to get and set a QVariant as variable.
+ * Property to get and set a TQVariant as variable.
*/
- Q_PROPERTY(QVariant variant READ variant WRITE setVariant)
+ TQ_PROPERTY(TQVariant variant READ variant WRITE setVariant)
/**
- * Property to get and set a QObject as variable.
+ * Property to get and set a TQObject as variable.
*/
- Q_PROPERTY(QObject* object READ object WRITE setObject)
+ TQ_PROPERTY(TQObject* object READ object WRITE setObject)
/**
* Property to get a string-representation of the variable.
*/
- Q_PROPERTY(QString string READ toString)
+ TQ_PROPERTY(TQString string READ toString)
public:
/**
* A list of variables.
*/
- typedef QValueList<KSharedPtr<Variable > > List;
+ typedef TQValueList<KSharedPtr<Variable > > List;
/**
* A map of variables.
*/
- typedef QMap<QString, KSharedPtr<Variable > > Map;
+ typedef TQMap<TQString, KSharedPtr<Variable > > Map;
/**
* Default constructor.
@@ -71,28 +71,28 @@ namespace KoMacro {
explicit Variable();
/**
- * Constructor from the QVariant @p variant .
+ * Constructor from the TQVariant @p variant .
*
* @param variant The value this variable has.
* @param name The unique @a name() this variable has.
* @param text The describing @a text() this variable has.
*/
- Variable(const QVariant& variant, const QString& name = QString::null, const QString& text = QString::null);
+ Variable(const TQVariant& variant, const TQString& name = TQString(), const TQString& text = TQString());
/**
- * Constructor from the QObject @p object .
+ * Constructor from the TQObject @p object .
*
* @param object The value this variable has.
*/
- Variable(const QObject* object);
+ Variable(const TQObject* object);
/**
- * Constructor from the QDomElement @p element .
+ * Constructor from the TQDomElement @p element .
* @deprecated replaced with methods of @a XMLHandler.
- * @param element The QDomElement that may optional contains the
+ * @param element The TQDomElement that may optional contains the
* variable content or other additional informations.
*/
- Variable(const QDomElement& element);
+ Variable(const TQDomElement& element);
/**
* Destructor.
@@ -102,69 +102,69 @@ namespace KoMacro {
/**
* @return the name this @a Variable has.
*/
- QString name() const;
+ TQString name() const;
/**
* Set the name @param name this @a Variable has.
*/
- void setName(const QString& name);
+ void setName(const TQString& name);
/**
* @return the caption this @a Variable has.
*/
- QString text() const;
+ TQString text() const;
/**
* Set the caption @param text this @a Variable has.
*/
- void setText(const QString& text);
+ void setText(const TQString& text);
/**
- * Set the QObject @param object this variable has. A
+ * Set the TQObject @param object this variable has. A
* previously remembered value will be overwritten and
* the new type is a @a TypeObject .
*/
- void setObject(const QObject* object);
+ void setObject(const TQObject* object);
/**
- * @return the QVariant this variable has. If this
- * variable isn't a @a TypeVariant an invalid QVariant
+ * @return the TQVariant this variable has. If this
+ * variable isn't a @a TypeVariant an invalid TQVariant
* got returned.
*/
- const QVariant variant() const;
+ const TQVariant variant() const;
/**
- * Set the QVariant @param variant this variable has. A
+ * Set the TQVariant @param variant this variable has. A
* previously remembered value will be overwritten and
* the new type is a @a TypeVariant . If @param detecttype is
* true the method tries to set the @a variantType according
- * to the passed QVariant. If false the variantType won't
+ * to the passed TQVariant. If false the variantType won't
* be changed.
*/
- void setVariant(const QVariant& variant, bool detecttype = true);
+ void setVariant(const TQVariant& variant, bool detecttype = true);
/**
- * @return the QObject this variable has. If this
+ * @return the TQObject this variable has. If this
* variable isn't a @a TypeObject NULL got returned.
*/
- const QObject* object() const;
+ const TQObject* object() const;
/**
- * Implicit conversion to QVariant operator. This method
+ * Implicit conversion to TQVariant operator. This method
* calls @a variant() internaly.
*/
- operator QVariant () const;
+ operator TQVariant () const;
/**
- * Implicit conversion to QObject operator. This method
+ * Implicit conversion to TQObject operator. This method
* calls @a object() internaly.
*/
- operator const QObject* () const;
+ operator const TQObject* () const;
/**
* @return a string-represenation of the variable.
*/
- const QString toString() const;
+ const TQString toString() const;
/**
* @return a integer-represenation of the variable.
@@ -173,29 +173,29 @@ namespace KoMacro {
/**
* @return the optional list of @a Variable instances
- * that are children of this @a Variable .
+ * that are tqchildren of this @a Variable .
*
* @note that the list is returned call-by-reference. The
* list is accessed as getter/setter (read/write). So,
* don't set this method to const!
*/
- List children() const;
+ List tqchildren() const;
/**
- * Append a @a Variable to the list of children this
+ * Append a @a Variable to the list of tqchildren this
* @a Variable has.
*/
void appendChild(KSharedPtr<Variable> variable);
/**
- * Clear the list of children this @a Variable has.
+ * Clear the list of tqchildren this @a Variable has.
*/
void clearChildren();
/**
- * Set the children this @a Variable has.
+ * Set the tqchildren this @a Variable has.
*/
- void setChildren(const List& children);
+ void setChildren(const List& tqchildren);
#if 0
/**
diff --git a/kexi/plugins/macros/lib/xmlhandler.cpp b/kexi/plugins/macros/lib/xmlhandler.cpp
index b35759e1..4894c619 100644
--- a/kexi/plugins/macros/lib/xmlhandler.cpp
+++ b/kexi/plugins/macros/lib/xmlhandler.cpp
@@ -22,7 +22,7 @@
#include "macroitem.h"
#include "action.h"
-#include <qdom.h>
+#include <tqdom.h>
#include <kdebug.h>
using namespace KoMacro;
@@ -67,7 +67,7 @@ XMLHandler::~XMLHandler()
delete d;
}
-bool XMLHandler::parseXML(const QDomElement& element)
+bool XMLHandler::parseXML(const TQDomElement& element)
{
// Remove old items. We should clear first.
d->macro->clearItems();
@@ -75,7 +75,7 @@ bool XMLHandler::parseXML(const QDomElement& element)
// We expect a <macro> element. Do we really need to be such strict or
// would it be more wise to trust the application in that case?
if(element.tagName() != "macro") {
- kdDebug() << QString("XMLHandler::parseXML() Invalid tagname \"%1\"").arg(element.tagName()) << endl;
+ kdDebug() << TQString("XMLHandler::parseXML() Invalid tagname \"%1\"").tqarg(element.tagName()) << endl;
return false;
}
@@ -83,20 +83,20 @@ bool XMLHandler::parseXML(const QDomElement& element)
// If there is more than one version, parsing should update old macro-data, so that it
// could write out in the newer version in toXML().
if( element.attribute("xmlversion") != "1"){
- kdDebug() << QString("XMLHandler::parseXML() Invalid xml-version \"%1\"").arg(element.attribute("xmlversion")) << endl;
+ kdDebug() << TQString("XMLHandler::parseXML() Invalid xml-version \"%1\"").tqarg(element.attribute("xmlversion")) << endl;
return false;
}
// Do we need to load the macro's name?
// d->macro->setName(element.attribute("name"));
- // Iterate through the child nodes the passed QDomElement has and
+ // Iterate through the child nodes the passed TQDomElement has and
// build the MacroItem elements.
- for(QDomNode itemnode = element.firstChild(); ! itemnode.isNull(); itemnode = itemnode.nextSibling()) {
+ for(TQDomNode itemnode = element.firstChild(); ! itemnode.isNull(); itemnode = itemnode.nextSibling()) {
// The tagname should be "item"
if(itemnode.nodeName() == "item") {
// The node is an element.
- const QDomElement itemelem = itemnode.toElement();
+ const TQDomElement itemelem = itemnode.toElement();
// Create a new MacroItem
KSharedPtr<MacroItem> item = new MacroItem();
@@ -115,18 +115,18 @@ bool XMLHandler::parseXML(const QDomElement& element)
// Set the comment
item->setComment( itemelem.attribute("comment") );
- // Iterate through the children this item has and try
+ // Iterate through the tqchildren this item has and try
// to fill the list of variables our new MacroItem has.
- for(QDomNode childnode = itemnode.firstChild(); ! childnode.isNull(); childnode = childnode.nextSibling()) {
+ for(TQDomNode childnode = itemnode.firstChild(); ! childnode.isNull(); childnode = childnode.nextSibling()) {
// The tagname should be "variable"
if(childnode.nodeName() == "variable") {
// The node is an element.
- const QDomElement childelem = childnode.toElement();
+ const TQDomElement childelem = childnode.toElement();
// The name the variable has.
- const QString name = childelem.attribute("name");
+ const TQString name = childelem.attribute("name");
// The value the variable has.
- const QString value = childelem.text();
+ const TQString value = childelem.text();
// Store the new variable in our macroitem.
item->addVariable(name, value);
@@ -139,13 +139,13 @@ bool XMLHandler::parseXML(const QDomElement& element)
return true;
}
-QDomElement XMLHandler::toXML()
+TQDomElement XMLHandler::toXML()
{
- // The QDomDocument provides us the functionality to create new QDomElement instances.
- QDomDocument document;
+ // The TQDomDocument provides us the functionality to create new TQDomElement instances.
+ TQDomDocument document;
- // Create the Macro-QDomElement. This element will be returned.
- QDomElement macroelem = document.createElement("macro");
+ // Create the Macro-TQDomElement. This element will be returned.
+ TQDomElement macroelem = document.createElement("macro");
// Set the Macro-XML-Version, it should be the newest Version.
macroelem.setAttribute("xmlversion","1");
@@ -156,12 +156,12 @@ QDomElement XMLHandler::toXML()
// redundancy at this point.
//macroelem.setAttribute("name",d->macro->name());
- // The list of MacroItem-children a Macro provides.
- QValueList<KSharedPtr<MacroItem > > items = d->macro->items();
+ // The list of MacroItem-tqchildren a Macro provides.
+ TQValueList<KSharedPtr<MacroItem > > items = d->macro->items();
// Create an iterator...
- QValueList<KSharedPtr<MacroItem > >::ConstIterator it(items.constBegin()), end(items.constEnd());
- // ...and iterate over the list of children the Macro provides.
+ TQValueList<KSharedPtr<MacroItem > >::ConstIterator it(items.constBegin()), end(items.constEnd());
+ // ...and iterate over the list of tqchildren the Macro provides.
for(;it != end; ++it) {
// We are iterating over MacroItem instances.
KSharedPtr<MacroItem> item = *it;
@@ -171,7 +171,7 @@ QDomElement XMLHandler::toXML()
bool append = false;
// Each MacroItem will have an own node.
- QDomElement itemelem = document.createElement("item");
+ TQDomElement itemelem = document.createElement("item");
// Each MacroItem could point to an Action provided by the Manager.
const KSharedPtr<Action> action = item->action();
@@ -184,9 +184,9 @@ QDomElement XMLHandler::toXML()
// Each MacroItem could have a list of variables. We
// iterate through that list and build a element
// for each single variable.
- QMap<QString, KSharedPtr<Variable > > varmap = item->variables();
+ TQMap<TQString, KSharedPtr<Variable > > varmap = item->variables();
- for(QMap<QString, KSharedPtr<Variable > >::ConstIterator vit = varmap.constBegin(); vit != varmap.constEnd(); ++vit) {
+ for(TQMap<TQString, KSharedPtr<Variable > >::ConstIterator vit = varmap.constBegin(); vit != varmap.constEnd(); ++vit) {
const KSharedPtr<Variable> v = vit.data();
if(! v.data()) {
// skip if the variable is NULL.
@@ -194,7 +194,7 @@ QDomElement XMLHandler::toXML()
}
// Create an own element for the variable. The tagname will be
// the name of the variable.
- QDomElement varelement = document.createElement("variable");
+ TQDomElement varelement = document.createElement("variable");
// Remember the name the value has.
varelement.setAttribute("name", vit.key());
@@ -208,7 +208,7 @@ QDomElement XMLHandler::toXML()
}
// Each MacroItem could have an optional comment.
- const QString comment = item->comment();
+ const TQString comment = item->comment();
if(! comment.isEmpty()) {
append = true;
itemelem.setAttribute("comment", item->comment());
diff --git a/kexi/plugins/macros/lib/xmlhandler.h b/kexi/plugins/macros/lib/xmlhandler.h
index b6978d0f..c6ee0c26 100644
--- a/kexi/plugins/macros/lib/xmlhandler.h
+++ b/kexi/plugins/macros/lib/xmlhandler.h
@@ -22,8 +22,8 @@
#include "komacro_export.h"
-class QObject;
-class QDomElement;
+class TQObject;
+class TQDomElement;
namespace KoMacro {
@@ -51,20 +51,20 @@ namespace KoMacro {
~XMLHandler();
/**
- * Reads a given @a QDomElement, extracts given
+ * Reads a given @a TQDomElement, extracts given
* Actions into the managed Macro-Instance.
- * @param element The @a QDomElement within
+ * @param element The @a TQDomElement within
* the @a Macro.
* @return Return true when parsing is successfull.
*/
- bool parseXML(const QDomElement& element);
+ bool parseXML(const TQDomElement& element);
/**
- * Converts the macro to a @a QDomElement.
- * @return The resulten @a QDomElement from
+ * Converts the macro to a @a TQDomElement.
+ * @return The resulten @a TQDomElement from
* the @a Macro.
*/
- QDomElement toXML();
+ TQDomElement toXML();
private:
/// @internal d-pointer class.