kexi
kexicsvexportwizard.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef KEXI_CSVEXPORTEIZARD_H
00021 #define KEXI_CSVEXPORTEIZARD_H
00022
00023 #include <kwizard.h>
00024
00025 class QCheckBox;
00026 class QGroupBox;
00027 class KPushButton;
00028 class KexiMainWindow;
00029 class KexiStartupFileDialog;
00030 class KexiCSVDelimiterWidget;
00031 class KexiCSVTextQuoteComboBox;
00032 class KexiCSVInfoLabel;
00033 class KexiCharacterEncodingComboBox;
00034 namespace KexiDB {
00035 class TableOrQuerySchema;
00036 }
00037
00040 class KexiCSVExportWizard : public KWizard
00041 {
00042 Q_OBJECT
00043
00044 public:
00046 enum Mode { Clipboard, File };
00047
00049 class Options {
00050 public:
00051 Options();
00052 Mode mode;
00053 int itemId;
00054 QString forceDelimiter;
00055 };
00056
00057 KexiCSVExportWizard( const Options& options, KexiMainWindow* mainWin,
00058 QWidget * parent = 0, const char * name = 0 );
00059
00060 virtual ~KexiCSVExportWizard();
00061
00062 bool cancelled() const;
00063
00064 virtual void showPage ( QWidget * page );
00065
00066 protected slots:
00067 virtual void next();
00068 virtual void done(int result);
00069 void slotShowOptionsButtonClicked();
00070 void slotDefaultsButtonClicked();
00071
00072 protected:
00074 virtual void layOutButtonRow( QHBoxLayout * layout );
00075
00077 bool exportData();
00078
00080 QString defaultDelimiter() const;
00081
00083 QString defaultTextQuote() const;
00084
00089 bool readBoolEntry(const char *key, bool defaultValue);
00090
00092 QString readEntry(const char *key, const QString& defaultValue = QString::null);
00093
00098 void writeEntry(const char *key, bool value);
00099
00101 void writeEntry(const char *key, const QString& value);
00102
00104 void deleteEntry(const char *key);
00105
00106 Options m_options;
00107
00108
00109 KexiMainWindow* m_mainWin;
00110 KexiStartupFileDialog* m_fileSavePage;
00111 QWidget* m_exportOptionsPage;
00112 KPushButton *m_showOptionsButton;
00113 KPushButton *m_defaultsBtn;
00114 QGroupBox* m_exportOptionsSection;
00115 KexiCSVInfoLabel *m_infoLblFrom, *m_infoLblTo;
00116 KexiCSVDelimiterWidget* m_delimiterWidget;
00117 KexiCSVTextQuoteComboBox* m_textQuote;
00118 KexiCharacterEncodingComboBox *m_characterEncodingCombo;
00119 QCheckBox* m_addColumnNamesCheckBox, *m_alwaysUseCheckBox;
00120 KexiDB::TableOrQuerySchema* m_tableOrQuery;
00121 int m_rowCount;
00122 bool m_rowCountDetermined : 1;
00123 bool m_cancelled : 1;
00124 };
00125
00126 #endif
|