00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
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 ¤t,
00117
QWidget *parent );
00118
00119
QString selected()
const;
00120
00121
static QString getEmail(
const QStringList &emails,
const QString ¤t,
00122
QWidget *parent );
00123
00124
private:
00125
QButtonGroup *mButtonGroup;
00126
QMap<int, QString> mEmailMap;
00127 };
00128
00129
#endif