00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
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