kexi

importwizard.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 2004 Adam Pigg <adam@piggz.co.uk>
00003    Copyright (C) 2004-2006 Jaroslaw Staniek <js@iidea.pl>
00004    Copyright (C) 2005 Martin Ellis <martin.ellis@kdemail.net>
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., 51 Franklin Street, Fifth Floor,
00019  * Boston, MA 02110-1301, USA.
00020 */
00021 
00022 #ifndef KEXIMIGRATIONIMPORTWIZARD_H
00023 #define KEXIMIGRATIONIMPORTWIZARD_H
00024 
00025 #include <kwizard.h>
00026 #include <kprogress.h>
00027 #include <kapplication.h>
00028 
00029 #include <kexiutils/tristate.h> 
00030 
00031 class QLabel;
00032 class QCheckBox;
00033 class QPushButton;
00034 class QHBoxLayout;
00035 class QVBoxLayout;
00036 class QVButtonGroup;
00037 class KComboBox;
00038 class KListView;
00039 class KLineEdit;
00040 class KActiveLabel;
00041 class KexiConnSelectorWidget;
00042 class KexiProjectSelectorWidget;
00043 class KexiProjectSet;
00044 class KexiDBTitlePage;
00045 class KexiDBDriverComboBox;
00046 
00047 namespace Kexi
00048 {
00049     class ObjectStatus;
00050 }
00051 
00052 namespace KexiDB
00053 {
00054     class ConnectionData;
00055 }
00056 
00057 namespace KexiMigration {
00058 
00059 class KexiMigrate;
00060 
00062 class KEXIMIGR_EXPORT ImportWizard : public KWizard
00063 {
00064 Q_OBJECT
00065 public:
00070     ImportWizard(QWidget *parent = 0, QMap<QString,QString>* args = 0);
00071     virtual ~ImportWizard();
00072 
00073 public slots:
00074     void progressUpdated(int percent);
00075 
00076 protected slots:
00077     virtual void next();
00078     virtual void back();
00079     void pageSelected(const QString &);
00080     virtual void accept();
00081     virtual void reject();
00082     void helpClicked();
00083     void slotOptionsButtonClicked();
00084 
00085 private:
00086     void parseArguments();
00087     void setupIntro();
00088 //  void setupSrcType();
00089     void setupSrcConn();
00090     void setupSrcDB();
00091     void setupDstType();
00092     void setupDstTitle();
00093     void setupDst();
00094     void setupFinish();
00095     void setupImportType();
00096     void setupImporting();
00097     bool checkUserInput();
00098 
00099     KexiMigrate* prepareImport(Kexi::ObjectStatus& result);
00100 
00104     tristate import();
00105 
00106     bool fileBasedSrcSelected() const;
00107     bool fileBasedDstSelected() const;
00108     QString driverNameForSelectedSource();
00109 //  void checkIfSrcTypeFileBased(const QString& srcType);
00110 //  void checkIfDstTypeFileBased(const QString& dstType);
00111 
00112     void arriveSrcConnPage();
00113     void arriveSrcDBPage();
00114     void arriveDstTitlePage();
00115     void arriveDstPage();
00116     void arriveFinishPage();
00117     void arriveImportingPage();
00118 
00119     QWidget *m_introPage, /* *m_srcTypePage,*/ *m_srcConnPage, *m_srcDBPage, 
00120         *m_dstTypePage, *m_dstPage, *m_importTypePage, *m_importingPage, *m_finishPage;
00121 
00122     QVButtonGroup *m_importTypeButtonGroup;
00123     KexiDBTitlePage* m_dstTitlePage;
00124 
00125     KComboBox *m_srcTypeCombo;
00126     KexiDBDriverComboBox *m_dstTypeCombo;
00127 
00128     KexiConnSelectorWidget *m_srcConn, *m_dstConn;
00129     KLineEdit *m_dstNewDBNameLineEdit;
00130     KexiProjectSelectorWidget *m_srcDBName;
00131 
00132     QLabel *m_lblImportingTxt;
00133     KActiveLabel *m_lblImportingErrTxt, *m_finishLbl;
00134     QCheckBox *m_openImportedProjectCheckBox;
00135     bool m_fileBasedDstWasPresented, m_setupFileBasedSrcNeeded, 
00136         m_importExecuted; 
00137     KexiProjectSet* m_prjSet;
00138     KProgress *m_progressBar;
00139     QPushButton* m_importOptionsButton;
00140     QMap<QString,QString> *m_args;
00141     QString m_predefinedDatabaseName, m_predefinedMimeType;
00142     KexiDB::ConnectionData *m_predefinedConnectionData;
00143 
00146     QString m_sourceDBEncoding;
00147 };
00148 
00149 }
00150 
00151 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys