kaddressbook Library API Documentation

csvimportdialog.h

00001 /* 00002 This file is part of KAddressBook. 00003 Copyright (C) 2003 Tobias Koenig <tokoe@kde.org> 00004 based on the code of KSpread's CSV Import Dialog 00005 00006 This library is free software; you can redistribute it and/or 00007 modify it under the terms of the GNU Library General Public 00008 License as published by the Free Software Foundation; either 00009 version 2 of the License, or (at your option) any later version. 00010 00011 This library is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 Library General Public License for more details. 00015 00016 You should have received a copy of the GNU Library General Public License 00017 along with this library; see the file COPYING.LIB. If not, write to 00018 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 00019 Boston, MA 02111-1307, USA. 00020 */ 00021 00022 #ifndef CSV_IMPORT_DLG_H 00023 #define CSV_IMPORT_DLG_H 00024 00025 #include <kabc/addressbook.h> 00026 #include <kabc/addresseelist.h> 00027 #include <kdialogbase.h> 00028 00029 #include <qvaluelist.h> 00030 00031 class KURLRequester; 00032 00033 class QButtonGroup; 00034 class QComboBox; 00035 class QCheckBox; 00036 class QLineEdit; 00037 class QPushButton; 00038 class QRadioButton; 00039 class QTable; 00040 00041 class CSVImportDialog : public KDialogBase 00042 { 00043 Q_OBJECT 00044 00045 public: 00046 CSVImportDialog( KABC::AddressBook *ab, QWidget *parent, 00047 const char *name = 0 ); 00048 ~CSVImportDialog(); 00049 00050 KABC::AddresseeList contacts() const; 00051 00052 protected slots: 00053 virtual void slotOk(); 00054 00055 private slots: 00056 void returnPressed(); 00057 void delimiterClicked( int id ); 00058 void lineSelected( const QString& line ); 00059 void textquoteSelected( const QString& mark ); 00060 void textChanged ( const QString & ); 00061 void ignoreDuplicatesChanged( int ); 00062 void setFile( const QString& ); 00063 void urlChanged( const QString& ); 00064 void codecChanged(); 00065 00066 void applyTemplate(); 00067 void saveTemplate(); 00068 00069 private: 00070 enum { Undefined, FormattedName, FamilyName, GivenName, AdditionalName, 00071 Prefix, Suffix, NickName, Birthday, 00072 HomeAddressStreet, HomeAddressLocality, HomeAddressRegion, 00073 HomeAddressPostalCode, HomeAddressCountry, HomeAddressLabel, 00074 BusinessAddressStreet, BusinessAddressLocality, BusinessAddressRegion, 00075 BusinessAddressPostalCode, BusinessAddressCountry, 00076 BusinessAddressLabel, 00077 HomePhone, BusinessPhone, MobilePhone, HomeFax, BusinessFax, CarPhone, 00078 Isdn, Pager, Email, Mailer, Title, Role, Organization, Note, URL 00079 }; 00080 00081 QTable* mTable; 00082 QButtonGroup* mDelimiterBox; 00083 QRadioButton* mRadioComma; 00084 QRadioButton* mRadioSemicolon; 00085 QRadioButton* mRadioTab; 00086 QRadioButton* mRadioSpace; 00087 QRadioButton* mRadioOther; 00088 QLineEdit* mDelimiterEdit; 00089 QLineEdit* mDatePatternEdit; 00090 QComboBox* mComboLine; 00091 QComboBox* mComboQuote; 00092 QCheckBox* mIgnoreDuplicates; 00093 QComboBox* mCodecCombo; 00094 QWidget* mPage; 00095 KURLRequester* mUrlRequester; 00096 00097 void initGUI(); 00098 void fillTable(); 00099 void clearTable(); 00100 void fillComboBox(); 00101 void setText( int row, int col, const QString& text ); 00102 void adjustRows( int rows ); 00103 QString getText( int row, int col ); 00104 uint posToType( int pos ) const; 00105 int typeToPos( uint type ) const; 00106 00107 void reloadCodecs(); 00108 QTextCodec *currentCodec(); 00109 QPtrList<QTextCodec> mCodecs; 00110 00111 bool mAdjustRows; 00112 int mStartLine; 00113 QChar mTextQuote; 00114 QString mDelimiter; 00115 QString mData; 00116 QByteArray mFileArray; 00117 QMap<QString, uint> mTypeMap; 00118 KABC::AddressBook *mAddressBook; 00119 int mCustomCounter; 00120 bool mClearTypeStore; 00121 QValueList<int> mTypeStore; 00122 }; 00123 00124 #endif
KDE Logo
This file is part of the documentation for kaddressbook Library Version 3.3.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Fri Oct 1 15:19:04 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003