1
/* This file is part of the KDE project
2
Copyright (C) 2002 Norbert Andres, nandres@web.de
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 as published by the Free Software Foundation; either
7
version 2 of the License, or (at your option) any later version.
9
This library is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
Library General Public License for more details.
14
You should have received a copy of the GNU Library General Public License
15
along with this library; see the file COPYING.LIB. If not, write to
16
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17
Boston, MA 02111-1307, USA.
20
#ifndef __kspread_dlg_database__
21
#define __kspread_dlg_database__
47
class KSpreadDatabaseDlg : public KWizard
52
enum PageId { eDatabase = 0, eTables = 1, eColumns = 2, eOptions = 3, eResult = 4 };
54
KSpreadDatabaseDlg( KSpreadView * parent, QRect const & rect, const char * name = 0, bool modal = FALSE, WFlags fl = 0 );
55
virtual ~KSpreadDatabaseDlg();
59
void andBox_clicked();
60
void startingCell_clicked();
61
void startingRegion_clicked();
62
void connectButton_clicked();
63
void databaseNameChanged( const QString & s );
64
void databaseHostChanged( const QString & s );
65
void databaseDriverChanged( int );
66
void popupTableViewMenu( QListViewItem *, const QPoint &, int );
67
void tableViewClicked( QListViewItem * );
74
QGridLayout * m_databaseLayout;
75
QGridLayout * m_tableLayout;
76
QGridLayout * m_columnsLayout;
77
QGridLayout * m_optionsLayout;
78
QGridLayout * m_resultLayout;
82
KSpreadView * m_pView;
84
QSqlDatabase * m_dbConnection;
87
QLabel * m_databaseStatus;
88
QLineEdit * m_username;
90
QLineEdit * m_databaseName;
92
QLineEdit * m_password;
96
QComboBox * m_databaseList;
97
KPushButton * m_connectButton;
98
QLabel * m_tableStatus;
99
QLabel * m_SelectTableLabel;
100
KListView * m_tableView;
102
KListView * m_columnView;
103
QLabel * m_columnsStatus;
105
QComboBox * m_columns_1;
106
QComboBox * m_columns_2;
107
QComboBox * m_columns_3;
108
QComboBox * m_operator_1;
109
QComboBox * m_operator_2;
110
QComboBox * m_operator_3;
111
QLineEdit * m_operatorValue_1;
112
QLineEdit * m_operatorValue_2;
113
QLineEdit * m_operatorValue_3;
114
QRadioButton * m_andBox;
115
QRadioButton * m_orBox;
116
QComboBox * m_columnsSort_1;
117
QComboBox * m_columnsSort_2;
118
QComboBox * m_sortMode_1;
119
QComboBox * m_sortMode_2;
120
QCheckBox * m_distinct;
122
QTextEdit * m_sqlQuery;
123
QRadioButton * m_startingRegion;
125
QLineEdit * m_region;
126
QRadioButton * m_startingCell;
128
void switchPage( int id );
129
bool databaseDoNext();
131
bool columnsDoNext();
132
bool optionsDoNext();
134
QString exchangeWildcards(QString const & value);
135
QString getWhereCondition( QString const &, QString const &, int );