kspread
kspread_dlg_csv.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
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 }
00129
00130 #endif // CVSDIALOG_H
|