author | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
commit | a08aff328d4393031d5ba7d622c2b05705a89d73 (patch) (unidiff) | |
tree | 8ee90d686081c52e7c69b5ce946e9b1a7d690001 /kaddressbook/features/distributionlistwidget.h | |
parent | 11edc920afe4f274c0964436633aa632c8288a40 (diff) | |
download | kdepimpi-p1.zip kdepimpi-p1.tar.gz kdepimpi-p1.tar.bz2 |
initial public commit of qt4 portp1
Diffstat (limited to 'kaddressbook/features/distributionlistwidget.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kaddressbook/features/distributionlistwidget.h | 13 |
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 | ||
32 | class QButtonGroup; | 37 | class Q3ButtonGroup; |
33 | class QComboBox; | 38 | class QComboBox; |
34 | class QLabel; | 39 | class QLabel; |
35 | class QListView; | 40 | class Q3ListView; |
36 | 41 | ||
37 | class DistributionListView; | 42 | class DistributionListView; |
38 | class KABCore; | 43 | class KABCore; |
39 | 44 | ||
40 | namespace KABC { | 45 | namespace KABC { |
41 | class AddressBook; | 46 | class AddressBook; |
42 | class DistributionListManager; | 47 | class DistributionListManager; |
43 | } | 48 | } |
44 | 49 | ||
45 | class DistributionListWidget : public ExtensionWidget | 50 | class 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 | */ |
94 | class DistributionListView : public KListView | 99 | class 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 | */ |
111 | class EmailSelector : public KDialogBase | 116 | class EmailSelector : public KDialogBase |
112 | { | 117 | { |
113 | public: | 118 | public: |
114 | EmailSelector( const QStringList &emails, const QString ¤t, | 119 | EmailSelector( const QStringList &emails, const QString ¤t, |
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 ¤t, | 124 | static QString getEmail( const QStringList &emails, const QString ¤t, |
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 |
128 | class DistributionListFactory : public ExtensionFactory | 133 | class 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 |