kspread

kspread_dlg_database.h
1/* This file is part of the KDE project
2 Copyright (C) 2002-2003 Norbert Andres <nandres@web.de>
3 (C) 2002 Ariya Hidayat <ariya@kde.org>
4 (C) 2002 Laurent Montel <montel@kde.org>
5
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public
8 License as published by the Free Software Foundation; either
9 version 2 of the License, or (at your option) any later version.
10
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Library General Public License for more details.
15
16 You should have received a copy of the GNU Library General Public License
17 along with this library; see the file COPYING.LIB. If not, write to
18 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02110-1301, USA.
20*/
21
22#ifndef __kspread_dlg_database__
23#define __kspread_dlg_database__
24
25#include <tqdialog.h>
26#include <tqrect.h>
27
28#include <kwizard.h>
29
30class TQCheckBox;
31class TQComboBox;
32class TQFrame;
33class TQGridLayout;
34class TQLabel;
35class TQLineEdit;
36class TQListViewItem;
37class TQHBoxLayout;
38class TQRadioButton;
39class TQSqlDatabase;
40class TQTextEdit;
41class TQVBoxLayout;
42class TQWidget;
43
44class TDEListView;
45class KPushButton;
46namespace KSpread
47{
48class View;
49
50class DatabaseDialog : public KWizard
51{
52 TQ_OBJECT
53
54
55 public:
56 enum PageId { eDatabase = 0, eSheets = 1, eColumns = 2, eOptions = 3, eResult = 4 };
57
58 DatabaseDialog( View * parent, TQRect const & rect, const char * name = 0, bool modal = false, WFlags fl = 0 );
59 virtual ~DatabaseDialog();
60
61 private slots:
62 void orBox_clicked();
63 void andBox_clicked();
64 void startingCell_clicked();
65 void startingRegion_clicked();
66 void connectButton_clicked();
67 void databaseNameChanged( const TQString & s );
68 void databaseHostChanged( const TQString & s );
69 void databaseDriverChanged( int );
70 void popupSheetViewMenu( TQListViewItem *, const TQPoint &, int );
71 void sheetViewClicked( TQListViewItem * );
72 void accept();
73
74 protected:
75 void next();
76 void back();
77
78 TQGridLayout * m_databaseLayout;
79 TQGridLayout * m_sheetLayout;
80 TQGridLayout * m_columnsLayout;
81 TQGridLayout * m_optionsLayout;
82 TQGridLayout * m_resultLayout;
83
84 private:
85 int m_currentPage;
86 View * m_pView;
87 TQRect m_targetRect;
88 TQSqlDatabase * m_dbConnection;
89
90 TQWidget * m_database;
91 TQLabel * m_databasetStatus;
92 TQLineEdit * m_username;
93 TQLineEdit * m_port;
94 TQLineEdit * m_databaseName;
95 TQComboBox * m_driver;
96 TQLineEdit * m_password;
97 TQLineEdit * m_host;
98 TQLabel * m_Type;
99 TQWidget * m_sheet;
100 TQComboBox * m_databaseList;
101 KPushButton * m_connectButton;
102 TQLabel * m_sheetStatus;
103 TQLabel * m_SelectSheetLabel;
104 TDEListView * m_sheetView;
105 TQWidget * m_columns;
106 TDEListView * m_columnView;
107 TQLabel * m_columnsStatus;
108 TQWidget * m_options;
109 TQComboBox * m_columns_1;
110 TQComboBox * m_columns_2;
111 TQComboBox * m_columns_3;
112 TQComboBox * m_operator_1;
113 TQComboBox * m_operator_2;
114 TQComboBox * m_operator_3;
115 TQLineEdit * m_operatorValue_1;
116 TQLineEdit * m_operatorValue_2;
117 TQLineEdit * m_operatorValue_3;
118 TQRadioButton * m_andBox;
119 TQRadioButton * m_orBox;
120 TQComboBox * m_columnsSort_1;
121 TQComboBox * m_columnsSort_2;
122 TQComboBox * m_sortMode_1;
123 TQComboBox * m_sortMode_2;
124 TQCheckBox * m_distinct;
125 TQWidget * m_result;
126 TQTextEdit * m_sqlQuery;
127 TQRadioButton * m_startingRegion;
128 TQLineEdit * m_cell;
129 TQLineEdit * m_region;
130 TQRadioButton * m_startingCell;
131
132 void switchPage( int id );
133 bool databaseDoNext();
134 bool sheetsDoNext();
135 bool columnsDoNext();
136 bool optionsDoNext();
137
138 TQString exchangeWildcards(TQString const & value);
139 TQString getWhereCondition( TQString const &, TQString const &, int );
140};
141
142} // namespace KSpread
143
144#endif
The KSpread namespace.
Definition commands.h:39