kaddressbook
distributionlistwidget.h00001
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 <config.h>
00028 #include <kdialogbase.h>
00029 #include <klistview.h>
00030
00031 #include "extensionwidget.h"
00032
00033 class QButtonGroup;
00034 class QComboBox;
00035 class QListView;
00036
00037 class DistributionListView;
00038
00039 namespace KAB {
00040 class Core;
00041 }
00042
00043 namespace KABC {
00044 class AddressBook;
00045 class DistributionListManager;
00046 }
00047
00048 class DistributionListWidget : public KAB::ExtensionWidget
00049 {
00050 Q_OBJECT
00051
00052 public:
00053 DistributionListWidget( KAB::Core*, QWidget *parent, const char *name = 0 );
00054 virtual ~DistributionListWidget();
00055
00056 void contactsSelectionChanged();
00057
00058 QString title() const;
00059 QString identifier() const;
00060
00061 public slots:
00062 void save();
00063 void dropped( QDropEvent*, QListViewItem* );
00064
00065 void removeContact();
00066
00067 private slots:
00068 void createList();
00069 void editList();
00070 void removeList();
00071 void addContact();
00072 void changeEmail();
00073 void updateNameCombo();
00074 void updateContactView();
00075 void selectionContactViewChanged();
00076
00077 private:
00078 #ifdef KDEPIM_NEW_DISTRLISTS
00079 void changed( const KABC::Addressee& dist );
00080 #else
00081 void changed();
00082 #endif
00083 bool alreadyExists( const QString& distrListName ) const;
00084
00085 protected:
00086 void dropEvent( QDropEvent* );
00087
00088 private:
00089 QComboBox *mNameCombo;
00090 QLabel *mEntryCountLabel;
00091 DistributionListView *mContactView;
00092
00093 #ifndef KDEPIM_NEW_DISTRLISTS
00094 KABC::DistributionListManager *mManager;
00095 #endif
00096 QPushButton *mCreateListButton;
00097 QPushButton *mEditListButton;
00098 QPushButton *mRemoveListButton;
00099 QPushButton *mChangeEmailButton;
00100 QPushButton *mAddContactButton;
00101 QPushButton *mRemoveContactButton;
00102 };
00103
00107 class DistributionListView : public KListView
00108 {
00109 Q_OBJECT
00110
00111 public:
00112 DistributionListView( QWidget *parent, const char* name = 0 );
00113
00114 protected:
00115 void dragEnterEvent( QDragEnterEvent *e );
00116 void dropEvent( QDropEvent *e );
00117 void viewportDragMoveEvent( QDragMoveEvent *e );
00118 void viewportDropEvent( QDropEvent *e );
00119 };
00120
00124 class EmailSelector : public KDialogBase
00125 {
00126 public:
00127 EmailSelector( const QStringList &emails, const QString ¤t,
00128 QWidget *parent );
00129
00130 QString selected() const;
00131
00132 static QString getEmail( const QStringList &emails, const QString ¤t,
00133 QWidget *parent );
00134
00135 private:
00136 QButtonGroup *mButtonGroup;
00137 QMap<int, QString> mEmailMap;
00138 };
00139
00140 #endif
|