aboutsummaryrefslogtreecommitdiffstats
path: root/SQLiteStudio3/guiSQLiteStudio/constraints/columnforeignkeypanel.h
diff options
context:
space:
mode:
Diffstat (limited to 'SQLiteStudio3/guiSQLiteStudio/constraints/columnforeignkeypanel.h')
-rw-r--r--SQLiteStudio3/guiSQLiteStudio/constraints/columnforeignkeypanel.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/SQLiteStudio3/guiSQLiteStudio/constraints/columnforeignkeypanel.h b/SQLiteStudio3/guiSQLiteStudio/constraints/columnforeignkeypanel.h
new file mode 100644
index 0000000..3fe3077
--- /dev/null
+++ b/SQLiteStudio3/guiSQLiteStudio/constraints/columnforeignkeypanel.h
@@ -0,0 +1,48 @@
+#ifndef COLUMNFOREIGNKEYPANEL_H
+#define COLUMNFOREIGNKEYPANEL_H
+
+#include "constraintpanel.h"
+#include "parser/ast/sqlitecreatetable.h"
+#include "guiSQLiteStudio_global.h"
+#include <QStringListModel>
+#include <QWidget>
+
+namespace Ui {
+ class ColumnForeignKeyPanel;
+}
+
+class QGridLayout;
+class QSignalMapper;
+
+class GUI_API_EXPORT ColumnForeignKeyPanel : public ConstraintPanel
+{
+ Q_OBJECT
+
+ public:
+ explicit ColumnForeignKeyPanel(QWidget *parent = 0);
+ ~ColumnForeignKeyPanel();
+
+ bool validate();
+
+ protected:
+ void changeEvent(QEvent *e);
+ void constraintAvailable();
+ void storeConfiguration();
+
+ private:
+ void init();
+ void readConstraint();
+ void readTables();
+ void readCondition(SqliteForeignKey::Condition* condition);
+ void storeCondition(SqliteForeignKey::Condition::Action action, const QString& reaction);
+ void storeMatchCondition(const QString& reaction);
+
+ Ui::ColumnForeignKeyPanel *ui = nullptr;
+ QStringListModel fkColumnsModel;
+
+ private slots:
+ void updateState();
+ void updateFkColumns();
+};
+
+#endif // COLUMNFOREIGNKEYPANEL_H