Diffstat (limited to 'kaddressbook/addresseeeditorwidget.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kaddressbook/addresseeeditorwidget.h | 184 |
1 files changed, 184 insertions, 0 deletions
diff --git a/kaddressbook/addresseeeditorwidget.h b/kaddressbook/addresseeeditorwidget.h new file mode 100644 index 0000000..b9d9e25 --- a/dev/null +++ b/kaddressbook/addresseeeditorwidget.h | |||
@@ -0,0 +1,184 @@ | |||
1 | /* | ||
2 | This file is part of KAddressBook. | ||
3 | Copyright (c) 2002 Mike Pilone <mpilone@slac.com> | ||
4 | |||
5 | This program is free software; you can redistribute it and/or modify | ||
6 | it under the terms of the GNU General Public License as published by | ||
7 | the Free Software Foundation; either version 2 of the License, or | ||
8 | (at your option) any later version. | ||
9 | |||
10 | This program is distributed in the hope that it will be useful, | ||
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | GNU General Public License for more details. | ||
14 | |||
15 | You should have received a copy of the GNU General Public License | ||
16 | along with this program; if not, write to the Free Software | ||
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
18 | |||
19 | As a special exception, permission is given to link this program | ||
20 | with any edition of Qt, and distribute the resulting executable, | ||
21 | without including the source code for Qt in the source distribution. | ||
22 | */ | ||
23 | |||
24 | #ifndef ADDRESSEEEDITORWIDGET_H | ||
25 | #define ADDRESSEEEDITORWIDGET_H | ||
26 | |||
27 | #include <qdatetime.h> | ||
28 | |||
29 | #include <kabc/addressee.h> | ||
30 | #include <kdialogbase.h> | ||
31 | #include <kjanuswidget.h> | ||
32 | |||
33 | #include "extensionwidget.h" | ||
34 | |||
35 | class AddresseeConfig; | ||
36 | class QCheckBox; | ||
37 | class QSpinBox; | ||
38 | class QTabWidget; | ||
39 | |||
40 | #ifndef KAB_EMBEDDED | ||
41 | class QTextEdit; | ||
42 | #else //KAB_EMBEDDED | ||
43 | class QMultiLineEdit; | ||
44 | #endif //KAB_EMBEDDED | ||
45 | |||
46 | class KComboBox; | ||
47 | class KDateEdit; | ||
48 | class KLineEdit; | ||
49 | class KSqueezedTextLabel; | ||
50 | |||
51 | class AddressEditWidget; | ||
52 | class EmailEditWidget; | ||
53 | class GeoWidget; | ||
54 | class ImageWidget; | ||
55 | class KABCore; | ||
56 | class KeyWidget; | ||
57 | class PhoneEditWidget; | ||
58 | class SecrecyWidget; | ||
59 | class SoundWidget; | ||
60 | |||
61 | namespace KPIM | ||
62 | { | ||
63 | class CategorySelectDialog; | ||
64 | class CategoryEditDialog; | ||
65 | } | ||
66 | |||
67 | namespace KABC { class AddressBook; } | ||
68 | |||
69 | class AddresseeEditorWidget : public ExtensionWidget | ||
70 | { | ||
71 | Q_OBJECT | ||
72 | |||
73 | public: | ||
74 | AddresseeEditorWidget( KABCore *core, bool isExtension, | ||
75 | QWidget *parent, const char *name = 0 ); | ||
76 | ~AddresseeEditorWidget(); | ||
77 | |||
78 | void setAddressee( const KABC::Addressee& ); | ||
79 | const KABC::Addressee &addressee(); | ||
80 | |||
81 | void contactsSelectionChanged(); | ||
82 | |||
83 | void load(); | ||
84 | void save(); | ||
85 | |||
86 | bool dirty(); | ||
87 | |||
88 | QString title() const; | ||
89 | QString identifier() const; | ||
90 | |||
91 | protected slots: | ||
92 | void textChanged( const QString& ); | ||
93 | void pageChanged( QWidget *wdg ); | ||
94 | |||
95 | /** | ||
96 | Emits the modified signal and sets the dirty flag. Any slot | ||
97 | that modifies data should use this method instead of calling emit | ||
98 | modified() directly. | ||
99 | */ | ||
100 | void emitModified(); | ||
101 | |||
102 | void dateChanged( QDate ); | ||
103 | void invalidDate(); | ||
104 | void nameTextChanged( const QString& ); | ||
105 | void nameBoxChanged(); | ||
106 | void nameButtonClicked(); | ||
107 | void categoryButtonClicked(); | ||
108 | |||
109 | /** | ||
110 | Called whenever the categories change in the categories dialog. | ||
111 | */ | ||
112 | void categoriesSelected( const QStringList& ); | ||
113 | |||
114 | /** | ||
115 | Edits which categories are available in the CategorySelectDialog. | ||
116 | */ | ||
117 | void editCategories(); | ||
118 | |||
119 | private: | ||
120 | AddresseeConfig * mAConfig; | ||
121 | void initGUI(); | ||
122 | void setupTab1(); | ||
123 | void setupTab1_1(); | ||
124 | void setupTab2(); | ||
125 | void setupTab2_1(); | ||
126 | void setupTab3(); | ||
127 | void setupTab3_1(); | ||
128 | |||
129 | KABC::Addressee mAddressee; | ||
130 | int mFormattedNameType; | ||
131 | bool mDirty; | ||
132 | bool mIsExtension; | ||
133 | bool mBlockSignals; | ||
134 | |||
135 | // GUI | ||
136 | KPIM::CategorySelectDialog *mCategoryDialog; | ||
137 | KPIM::CategoryEditDialog *mCategoryEditDialog; | ||
138 | QTabWidget *mTabWidget; | ||
139 | |||
140 | // Tab1 and Tab1_1 | ||
141 | KLineEdit *mNameEdit; | ||
142 | KLineEdit *mRoleEdit; | ||
143 | KLineEdit *mOrgEdit; | ||
144 | |||
145 | KSqueezedTextLabel *mFormattedNameLabel; | ||
146 | AddressEditWidget *mAddressEditWidget; | ||
147 | EmailEditWidget *mEmailWidget; | ||
148 | PhoneEditWidget *mPhoneEditWidget; | ||
149 | KLineEdit *mURLEdit; | ||
150 | KLineEdit *mIMAddressEdit; | ||
151 | KLineEdit *mCategoryEdit; | ||
152 | SecrecyWidget *mSecrecyWidget; | ||
153 | KSqueezedTextLabel *mNameLabel; | ||
154 | |||
155 | // Tab2 and Tab2_2 | ||
156 | KLineEdit *mDepartmentEdit; | ||
157 | KLineEdit *mOfficeEdit; | ||
158 | KLineEdit *mProfessionEdit; | ||
159 | KLineEdit *mManagerEdit; | ||
160 | KLineEdit *mAssistantEdit; | ||
161 | KLineEdit *mNicknameEdit; | ||
162 | KLineEdit *mSpouseEdit; | ||
163 | KDateEdit *mBirthdayPicker; | ||
164 | KDateEdit *mAnniversaryPicker; | ||
165 | #ifndef KAB_EMBEDDED | ||
166 | QTextEdit *mNoteEdit; | ||
167 | #else //KAB_EMBEDDED | ||
168 | QMultiLineEdit *mNoteEdit; | ||
169 | #endif //KAB_EMBEDDED | ||
170 | |||
171 | QSpinBox *mTimeZoneSpin; | ||
172 | QSpinBox *mGeoLat; | ||
173 | QSpinBox *mGeoLon; | ||
174 | |||
175 | // Tab3 | ||
176 | GeoWidget *mGeoWidget; | ||
177 | ImageWidget *mImageWidget; | ||
178 | #ifndef KAB_EMBEDDED | ||
179 | SoundWidget *mSoundWidget; | ||
180 | #endif //KAB_EMBEDDED | ||
181 | KeyWidget *mKeyWidget; | ||
182 | }; | ||
183 | |||
184 | #endif | ||