kspread

kspread_dlg_csv.h
1/* This file is part of the KDE project
2 Copyright (C) 2002-2003 Norbert Andres <nandres@web.de>
3 (C) 2002-2003 Ariya Hidayat <ariya@kde.org>
4 (C) 2002 Laurent Montel <montel@kde.org>
5 (C) 1999 David Faure <faure@kde.org>
6
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Library General Public
9 License as published by the Free Software Foundation; either
10 version 2 of the License, or (at your option) any later version.
11
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Library General Public License for more details.
16
17 You should have received a copy of the GNU Library General Public License
18 along with this library; see the file COPYING.LIB. If not, write to
19 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 * Boston, MA 02110-1301, USA.
21*/
22
23#ifndef CSVDIALOG_H
24#define CSVDIALOG_H
25
26#include <kdialogbase.h>
27
28class TQVBoxLayout;
29class TQHBoxLayout;
30class TQGridLayout;
31class TQButtonGroup;
32class TQComboBox;
33class TQCheckBox;
34class TQLabel;
35class TQLineEdit;
36class TQPushButton;
37class TQRadioButton;
38class TQTable;
39
40
41namespace KSpread
42{
43class View;
44
55class CSVDialog : public KDialogBase
56{
57 TQ_OBJECT
58
59
60 public:
61
62 enum Mode { Clipboard, File, Column };
63 enum Header { TEXT, NUMBER, DATE, CURRENCY };
64
65 CSVDialog( View * parent, const char * name, TQRect const & rect, Mode mode);
66
67 ~CSVDialog();
68
69 bool cancelled();
70
71 protected:
72 void accept();
73
74
75 private:
76 View* m_pView;
77
78 TQGridLayout* MyDialogLayout;
79 TQHBoxLayout* Layout1;
80 TQGridLayout* m_delimiterBoxLayout;
81 TQGridLayout* m_formatBoxLayout;
82 TQTable* m_sheet;
83 TQButtonGroup* m_delimiterBox;
84 TQRadioButton* m_radioComma;
85 TQRadioButton* m_radioSemicolon;
86 TQRadioButton* m_radioTab;
87 TQRadioButton* m_radioSpace;
88 TQRadioButton* m_radioOther;
89 TQLineEdit* m_delimiterEdit;
90 TQButtonGroup* m_formatBox;
91 TQRadioButton* m_radioNumber;
92 TQRadioButton* m_radioText;
93 TQRadioButton* m_radioCurrency;
94 TQRadioButton* m_radioDate;
95 TQComboBox* m_comboLine;
96 TQComboBox* m_comboQuote;
97 TQLabel* TextLabel3;
98 TQLabel* TextLabel2;
99 TQCheckBox * m_ignoreDuplicates;
100
101 void fillSheet();
102 void fillComboBox();
103 void setText(int row, int col, const TQString& text);
104 void adjustRows(int iRows);
105 int getHeader(int col);
106 TQString getText(int row, int col);
107
108 bool m_cancelled;
109 int m_adjustRows;
110 int m_startline;
111 TQChar m_textquote;
112 TQString m_delimiter;
113 TQString m_data;
114 TQByteArray m_fileArray;
115 TQRect m_targetRect;
116 Mode m_mode;
117
118 private slots:
119 void returnPressed();
120 void formatClicked(int id);
121 void delimiterClicked(int id);
122 void lineSelected(const TQString& line);
123 void textquoteSelected(const TQString& mark);
124 void currentCellChanged(int, int col);
125 void textChanged ( const TQString & );
126 void ignoreDuplicatesChanged(int);
127};
128
129} // namespace KSpread
130
131#endif // CVSDIALOG_H
The View class displays a KSpread document.
The KSpread namespace.
Definition commands.h:39