summaryrefslogtreecommitdiffabout
path: root/kaddressbook/features/distributionlistwidget.h
Unidiff
Diffstat (limited to 'kaddressbook/features/distributionlistwidget.h') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/features/distributionlistwidget.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/kaddressbook/features/distributionlistwidget.h b/kaddressbook/features/distributionlistwidget.h
index 82bac3d..f619389 100644
--- a/kaddressbook/features/distributionlistwidget.h
+++ b/kaddressbook/features/distributionlistwidget.h
@@ -1,143 +1,148 @@
1/* 1/*
2 This file is part of KAddressBook. 2 This file is part of KAddressBook.
3 Copyright (c) 2002 Tobias Koenig <tokoe@kde.org> 3 Copyright (c) 2002 Tobias Koenig <tokoe@kde.org>
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#ifndef DISTRIBUTIONLISTWIDGET_H 24#ifndef DISTRIBUTIONLISTWIDGET_H
25#define DISTRIBUTIONLISTWIDGET_H 25#define DISTRIBUTIONLISTWIDGET_H
26 26
27#include <kdialogbase.h> 27#include <kdialogbase.h>
28#include <klistview.h> 28#include <klistview.h>
29 29
30#include "extensionwidget.h" 30#include "extensionwidget.h"
31//Added by qt3to4:
32#include <QDragEnterEvent>
33#include <QDropEvent>
34#include <QLabel>
35#include <QDragMoveEvent>
31 36
32class QButtonGroup; 37class Q3ButtonGroup;
33class QComboBox; 38class QComboBox;
34class QLabel; 39class QLabel;
35class QListView; 40class Q3ListView;
36 41
37class DistributionListView; 42class DistributionListView;
38class KABCore; 43class KABCore;
39 44
40namespace KABC { 45namespace KABC {
41class AddressBook; 46class AddressBook;
42class DistributionListManager; 47class DistributionListManager;
43} 48}
44 49
45class DistributionListWidget : public ExtensionWidget 50class DistributionListWidget : public ExtensionWidget
46{ 51{
47 Q_OBJECT 52 Q_OBJECT
48 53
49 public: 54 public:
50 DistributionListWidget( KABCore*, QWidget *parent, const char *name = 0 ); 55 DistributionListWidget( KABCore*, QWidget *parent, const char *name = 0 );
51 virtual ~DistributionListWidget(); 56 virtual ~DistributionListWidget();
52 57
53 void contactsSelectionChanged(); 58 void contactsSelectionChanged();
54 59
55 QString title() const; 60 QString title() const;
56 QString identifier() const; 61 QString identifier() const;
57 62
58 public slots: 63 public slots:
59 void save(); 64 void save();
60 void dropped( QDropEvent*, QListViewItem* ); 65 void dropped( QDropEvent*, Q3ListViewItem* );
61 66
62 private slots: 67 private slots:
63 void createList(); 68 void createList();
64 void editList(); 69 void editList();
65 void removeList(); 70 void removeList();
66 void addContact(); 71 void addContact();
67 void removeContact(); 72 void removeContact();
68 void changeEmail(); 73 void changeEmail();
69 void updateNameCombo(); 74 void updateNameCombo();
70 void updateContactView(); 75 void updateContactView();
71 void selectionContactViewChanged(); 76 void selectionContactViewChanged();
72 void changed(); 77 void changed();
73 78
74 protected: 79 protected:
75 void dropEvent( QDropEvent* ); 80 void dropEvent( QDropEvent* );
76 81
77 private: 82 private:
78 QComboBox *mNameCombo; 83 QComboBox *mNameCombo;
79 QLabel *mListLabel; 84 QLabel *mListLabel;
80 DistributionListView *mContactView; 85 DistributionListView *mContactView;
81 86
82 KABC::DistributionListManager *mManager; 87 KABC::DistributionListManager *mManager;
83 QPushButton *mCreateListButton; 88 QPushButton *mCreateListButton;
84 QPushButton *mEditListButton; 89 QPushButton *mEditListButton;
85 QPushButton *mRemoveListButton; 90 QPushButton *mRemoveListButton;
86 QPushButton *mChangeEmailButton; 91 QPushButton *mChangeEmailButton;
87 QPushButton *mAddContactButton; 92 QPushButton *mAddContactButton;
88 QPushButton *mRemoveContactButton; 93 QPushButton *mRemoveContactButton;
89}; 94};
90 95
91/** 96/**
92 @short Helper class 97 @short Helper class
93*/ 98*/
94class DistributionListView : public KListView 99class DistributionListView : public KListView
95{ 100{
96 Q_OBJECT 101 Q_OBJECT
97 102
98 public: 103 public:
99 DistributionListView( QWidget *parent, const char* name = 0 ); 104 DistributionListView( QWidget *parent, const char* name = 0 );
100 105
101 protected: 106 protected:
102 void dragEnterEvent( QDragEnterEvent *e ); 107 void dragEnterEvent( QDragEnterEvent *e );
103 void dropEvent( QDropEvent *e ); 108 void dropEvent( QDropEvent *e );
104 void viewportDragMoveEvent( QDragMoveEvent *e ); 109 void viewportDragMoveEvent( QDragMoveEvent *e );
105 void viewportDropEvent( QDropEvent *e ); 110 void viewportDropEvent( QDropEvent *e );
106}; 111};
107 112
108/** 113/**
109 @short Helper class 114 @short Helper class
110*/ 115*/
111class EmailSelector : public KDialogBase 116class EmailSelector : public KDialogBase
112{ 117{
113 public: 118 public:
114 EmailSelector( const QStringList &emails, const QString &current, 119 EmailSelector( const QStringList &emails, const QString &current,
115 QWidget *parent ); 120 QWidget *parent );
116 121
117 QString selected(); 122 QString selected();
118 123
119 static QString getEmail( const QStringList &emails, const QString &current, 124 static QString getEmail( const QStringList &emails, const QString &current,
120 QWidget *parent ); 125 QWidget *parent );
121 126
122 private: 127 private:
123 QButtonGroup *mButtonGroup; 128 Q3ButtonGroup *mButtonGroup;
124}; 129};
125 130
126 131
127#ifdef KAB_EMBEDDED 132#ifdef KAB_EMBEDDED
128class DistributionListFactory : public ExtensionFactory 133class DistributionListFactory : public ExtensionFactory
129{ 134{
130 public: 135 public:
131 ExtensionWidget *extension( KABCore *core, QWidget *parent, const char *name ) 136 ExtensionWidget *extension( KABCore *core, QWidget *parent, const char *name )
132 { 137 {
133 return new DistributionListWidget( core, parent, name ); 138 return new DistributionListWidget( core, parent, name );
134 } 139 }
135 140
136 QString identifier() const 141 QString identifier() const
137 { 142 {
138 return "distribution_list_editor"; 143 return "distribution_list_editor";
139 } 144 }
140}; 145};
141#endif //KAB_EMBEDDED 146#endif //KAB_EMBEDDED
142 147
143#endif 148#endif