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 TQt, and distribute the resulting executable,
00021     without including the source code for TQt in the source distribution.
00022 */
00023 
00024 #ifndef ADDRESSEEWIDGET_H
00025 #define ADDRESSEEWIDGET_H
00026 
00027 #include <tqwidget.h>
00028 
00029 class KComboBox;
00030 class KLineEdit;
00031 
00032 class TQListBox;
00033 class TQListBoxItem;
00034 class TQPushButton;
00035 
00036 class NamePartWidget : public TQWidget
00037 {
00038   Q_OBJECT
00039   TQ_OBJECT
00040 
00041   public:
00042     NamePartWidget( const TQString &title, const TQString &label, TQWidget *parent,
00043                     const char *name = 0 );
00044     ~NamePartWidget();
00045 
00046     void setNameParts( const TQStringList &list );
00047     TQStringList nameParts() const;
00048 
00049   signals:
00050     void modified();
00051 
00052   private slots:
00053     void add();
00054     void edit();
00055     void remove();
00056 
00057     void selectionChanged( TQListBoxItem* );
00058 
00059   private:
00060     TQListBox *mBox;
00061     TQPushButton *mAddButton;
00062     TQPushButton *mEditButton;
00063     TQPushButton *mRemoveButton;
00064 
00065     TQString mTitle;
00066     TQString mLabel;
00067 };
00068 
00069 class AddresseeWidget : public TQWidget
00070 {
00071   Q_OBJECT
00072   TQ_OBJECT
00073 
00074   public:
00075     AddresseeWidget( TQWidget *parent, const char *name = 0 );
00076     ~AddresseeWidget();
00077 
00078     void restoreSettings();
00079     void saveSettings();
00080 
00081   signals:
00082     void modified();
00083 
00084   private:
00085     KComboBox *mFormattedNameCombo;
00086     NamePartWidget *mPrefix;
00087     NamePartWidget *mInclusion;
00088     NamePartWidget *mSuffix;
00089 };
00090 
00091 #endif