kaddressbook Library API Documentation

phoneeditwidget.h

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