-rw-r--r-- | microkde/kdeui/klistbox.h | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/microkde/kdeui/klistbox.h b/microkde/kdeui/klistbox.h index 8023780..5ec514b 100644 --- a/microkde/kdeui/klistbox.h +++ b/microkde/kdeui/klistbox.h | |||
@@ -1,141 +1,146 @@ | |||
1 | /* This file is part of the KDE libraries | 1 | /* This file is part of the KDE libraries |
2 | Copyright (C) 2000 Reginald Stadlbauer <reggie@kde.org> | 2 | Copyright (C) 2000 Reginald Stadlbauer <reggie@kde.org> |
3 | 3 | ||
4 | This library is free software; you can redistribute it and/or | 4 | This library is free software; you can redistribute it and/or |
5 | modify it under the terms of the GNU Library General Public | 5 | modify it under the terms of the GNU Library General Public |
6 | License version 2 as published by the Free Software Foundation. | 6 | License version 2 as published by the Free Software Foundation. |
7 | 7 | ||
8 | This library is distributed in the hope that it will be useful, | 8 | This library is distributed in the hope that it will be useful, |
9 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
11 | Library General Public License for more details. | 11 | Library General Public License for more details. |
12 | 12 | ||
13 | You should have received a copy of the GNU Library General Public License | 13 | You should have received a copy of the GNU Library General Public License |
14 | along with this library; see the file COPYING.LIB. If not, write to | 14 | along with this library; see the file COPYING.LIB. If not, write to |
15 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 15 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
16 | Boston, MA 02111-1307, USA. | 16 | Boston, MA 02111-1307, USA. |
17 | */ | 17 | */ |
18 | #ifndef KLISTBOX_H | 18 | #ifndef KLISTBOX_H |
19 | #define KLISTBOX_H | 19 | #define KLISTBOX_H |
20 | 20 | ||
21 | #include <qlistbox.h> | 21 | #include <q3listbox.h> |
22 | //Added by qt3to4: | ||
23 | #include <QMouseEvent> | ||
24 | #include <QFocusEvent> | ||
25 | #include <QKeyEvent> | ||
26 | #include <QEvent> | ||
22 | 27 | ||
23 | /** | 28 | /** |
24 | * Extends the functionality of @ref QListBox to honor the system | 29 | * Extends the functionality of @ref QListBox to honor the system |
25 | * wide settings for Single Click/Double Click mode, Auto Selection and | 30 | * wide settings for Single Click/Double Click mode, Auto Selection and |
26 | * Change Cursor over Link. | 31 | * Change Cursor over Link. |
27 | * | 32 | * |
28 | * There is a new signal @ref executed(). It gets connected to either | 33 | * There is a new signal @ref executed(). It gets connected to either |
29 | * @ref QListBox::clicked() or @ref QListBox::doubleClicked() | 34 | * @ref QListBox::clicked() or @ref QListBox::doubleClicked() |
30 | * depending on the KDE wide Single Click/Double Click settings. It is | 35 | * depending on the KDE wide Single Click/Double Click settings. It is |
31 | * strongly recomended that you use this signal instead of the above | 36 | * strongly recomended that you use this signal instead of the above |
32 | * mentioned. This way you don't need to care about the current | 37 | * mentioned. This way you don't need to care about the current |
33 | * settings. If you want to get informed when the user selects | 38 | * settings. If you want to get informed when the user selects |
34 | * something connect to the @ref QListBox::selectionChanged() signal. | 39 | * something connect to the @ref QListBox::selectionChanged() signal. |
35 | * | 40 | * |
36 | * @short A variant of @ref QListBox that honors KDE's system-wide settings. | 41 | * @short A variant of @ref QListBox that honors KDE's system-wide settings. |
37 | **/ | 42 | **/ |
38 | class KListBox : public QListBox | 43 | class KListBox : public Q3ListBox |
39 | { | 44 | { |
40 | Q_OBJECT | 45 | Q_OBJECT |
41 | 46 | ||
42 | public: | 47 | public: |
43 | KListBox( QWidget *parent = 0, const char *name = 0, WFlags f = 0 ); | 48 | KListBox( QWidget *parent = 0, const char *name = 0, Qt::WFlags f = 0 ); |
44 | 49 | ||
45 | signals: | 50 | signals: |
46 | 51 | ||
47 | /** | 52 | /** |
48 | * Emitted whenever the user executes an listbox item. | 53 | * Emitted whenever the user executes an listbox item. |
49 | * | 54 | * |
50 | * That means depending on the KDE wide Single Click/Double Click | 55 | * That means depending on the KDE wide Single Click/Double Click |
51 | * setting the user clicked or double clicked on that item. | 56 | * setting the user clicked or double clicked on that item. |
52 | * @param item is the pointer to the executed listbox item. | 57 | * @param item is the pointer to the executed listbox item. |
53 | * | 58 | * |
54 | * Note that you may not delete any @ref QListBoxItem objects in slots | 59 | * Note that you may not delete any @ref QListBoxItem objects in slots |
55 | * connected to this signal. | 60 | * connected to this signal. |
56 | */ | 61 | */ |
57 | void executed( QListBoxItem *item ); | 62 | void executed( Q3ListBoxItem *item ); |
58 | 63 | ||
59 | /** | 64 | /** |
60 | * Emitted whenever the user executes an listbox item. | 65 | * Emitted whenever the user executes an listbox item. |
61 | * | 66 | * |
62 | * That means depending on the KDE wide Single Click/Double Click | 67 | * That means depending on the KDE wide Single Click/Double Click |
63 | * setting the user clicked or double clicked on that item. | 68 | * setting the user clicked or double clicked on that item. |
64 | * @param item is the pointer to the executed listbox item. | 69 | * @param item is the pointer to the executed listbox item. |
65 | * @param pos is the position where the user has clicked | 70 | * @param pos is the position where the user has clicked |
66 | * | 71 | * |
67 | * Note that you may not delete any @ref QListBoxItem objects in slots | 72 | * Note that you may not delete any @ref QListBoxItem objects in slots |
68 | * connected to this signal. | 73 | * connected to this signal. |
69 | */ | 74 | */ |
70 | void executed( QListBoxItem *item, const QPoint &pos ); | 75 | void executed( Q3ListBoxItem *item, const QPoint &pos ); |
71 | 76 | ||
72 | /** | 77 | /** |
73 | * This signal gets emitted whenever the user double clicks into the | 78 | * This signal gets emitted whenever the user double clicks into the |
74 | * listbox. | 79 | * listbox. |
75 | * | 80 | * |
76 | * @param item The pointer to the clicked listbox item. | 81 | * @param item The pointer to the clicked listbox item. |
77 | * @param pos The position where the user has clicked. | 82 | * @param pos The position where the user has clicked. |
78 | * | 83 | * |
79 | * Note that you may not delete any @ref QListBoxItem objects in slots | 84 | * Note that you may not delete any @ref QListBoxItem objects in slots |
80 | * connected to this signal. | 85 | * connected to this signal. |
81 | * | 86 | * |
82 | * This signal is more or less here for the sake of completeness. | 87 | * This signal is more or less here for the sake of completeness. |
83 | * You should normally not need to use this. In most cases it's better | 88 | * You should normally not need to use this. In most cases it's better |
84 | * to use @ref executed() instead. | 89 | * to use @ref executed() instead. |
85 | */ | 90 | */ |
86 | void doubleClicked( QListBoxItem *item, const QPoint &pos ); | 91 | void doubleClicked( Q3ListBoxItem *item, const QPoint &pos ); |
87 | 92 | ||
88 | protected slots: | 93 | protected slots: |
89 | void slotOnItem( QListBoxItem *item ); | 94 | void slotOnItem( Q3ListBoxItem *item ); |
90 | void slotOnViewport(); | 95 | void slotOnViewport(); |
91 | 96 | ||
92 | //US void slotSettingsChanged(int); | 97 | //US void slotSettingsChanged(int); |
93 | 98 | ||
94 | /** | 99 | /** |
95 | * Auto selection happend. | 100 | * Auto selection happend. |
96 | */ | 101 | */ |
97 | void slotAutoSelect(); | 102 | void slotAutoSelect(); |
98 | 103 | ||
99 | protected: | 104 | protected: |
100 | void emitExecute( QListBoxItem *item, const QPoint &pos ); | 105 | void emitExecute( Q3ListBoxItem *item, const QPoint &pos ); |
101 | 106 | ||
102 | /** | 107 | /** |
103 | * @reimplemented | 108 | * @reimplemented |
104 | */ | 109 | */ |
105 | virtual void keyPressEvent(QKeyEvent *e); | 110 | virtual void keyPressEvent(QKeyEvent *e); |
106 | /** | 111 | /** |
107 | * @reimplemented | 112 | * @reimplemented |
108 | */ | 113 | */ |
109 | virtual void focusOutEvent( QFocusEvent *fe ); | 114 | virtual void focusOutEvent( QFocusEvent *fe ); |
110 | /** | 115 | /** |
111 | * @reimplemented | 116 | * @reimplemented |
112 | */ | 117 | */ |
113 | virtual void leaveEvent( QEvent *e ); | 118 | virtual void leaveEvent( QEvent *e ); |
114 | /** | 119 | /** |
115 | * @reimplemented | 120 | * @reimplemented |
116 | */ | 121 | */ |
117 | virtual void contentsMousePressEvent( QMouseEvent *e ); | 122 | virtual void contentsMousePressEvent( QMouseEvent *e ); |
118 | /** | 123 | /** |
119 | * @reimplemented | 124 | * @reimplemented |
120 | */ | 125 | */ |
121 | virtual void contentsMouseDoubleClickEvent ( QMouseEvent *e ); | 126 | virtual void contentsMouseDoubleClickEvent ( QMouseEvent *e ); |
122 | 127 | ||
123 | bool m_bUseSingle; | 128 | bool m_bUseSingle; |
124 | //US bool m_bChangeCursorOverItem; | 129 | //US bool m_bChangeCursorOverItem; |
125 | 130 | ||
126 | QListBoxItem* m_pCurrentItem; | 131 | Q3ListBoxItem* m_pCurrentItem; |
127 | 132 | ||
128 | QTimer* m_pAutoSelect; | 133 | QTimer* m_pAutoSelect; |
129 | int m_autoSelectDelay; | 134 | int m_autoSelectDelay; |
130 | 135 | ||
131 | private slots: | 136 | private slots: |
132 | void slotMouseButtonClicked( int btn, QListBoxItem *item, const QPoint &pos ); | 137 | void slotMouseButtonClicked( int btn, Q3ListBoxItem *item, const QPoint &pos ); |
133 | 138 | ||
134 | protected: | 139 | protected: |
135 | virtual void virtual_hook( int id, void* data ); | 140 | virtual void virtual_hook( int id, void* data ); |
136 | private: | 141 | private: |
137 | class KListBoxPrivate; | 142 | class KListBoxPrivate; |
138 | KListBoxPrivate *d; | 143 | KListBoxPrivate *d; |
139 | }; | 144 | }; |
140 | 145 | ||
141 | #endif | 146 | #endif |