00001
00002
00003
00004
00005
00006
00007
00008 #ifndef ALTERTABLEDIALOG_H
00009 #define ALTERTABLEDIALOG_H
00010
00011 #include "database.h"
00012 #include "tableeditordialog.h"
00013
00014
00026 class AlterTableDialog : public TableEditorDialog
00027 {
00028 Q_OBJECT
00029
00030 public:
00031 AlterTableDialog(QWidget * parent = 0, const QString & tableName = 0, const QString & schema = 0);
00032 ~AlterTableDialog(){};
00033
00034 bool update;
00035
00036 private:
00040 QMap<QString,QStringList> m_columnIndexMap;
00041
00043 QString m_table;
00044 QString m_schema;
00046 int m_protectedRows;
00047
00049 int m_dropColumns;
00050
00052 void resetStructure();
00054 void checkChanges();
00055
00059 bool addColumns();
00060
00065 bool renameTable();
00066
00073 bool execSql(const QString & statement, const QString & message, const QString & tmpName=0);
00074
00076 QStringList originalSource();
00077
00078 private slots:
00079 void addField();
00080 void removeField();
00081 void fieldSelected();
00083 void cellClicked(int, int);
00084
00085 void dropItem_stateChanged(int);
00086
00087 void createButton_clicked();
00088 };
00089
00090 #endif