kspread Library API Documentation

kspread_dlg_database.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 2002-2003 Norbert Andres <nandres@web.de>
00003              (C) 2002 Ariya Hidayat <ariya@kde.org>
00004              (C) 2002 Laurent Montel <montel@kde.org>
00005 
00006    This library is free software; you can redistribute it and/or
00007    modify it under the terms of the GNU Library General Public
00008    License as published by the Free Software Foundation; either
00009    version 2 of the License, or (at your option) any later version.
00010 
00011    This library is distributed in the hope that it will be useful,
00012    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014    Library General Public License for more details.
00015 
00016    You should have received a copy of the GNU Library General Public License
00017    along with this library; see the file COPYING.LIB.  If not, write to
00018    the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00019    Boston, MA 02111-1307, USA.
00020 */
00021 
00022 #ifndef __kspread_dlg_database__
00023 #define __kspread_dlg_database__
00024 
00025 #include <qdialog.h>
00026 #include <qrect.h>
00027 
00028 #include <kwizard.h>
00029 
00030 class KSpreadView;
00031 
00032 class QCheckBox;
00033 class QComboBox;
00034 class QFrame;
00035 class QGridLayout;
00036 class QLabel;
00037 class QLineEdit;
00038 class QListViewItem;
00039 class QHBoxLayout;
00040 class QRadioButton;
00041 class QSqlDatabase;
00042 class QTextEdit;
00043 class QVBoxLayout;
00044 class QWidget;
00045 
00046 class KListView;
00047 class KPushButton;
00048 
00049 class KSpreadDatabaseDlg : public KWizard
00050 {
00051   Q_OBJECT
00052 
00053  public:
00054   enum PageId { eDatabase = 0, eSheets = 1, eColumns = 2, eOptions = 3, eResult = 4 };
00055 
00056   KSpreadDatabaseDlg( KSpreadView * parent, QRect const & rect, const char * name = 0, bool modal = FALSE, WFlags fl = 0 );
00057   virtual ~KSpreadDatabaseDlg();
00058 
00059  private slots:
00060   void orBox_clicked();
00061   void andBox_clicked();
00062   void startingCell_clicked();
00063   void startingRegion_clicked();
00064   void connectButton_clicked();
00065   void databaseNameChanged( const QString & s );
00066   void databaseHostChanged( const QString & s );
00067   void databaseDriverChanged( int );
00068   void popupSheetViewMenu( QListViewItem *, const QPoint &, int );
00069   void sheetViewClicked( QListViewItem * );
00070   void accept();
00071 
00072  protected:
00073   void next();
00074   void back();
00075 
00076   QGridLayout  * m_databaseLayout;
00077   QGridLayout  * m_sheetLayout;
00078   QGridLayout  * m_columnsLayout;
00079   QGridLayout  * m_optionsLayout;
00080   QGridLayout  * m_resultLayout;
00081 
00082  private:
00083   int            m_currentPage;
00084   KSpreadView  * m_pView;
00085   QRect          m_targetRect;
00086   QSqlDatabase * m_dbConnection;
00087 
00088   QWidget      * m_database;
00089   QLabel       * m_databaseStatus;
00090   QLineEdit    * m_username;
00091   QLineEdit    * m_port;
00092   QLineEdit    * m_databaseName;
00093   QComboBox    * m_driver;
00094   QLineEdit    * m_password;
00095   QLineEdit    * m_host;
00096   QLabel       * m_Type;
00097   QWidget      * m_sheet;
00098   QComboBox    * m_databaseList;
00099   KPushButton  * m_connectButton;
00100   QLabel       * m_sheetStatus;
00101   QLabel       * m_SelectSheetLabel;
00102   KListView    * m_sheetView;
00103   QWidget      * m_columns;
00104   KListView    * m_columnView;
00105   QLabel       * m_columnsStatus;
00106   QWidget      * m_options;
00107   QComboBox    * m_columns_1;
00108   QComboBox    * m_columns_2;
00109   QComboBox    * m_columns_3;
00110   QComboBox    * m_operator_1;
00111   QComboBox    * m_operator_2;
00112   QComboBox    * m_operator_3;
00113   QLineEdit    * m_operatorValue_1;
00114   QLineEdit    * m_operatorValue_2;
00115   QLineEdit    * m_operatorValue_3;
00116   QRadioButton * m_andBox;
00117   QRadioButton * m_orBox;
00118   QComboBox    * m_columnsSort_1;
00119   QComboBox    * m_columnsSort_2;
00120   QComboBox    * m_sortMode_1;
00121   QComboBox    * m_sortMode_2;
00122   QCheckBox    * m_distinct;
00123   QWidget      * m_result;
00124   QTextEdit    * m_sqlQuery;
00125   QRadioButton * m_startingRegion;
00126   QLineEdit    * m_cell;
00127   QLineEdit    * m_region;
00128   QRadioButton * m_startingCell;
00129 
00130   void switchPage( int id );
00131   bool databaseDoNext();
00132   bool sheetsDoNext();
00133   bool columnsDoNext();
00134   bool optionsDoNext();
00135 
00136   QString exchangeWildcards(QString const & value);
00137   QString getWhereCondition( QString const &, QString const &, int );
00138 };
00139 
00140 #endif
KDE Logo
This file is part of the documentation for kspread Library Version 1.4.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Mon Feb 13 09:42:54 2006 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003