1
/* This file is part of the KDE project
2
Copyright (C) 2009 Adam Pigg <adam@piggz.co.uk>
4
This library is free software; you can redistribute it and/or
5
modify it under the terms of the GNU Library General Public
6
License version 2 as published by the Free Software Foundation.
8
This library is distributed in the hope that it will be useful,
9
but WITHOUT ANY WARRANTY; without even the implied warranty of
10
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
Library General Public License for more details.
13
You should have received a copy of the GNU Library General Public License
14
along with this library; see the file COPYING.LIB. If not, write to
15
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16
Boston, MA 02110-1301, USA.
19
#ifndef ALTERSCHEMAWIDGET_H
20
#define ALTERSCHEMAWIDGET_H
24
#include <AlterSchemaTableModel.h>
34
namespace KexiMigration {
36
class AlterSchemaWidget : public QWidget
40
explicit AlterSchemaWidget(QWidget* parent = 0);
43
void setTableSchema(KDbTableSchema *schema);
44
void setData(QList<KDbRecordData*>* data);
46
KDbTableSchema* newSchema();
47
KDbTableSchema* takeTableSchema();
49
KexiNameWidget* nameWidget();
50
bool nameExists(const QString &name) const;
52
AlterSchemaTableModel* model();
55
QGridLayout *m_layout;
57
QComboBox *m_columnType;
58
QCheckBox *m_columnPKey;
59
KexiNameWidget *m_tableNameWidget;
63
AlterSchemaTableModel *m_model;
65
QLabel *m_columnNumLabel;
66
QLabel *m_columnTypeLabel;
67
QLabel *m_columnPKeyLabel;
69
KDbTableSchema *m_schema;
73
//! @todo Something like this could go in kexi utils/project?
74
QString suggestedItemCaption(const QString& baseCaption);
77
void tableClicked(const QModelIndex& idx);
78
void typeActivated(int typ);
79
void pkeyClicked(bool pkey);
82
#endif // ALTERSCHEMAWIDGET_H