kaddressbook Library API Documentation

distributionlistwidget.h

00001 /*
00002     This file is part of KAddressBook.
00003     Copyright (c) 2002 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, 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 DISTRIBUTIONLISTWIDGET_H
00025 #define DISTRIBUTIONLISTWIDGET_H
00026 
00027 #include <kdialogbase.h>
00028 #include <klistview.h>
00029 
00030 #include "extensionwidget.h"
00031 
00032 class QButtonGroup;
00033 class QComboBox;
00034 class QListView;
00035 
00036 class DistributionListView;
00037 
00038 namespace KAB {
00039 class Core;
00040 }
00041 
00042 namespace KABC {
00043 //class AddressBook;
00044 class DistributionListManager;
00045 }
00046 
00047 class DistributionListWidget : public KAB::ExtensionWidget
00048 {
00049     Q_OBJECT
00050 
00051   public:
00052     DistributionListWidget( KAB::Core*, QWidget *parent, const char *name = 0 );
00053     virtual ~DistributionListWidget();
00054 
00055     void contactsSelectionChanged();
00056 
00057     QString title() const;
00058     QString identifier() const;
00059 
00060   public slots:
00061     void dropped( QDropEvent*, QListViewItem* );
00062 
00063   private slots:
00064     void createList();
00065     void editList();
00066     void removeList();
00067     void addContact();
00068     void removeContact();
00069     void changeEmail();
00070     void updateNameCombo();
00071     void updateContactView();
00072     void selectionContactViewChanged();
00073     void changed( const KABC::Addressee& dist );
00074 
00075   protected:
00076     void dropEvent( QDropEvent* );
00077 
00078   private:
00079     QComboBox *mNameCombo;
00080     QLabel *mListLabel;
00081     DistributionListView *mContactView;
00082 
00083     QPushButton *mCreateListButton;
00084     QPushButton *mEditListButton;
00085     QPushButton *mRemoveListButton;
00086     QPushButton *mChangeEmailButton;
00087     QPushButton *mAddContactButton;
00088     QPushButton *mRemoveContactButton;
00089 };
00090 
00094 class DistributionListView : public KListView
00095 {
00096   Q_OBJECT
00097 
00098   public:
00099     DistributionListView( QWidget *parent, const char* name = 0 );
00100 
00101   protected:
00102     void dragEnterEvent( QDragEnterEvent *e );
00103     void dropEvent( QDropEvent *e );
00104     void viewportDragMoveEvent( QDragMoveEvent *e );
00105     void viewportDropEvent( QDropEvent *e );
00106 };
00107 
00111 class EmailSelector : public KDialogBase
00112 {
00113   public:
00114     EmailSelector( const QStringList &emails, const QString &current,
00115                    QWidget *parent );
00116 
00117     QString selected() const;
00118 
00119     static QString getEmail( const QStringList &emails, const QString &current,
00120                              QWidget *parent );
00121 
00122   private:
00123     QButtonGroup *mButtonGroup;
00124     QMap<int, QString> mEmailMap;
00125 };
00126 
00127 #endif
KDE Logo
This file is part of the documentation for kaddressbook Library Version 3.3.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Thu Aug 2 09:54:30 2007 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003