summaryrefslogtreecommitdiffstats
path: root/kexi/plugins/importexport/csv/kexicsvimportdialog.h
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
commitf008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch)
tree8e9244c4d4957c36be81e15b566b4aa5ea26c982 /kexi/plugins/importexport/csv/kexicsvimportdialog.h
parent1210f27b660efb7b37ff43ec68763e85a403471f (diff)
downloadkoffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.tar.gz
koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.zip
TQt4 port koffice
This should enable compilation under both Qt3 and Qt4; fixes for any missed components will be forthcoming git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1238284 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kexi/plugins/importexport/csv/kexicsvimportdialog.h')
-rw-r--r--kexi/plugins/importexport/csv/kexicsvimportdialog.h105
1 files changed, 53 insertions, 52 deletions
diff --git a/kexi/plugins/importexport/csv/kexicsvimportdialog.h b/kexi/plugins/importexport/csv/kexicsvimportdialog.h
index 1f7b159e..dd8a51df 100644
--- a/kexi/plugins/importexport/csv/kexicsvimportdialog.h
+++ b/kexi/plugins/importexport/csv/kexicsvimportdialog.h
@@ -28,11 +28,11 @@
#ifndef KEXI_CSVDIALOG_H
#define KEXI_CSVDIALOG_H
-#include <qvaluevector.h>
-#include <qvaluelist.h>
-#include <qptrvector.h>
-#include <qregexp.h>
-#include <qbitarray.h>
+#include <tqvaluevector.h>
+#include <tqvaluelist.h>
+#include <tqptrvector.h>
+#include <tqregexp.h>
+#include <tqbitarray.h>
#include <kdialogbase.h>
@@ -41,17 +41,17 @@
#include "kexicsvimportoptionsdlg.h"
-class QVBoxLayout;
-class QHBoxLayout;
-class QGridLayout;
-class QButtonGroup;
-class QCheckBox;
-class QLabel;
-class QLineEdit;
-class QPushButton;
-class QRadioButton;
-class QTable;
-class QFile;
+class TQVBoxLayout;
+class TQHBoxLayout;
+class TQGridLayout;
+class TQButtonGroup;
+class TQCheckBox;
+class TQLabel;
+class TQLineEdit;
+class TQPushButton;
+class TQRadioButton;
+class TQTable;
+class TQFile;
class KComboBox;
class KIntSpinBox;
class KProgressDialog;
@@ -78,69 +78,70 @@ class KexiCSVInfoLabel;
class KexiCSVImportDialog : public KDialogBase
{
Q_OBJECT
+ TQ_OBJECT
public:
enum Mode { Clipboard, File /*, Column*/ };
enum Header { TEXT, NUMBER, DATE, CURRENCY };
//! @todo what about making it kexidb-independent?
- KexiCSVImportDialog( Mode mode, KexiMainWindow* mainWin, QWidget * parent,
- const char * name = 0/*, QRect const & rect*/);
+ KexiCSVImportDialog( Mode mode, KexiMainWindow* mainWin, TQWidget * tqparent,
+ const char * name = 0/*, TQRect const & rect*/);
virtual ~KexiCSVImportDialog();
bool cancelled() const;
- virtual bool eventFilter ( QObject * watched, QEvent * e );
+ virtual bool eventFilter ( TQObject * watched, TQEvent * e );
protected:
bool openData();
virtual void accept();
private:
- QGridLayout* MyDialogLayout;
- QHBoxLayout* Layout1;
- QTable* m_table;
+ TQGridLayout* MyDialogLayout;
+ TQHBoxLayout* Layout1;
+ TQTable* m_table;
KexiCSVDelimiterWidget* m_delimiterWidget;
bool m_detectDelimiter; //!< true if delimiter should be detected
//!< (true by default, set to false if user sets delimiter)
- QString m_formatComboText;
- QLabel* m_formatLabel;
+ TQString m_formatComboText;
+ TQLabel* m_formatLabel;
KComboBox* m_formatCombo;
KIntSpinBox *m_startAtLineSpinBox;
KexiCSVTextQuoteComboBox* m_comboQuote;
- QLabel* m_startAtLineLabel;
- QLabel* TextLabel2;
- QCheckBox* m_ignoreDuplicates;
- QCheckBox* m_1stRowForFieldNames;
- QCheckBox* m_primaryKeyField;
+ TQLabel* m_startAtLineLabel;
+ TQLabel* TextLabel2;
+ TQCheckBox* m_ignoreDuplicates;
+ TQCheckBox* m_1stRowForFieldNames;
+ TQCheckBox* m_primaryKeyField;
KexiMainWindow* m_mainWin;
- void detectTypeAndUniqueness(int row, int col, const QString& text);
- void setText(int row, int col, const QString& text, bool inGUI);
+ void detectTypeAndUniqueness(int row, int col, const TQString& text);
+ void setText(int row, int col, const TQString& text, bool inGUI);
/*! Parses date from \a text and stores into \a date.
m_dateRegExp is used for clever detection;
if '/' separated is found, it's assumed the format is american mm/dd/yyyy.
This function supports omitted zeros, so 1/2/2006 is parsed properly too.
\return true on success. */
- bool parseDate(const QString& text, QDate& date);
+ bool parseDate(const TQString& text, TQDate& date);
/*! Parses time from \a text and stores into \a date.
m_timeRegExp1 and m_timeRegExp2 are used for clever detection;
both hh:mm:ss and hh:mm are supported.
This function supports omitted zeros, so 1:2:3 is parsed properly too.
\return true on success. */
- bool parseTime(const QString& text, QTime& time);
+ bool parseTime(const TQString& text, TQTime& time);
/*! Called after the first fillTable() when number of rows is unknown. */
void adjustRows(int iRows);
int getHeader(int col);
- QString getText(int row, int col);
+ TQString getText(int row, int col);
void updateColumnText(int col);
void updateRowCountInfo();
- tristate loadRows(QString &field, int &row, int &columnm, int &maxColumn, bool inGUI);
+ tristate loadRows(TQString &field, int &row, int &columnm, int &maxColumn, bool inGUI);
/*! Detects delimiter by looking at first 4K bytes of the data. Used by loadRows().
The used algorithm:
@@ -154,8 +155,8 @@ class KexiCSVImportDialog : public KDialogBase
(escaped) quotes.
2. While scanning the data, for every row following number of tabs, semicolons and commas
(only these outside of the quotes) are computed. On every line the values are appended
- to a separate list (QValueList<int>).
- 3. After scanning, all the values are checked on the QValueList<int> of tabs.
+ to a separate list (TQValueList<int>).
+ 3. After scanning, all the values are checked on the TQValueList<int> of tabs.
If the list has more one element (so there was more than one row) and all the values
(numbers of tabs) are equal, it's very probable the tab is a delimiter.
So, this character is returned as a delimiter.
@@ -163,7 +164,7 @@ class KexiCSVImportDialog : public KDialogBase
3b. The same algorithm as in 3. is performed for comma character.
4. If the step 3. did not return a delimiter, a character found in step 1. with
the highest priority is retured as delimiter. */
- QString detectDelimiterByLookingAtFirstBytesOfFile(QTextStream& inputStream);
+ TQString detectDelimiterByLookingAtFirstBytesOfFile(TQTextStream& inputStream);
/*! Callback, called whenever row is loaded in loadRows(). When inGUI is true,
nothing is performed, else database buffer is written back to the database. */
@@ -172,23 +173,23 @@ class KexiCSVImportDialog : public KDialogBase
bool m_cancelled;
bool m_adjustRows;
int m_startline;
- QChar m_textquote;
- QString m_clipboardData;
- QByteArray m_fileArray;
+ TQChar m_textquote;
+ TQString m_clipboardData;
+ TQByteArray m_fileArray;
Mode m_mode;
int m_prevSelectedCol;
//! vector of detected types, 0==text (the default), 1==number, 2==date
//! @todo more types
- QValueVector<int> m_detectedTypes;
+ TQValueVector<int> m_detectedTypes;
//! m_detectedUniqueColumns[i]==true means that i-th column has unique values
//! (only for numeric type)
- QPtrVector< QValueList<int> > m_uniquenessTest;
+ TQPtrVector< TQValueList<int> > m_uniquenessTest;
- QRegExp m_dateRegExp, m_timeRegExp1, m_timeRegExp2, m_fpNumberRegExp;
- QValueVector<QString> m_typeNames, m_columnNames;
- QBitArray m_changedColumnNames;
+ TQRegExp m_dateRegExp, m_timeRegExp1, m_timeRegExp2, m_fpNumberRegExp;
+ TQValueVector<TQString> m_typeNames, m_columnNames;
+ TQBitArray m_changedColumnNames;
bool m_columnsAdjusted : 1; //!< to call adjustColumn() only once
bool m_1stRowForFieldNamesDetected : 1; //!< used to force rerun fillTable() after 1st row
bool m_firstFillTableCall : 1; //!< used to know whether it's 1st fillTable() call
@@ -196,10 +197,10 @@ class KexiCSVImportDialog : public KDialogBase
int m_primaryKeyColumn; //!< index of column with PK assigned (-1 if none)
int m_maximumRowsForPreview;
int m_maximumBytesForPreview;
- QPixmap m_pkIcon;
- QString m_fname;
- QFile* m_file;
- QTextStream *m_inputStream; //!< used in loadData()
+ TQPixmap m_pkIcon;
+ TQString m_fname;
+ TQFile* m_file;
+ TQTextStream *m_inputStream; //!< used in loadData()
KexiCSVImportOptions m_options;
KProgressDialog *m_loadingProgressDlg, *m_importingProgressDlg;
bool m_dialogCancelled;
@@ -207,7 +208,7 @@ class KexiCSVImportDialog : public KDialogBase
KexiDB::Connection *m_conn; //!< (temp) database connection used for importing
KexiDB::TableSchema *m_destinationTableSchema; //!< (temp) dest. table schema used for importing
KexiDB::PreparedStatement::Ptr m_importingStatement;
- QValueList<QVariant> m_dbRowBuffer; //!< (temp) used for importing
+ TQValueList<TQVariant> m_dbRowBuffer; //!< (temp) used for importing
bool m_implicitPrimaryKeyAdded; //!< (temp) used for importing
bool m_allRowsLoadedInPreview; //!< we need to know whether all rows were loaded or it's just a partial data preview
bool m_stoppedAt_MAX_BYTES_TO_PREVIEW; //!< used to compute m_allRowsLoadedInPreview
@@ -217,7 +218,7 @@ class KexiCSVImportDialog : public KDialogBase
void fillTableLater();
void initLater();
void formatChanged(int id);
- void delimiterChanged(const QString& delimiter);
+ void delimiterChanged(const TQString& delimiter);
void startlineSelected(int line);
void textquoteSelected(int);
void currentCellChanged(int, int col);