diff options
Diffstat (limited to 'kexi/formeditor/commands.h')
-rw-r--r-- | kexi/formeditor/commands.h | 164 |
1 files changed, 82 insertions, 82 deletions
diff --git a/kexi/formeditor/commands.h b/kexi/formeditor/commands.h index 619ef791..c38f9b86 100644 --- a/kexi/formeditor/commands.h +++ b/kexi/formeditor/commands.h @@ -21,21 +21,21 @@ #ifndef KFORMEDITOR_COMMANDS_H #define KFORMEDITOR_COMMANDS_H -#include <qmap.h> -#include <qdict.h> -#include <qptrlist.h> -#include <qptrdict.h> -#include <qvariant.h> -#include <qdom.h> +#include <tqmap.h> +#include <tqdict.h> +#include <tqptrlist.h> +#include <tqptrdict.h> +#include <tqvariant.h> +#include <tqdom.h> #include <kcommand.h> #include "utils.h" -class QWidget; -class QRect; -class QPoint; -class QStringList; -class QCString; +class TQWidget; +class TQRect; +class TQPoint; +class TQStringList; +class TQCString; namespace KFormDesigner { @@ -54,32 +54,32 @@ class KFORMEDITOR_EXPORT Command : public KCommand virtual void debug() = 0; }; -/*! This command is used when changing a property for one or more widgets. \a oldvalues is a QMap +/*! This command is used when changing a property for one or more widgets. \a oldvalues is a TQMap of the old values of the property for every widget, to allow reverting the change. \a value is the new value of the property. You can use the simpler constructor for a single widget. */ class KFORMEDITOR_EXPORT PropertyCommand : public Command { public: - PropertyCommand(WidgetPropertySet *set, const QCString &wname, const QVariant &oldValue, - const QVariant &value, const QCString &property); - PropertyCommand(WidgetPropertySet *set, const QMap<QCString, QVariant> &oldvalues, - const QVariant &value, const QCString &property); + PropertyCommand(WidgetPropertySet *set, const TQCString &wname, const TQVariant &oldValue, + const TQVariant &value, const TQCString &property); + PropertyCommand(WidgetPropertySet *set, const TQMap<TQCString, TQVariant> &oldvalues, + const TQVariant &value, const TQCString &property); virtual void execute(); virtual void unexecute(); - virtual QString name() const; - QCString property() const { return m_property; } + virtual TQString name() const; + TQCString property() const { return m_property; } - void setValue(const QVariant &value); - const QMap<QCString, QVariant>& oldValues() const { return m_oldvalues; } + void setValue(const TQVariant &value); + const TQMap<TQCString, TQVariant>& oldValues() const { return m_oldvalues; } virtual void debug(); protected: WidgetPropertySet *m_propSet; - QVariant m_value; - QMap<QCString, QVariant> m_oldvalues; - QCString m_property; + TQVariant m_value; + TQMap<TQCString, TQVariant> m_oldvalues; + TQCString m_property; }; /*! This command is used when moving multiples widgets at the same time, while holding Ctrl or Shift. @@ -88,24 +88,24 @@ class KFORMEDITOR_EXPORT PropertyCommand : public Command class KFORMEDITOR_EXPORT GeometryPropertyCommand : public Command { public: - GeometryPropertyCommand(WidgetPropertySet *set, const QStringList &names, const QPoint& oldPos); + GeometryPropertyCommand(WidgetPropertySet *set, const TQStringList &names, const TQPoint& oldPos); virtual void execute(); virtual void unexecute(); - virtual QString name() const; - void setPos(const QPoint& pos); + virtual TQString name() const; + void setPos(const TQPoint& pos); virtual void debug(); protected: WidgetPropertySet *m_propSet; - QStringList m_names; - QPoint m_oldPos; - QPoint m_pos; + TQStringList m_names; + TQPoint m_oldPos; + TQPoint m_pos; }; /*! This command is used when an item in 'Align Widgets position' is selected. You just need to give the list of widget names (the selected ones), and the - type of alignment (see the enum for possible values). */ + type of tqalignment (see the enum for possible values). */ class KFORMEDITOR_EXPORT AlignWidgetsCommand : public Command { public: @@ -115,13 +115,13 @@ class KFORMEDITOR_EXPORT AlignWidgetsCommand : public Command virtual void execute(); virtual void unexecute(); - virtual QString name() const; + virtual TQString name() const; virtual void debug(); protected: Form *m_form; int m_type; - QMap<QCString, QPoint> m_pos; + TQMap<TQCString, TQPoint> m_pos; }; /*! This command is used when an item in 'Adjust Widgets Size' is selected. You just need @@ -137,39 +137,39 @@ class KFORMEDITOR_EXPORT AdjustSizeCommand : public Command virtual void execute(); virtual void unexecute(); - virtual QString name() const; + virtual TQString name() const; virtual void debug(); protected: - QSize getSizeFromChildren(ObjectTreeItem *item); + TQSize getSizeFromChildren(ObjectTreeItem *item); protected: Form *m_form; int m_type; - QMap<QCString, QPoint> m_pos; - QMap<QCString, QSize> m_sizes; + TQMap<TQCString, TQPoint> m_pos; + TQMap<TQCString, TQSize> m_sizes; }; -/*! This command is used when switching the layout of a Container. It remembers the old pos +/*! This command is used when switching the tqlayout of a Container. It remembers the old pos of every widget inside the Container. */ class KFORMEDITOR_EXPORT LayoutPropertyCommand : public PropertyCommand { public: - LayoutPropertyCommand(WidgetPropertySet *set, const QCString &wname, - const QVariant &oldValue, const QVariant &value); + LayoutPropertyCommand(WidgetPropertySet *set, const TQCString &wname, + const TQVariant &oldValue, const TQVariant &value); virtual void execute(); virtual void unexecute(); - virtual QString name() const; + virtual TQString name() const; virtual void debug(); protected: Form *m_form; - QMap<QCString,QRect> m_geometries; + TQMap<TQCString,TQRect> m_geometries; }; /*! This command is used when inserting a widger using toolbar or menu. You only need to give -the parent Container and the widget pos. +the tqparent Container and the widget pos. The other information is taken from FormManager. */ class KFORMEDITOR_EXPORT InsertWidgetCommand : public Command { @@ -183,45 +183,45 @@ class KFORMEDITOR_EXPORT InsertWidgetCommand : public Command otherwise, \a namePrefix is used to generate widget's name. This allows e.g. inserting a widgets having name constructed using */ - InsertWidgetCommand(Container *container, const QCString& className, - const QPoint& pos, const QCString& namePrefix = QCString()); + InsertWidgetCommand(Container *container, const TQCString& className, + const TQPoint& pos, const TQCString& namePrefix = TQCString()); virtual void execute(); virtual void unexecute(); - virtual QString name() const; + virtual TQString name() const; virtual void debug(); //! \return inserted widget's name - QCString widgetName() const { return m_name; } + TQCString widgetName() const { return m_name; } protected: Form *m_form; - QString m_containername; - QPoint m_point; - QCString m_name; - QCString m_class; - QRect m_insertRect; + TQString m_containername; + TQPoint m_point; + TQCString m_name; + TQCString m_class; + TQRect m_insertRect; }; -/*! This command is used when creating a layout from some widgets using "Lay out in..." menu item. +/*! This command is used when creating a tqlayout from some widgets using "Lay out in..." menu item. It remembers the old pos of every widget, and takes care of updating ObjectTree too. You need to supply a WidgetList of the selected widgets. */ class KFORMEDITOR_EXPORT CreateLayoutCommand : public Command { public: - CreateLayoutCommand(int layoutType, WidgetList &list, Form *form); + CreateLayoutCommand(int tqlayoutType, WidgetList &list, Form *form); CreateLayoutCommand() {;} // for BreakLayoutCommand virtual void execute(); virtual void unexecute(); - virtual QString name() const; + virtual TQString name() const; virtual void debug(); protected: Form *m_form; - QString m_containername; - QString m_name; - QMap<QCString,QRect> m_pos; + TQString m_containername; + TQString m_name; + TQMap<TQCString,TQRect> m_pos; int m_type; }; @@ -234,46 +234,46 @@ class KFORMEDITOR_EXPORT BreakLayoutCommand : public CreateLayoutCommand virtual void execute(); virtual void unexecute(); - virtual QString name() const; + virtual TQString name() const; virtual void debug(); }; -/*! This command is used when pasting widgets. You need to give the QDomDocument containing +/*! This command is used when pasting widgets. You need to give the TQDomDocument containing the widget(s) to paste, and optionnally the point where to paste widgets. */ class KFORMEDITOR_EXPORT PasteWidgetCommand : public Command { public: - PasteWidgetCommand(QDomDocument &domDoc, Container *container, const QPoint& p = QPoint()); + PasteWidgetCommand(TQDomDocument &domDoc, Container *container, const TQPoint& p = TQPoint()); virtual void execute(); virtual void unexecute(); - virtual QString name() const; + virtual TQString name() const; virtual void debug(); protected: /*! Internal function used to change the coordinates of a widget to \a newpos before pasting it (to paste it at the position of the contextual menu). It modifies - the "geometry" property of the QDomElement representing the widget. */ - void changePos(QDomElement &widg, const QPoint &newpos); + the "geometry" property of the TQDomElement representing the widget. */ + void changePos(TQDomElement &widg, const TQPoint &newpos); /*! Internal function used to fix the coordinates of a widget before pasting it (to avoid having two widgets at the same position). It moves the widget by (10, 10) increment (several times if there are already pasted widgets at this position). */ - void fixPos(QDomElement &el, Container *container); - void moveWidgetBy(QDomElement &el, Container *container, const QPoint &p); + void fixPos(TQDomElement &el, Container *container); + void moveWidgetBy(TQDomElement &el, Container *container, const TQPoint &p); /*! Internal function used to fix the names of the widgets before pasting them. It prevents from pasting a widget with the same name as an actual widget. The child widgets are also fixed recursively.\n - If the name of the widget ends with a number (eg "QLineEdit1"), the new name is - just incremented by one (eg becomes "QLineEdit2"). Otherwise, a "2" is just + If the name of the widget ends with a number (eg "TQLineEdit1"), the new name is + just incremented by one (eg becomes "TQLineEdit2"). Otherwise, a "2" is just appended at the end of the name (eg "myWidget" becomes "myWidget2"). */ - void fixNames(QDomElement &el); + void fixNames(TQDomElement &el); protected: Form *m_form; - QCString m_data; - QString m_containername; - QPoint m_point; - QStringList m_names; + TQCString m_data; + TQString m_containername; + TQPoint m_point; + TQStringList m_names; }; /*! This command is used when deleting a widget using the "Delete" menu item. @@ -285,14 +285,14 @@ class KFORMEDITOR_EXPORT DeleteWidgetCommand : public Command virtual void execute(); virtual void unexecute(); - virtual QString name() const; + virtual TQString name() const; virtual void debug(); protected: - QDomDocument m_domDoc; + TQDomDocument m_domDoc; Form *m_form; - QMap<QCString, QCString> m_containers; - QMap<QCString, QCString> m_parents; + TQMap<TQCString, TQCString> m_containers; + TQMap<TQCString, TQCString> m_parents; }; /*! This command is used when cutting widgets. It is basically a DeleteWidgetCommand @@ -304,11 +304,11 @@ class KFORMEDITOR_EXPORT CutWidgetCommand : public DeleteWidgetCommand virtual void execute(); virtual void unexecute(); - virtual QString name() const; + virtual TQString name() const; virtual void debug(); protected: - QCString m_data; + TQCString m_data; }; /*! A Command Group is a command that holds several subcommands. @@ -321,7 +321,7 @@ class KFORMEDITOR_EXPORT CutWidgetCommand : public DeleteWidgetCommand class KFORMEDITOR_EXPORT CommandGroup : public Command { public: - CommandGroup( const QString & name, WidgetPropertySet *propSet ); + CommandGroup( const TQString & name, WidgetPropertySet *propSet ); virtual ~CommandGroup(); /*! Like KmacroCommand::addCommand(KCommand*) @@ -352,12 +352,12 @@ class KFORMEDITOR_EXPORT CommandGroup : public Command (in reversed order). */ virtual void unexecute(); - virtual QString name() const; + virtual TQString name() const; /*! \return a list of all subcommands of this group. Note that if a given subcommand is a group itself, it will not be expanded to subcommands on this list. */ - const QPtrList<KCommand>& commands() const; + const TQPtrList<KCommand>& commands() const; /*! Resets all 'allowExecute' flags that was set in addCommand(). Call this after calling CommandGroup::execute() to ensure that @@ -371,7 +371,7 @@ class KFORMEDITOR_EXPORT CommandGroup : public Command SubCommands *m_subCommands; //! Used to store pointers to subcommands that shouldn't be executed //! on CommandGroup::execute() - QPtrDict<char> m_commandsShouldntBeExecuted; + TQPtrDict<char> m_commandsShouldntBeExecuted; WidgetPropertySet *m_propSet; }; |