importwizard.h
1/* This file is part of the KDE project
2 Copyright (C) 2004 Adam Pigg <adam@piggz.co.uk>
3 Copyright (C) 2004-2006 Jaroslaw Staniek <js@iidea.pl>
4 Copyright (C) 2005 Martin Ellis <martin.ellis@kdemail.net>
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 KEXIMIGRATIONIMPORTWIZARD_H
23#define KEXIMIGRATIONIMPORTWIZARD_H
24
25#include <kwizard.h>
26#include <kprogress.h>
27#include <tdeapplication.h>
28
29#include <kexiutils/tristate.h>
30#include "migratemanager.h"
31
32class TQLabel;
33class TQCheckBox;
34class TQPushButton;
35class TQHBoxLayout;
36class TQVBoxLayout;
37class TQVButtonGroup;
38class KComboBox;
39class TDEListView;
40class KLineEdit;
43class KexiProjectSet;
44class KexiDBTitlePage;
47
48namespace Kexi
49{
50 class ObjectStatus;
51}
52
53namespace KexiDB
54{
55 class ConnectionData;
56}
57
58namespace KexiMigration {
59
60class KexiMigrate;
61
63class KEXIMIGR_EXPORT ImportWizard : public KWizard
64{
65TQ_OBJECT
66
67public:
72 ImportWizard(TQWidget *parent = 0, TQMap<TQString,TQString>* args = 0);
73 virtual ~ImportWizard();
74
75public slots:
76 void progressUpdated(int percent);
77
78protected slots:
79 virtual void next();
80 virtual void back();
81 void pageSelected(const TQString &);
82 virtual void accept();
83 virtual void reject();
84 void helpClicked();
85 void slotOptionsButtonClicked();
86
87private:
88 void parseArguments();
89 void setupIntro();
90// void setupSrcType();
91 void setupSrcConn();
92 void setupSrcDB();
93 void setupDstType();
94 void setupDstTitle();
95 void setupDst();
96 void setupFinish();
97 void setupImportType();
98 void setupImporting();
99 bool checkUserInput();
100
101 KexiMigrate* prepareImport(Kexi::ObjectStatus& result);
102
106 tristate import();
107
108 bool fileBasedSrcSelected() const;
109 bool fileBasedDstSelected() const;
110 TQString driverNameForSelectedSource();
111// void checkIfSrcTypeFileBased(const TQString& srcType);
112// void checkIfDstTypeFileBased(const TQString& dstType);
113
114 void arriveSrcConnPage();
115 void arriveSrcDBPage();
116 void arriveDstTitlePage();
117 void arriveDstPage();
118 void arriveFinishPage();
119 void arriveImportingPage();
120
121 TQWidget *m_introPage, /* *m_srcTypePage,*/ *m_srcConnPage, *m_srcDBPage,
122 *m_dstTypePage, *m_dstPage, *m_importTypePage, *m_importingPage, *m_finishPage;
123
124 TQVButtonGroup *m_importTypeButtonGroup;
125 KexiDBTitlePage* m_dstTitlePage;
126
127 KComboBox *m_srcTypeCombo;
128 KexiDBDriverComboBox *m_dstServerTypeCombo;
129 KexiPrjTypeSelector *m_dstPrjTypeSelector;
130
131 KexiConnSelectorWidget *m_srcConn, *m_dstConn;
132 KLineEdit *m_dstNewDBNameLineEdit;
133 KexiProjectSelectorWidget *m_srcDBName;
134
135 TQLabel *m_lblImportingTxt, *m_lblImportingErrTxt, *m_finishLbl;
136 TQCheckBox *m_openImportedProjectCheckBox;
137 bool m_fileBasedDstWasPresented, m_setupFileBasedSrcNeeded,
138 m_importExecuted;
139 KexiProjectSet* m_prjSet;
140 KProgress *m_progressBar;
141 TQPushButton* m_importOptionsButton;
142 TQMap<TQString,TQString> *m_args;
143 TQString m_predefinedDatabaseName, m_predefinedMimeType;
144 KexiDB::ConnectionData *m_predefinedConnectionData;
145 MigrateManager m_migrateManager;
146
149 TQString m_sourceDBEncoding;
150};
151
152}
153
154#endif
Combo box widget for selecting a database driver.
A helper widget used to displaying a line edit with a label and layout.
Database specific connection data, e.g. host, port.
GUI for importing external databases (file-based and server-based)
Imports non-native databases into Kexi projects.
Definition keximigrate.h:79
Migration library management, for finding and loading mogration drivers.
A simple widget with radio buttons with "show file/server-based projects" options.
Stores information about multiple kexi project-data items.
3-state logical type with three values: true, false and cancelled and convenient operators.
Definition tristate.h:100
High-level database connectivity library with database backend drivers.
Framework for importing databases into native KexiDB databases.
Namespace for general Kexi functions.
Definition kexi.h:38