kaddressbook

addresseeeditorwidget.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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 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 ADDRESSEEEDITORWIDGET_H
00025 #define ADDRESSEEEDITORWIDGET_H
00026 
00027 #include <qdatetime.h>
00028 
00029 #include <kabc/addressee.h>
00030 #include <kdialogbase.h>
00031 #include <kjanuswidget.h>
00032 
00033 #include "addresseeeditorbase.h"
00034 #include "contacteditorwidgetmanager.h"
00035 #include "extensionwidget.h"
00036 
00037 class QCheckBox;
00038 class QSpinBox;
00039 class QTabWidget;
00040 class QTextEdit;
00041 
00042 class KComboBox;
00043 class KDateEdit;
00044 class KLineEdit;
00045 class KSqueezedTextLabel;
00046 
00047 class AddressEditWidget;
00048 class EmailEditWidget;
00049 class IMEditWidget;
00050 class KeyWidget;
00051 class PhoneEditWidget;
00052 class SecrecyWidget;
00053 
00054 namespace KAB {
00055 class Core;
00056 }
00057 
00058 namespace KPIM {
00059 class AddresseeLineEdit;
00060 class CategorySelectDialog;
00061 class CategoryEditDialog;
00062 }
00063 
00064 namespace KABC { class AddressBook; }
00065 
00066 class AddresseeEditorWidget : public AddresseeEditorBase
00067 {
00068   Q_OBJECT
00069 
00070   public:
00071     AddresseeEditorWidget( QWidget *parent, const char *name = 0 );
00072     ~AddresseeEditorWidget();
00073 
00074     void setAddressee( const KABC::Addressee& );
00075     const KABC::Addressee &addressee();
00076 
00077     void load();
00078     void save();
00079 
00080     bool dirty();
00081 
00082     void setInitialFocus();
00083 
00084     bool readyToClose();
00085 
00086   protected slots:
00087     void textChanged( const QString& );
00088     void pageChanged( QWidget *wdg );
00089 
00095     void emitModified();
00096 
00097     void dateChanged( const QDate& );
00098     void invalidDate();
00099     void nameTextChanged( const QString& );
00100     void organizationTextChanged( const QString& );
00101     void nameBoxChanged();
00102     void nameButtonClicked();
00103     void selectCategories();
00104 
00108     void categoriesSelected( const QStringList& );
00109 
00113     void editCategories();
00114 
00115   private:
00116     void initGUI();
00117     void setupTab1();
00118     void setupTab2();
00119     void setupAdditionalTabs();
00120     void setupCustomFieldsTabs();
00121 
00122     void setReadOnly( bool );
00123 
00124     KABC::Addressee mAddressee;
00125     int mFormattedNameType;
00126     bool mDirty;
00127     bool mBlockSignals;
00128     bool mReadOnly;
00129 
00130     // GUI
00131     KPIM::CategorySelectDialog *mCategorySelectDialog;
00132     KPIM::CategoryEditDialog *mCategoryEditDialog;
00133     QTabWidget *mTabWidget;
00134 
00135     // Tab1
00136     KLineEdit *mNameEdit;
00137     KLineEdit *mRoleEdit;
00138     KLineEdit *mOrgEdit;
00139     KSqueezedTextLabel *mFormattedNameLabel;
00140     AddressEditWidget *mAddressEditWidget;
00141     EmailEditWidget *mEmailWidget;
00142     IMEditWidget *mIMWidget;
00143     PhoneEditWidget *mPhoneEditWidget;
00144     KLineEdit *mURLEdit;
00145     KLineEdit *mBlogEdit;
00146     QPushButton *mCategoryButton;
00147     KLineEdit *mCategoryEdit;
00148     SecrecyWidget *mSecrecyWidget;
00149     KSqueezedTextLabel *mNameLabel;
00150 
00151     // Tab2
00152     KLineEdit *mDepartmentEdit;
00153     KLineEdit *mOfficeEdit;
00154     KLineEdit *mProfessionEdit;
00155     KLineEdit *mTitleEdit;
00156     KPIM::AddresseeLineEdit *mManagerEdit;
00157     KPIM::AddresseeLineEdit *mAssistantEdit;
00158     KLineEdit *mNicknameEdit;
00159     KPIM::AddresseeLineEdit *mSpouseEdit;
00160     KDateEdit *mBirthdayPicker;
00161     KDateEdit *mAnniversaryPicker;
00162     QTextEdit *mNoteEdit;
00163 
00164     QDict<ContactEditorTabPage> mTabPages;
00165 };
00166 
00167 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys