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/views/colorlistbox.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/views/colorlistbox.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kaddressbook/views/colorlistbox.h | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/kaddressbook/views/colorlistbox.h b/kaddressbook/views/colorlistbox.h index bb91484..31a8085 100644 --- a/kaddressbook/views/colorlistbox.h +++ b/kaddressbook/views/colorlistbox.h | |||
@@ -1,77 +1,82 @@ | |||
1 | /* | 1 | /* |
2 | * kmail: KDE mail client | 2 | * kmail: KDE mail client |
3 | * This file: Copyright (C) 2000 Espen Sand, espen@kde.org | 3 | * This file: Copyright (C) 2000 Espen Sand, espen@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 | */ | 19 | */ |
20 | 20 | ||
21 | #ifndef _COLOR_LISTBOX_H_ | 21 | #ifndef _COLOR_LISTBOX_H_ |
22 | #define _COLOR_LISTBOX_H_ | 22 | #define _COLOR_LISTBOX_H_ |
23 | 23 | ||
24 | #include <klistbox.h> | 24 | #include <klistbox.h> |
25 | //Added by qt3to4: | ||
26 | #include <QDragMoveEvent> | ||
27 | #include <QDragLeaveEvent> | ||
28 | #include <QDropEvent> | ||
29 | #include <QDragEnterEvent> | ||
25 | 30 | ||
26 | class QDragEnterEvent; | 31 | class QDragEnterEvent; |
27 | class QDragLeaveEvent; | 32 | class QDragLeaveEvent; |
28 | class QDragMoveEvent; | 33 | class QDragMoveEvent; |
29 | class QDropEvent; | 34 | class QDropEvent; |
30 | 35 | ||
31 | class ColorListBox : public KListBox | 36 | class ColorListBox : public KListBox |
32 | { | 37 | { |
33 | Q_OBJECT | 38 | Q_OBJECT |
34 | 39 | ||
35 | public: | 40 | public: |
36 | ColorListBox( QWidget *parent=0, const char * name=0, WFlags f=0 ); | 41 | ColorListBox( QWidget *parent=0, const char * name=0, Qt::WFlags f=0 ); |
37 | void setColor( uint index, const QColor &color ); | 42 | void setColor( uint index, const QColor &color ); |
38 | QColor color( uint index ) const; | 43 | QColor color( uint index ) const; |
39 | 44 | ||
40 | public slots: | 45 | public slots: |
41 | virtual void setEnabled( bool state ); | 46 | virtual void setEnabled( bool state ); |
42 | 47 | ||
43 | protected: | 48 | protected: |
44 | void dragEnterEvent( QDragEnterEvent *e ); | 49 | void dragEnterEvent( QDragEnterEvent *e ); |
45 | void dragLeaveEvent( QDragLeaveEvent *e ); | 50 | void dragLeaveEvent( QDragLeaveEvent *e ); |
46 | void dragMoveEvent( QDragMoveEvent *e ); | 51 | void dragMoveEvent( QDragMoveEvent *e ); |
47 | void dropEvent( QDropEvent *e ); | 52 | void dropEvent( QDropEvent *e ); |
48 | 53 | ||
49 | private slots: | 54 | private slots: |
50 | void newColor( int index ); | 55 | void newColor( int index ); |
51 | void slotNewColor(QListBoxItem * i); | 56 | void slotNewColor(Q3ListBoxItem * i); |
52 | 57 | ||
53 | private: | 58 | private: |
54 | int mCurrentOnDragEnter; | 59 | int mCurrentOnDragEnter; |
55 | 60 | ||
56 | }; | 61 | }; |
57 | 62 | ||
58 | 63 | ||
59 | class ColorListItem : public QListBoxItem | 64 | class ColorListItem : public Q3ListBoxItem |
60 | { | 65 | { |
61 | public: | 66 | public: |
62 | ColorListItem( const QString &text, const QColor &color=Qt::black ); | 67 | ColorListItem( const QString &text, const QColor &color=Qt::black ); |
63 | const QColor &color( void ); | 68 | const QColor &color( void ); |
64 | void setColor( const QColor &color ); | 69 | void setColor( const QColor &color ); |
65 | 70 | ||
66 | protected: | 71 | protected: |
67 | virtual void paint( QPainter * ); | 72 | virtual void paint( QPainter * ); |
68 | virtual int height( const QListBox * ) const; | 73 | virtual int height( const Q3ListBox * ) const; |
69 | virtual int width( const QListBox * ) const; | 74 | virtual int width( const Q3ListBox * ) const; |
70 | 75 | ||
71 | private: | 76 | private: |
72 | QColor mColor; | 77 | QColor mColor; |
73 | int mBoxWidth; | 78 | int mBoxWidth; |
74 | }; | 79 | }; |
75 | 80 | ||
76 | #endif | 81 | #endif |
77 | 82 | ||