kaddressbook Library API Documentation

phoneeditwidget.h

00001 /* 00002 This file is part of KAddressBook. 00003 Copyright (c) 2002 Mike Pilone <mpilone@slac.com> 00004 00005 This program is free software; you can redistribute it and/or modify 00006 it under the terms of the GNU General Public License as published by 00007 the Free Software Foundation; either version 2 of the License, or 00008 (at your option) any later version. 00009 00010 This program is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 GNU General Public License for more details. 00014 00015 You should have received a copy of the GNU General Public License 00016 along with this program; if not, write to the Free Software 00017 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00018 00019 As a special exception, permission is given to link this program 00020 with any edition of Qt, and distribute the resulting executable, 00021 without including the source code for Qt in the source distribution. 00022 */ 00023 00024 #ifndef PHONEEDITWIDGET_H 00025 #define PHONEEDITWIDGET_H 00026 00027 #include <kdialogbase.h> 00028 00029 #include "addresseeconfig.h" 00030 #include "typecombo.h" 00031 00032 class QButtonGroup; 00033 class QCheckBox; 00034 00035 class KLineEdit; 00036 class KComboBox; 00037 00038 typedef TypeCombo<KABC::PhoneNumber> PhoneTypeCombo; 00039 00043 class PhoneEditWidget : public QWidget 00044 { 00045 Q_OBJECT 00046 00047 public: 00048 PhoneEditWidget( QWidget *parent, const char *name = 0 ); 00049 ~PhoneEditWidget(); 00050 00051 void setPhoneNumbers( const KABC::PhoneNumber::List &list ); 00052 KABC::PhoneNumber::List phoneNumbers(); 00053 00054 void updateTypeCombo( const KABC::PhoneNumber::List&, KComboBox* ); 00055 KABC::PhoneNumber currentPhoneNumber( KComboBox*, int ); 00056 00057 void setReadOnly( bool readOnly ); 00058 00059 signals: 00060 void modified(); 00061 00062 private slots: 00063 void edit(); 00064 00065 void updatePrefEdit(); 00066 void updateSecondEdit(); 00067 void updateThirdEdit(); 00068 void updateFourthEdit(); 00069 00070 void slotPrefEditChanged(); 00071 void slotSecondEditChanged(); 00072 void slotThirdEditChanged(); 00073 void slotFourthEditChanged(); 00074 00075 protected: 00076 void updateLineEdits(); 00077 void updateCombos(); 00078 00079 private: 00080 void updateEdit( PhoneTypeCombo *combo ); 00081 void updatePhoneNumber( PhoneTypeCombo *combo ); 00082 void updateOtherEdit( PhoneTypeCombo *combo, PhoneTypeCombo *otherCombo ); 00083 00084 PhoneTypeCombo *mPrefCombo; 00085 PhoneTypeCombo *mSecondCombo; 00086 PhoneTypeCombo *mThirdCombo; 00087 PhoneTypeCombo *mFourthCombo; 00088 QPushButton *mEditButton; 00089 00090 KLineEdit *mPrefEdit; 00091 KLineEdit *mSecondEdit; 00092 KLineEdit *mThirdEdit; 00093 KLineEdit *mFourthEdit; 00094 00095 KABC::PhoneNumber::List mPhoneList; 00096 bool mReadOnly; 00097 }; 00098 00102 class PhoneEditDialog : public KDialogBase 00103 { 00104 Q_OBJECT 00105 00106 public: 00107 PhoneEditDialog( const KABC::PhoneNumber::List &list, QWidget *parent, const char *name = 0 ); 00108 ~PhoneEditDialog(); 00109 00110 const KABC::PhoneNumber::List &phoneNumbers(); 00111 bool changed() const; 00112 00113 protected slots: 00114 void slotAddPhoneNumber(); 00115 void slotRemovePhoneNumber(); 00116 void slotEditPhoneNumber(); 00117 void slotSelectionChanged(); 00118 00119 private: 00120 KABC::PhoneNumber::List mPhoneNumberList; 00121 KABC::PhoneNumber::TypeList mTypeList; 00122 KComboBox *mTypeBox; 00123 KListView *mListView; 00124 00125 QPushButton *mRemoveButton; 00126 QPushButton *mEditButton; 00127 00128 bool mChanged; 00129 }; 00130 00134 class PhoneTypeDialog : public KDialogBase 00135 { 00136 Q_OBJECT 00137 public: 00138 PhoneTypeDialog( const KABC::PhoneNumber &phoneNumber, QWidget *parent, const char *name = 0 ); 00139 00140 KABC::PhoneNumber phoneNumber(); 00141 00142 private: 00143 KABC::PhoneNumber mPhoneNumber; 00144 KABC::PhoneNumber::TypeList mTypeList; 00145 00146 QButtonGroup *mGroup; 00147 QCheckBox *mPreferredBox; 00148 KLineEdit *mNumber; 00149 }; 00150 00151 #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 Thu Oct 21 19:46:37 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003