22 #ifndef KIMPORTDIALOG_H 23 #define KIMPORTDIALOG_H 25 #include <tqintdict.h> 26 #include <tqstringlist.h> 27 #include <tqspinbox.h> 28 #include <tqptrvector.h> 29 #include <tqvaluevector.h> 31 #include <kdialogbase.h> 42 enum { FormatUndefined = 0, FormatPlain, FormatUnquoted, FormatBracketed, FormatLast }; 44 KImportColumn(KImportDialog *dlg, const TQString &header, int count = 0); 45 virtual ~KImportColumn() {} 47 TQString header() const { return m_header; } 49 TQValueList<int> formats(); 50 TQString formatName( int format); 55 TQString preview( const TQString &value, int format); 58 void removeColId( int i); 60 TQValueList<int> colIdList(); 65 int m_maxCount, m_refCount; 68 TQValueList<int> mFormats; 71 TQValueList<int> mColIds; 73 KImportDialog *mDialog; 76 class KImportDialog : public KDialogBase 81 KImportDialog(TQWidget* parent); 84 bool setFile( const TQString& file); 86 TQString cell(uint row); 88 void addColumn(KImportColumn *); 91 void readFile( int rows = 10 ); 94 void registerColumns(); 95 int findFormat( int column); 97 virtual void convertRow() {} 100 void separatorClicked( int id); 101 void formatSelected(TQListViewItem* item); 102 void headerSelected(TQListViewItem* item); 103 void assignColumn(TQListViewItem *); 105 void assignTemplate(); 107 void applyConverter(); 108 void tableSelected(); 109 void slotUrlChanged( const TQString & ); 113 void updateFormatSelection( int column); 114 void setCellText( int row, int col, const TQString& text); 116 void setData( uint row, uint col, const TQString &text ); 117 TQString data( uint row, uint col ); 119 TQListView *mHeaderList; 120 TQSpinBox *mStartRow; 124 KComboBox *mFormatCombo; 125 KComboBox *mSeparatorCombo; 130 TQIntDict<KImportColumn> mColumnDict; 131 TQIntDict<uint> mTemplateDict; 132 TQMap<int,int> mFormats; 133 TQPtrList<KImportColumn> mColumns; 134 TQPtrVector<TQValueVector<TQString> > mData;
|