~ubuntu-branches/debian/sid/kexi/sid

« back to all changes in this revision

Viewing changes to src/migration/AlterSchemaWidget.h

  • Committer: Package Import Robot
  • Author(s): Pino Toscano
  • Date: 2017-06-24 20:10:10 UTC
  • Revision ID: package-import@ubuntu.com-20170624201010-5lrzd5r2vwthwifp
Tags: upstream-3.0.1.1
ImportĀ upstreamĀ versionĀ 3.0.1.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* This file is part of the KDE project
 
2
   Copyright (C) 2009 Adam Pigg <adam@piggz.co.uk>
 
3
 
 
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.
 
7
 
 
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.
 
12
 
 
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.
 
17
*/
 
18
 
 
19
#ifndef ALTERSCHEMAWIDGET_H
 
20
#define ALTERSCHEMAWIDGET_H
 
21
 
 
22
#include <QWidget>
 
23
#include <QTableView>
 
24
#include <AlterSchemaTableModel.h>
 
25
 
 
26
class QGridLayout;
 
27
class QTableView;
 
28
class QComboBox;
 
29
class QCheckBox;
 
30
class QLabel;
 
31
class KDbTableSchema;
 
32
class KexiNameWidget;
 
33
 
 
34
namespace KexiMigration {
 
35
 
 
36
class AlterSchemaWidget : public QWidget
 
37
{
 
38
    Q_OBJECT
 
39
    public:
 
40
        explicit AlterSchemaWidget(QWidget* parent = 0);
 
41
        ~AlterSchemaWidget();
 
42
 
 
43
        void setTableSchema(KDbTableSchema *schema);
 
44
        void setData(QList<KDbRecordData*>* data);
 
45
 
 
46
        KDbTableSchema* newSchema();
 
47
        KDbTableSchema* takeTableSchema();
 
48
 
 
49
        KexiNameWidget* nameWidget();
 
50
        bool nameExists(const QString &name) const;
 
51
 
 
52
        AlterSchemaTableModel* model();
 
53
 
 
54
    private:
 
55
        QGridLayout *m_layout;
 
56
        QTableView *m_table;
 
57
        QComboBox *m_columnType;
 
58
        QCheckBox *m_columnPKey;
 
59
        KexiNameWidget *m_tableNameWidget;
 
60
 
 
61
        QStringList m_types;
 
62
 
 
63
        AlterSchemaTableModel *m_model;
 
64
 
 
65
        QLabel *m_columnNumLabel;
 
66
        QLabel *m_columnTypeLabel;
 
67
        QLabel *m_columnPKeyLabel;
 
68
 
 
69
        KDbTableSchema *m_schema;
 
70
 
 
71
        int m_selectedColumn;
 
72
 
 
73
        //! @todo Something like this could go in kexi utils/project?
 
74
        QString suggestedItemCaption(const QString& baseCaption);
 
75
 
 
76
    private Q_SLOTS:
 
77
        void tableClicked(const QModelIndex& idx);
 
78
        void typeActivated(int typ);
 
79
        void pkeyClicked(bool pkey);
 
80
};
 
81
}
 
82
#endif // ALTERSCHEMAWIDGET_H