kspread

kspread_dlg_csv.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 2002-2003 Norbert Andres <nandres@web.de>
00003              (C) 2002-2003 Ariya Hidayat <ariya@kde.org>
00004              (C) 2002      Laurent Montel <montel@kde.org>
00005              (C) 1999 David Faure <faure@kde.org>
00006 
00007    This library is free software; you can redistribute it and/or
00008    modify it under the terms of the GNU Library General Public
00009    License as published by the Free Software Foundation; either
00010    version 2 of the License, or (at your option) any later version.
00011 
00012    This library is distributed in the hope that it will be useful,
00013    but WITHOUT ANY WARRANTY; without even the implied warranty of
00014    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015    Library General Public License for more details.
00016 
00017    You should have received a copy of the GNU Library General Public License
00018    along with this library; see the file COPYING.LIB.  If not, write to
00019    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00020  * Boston, MA 02110-1301, USA.
00021 */
00022 
00023 #ifndef CSVDIALOG_H
00024 #define CSVDIALOG_H
00025 
00026 #include <kdialogbase.h>
00027 
00028 class QVBoxLayout;
00029 class QHBoxLayout;
00030 class QGridLayout;
00031 class QButtonGroup;
00032 class QComboBox;
00033 class QCheckBox;
00034 class QLabel;
00035 class QLineEdit;
00036 class QPushButton;
00037 class QRadioButton;
00038 class QTable;
00039 
00040 
00041 namespace KSpread
00042 {
00043 class View;
00044 
00055 class CSVDialog : public KDialogBase
00056 {
00057   Q_OBJECT
00058 
00059  public:
00060 
00061   enum Mode { Clipboard, File, Column };
00062   enum Header { TEXT, NUMBER, DATE, CURRENCY };
00063 
00064   CSVDialog( View * parent, const char * name, QRect const & rect, Mode mode);
00065 
00066   ~CSVDialog();
00067 
00068   bool cancelled();
00069 
00070  protected:
00071   void accept();
00072 
00073 
00074  private:
00075   View* m_pView;
00076 
00077   QGridLayout* MyDialogLayout;
00078   QHBoxLayout* Layout1;
00079   QGridLayout* m_delimiterBoxLayout;
00080   QGridLayout* m_formatBoxLayout;
00081   QTable* m_sheet;
00082   QButtonGroup* m_delimiterBox;
00083   QRadioButton* m_radioComma;
00084   QRadioButton* m_radioSemicolon;
00085   QRadioButton* m_radioTab;
00086   QRadioButton* m_radioSpace;
00087   QRadioButton* m_radioOther;
00088   QLineEdit* m_delimiterEdit;
00089   QButtonGroup* m_formatBox;
00090   QRadioButton* m_radioNumber;
00091   QRadioButton* m_radioText;
00092   QRadioButton* m_radioCurrency;
00093   QRadioButton* m_radioDate;
00094   QComboBox* m_comboLine;
00095   QComboBox* m_comboQuote;
00096   QLabel* TextLabel3;
00097   QLabel* TextLabel2;
00098   QCheckBox * m_ignoreDuplicates;
00099 
00100   void fillSheet();
00101   void fillComboBox();
00102   void setText(int row, int col, const QString& text);
00103   void adjustRows(int iRows);
00104   int  getHeader(int col);
00105   QString getText(int row, int col);
00106 
00107   bool m_cancelled;
00108   int   m_adjustRows;
00109   int   m_startline;
00110   QChar m_textquote;
00111   QString m_delimiter;
00112   QString m_data;
00113   QByteArray m_fileArray;
00114   QRect m_targetRect;
00115   Mode  m_mode;
00116 
00117  private slots:
00118   void returnPressed();
00119   void formatClicked(int id);
00120   void delimiterClicked(int id);
00121   void lineSelected(const QString& line);
00122   void textquoteSelected(const QString& mark);
00123   void currentCellChanged(int, int col);
00124   void textChanged ( const QString & );
00125   void ignoreDuplicatesChanged(int);
00126 };
00127 
00128 } // namespace KSpread
00129 
00130 #endif // CVSDIALOG_H
KDE Home | KDE Accessibility Home | Description of Access Keys