00001
00002
00003 #ifndef EXPORTDIALOG_H
00004 #define EXPORTDIALOG_H
00005
00006 #include <qfont.h>
00007 #include <qcheckbox.h>
00008 #include "Worksheet.h"
00009 #include "Dialog.h"
00010 #include "FilterKexiDB.h"
00011
00012 class ExportDialog: public Dialog
00013 {
00014 Q_OBJECT
00015 public:
00016 ExportDialog(MainWin *mw, const char *name, int item);
00017 public slots:
00018 void selectFile();
00019
00020 void setFilename(QString fn) { filele->setText(fn); }
00021 void exportHeader(bool b=true) { headercb->setChecked(b); }
00022 void setStartRow(int row) { startrow->setText(QString::number(row)); }
00023 void setEndRow(int row) { endrow->setText(QString::number(row)); }
00024 void setFileType(int t) { exportcb->setCurrentItem(t); }
00025 void setSeparator(QString v) { slabel->setText(v); }
00026 void setImageFormat(int i) { ic->setCurrentItem(i); }
00027 void setImageFormat(QString f) { ic->setCurrentText(f); }
00028 void setCDFCompression(int c) { cdfcomcb->setCurrentItem(c); }
00029 void setCDFEncoding(int c) { cdfenccb->setCurrentItem(c); }
00030 void setAudioFormat(int f) { audioformatcb->setCurrentItem(f); }
00031 void setSampleRate(int v) { samplele->setText(QString::number(v)); }
00032 void setBinaryType(int t) { binarytypecb->setCurrentItem(t); }
00033 void setHDF5Datatype(int t) { hdf5datatypecb->setCurrentItem(t); }
00034
00035 int Apply() { return apply_clicked(); accept(); }
00036 private slots:
00037 void ok_clicked() { if(!apply_clicked()) accept(); }
00038 void saveSettings();
00039 int apply_clicked();
00040 void updateOptions(int item);
00041 void updateAudioFormat(int) { updateOptions(3); }
00042 void updateImageFormat(int) { updateOptions(4); }
00043 void wizardKexiDB(const QString &name);
00044 void finishKexiDB();
00045 private:
00046 void dumpASCII(QTextStream *t, QString sep);
00047 void dumpCDF(QString filename);
00048 void dumpNETCDF(QString filename);
00049 void dumpAUDIOFILE(QString filename);
00050 void dumpIMAGE(QString filename);
00051 void dumpBINARY(QDataStream *d);
00052 void dumpKexiDB();
00053 void dumpHDF5(QString filename);
00054 Plot *plot;
00055 int item;
00056 KLineEdit *startrow, *endrow, *samplele;
00057 QLabel *slabel, *flabel, *cdfcomlabel, *cdfenclabel, *audioformatlabel, *samplelabel;
00058 KComboBox *sc, *ic, *exportcb, *cdfcomcb, *cdfenccb, *audioformatcb;
00059 QCheckBox *imagecb, *compresscb, *headercb, *hdf5allcb;
00060 KComboBox *binarytypecb, *hdf5datatypecb, *hdf5ordercb;
00061 FilterKexiDB *kexi;
00062 KComboBox *driver, *databases, *tables;
00063 QLabel *connectionlabel, *tablelabel;
00064 KLineEdit *host, *user, *password;
00065 };
00066
00067 #endif // EXPORTDIALOG_H