kexi

kexicsvexportwizard.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 2005,2006 Jaroslaw Staniek <js@iidea.pl>
00003 
00004    This library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Library General Public
00006    License as published by the Free Software Foundation; either
00007    version 2 of the License, or (at your option) any later version.
00008 
00009    This library is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012    Library General Public License for more details.
00013 
00014    You should have received a copy of the GNU Library General Public License
00015    along with this library; see the file COPYING.LIB.  If not, write to
00016    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017  * Boston, MA 02110-1301, USA.
00018 */
00019 
00020 #ifndef KEXI_CSVEXPORTWIZARD_H
00021 #define KEXI_CSVEXPORTWIZARD_H
00022 
00023 #include <kwizard.h>
00024 
00025 #include "kexicsvexport.h"
00026 
00027 class QCheckBox;
00028 class QGroupBox;
00029 class KPushButton;
00030 class KexiMainWindow;
00031 class KexiStartupFileDialog;
00032 class KexiCSVDelimiterWidget;
00033 class KexiCSVTextQuoteComboBox;
00034 class KexiCSVInfoLabel;
00035 class KexiCharacterEncodingComboBox;
00036 namespace KexiDB {
00037     class TableOrQuerySchema;
00038 }
00039 
00042 class KexiCSVExportWizard : public KWizard
00043 {
00044     Q_OBJECT
00045 
00046     public:
00047         KexiCSVExportWizard( const KexiCSVExport::Options& options, KexiMainWindow* mainWin, 
00048             QWidget * parent = 0, const char * name = 0 );
00049 
00050         virtual ~KexiCSVExportWizard();
00051 
00052         bool cancelled() const;
00053 
00054         virtual void showPage ( QWidget * page );
00055 
00056     protected slots:
00057         virtual void next();
00058         virtual void done(int result);
00059         void slotShowOptionsButtonClicked();
00060         void slotDefaultsButtonClicked();
00061 
00062     protected:
00064         virtual void layOutButtonRow( QHBoxLayout * layout );
00065 
00067         QString defaultDelimiter() const;
00068 
00070         QString defaultTextQuote() const;
00071 
00076         bool readBoolEntry(const char *key, bool defaultValue);
00077 
00079         QString readEntry(const char *key, const QString& defaultValue = QString::null);
00080 
00085         void writeEntry(const char *key, bool value);
00086 
00088         void writeEntry(const char *key, const QString& value);
00089 
00091         void deleteEntry(const char *key);
00092 
00093         KexiCSVExport::Options m_options;
00094 //      Mode m_mode;
00095 //      int m_itemId;
00096         KexiMainWindow* m_mainWin;
00097         KexiStartupFileDialog* m_fileSavePage;
00098         QWidget* m_exportOptionsPage;
00099         KPushButton *m_showOptionsButton;
00100         KPushButton *m_defaultsBtn;
00101         QGroupBox* m_exportOptionsSection;
00102         KexiCSVInfoLabel *m_infoLblFrom, *m_infoLblTo;
00103         KexiCSVDelimiterWidget* m_delimiterWidget;
00104         KexiCSVTextQuoteComboBox* m_textQuote;
00105         KexiCharacterEncodingComboBox *m_characterEncodingCombo;
00106         QCheckBox* m_addColumnNamesCheckBox, *m_alwaysUseCheckBox;
00107         KexiDB::TableOrQuerySchema* m_tableOrQuery;
00108         int m_rowCount; 
00109         bool m_rowCountDetermined : 1;
00110         bool m_cancelled : 1;
00111 };
00112 
00113 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys