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 save(); 00062 void dropped( QDropEvent*, QListViewItem* ); 00063 00064 private slots: 00065 void createList(); 00066 void editList(); 00067 void removeList(); 00068 void addContact(); 00069 void removeContact(); 00070 void changeEmail(); 00071 void updateNameCombo(); 00072 void updateContactView(); 00073 void selectionContactViewChanged(); 00074 void changed(); 00075 00076 protected: 00077 void dropEvent( QDropEvent* ); 00078 00079 private: 00080 QComboBox *mNameCombo; 00081 QLabel *mListLabel; 00082 DistributionListView *mContactView; 00083 00084 KABC::DistributionListManager *mManager; 00085 QPushButton *mCreateListButton; 00086 QPushButton *mEditListButton; 00087 QPushButton *mRemoveListButton; 00088 QPushButton *mChangeEmailButton; 00089 QPushButton *mAddContactButton; 00090 QPushButton *mRemoveContactButton; 00091 }; 00092 00096 class DistributionListView : public KListView 00097 { 00098 Q_OBJECT 00099 00100 public: 00101 DistributionListView( QWidget *parent, const char* name = 0 ); 00102 00103 protected: 00104 void dragEnterEvent( QDragEnterEvent *e ); 00105 void dropEvent( QDropEvent *e ); 00106 void viewportDragMoveEvent( QDragMoveEvent *e ); 00107 void viewportDropEvent( QDropEvent *e ); 00108 }; 00109 00113 class EmailSelector : public KDialogBase 00114 { 00115 public: 00116 EmailSelector( const QStringList &emails, const QString &current, 00117 QWidget *parent ); 00118 00119 QString selected() const; 00120 00121 static QString getEmail( const QStringList &emails, const QString &current, 00122 QWidget *parent ); 00123 00124 private: 00125 QButtonGroup *mButtonGroup; 00126 QMap<int, QString> mEmailMap; 00127 }; 00128 00129 #endif
KDE Logo
This file is part of the documentation for kaddressbook Library Version 3.3.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Fri Oct 1 15:19:04 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003