F:/KPlato/koffice/libs/kofficeui/KoCsvImportDialog.h

Aller à la documentation de ce fichier.
00001 /* This file is part of the KDE project
00002    Copyright (C) 1999 David Faure <faure@kde.org>
00003    Copyright (C) 2004 Nicolas GOUTTE <goutte@kde.org>
00004 
00005    This library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Library General Public
00007    License as published by the Free Software Foundation; either
00008    version 2 of the License, or (at your option) any later version.
00009 
00010    This library is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Library General Public License for more details.
00014 
00015    You should have received a copy of the GNU Library General Public License
00016    along with this library; see the file COPYING.LIB.  If not, write to
00017    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00018  * Boston, MA 02110-1301, USA.
00019 */
00020 
00021 #ifndef KO_CSV_IMPORT_DIALOG
00022 #define KO_CSV_IMPORT_DIALOG
00023 
00024 #include <QStringList>
00025 #include <QWidget>
00026 
00027 #include <kdialog.h>
00028 
00029 #include "koffice_export.h"
00030 
00031 #include "ui_KoCsvImportDialog.h"
00032 
00033 class KoCsvImportWidget : public QWidget, public Ui::KoCsvImportWidget
00034 {
00035   public:
00036     KoCsvImportWidget(QWidget* parent) : QWidget(parent) { setupUi(this); }
00037 };
00038 
00039 class KOFFICEUI_EXPORT KoCsvImportDialog : public KDialog
00040 {
00041     Q_OBJECT
00042 public:
00043     enum Header
00044     {
00045         TEXT,       
00046         NUMBER,     
00047         DATE,       
00048         CURRENCY,   
00049         COMMANUMBER,
00050         POINTNUMBER 
00051     };
00052 
00053     KoCsvImportDialog(QWidget* parent);
00054     ~KoCsvImportDialog();
00055 
00056     void     setData( const QByteArray& data);
00057     bool     firstRowContainHeaders();
00058     bool     firstColContainHeaders();
00059     int      rows();
00060     int      cols();
00061     int      headerType(int col);
00062     QString  text(int row, int col);
00063 
00064 protected:
00065     void fillTable();
00066     void fillComboBox();
00067     void setText(int row, int col, const QString& text);
00068     void adjustRows(int iRows);
00069     void adjustCols(int iCols);
00070     bool checkUpdateRange();
00071     QTextCodec* getCodec(void) const;
00072 
00073     // The real contents of the dialog
00074     KoCsvImportWidget *m_dialog;
00075 
00076     bool       m_adjustRows;
00077     bool       m_adjustCols;
00078     int        m_startRow;
00079     int        m_startCol;
00080     int        m_endRow;
00081     int        m_endCol;
00082     QChar      m_textquote;
00083     QString    m_delimiter;
00084     bool       m_ignoreDups;
00085     QByteArray m_fileArray;
00086     QTextCodec *m_codec;
00087     QStringList m_formatList; 
00088 
00089 protected slots:
00090     void returnPressed();
00091     void formatChanged( const QString& );
00092     void delimiterClicked(int id);
00093     void textquoteSelected(const QString& mark);
00094     void currentCellChanged(int, int col);
00095     void genericDelimiterChanged( const QString & );
00096     void ignoreDuplicatesChanged( int );
00097     void updateClicked();
00098     void encodingChanged ( const QString & );
00099 };
00100 
00101 #endif // KO_CSV_IMPORT_DIALOG

Généré le Wed Nov 22 23:41:04 2006 pour KPlato par  doxygen 1.5.1-p1