kexi
kexitabledesignercommands.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef KEXITABLEDESIGNER_COMMANDS_H
00021 #define KEXITABLEDESIGNER_COMMANDS_H
00022
00023 #include <qmap.h>
00024 #include <qdict.h>
00025 #include <qptrlist.h>
00026 #include <qptrdict.h>
00027 #include <qvariant.h>
00028 #include <qguardedptr.h>
00029
00030 #include <kcommand.h>
00031 #include <kexidb/alter.h>
00032 #include <koproperty/set.h>
00033
00034 #include "kexitabledesignerview.h"
00035
00036 class QWidget;
00037 class QRect;
00038 class QPoint;
00039 class QStringList;
00040 class QCString;
00041
00042 namespace KexiTableDesignerCommands {
00043
00045 class Command : public KCommand
00046 {
00047 public:
00048 Command(KexiTableDesignerView* view);
00049 virtual ~Command();
00050
00053 virtual KexiDB::AlterTableHandler::ActionBase* createAction() { return 0; }
00054
00055 virtual QString debugString() { return name(); }
00056
00057 protected:
00058 QGuardedPtr<KexiTableDesignerView> m_view;
00059 };
00060
00062 class ChangeFieldPropertyCommand : public Command
00063 {
00064 public:
00072 ChangeFieldPropertyCommand( KexiTableDesignerView* view,
00073 const KoProperty::Set& set, const QCString& propertyName,
00074 const QVariant& oldValue, const QVariant& newValue,
00075 KoProperty::Property::ListData* const oldListData = 0, KoProperty::Property::ListData* const newListData = 0);
00076
00077 virtual ~ChangeFieldPropertyCommand();
00078
00079 virtual QString name() const;
00080 virtual void execute();
00081 virtual void unexecute();
00082 virtual KexiDB::AlterTableHandler::ActionBase* createAction();
00083 virtual QString debugString();
00084
00085 protected:
00086 KexiDB::AlterTableHandler::ChangeFieldPropertyAction m_alterTableAction;
00087 QVariant m_oldValue;
00088
00089 KoProperty::Property::ListData* m_oldListData, *m_listData;
00090 };
00091
00093 class RemoveFieldCommand : public Command
00094 {
00095 public:
00098 RemoveFieldCommand( KexiTableDesignerView* view, int fieldIndex,
00099 const KoProperty::Set* set);
00100
00101 virtual ~RemoveFieldCommand();
00102
00103 virtual QString name() const;
00104 virtual void execute();
00105 virtual void unexecute();
00106 virtual KexiDB::AlterTableHandler::ActionBase* createAction();
00107
00108 virtual QString debugString();
00109
00110 protected:
00111 KexiDB::AlterTableHandler::RemoveFieldAction m_alterTableAction;
00112 KoProperty::Set* m_set;
00113 int m_fieldIndex;
00114 };
00115
00117 class InsertFieldCommand : public Command
00118 {
00119 public:
00120 InsertFieldCommand( KexiTableDesignerView* view,
00121 int fieldIndex, const KoProperty::Set& set );
00122 virtual ~InsertFieldCommand();
00123
00124 virtual QString name() const;
00125 virtual void execute();
00126 virtual void unexecute();
00127 virtual KexiDB::AlterTableHandler::ActionBase* createAction();
00128
00129 virtual QString debugString() {
00130 return name() + "\nAT ROW " + QString::number(m_alterTableAction->index())
00131 + ", FIELD: " + m_set["caption"].value().toString();
00132 }
00133
00134 protected:
00135 KexiDB::AlterTableHandler::InsertFieldAction *m_alterTableAction;
00136 KoProperty::Set m_set;
00137 };
00138
00139
00140
00141
00143
00144 class ChangePropertyVisibilityCommand : public Command
00145 {
00146 public:
00152 ChangePropertyVisibilityCommand( KexiTableDesignerView* view,
00153 const KoProperty::Set& set, const QCString& propertyName,
00154 bool visible);
00155
00156 virtual ~ChangePropertyVisibilityCommand();
00157
00158 virtual QString name() const;
00159 virtual void execute();
00160 virtual void unexecute();
00161
00162 protected:
00163 KexiDB::AlterTableHandler::ChangeFieldPropertyAction m_alterTableAction;
00164
00165 bool m_oldVisibility;
00166 };
00167
00169
00170 class InsertEmptyRowCommand : public Command
00171 {
00172 public:
00174 InsertEmptyRowCommand( KexiTableDesignerView* view, int row );
00175 virtual ~InsertEmptyRowCommand();
00176
00177 virtual QString name() const;
00178 virtual void execute();
00179 virtual void unexecute();
00180
00181 protected:
00182 KexiDB::AlterTableHandler::ChangeFieldPropertyAction m_alterTableAction;
00183 int m_row;
00184 };
00185
00186 }
00187
00188 #endif
|