~ubuntu-branches/ubuntu/edgy/koffice/edgy-updates

« back to all changes in this revision

Viewing changes to kspread/kspread_dlg_database.h

  • Committer: Bazaar Package Importer
  • Author(s): Ben Burton
  • Date: 2004-05-09 11:33:00 UTC
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20040509113300-xi5t1z4yxe7n03x7
Tags: upstream-1.3.1
ImportĀ upstreamĀ versionĀ 1.3.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) 2002 Norbert Andres, nandres@web.de
 
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 as published by the Free Software Foundation; either
 
7
   version 2 of the License, or (at your option) any later version.
 
8
 
 
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.
 
13
 
 
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.
 
18
*/
 
19
 
 
20
#ifndef __kspread_dlg_database__
 
21
#define __kspread_dlg_database__
 
22
 
 
23
#include <qdialog.h>
 
24
#include <qrect.h>
 
25
 
 
26
#include <kwizard.h>
 
27
 
 
28
class KSpreadView;
 
29
 
 
30
class QCheckBox;
 
31
class QComboBox;
 
32
class QFrame;
 
33
class QGridLayout;
 
34
class QLabel;
 
35
class QLineEdit;
 
36
class QListViewItem;
 
37
class QHBoxLayout;
 
38
class QRadioButton;
 
39
class QSqlDatabase;
 
40
class QTextEdit;
 
41
class QVBoxLayout;
 
42
class QWidget;
 
43
 
 
44
class KListView;
 
45
class KPushButton;
 
46
 
 
47
class KSpreadDatabaseDlg : public KWizard
 
48
{
 
49
  Q_OBJECT
 
50
 
 
51
 public:
 
52
  enum PageId { eDatabase = 0, eTables = 1, eColumns = 2, eOptions = 3, eResult = 4 };
 
53
 
 
54
  KSpreadDatabaseDlg( KSpreadView * parent, QRect const & rect, const char * name = 0, bool modal = FALSE, WFlags fl = 0 );
 
55
  virtual ~KSpreadDatabaseDlg();
 
56
 
 
57
 private slots:
 
58
  void orBox_clicked();
 
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 * );
 
68
  void accept();
 
69
 
 
70
 protected:
 
71
  void next();
 
72
  void back();
 
73
 
 
74
  QGridLayout  * m_databaseLayout;
 
75
  QGridLayout  * m_tableLayout;
 
76
  QGridLayout  * m_columnsLayout;
 
77
  QGridLayout  * m_optionsLayout;
 
78
  QGridLayout  * m_resultLayout;
 
79
 
 
80
 private:
 
81
  int            m_currentPage;
 
82
  KSpreadView  * m_pView;
 
83
  QRect          m_targetRect;
 
84
  QSqlDatabase * m_dbConnection;
 
85
 
 
86
  QWidget      * m_database;
 
87
  QLabel       * m_databaseStatus;
 
88
  QLineEdit    * m_username;
 
89
  QLineEdit    * m_port;
 
90
  QLineEdit    * m_databaseName;
 
91
  QComboBox    * m_driver;
 
92
  QLineEdit    * m_password;
 
93
  QLineEdit    * m_host;
 
94
  QLabel       * m_Type;
 
95
  QWidget      * m_table;
 
96
  QComboBox    * m_databaseList;
 
97
  KPushButton  * m_connectButton;
 
98
  QLabel       * m_tableStatus;
 
99
  QLabel       * m_SelectTableLabel;
 
100
  KListView    * m_tableView;
 
101
  QWidget      * m_columns;
 
102
  KListView    * m_columnView;
 
103
  QLabel       * m_columnsStatus;
 
104
  QWidget      * m_options;
 
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;
 
121
  QWidget      * m_result;
 
122
  QTextEdit    * m_sqlQuery;
 
123
  QRadioButton * m_startingRegion;
 
124
  QLineEdit    * m_cell;
 
125
  QLineEdit    * m_region;
 
126
  QRadioButton * m_startingCell;
 
127
 
 
128
  void switchPage( int id );
 
129
  bool databaseDoNext();
 
130
  bool tablesDoNext();
 
131
  bool columnsDoNext();
 
132
  bool optionsDoNext();
 
133
 
 
134
  QString exchangeWildcards(QString const & value);
 
135
  QString getWhereCondition( QString const &, QString const &, int );
 
136
};
 
137
 
 
138
#endif