kaddressbook

addresseewidget.h

00001 /*
00002     This file is part of KAddressBook.
00003     Copyright (c) 2003 Tobias Koenig <tokoe@kde.org>
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 ADDRESSEEWIDGET_H
00025 #define ADDRESSEEWIDGET_H
00026 
00027 #include <qwidget.h>
00028 
00029 class KComboBox;
00030 class KLineEdit;
00031 
00032 class QListBox;
00033 class QListBoxItem;
00034 class QPushButton;
00035 
00036 class NamePartWidget : public QWidget
00037 {
00038   Q_OBJECT
00039 
00040   public:
00041     NamePartWidget( const QString &title, const QString &label, QWidget *parent,
00042                     const char *name = 0 );
00043     ~NamePartWidget();
00044 
00045     void setNameParts( const QStringList &list );
00046     QStringList nameParts() const;
00047 
00048   signals:
00049     void modified();
00050 
00051   private slots:
00052     void add();
00053     void edit();
00054     void remove();
00055 
00056     void selectionChanged( QListBoxItem* );
00057 
00058   private:
00059     QListBox *mBox;
00060     QPushButton *mAddButton;
00061     QPushButton *mEditButton;
00062     QPushButton *mRemoveButton;
00063 
00064     QString mTitle;
00065     QString mLabel;
00066 };
00067 
00068 class AddresseeWidget : public QWidget
00069 {
00070   Q_OBJECT
00071 
00072   public:
00073     AddresseeWidget( QWidget *parent, const char *name = 0 );
00074     ~AddresseeWidget();
00075 
00076     void restoreSettings();
00077     void saveSettings();
00078 
00079   signals:
00080     void modified();
00081 
00082   private:
00083     KComboBox *mFormattedNameCombo;
00084     NamePartWidget *mPrefix;
00085     NamePartWidget *mInclusion;
00086     NamePartWidget *mSuffix;
00087 };
00088 
00089 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys