kaddressbook

addresseeeditorwidget.h
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18
19 As a special exception, permission is given to link this program
20 with any edition of TQt, and distribute the resulting executable,
21 without including the source code for TQt in the source distribution.
22*/
23
24#ifndef ADDRESSEEEDITORWIDGET_H
25#define ADDRESSEEEDITORWIDGET_H
26
27#include <tqdatetime.h>
28
29#include <tdeabc/addressee.h>
30#include <kdialogbase.h>
31#include <kjanuswidget.h>
32
33#include "addresseeeditorbase.h"
34#include "contacteditorwidgetmanager.h"
35#include "extensionwidget.h"
36
37class TQCheckBox;
38class TQSpinBox;
39class TQTabWidget;
40class TQTextEdit;
41
42class KComboBox;
43class KDateEdit;
44class KLineEdit;
45class KSqueezedTextLabel;
46
48class EmailEditWidget;
49class IMEditWidget;
50class KeyWidget;
51class PhoneEditWidget;
52class SecrecyWidget;
53
54namespace KAB {
55class Core;
56}
57
58namespace KPIM {
59class AddresseeLineEdit;
60class CategorySelectDialog;
61class CategoryEditDialog;
62}
63
64namespace TDEABC { class AddressBook; }
65
66class AddresseeEditorWidget : public AddresseeEditorBase
67{
68 TQ_OBJECT
69
70
71 public:
72 AddresseeEditorWidget( TQWidget *parent, const char *name = 0 );
73 ~AddresseeEditorWidget();
74
75 void setAddressee( const TDEABC::Addressee& );
76 const TDEABC::Addressee &addressee();
77
78 void load();
79 void save();
80
81 bool dirty();
82
83 void setInitialFocus();
84
85 bool readyToClose();
86
87 protected slots:
88 void textChanged( const TQString& );
89 void pageChanged( TQWidget *wdg );
90
96 void emitModified();
97
98 void dateChanged( const TQDate& );
99 void invalidDate();
100 void nameTextChanged( const TQString& );
101 void organizationTextChanged( const TQString& );
102 void nameBoxChanged();
103 void nameButtonClicked();
104 void selectCategories();
105
109 void categoriesSelected( const TQStringList& );
110
114 void editCategories();
115
116 private:
117 void initGUI();
118 void setupTab1();
119 void setupTab2();
120 void setupAdditionalTabs();
121 void setupCustomFieldsTabs();
122
123 void setReadOnly( bool );
124
125 TDEABC::Addressee mAddressee;
126 int mFormattedNameType;
127 bool mDirty;
128 bool mBlockSignals;
129 bool mReadOnly;
130
131 // GUI
132 KPIM::CategorySelectDialog *mCategorySelectDialog;
133 KPIM::CategoryEditDialog *mCategoryEditDialog;
134 TQTabWidget *mTabWidget;
135
136 // Tab1
137 KLineEdit *mNameEdit;
138 KLineEdit *mRoleEdit;
139 KLineEdit *mOrgEdit;
140 KSqueezedTextLabel *mFormattedNameLabel;
141 AddressEditWidget *mAddressEditWidget;
142 EmailEditWidget *mEmailWidget;
143 IMEditWidget *mIMWidget;
144 PhoneEditWidget *mPhoneEditWidget;
145 KLineEdit *mURLEdit;
146 KLineEdit *mBlogEdit;
147 TQPushButton *mCategoryButton;
148 KLineEdit *mCategoryEdit;
149 SecrecyWidget *mSecrecyWidget;
150 KSqueezedTextLabel *mNameLabel;
151
152 // Tab2
153 KLineEdit *mDepartmentEdit;
154 KLineEdit *mOfficeEdit;
155 KLineEdit *mProfessionEdit;
156 KLineEdit *mTitleEdit;
157 KPIM::AddresseeLineEdit *mManagerEdit;
158 KPIM::AddresseeLineEdit *mAssistantEdit;
159 KLineEdit *mNicknameEdit;
160 KPIM::AddresseeLineEdit *mSpouseEdit;
161 KDateEdit *mBirthdayPicker;
162 KDateEdit *mAnniversaryPicker;
163 TQTextEdit *mNoteEdit;
164
165 TQDict<ContactEditorTabPage> mTabPages;
166};
167
168#endif
Editor widget for addresses.
This widget displays a list box of the email addresses as well as buttons to manipulate them (up,...
This widget displays a list box of the instant messaging addresses as well as buttons to manipulate t...
Definition: imeditwidget.h:45
Widget for editing phone numbers.