csvimportdialog.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
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
00065 void applyTemplate();
00066 void saveTemplate();
00067
00068 private:
00069 enum { Undefined, FormattedName, FamilyName, GivenName, AdditionalName,
00070 Prefix, Suffix, NickName, Birthday,
00071 HomeAddressStreet, HomeAddressLocality, HomeAddressRegion,
00072 HomeAddressPostalCode, HomeAddressCountry, HomeAddressLabel,
00073 BusinessAddressStreet, BusinessAddressLocality, BusinessAddressRegion,
00074 BusinessAddressPostalCode, BusinessAddressCountry,
00075 BusinessAddressLabel,
00076 HomePhone, BusinessPhone, MobilePhone, HomeFax, BusinessFax, CarPhone,
00077 Isdn, Pager, Email, Mailer, Title, Role, Organization, Note, URL
00078 };
00079
00080 QTable* mTable;
00081 QButtonGroup* mDelimiterBox;
00082 QRadioButton* mRadioComma;
00083 QRadioButton* mRadioSemicolon;
00084 QRadioButton* mRadioTab;
00085 QRadioButton* mRadioSpace;
00086 QRadioButton* mRadioOther;
00087 QLineEdit* mDelimiterEdit;
00088 QLineEdit* mDatePatternEdit;
00089 QComboBox* mComboLine;
00090 QComboBox* mComboQuote;
00091 QCheckBox* mIgnoreDuplicates;
00092 QWidget* mPage;
00093 KURLRequester* mUrlRequester;
00094
00095 void initGUI();
00096 void fillTable();
00097 void clearTable();
00098 void fillComboBox();
00099 void setText( int row, int col, const QString& text );
00100 void adjustRows( int rows );
00101 QString getText( int row, int col );
00102 uint posToType( int pos ) const;
00103 int typeToPos( uint type ) const;
00104
00105 bool mAdjustRows;
00106 int mStartLine;
00107 QChar mTextQuote;
00108 QString mDelimiter;
00109 QString mData;
00110 QByteArray mFileArray;
00111 QMap<QString, uint> mTypeMap;
00112 KABC::AddressBook *mAddressBook;
00113 int mCustomCounter;
00114 bool mClearTypeStore;
00115 QValueList<int> mTypeStore;
00116 };
00117
00118 #endif
This file is part of the documentation for kaddressbook Library Version 3.2.2.