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 TQButtonGroup;
00034 class TQComboBox;
00035 class TQListView;
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 TQ_OBJECT
00052
00053 public:
00054 DistributionListWidget( KAB::Core*, TQWidget *parent, const char *name = 0 );
00055 virtual ~DistributionListWidget();
00056
00057 void contactsSelectionChanged();
00058
00059 TQString title() const;
00060 TQString identifier() const;
00061
00062 public slots:
00063 void save();
00064 void dropped( TQDropEvent*, TQListViewItem* );
00065
00066 void removeContact();
00067
00068 private slots:
00069 void createList();
00070 void editList();
00071 void removeList();
00072 void addContact();
00073 void changeEmail();
00074 void updateNameCombo();
00075 void updateContactView();
00076 void selectionContactViewChanged();
00077
00078 private:
00079 #ifdef KDEPIM_NEW_DISTRLISTS
00080 void changed( const KABC::Addressee& dist );
00081 #else
00082 void changed();
00083 #endif
00084 bool alreadyExists( const TQString& distrListName ) const;
00085
00086 protected:
00087 void dropEvent( TQDropEvent* );
00088
00089 private:
00090 TQComboBox *mNameCombo;
00091 TQLabel *mEntryCountLabel;
00092 DistributionListView *mContactView;
00093
00094 #ifndef KDEPIM_NEW_DISTRLISTS
00095 KABC::DistributionListManager *mManager;
00096 #endif
00097 TQPushButton *mCreateListButton;
00098 TQPushButton *mEditListButton;
00099 TQPushButton *mRemoveListButton;
00100 TQPushButton *mChangeEmailButton;
00101 TQPushButton *mAddContactButton;
00102 TQPushButton *mRemoveContactButton;
00103 };
00104
00108 class DistributionListView : public KListView
00109 {
00110 Q_OBJECT
00111 TQ_OBJECT
00112
00113 public:
00114 DistributionListView( TQWidget *parent, const char* name = 0 );
00115
00116 protected:
00117 void dragEnterEvent( TQDragEnterEvent *e );
00118 void dropEvent( TQDropEvent *e );
00119 void viewportDragMoveEvent( TQDragMoveEvent *e );
00120 void viewportDropEvent( TQDropEvent *e );
00121 };
00122
00126 class EmailSelector : public KDialogBase
00127 {
00128 public:
00129 EmailSelector( const TQStringList &emails, const TQString ¤t,
00130 TQWidget *parent );
00131
00132 TQString selected() const;
00133
00134 static TQString getEmail( const TQStringList &emails, const TQString ¤t,
00135 TQWidget *parent, bool &canceled );
00136
00137 private:
00138 TQButtonGroup *mButtonGroup;
00139 TQMap<int, TQString> mEmailMap;
00140 };
00141
00142 #endif
|