author | zecke <zecke> | 2004-03-14 17:00:46 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-03-14 17:00:46 (UTC) |
commit | 52169e2469a1edcca986e9f0404c3ca815d5833b (patch) (unidiff) | |
tree | 9c6651125f29fe63df33fe56b352d3288b2ea8df /libopie2/opieui | |
parent | 59106c8ffcf25181925281c519a2b49d6835ef9e (diff) | |
download | opie-52169e2469a1edcca986e9f0404c3ca815d5833b.zip opie-52169e2469a1edcca986e9f0404c3ca815d5833b.tar.gz opie-52169e2469a1edcca986e9f0404c3ca815d5833b.tar.bz2 |
Change Signature of Signals to obey namespace
Make example compile
-rw-r--r-- | libopie2/opieui/opopupmenu.h | 2 | ||||
-rw-r--r-- | libopie2/opieui/otimepicker.h | 3 | ||||
-rw-r--r-- | libopie2/opieui/oversatileview.h | 48 |
3 files changed, 25 insertions, 28 deletions
diff --git a/libopie2/opieui/opopupmenu.h b/libopie2/opieui/opopupmenu.h index 419a954..294edcc 100644 --- a/libopie2/opieui/opopupmenu.h +++ b/libopie2/opieui/opopupmenu.h | |||
@@ -1,264 +1,264 @@ | |||
1 | //FIXME what is ODE? ODE Desktop Environemt? -zecke | 1 | //FIXME what is ODE? ODE Desktop Environemt? -zecke |
2 | //FIXME do we need titles? space is limited that is only eyecandy? -zecke | 2 | //FIXME do we need titles? space is limited that is only eyecandy? -zecke |
3 | //FIXME keyboard navigation is also not that popular on a PDA might be with a keyboard (tuxphone) -zecke | 3 | //FIXME keyboard navigation is also not that popular on a PDA might be with a keyboard (tuxphone) -zecke |
4 | /* This file is part of the ODE libraries | 4 | /* This file is part of the ODE libraries |
5 | Copyright (C) 2000 Daniel M. Duley <mosfet@kde.org> | 5 | Copyright (C) 2000 Daniel M. Duley <mosfet@kde.org> |
6 | 6 | ||
7 | This library is free software; you can redistribute it and/or | 7 | This library is free software; you can redistribute it and/or |
8 | modify it under the terms of the GNU Library General Public | 8 | modify it under the terms of the GNU Library General Public |
9 | License version 2 as published by the Free Software Foundation. | 9 | License version 2 as published by the Free Software Foundation. |
10 | 10 | ||
11 | This library is distributed in the hope that it will be useful, | 11 | This library is distributed in the hope that it will be useful, |
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
14 | Library General Public License for more details. | 14 | Library General Public License for more details. |
15 | 15 | ||
16 | You should have received a copy of the GNU Library General Public License | 16 | You should have received a copy of the GNU Library General Public License |
17 | along with this library; see the file COPYING.LIB. If not, write to | 17 | along with this library; see the file COPYING.LIB. If not, write to |
18 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 18 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
19 | Boston, MA 02111-1307, USA. | 19 | Boston, MA 02111-1307, USA. |
20 | */ | 20 | */ |
21 | #ifndef _OPOPUP_H | 21 | #ifndef _OPOPUP_H |
22 | #define _OPOPUP_H | 22 | #define _OPOPUP_H |
23 | 23 | ||
24 | #define INCLUDE_MENUITEM_DEF | 24 | #define INCLUDE_MENUITEM_DEF |
25 | 25 | ||
26 | /* QT */ | 26 | /* QT */ |
27 | 27 | ||
28 | #include <qpopupmenu.h> | 28 | #include <qpopupmenu.h> |
29 | 29 | ||
30 | /* OPIE */ | 30 | /* OPIE */ |
31 | 31 | ||
32 | #include <opie2/opixmapeffect.h> | 32 | #include <opie2/opixmapeffect.h> |
33 | 33 | ||
34 | namespace Opie { | 34 | namespace Opie { |
35 | namespace Ui { | 35 | namespace Ui { |
36 | /** | 36 | /** |
37 | * Title widget for use in @ref OPopupMenu. | 37 | * Title widget for use in @ref OPopupMenu. |
38 | * | 38 | * |
39 | * You usually don't have to create this manually since | 39 | * You usually don't have to create this manually since |
40 | * @ref OPopupMenu::insertTitle will do it for you, but it is allowed if | 40 | * @ref OPopupMenu::insertTitle will do it for you, but it is allowed if |
41 | * you wish to customize it's look. | 41 | * you wish to customize it's look. |
42 | * | 42 | * |
43 | * @author Daniel M. Duley <mosfet@kde.org> | 43 | * @author Daniel M. Duley <mosfet@kde.org> |
44 | * @short OPopupMenu title widget. | 44 | * @short OPopupMenu title widget. |
45 | */ | 45 | */ |
46 | class OPopupTitle : public QWidget | 46 | class OPopupTitle : public QWidget |
47 | { | 47 | { |
48 | Q_OBJECT | 48 | Q_OBJECT |
49 | 49 | ||
50 | public: | 50 | public: |
51 | /** | 51 | /** |
52 | * Constructs a title widget with the user specified gradient, pixmap, | 52 | * Constructs a title widget with the user specified gradient, pixmap, |
53 | * and colors. | 53 | * and colors. |
54 | */ | 54 | */ |
55 | OPopupTitle(QWidget *parent=0, const char *name=0); | 55 | OPopupTitle(QWidget *parent=0, const char *name=0); |
56 | /** | 56 | /** |
57 | * @deprecated | 57 | * @deprecated |
58 | * Constructs a title widget with the specified gradient and colors. | 58 | * Constructs a title widget with the specified gradient and colors. |
59 | */ | 59 | */ |
60 | OPopupTitle(OPixmapEffect::GradientType gradient, const QColor &color, | 60 | OPopupTitle(OPixmapEffect::GradientType gradient, const QColor &color, |
61 | const QColor &textColor, QWidget *parent=0, | 61 | const QColor &textColor, QWidget *parent=0, |
62 | const char *name=0); | 62 | const char *name=0); |
63 | /** | 63 | /** |
64 | * @deprecated | 64 | * @deprecated |
65 | * Constructs a title widget with the specified pixmap and colors. | 65 | * Constructs a title widget with the specified pixmap and colors. |
66 | */ | 66 | */ |
67 | OPopupTitle(const OPixmap &background, const QColor &color, | 67 | OPopupTitle(const OPixmap &background, const QColor &color, |
68 | const QColor &textColor, QWidget *parent=0, | 68 | const QColor &textColor, QWidget *parent=0, |
69 | const char *name=0); | 69 | const char *name=0); |
70 | /** | 70 | /** |
71 | * Sets the title string and optional icon for the title widget. | 71 | * Sets the title string and optional icon for the title widget. |
72 | * | 72 | * |
73 | * You will want to call this before inserting into a menu. | 73 | * You will want to call this before inserting into a menu. |
74 | */ | 74 | */ |
75 | void setTitle(const QString &text, const QPixmap *icon=NULL); | 75 | void setTitle(const QString &text, const QPixmap *icon=NULL); |
76 | /** | 76 | /** |
77 | * Returns the current title. | 77 | * Returns the current title. |
78 | */ | 78 | */ |
79 | QString title() const { return(titleStr); } | 79 | QString title() const { return(titleStr); } |
80 | /** | 80 | /** |
81 | * Returns the current icon. | 81 | * Returns the current icon. |
82 | */ | 82 | */ |
83 | QPixmap icon() const { return(miniicon); } | 83 | QPixmap icon() const { return(miniicon); } |
84 | 84 | ||
85 | QSize sizeHint() const; | 85 | QSize sizeHint() const; |
86 | 86 | ||
87 | public slots: | 87 | public slots: |
88 | /// @since 3.1 | 88 | /// @since 3.1 |
89 | void setText( const QString &text ); | 89 | void setText( const QString &text ); |
90 | /// @since 3.1 | 90 | /// @since 3.1 |
91 | void setIcon( const QPixmap &pix ); | 91 | void setIcon( const QPixmap &pix ); |
92 | 92 | ||
93 | protected: | 93 | protected: |
94 | void paintEvent(QPaintEvent *ev); | 94 | void paintEvent(QPaintEvent *ev); |
95 | 95 | ||
96 | QString titleStr; | 96 | QString titleStr; |
97 | QPixmap miniicon; | 97 | QPixmap miniicon; |
98 | 98 | ||
99 | // Remove in KDE4 | 99 | // Remove in KDE4 |
100 | OPixmapEffect::GradientType grType; | 100 | OPixmapEffect::GradientType grType; |
101 | QPixmap fill; | 101 | QPixmap fill; |
102 | QColor fgColor, bgColor, grHigh, grLow; | 102 | QColor fgColor, bgColor, grHigh, grLow; |
103 | bool useGradient; | 103 | bool useGradient; |
104 | 104 | ||
105 | protected: | 105 | protected: |
106 | virtual void virtual_hook( int id, void* data ); | 106 | virtual void virtual_hook( int id, void* data ); |
107 | private: | 107 | private: |
108 | class OPopupTitlePrivate; | 108 | class OPopupTitlePrivate; |
109 | OPopupTitlePrivate *d; | 109 | OPopupTitlePrivate *d; |
110 | }; | 110 | }; |
111 | 111 | ||
112 | /** | 112 | /** |
113 | * OPopupMenu is a class for menus with standard title items and keyboard | 113 | * OPopupMenu is a class for menus with standard title items and keyboard |
114 | * accessibility for popups with many options and/or varying options. It acts | 114 | * accessibility for popups with many options and/or varying options. It acts |
115 | * identically to QPopupMenu, with the addition of insertTitle(), | 115 | * identically to QPopupMenu, with the addition of insertTitle(), |
116 | * changeTitle(), setKeyboardShortcutsEnabled() and | 116 | * changeTitle(), setKeyboardShortcutsEnabled() and |
117 | * setKeyboardShortcutsExecute() methods. | 117 | * setKeyboardShortcutsExecute() methods. |
118 | * | 118 | * |
119 | * The titles support a text string, an icon, plus user defined gradients, | 119 | * The titles support a text string, an icon, plus user defined gradients, |
120 | * colors, and background pixmaps. | 120 | * colors, and background pixmaps. |
121 | * | 121 | * |
122 | * The keyboard search algorithm is incremental with additional underlining | 122 | * The keyboard search algorithm is incremental with additional underlining |
123 | * for user feedback. | 123 | * for user feedback. |
124 | * | 124 | * |
125 | * @short A menu with title items. | 125 | * @short A menu with title items. |
126 | * @author Daniel M. Duley <mosfet@kde.org> | 126 | * @author Daniel M. Duley <mosfet@kde.org> |
127 | * @author Hamish Rodda <meddie@yoyo.its.monash.edu.au> | 127 | * @author Hamish Rodda <meddie@yoyo.its.monash.edu.au> |
128 | */ | 128 | */ |
129 | class OPopupMenu : public QPopupMenu { | 129 | class OPopupMenu : public QPopupMenu { |
130 | Q_OBJECT | 130 | Q_OBJECT |
131 | public: | 131 | public: |
132 | /** | 132 | /** |
133 | * Constructs a OPopupMenu. | 133 | * Constructs a OPopupMenu. |
134 | */ | 134 | */ |
135 | OPopupMenu(QWidget *parent=0, const char *name=0); | 135 | OPopupMenu(QWidget *parent=0, const char *name=0); |
136 | 136 | ||
137 | /** | 137 | /** |
138 | * Destructs the object | 138 | * Destructs the object |
139 | */ | 139 | */ |
140 | ~OPopupMenu(); | 140 | ~OPopupMenu(); |
141 | 141 | ||
142 | /** | 142 | /** |
143 | * Inserts a title item with no icon. | 143 | * Inserts a title item with no icon. |
144 | */ | 144 | */ |
145 | int insertTitle(const QString &text, int id=-1, int index=-1); | 145 | int insertTitle(const QString &text, int id=-1, int index=-1); |
146 | /** | 146 | /** |
147 | * Inserts a title item with the given icon and title. | 147 | * Inserts a title item with the given icon and title. |
148 | */ | 148 | */ |
149 | int insertTitle(const QPixmap &icon, const QString &text, int id=-1, | 149 | int insertTitle(const QPixmap &icon, const QString &text, int id=-1, |
150 | int index=-1); | 150 | int index=-1); |
151 | /** | 151 | /** |
152 | * Changes the title of the item at the specified id. If a icon was | 152 | * Changes the title of the item at the specified id. If a icon was |
153 | * previously set it is cleared. | 153 | * previously set it is cleared. |
154 | */ | 154 | */ |
155 | void changeTitle(int id, const QString &text); | 155 | void changeTitle(int id, const QString &text); |
156 | /** | 156 | /** |
157 | * Changes the title and icon of the title item at the specified id. | 157 | * Changes the title and icon of the title item at the specified id. |
158 | */ | 158 | */ |
159 | void changeTitle(int id, const QPixmap &icon, const QString &text); | 159 | void changeTitle(int id, const QPixmap &icon, const QString &text); |
160 | /** | 160 | /** |
161 | * Returns the title of the title item at the specified id. The default | 161 | * Returns the title of the title item at the specified id. The default |
162 | * id of -1 is for backwards compatibility only, you should always specify | 162 | * id of -1 is for backwards compatibility only, you should always specify |
163 | * the id. | 163 | * the id. |
164 | */ | 164 | */ |
165 | QString title(int id=-1) const; | 165 | QString title(int id=-1) const; |
166 | /** | 166 | /** |
167 | * Returns the icon of the title item at the specified id. | 167 | * Returns the icon of the title item at the specified id. |
168 | */ | 168 | */ |
169 | QPixmap titlePixmap(int id) const; | 169 | QPixmap titlePixmap(int id) const; |
170 | 170 | ||
171 | /** | 171 | /** |
172 | * Enables keyboard navigation by searching for the entered key sequence. | 172 | * Enables keyboard navigation by searching for the entered key sequence. |
173 | * Also underlines the currently selected item, providing feedback on the search. | 173 | * Also underlines the currently selected item, providing feedback on the search. |
174 | * | 174 | * |
175 | * Defaults to off. | 175 | * Defaults to off. |
176 | * | 176 | * |
177 | * WARNING: calls to text() of currently keyboard-selected items will | 177 | * WARNING: calls to text() of currently keyboard-selected items will |
178 | * contain additional ampersand characters. | 178 | * contain additional ampersand characters. |
179 | * | 179 | * |
180 | * WARNING: though pre-existing keyboard shortcuts will not interfere with the | 180 | * WARNING: though pre-existing keyboard shortcuts will not interfere with the |
181 | * operation of this feature, they may be confusing to the user as the existing | 181 | * operation of this feature, they may be confusing to the user as the existing |
182 | * shortcuts will not work. | 182 | * shortcuts will not work. |
183 | * @since 3.1 | 183 | * @since 3.1 |
184 | */ | 184 | */ |
185 | void setKeyboardShortcutsEnabled(bool enable); | 185 | void setKeyboardShortcutsEnabled(bool enable); |
186 | 186 | ||
187 | /** | 187 | /** |
188 | * Enables execution of the menu item once it is uniquely specified. | 188 | * Enables execution of the menu item once it is uniquely specified. |
189 | * Defaults to off. | 189 | * Defaults to off. |
190 | * @since 3.1 | 190 | * @since 3.1 |
191 | */ | 191 | */ |
192 | void setKeyboardShortcutsExecute(bool enable); | 192 | void setKeyboardShortcutsExecute(bool enable); |
193 | 193 | ||
194 | /** | 194 | /** |
195 | * Obsolete method provided for backwards compatibility only. Use the | 195 | * Obsolete method provided for backwards compatibility only. Use the |
196 | * normal constructor and insertTitle instead. | 196 | * normal constructor and insertTitle instead. |
197 | */ | 197 | */ |
198 | OPopupMenu(const QString &title, QWidget *parent=0, const char *name=0); | 198 | OPopupMenu(const QString &title, QWidget *parent=0, const char *name=0); |
199 | /** | 199 | /** |
200 | * Obsolete method provided for backwards compatibility only. Use | 200 | * Obsolete method provided for backwards compatibility only. Use |
201 | * insertTitle and changeTitle instead. | 201 | * insertTitle and changeTitle instead. |
202 | */ | 202 | */ |
203 | void setTitle(const QString &title); | 203 | void setTitle(const QString &title); |
204 | 204 | ||
205 | /** | 205 | /** |
206 | * Returns the context menu associated with this menu | 206 | * Returns the context menu associated with this menu |
207 | * @since 3.2 | 207 | * @since 3.2 |
208 | */ | 208 | */ |
209 | QPopupMenu* contextMenu(); | 209 | QPopupMenu* contextMenu(); |
210 | 210 | ||
211 | /** | 211 | /** |
212 | * Hides the context menu if shown | 212 | * Hides the context menu if shown |
213 | * @since 3.2 | 213 | * @since 3.2 |
214 | */ | 214 | */ |
215 | void cancelContextMenuShow(); | 215 | void cancelContextMenuShow(); |
216 | 216 | ||
217 | /** | 217 | /** |
218 | * Returns the OPopupMenu associated with the current context menu | 218 | * Returns the OPopupMenu associated with the current context menu |
219 | * @since 3.2 | 219 | * @since 3.2 |
220 | */ | 220 | */ |
221 | static OPopupMenu* contextMenuFocus(); | 221 | static OPopupMenu* contextMenuFocus(); |
222 | 222 | ||
223 | /** | 223 | /** |
224 | * returns the ID of the menuitem associated with the current context menu | 224 | * returns the ID of the menuitem associated with the current context menu |
225 | * @since 3.2 | 225 | * @since 3.2 |
226 | */ | 226 | */ |
227 | static int contextMenuFocusItem(); | 227 | static int contextMenuFocusItem(); |
228 | 228 | ||
229 | signals: | 229 | signals: |
230 | /** | 230 | /** |
231 | * connect to this signal to be notified when a context menu is about to be shown | 231 | * connect to this signal to be notified when a context menu is about to be shown |
232 | * @param menu The menu that the context menu is about to be shown for | 232 | * @param menu The menu that the context menu is about to be shown for |
233 | * @param menuItem The menu item that the context menu is currently on | 233 | * @param menuItem The menu item that the context menu is currently on |
234 | * @param ctxMenu The context menu itself | 234 | * @param ctxMenu The context menu itself |
235 | * @since 3.2 | 235 | * @since 3.2 |
236 | */ | 236 | */ |
237 | void aboutToShowContextMenu(OPopupMenu* menu, int menuItem, QPopupMenu* ctxMenu); | 237 | void aboutToShowContextMenu(Opie::Ui::OPopupMenu* menu, int menuItem, QPopupMenu* ctxMenu); |
238 | 238 | ||
239 | protected: | 239 | protected: |
240 | virtual void closeEvent(QCloseEvent *); | 240 | virtual void closeEvent(QCloseEvent *); |
241 | virtual void keyPressEvent(QKeyEvent* e); | 241 | virtual void keyPressEvent(QKeyEvent* e); |
242 | virtual bool eventFilter(QObject* obj, QEvent* event); | 242 | virtual bool eventFilter(QObject* obj, QEvent* event); |
243 | virtual void hideEvent(QHideEvent*); | 243 | virtual void hideEvent(QHideEvent*); |
244 | 244 | ||
245 | virtual void virtual_hook( int id, void* data ); | 245 | virtual void virtual_hook( int id, void* data ); |
246 | 246 | ||
247 | protected slots: | 247 | protected slots: |
248 | /// @since 3.1 | 248 | /// @since 3.1 |
249 | QString underlineText(const QString& text, uint length); | 249 | QString underlineText(const QString& text, uint length); |
250 | /// @since 3.1 | 250 | /// @since 3.1 |
251 | void resetKeyboardVars(bool noMatches = false); | 251 | void resetKeyboardVars(bool noMatches = false); |
252 | void itemHighlighted(int whichItem); | 252 | void itemHighlighted(int whichItem); |
253 | void showCtxMenu(QPoint pos); | 253 | void showCtxMenu(QPoint pos); |
254 | void ctxMenuHiding(); | 254 | void ctxMenuHiding(); |
255 | 255 | ||
256 | private: | 256 | private: |
257 | class OPopupMenuPrivate; | 257 | class OPopupMenuPrivate; |
258 | OPopupMenuPrivate *d; | 258 | OPopupMenuPrivate *d; |
259 | }; | 259 | }; |
260 | 260 | ||
261 | } | 261 | } |
262 | } | 262 | } |
263 | 263 | ||
264 | #endif | 264 | #endif |
diff --git a/libopie2/opieui/otimepicker.h b/libopie2/opieui/otimepicker.h index 01bb557..fb20781 100644 --- a/libopie2/opieui/otimepicker.h +++ b/libopie2/opieui/otimepicker.h | |||
@@ -1,132 +1,129 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the Opie Project | 2 | This file is part of the Opie Project |
3 | Copyright (C) Stefan Eilers <eilers.stefan@epost.de> | 3 | Copyright (C) Stefan Eilers <eilers.stefan@epost.de> |
4 | =. Copyright (C) The Opie Team <opie-devel@handhelds.org> | 4 | =. Copyright (C) The Opie Team <opie-devel@handhelds.org> |
5 | .=l. | 5 | .=l. |
6 | .>+-= | 6 | .>+-= |
7 | _;:, .> :=|. This program is free software; you can | 7 | _;:, .> :=|. This program is free software; you can |
8 | .> <`_, > . <= redistribute it and/or modify it under | 8 | .> <`_, > . <= redistribute it and/or modify it under |
9 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 9 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
10 | .="- .-=="i, .._ License as published by the Free Software | 10 | .="- .-=="i, .._ License as published by the Free Software |
11 | - . .-<_> .<> Foundation; either version 2 of the License, | 11 | - . .-<_> .<> Foundation; either version 2 of the License, |
12 | ._= =} : or (at your option) any later version. | 12 | ._= =} : or (at your option) any later version. |
13 | .%`+i> _;_. | 13 | .%`+i> _;_. |
14 | .i_,=:_. -<s. This program is distributed in the hope that | 14 | .i_,=:_. -<s. This program is distributed in the hope that |
15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
16 | : .. .:, . . . without even the implied warranty of | 16 | : .. .:, . . . without even the implied warranty of |
17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
19 | ..}^=.= = ; Library General Public License for more | 19 | ..}^=.= = ; Library General Public License for more |
20 | ++= -. .` .: details. | 20 | ++= -. .` .: details. |
21 | : = ...= . :.=- | 21 | : = ...= . :.=- |
22 | -. .:....=;==+<; You should have received a copy of the GNU | 22 | -. .:....=;==+<; You should have received a copy of the GNU |
23 | -_. . . )=. = Library General Public License along with | 23 | -_. . . )=. = Library General Public License along with |
24 | -- :-=` this library; see the file COPYING.LIB. | 24 | -- :-=` this library; see the file COPYING.LIB. |
25 | If not, write to the Free Software Foundation, | 25 | If not, write to the Free Software Foundation, |
26 | Inc., 59 Temple Place - Suite 330, | 26 | Inc., 59 Temple Place - Suite 330, |
27 | Boston, MA 02111-1307, USA. | 27 | Boston, MA 02111-1307, USA. |
28 | */ | 28 | */ |
29 | 29 | ||
30 | #ifndef OTIMEPICKER_H | 30 | #ifndef OTIMEPICKER_H |
31 | #define OTIMEPICKER_H | 31 | #define OTIMEPICKER_H |
32 | 32 | ||
33 | /* OPIE */ | 33 | /* OPIE */ |
34 | #include <opie2/oclickablelabel.h> | 34 | #include <opie2/oclickablelabel.h> |
35 | #include <opie2/otimepickerbase.h> | 35 | #include <opie2/otimepickerbase.h> |
36 | 36 | ||
37 | /* QT */ | 37 | /* QT */ |
38 | #include <qwidget.h> | 38 | #include <qwidget.h> |
39 | #include <qvaluelist.h> | 39 | #include <qvaluelist.h> |
40 | #include <qdatetime.h> | 40 | #include <qdatetime.h> |
41 | #include <qdialog.h> | 41 | #include <qdialog.h> |
42 | 42 | ||
43 | 43 | ||
44 | namespace Opie { | 44 | namespace Opie { |
45 | namespace Ui { | 45 | namespace Ui { |
46 | 46 | ||
47 | /** | 47 | /** |
48 | * A class to pick time. It uses clickable labels | 48 | * A class to pick time. It uses clickable labels |
49 | * internally to allow a quick selection of a time. | 49 | * internally to allow a quick selection of a time. |
50 | * A time can be selected by two clicks of a user | 50 | * A time can be selected by two clicks of a user |
51 | * | 51 | * |
52 | * @short A widget to quickly pick a QTime | 52 | * @short A widget to quickly pick a QTime |
53 | * @version 1.0 | 53 | * @version 1.0 |
54 | * @see QWidget | 54 | * @see QWidget |
55 | * @see QTime | 55 | * @see QTime |
56 | * @author Hakan Ardo, Stefan Eilers | 56 | * @author Hakan Ardo, Stefan Eilers |
57 | */ | 57 | */ |
58 | class OTimePicker : public QWidget | 58 | class OTimePicker : public QWidget |
59 | { | 59 | { |
60 | Q_OBJECT | 60 | Q_OBJECT |
61 | 61 | ||
62 | public: | 62 | public: |
63 | OTimePicker(QWidget* parent = 0, const char* name = 0, WFlags fl = 0); | 63 | OTimePicker(QWidget* parent = 0, const char* name = 0, WFlags fl = 0); |
64 | 64 | ||
65 | public slots: | 65 | public slots: |
66 | void setHour(int h); | 66 | void setHour(int h); |
67 | void setMinute(int m); | 67 | void setMinute(int m); |
68 | void setTime( const QTime& ); | 68 | void setTime( const QTime& ); |
69 | void setTime( int h, int m ); | 69 | void setTime( int h, int m ); |
70 | 70 | ||
71 | public: | 71 | public: |
72 | QTime time()const; | 72 | QTime time()const; |
73 | 73 | ||
74 | private: | 74 | private: |
75 | QValueList<OClickableLabel *> hourLst; | 75 | QValueList<OClickableLabel *> hourLst; |
76 | QValueList<OClickableLabel *> minuteLst; | 76 | QValueList<OClickableLabel *> minuteLst; |
77 | QTime tm; | 77 | QTime tm; |
78 | struct Private; | 78 | struct Private; |
79 | Private *d; | 79 | Private *d; |
80 | 80 | ||
81 | private slots: | 81 | private slots: |
82 | void slotHour(bool b); | 82 | void slotHour(bool b); |
83 | void slotMinute(bool b); | 83 | void slotMinute(bool b); |
84 | 84 | ||
85 | signals: | 85 | signals: |
86 | /** | 86 | /** |
87 | * gets emitted when the time got changed by the user | 87 | * gets emitted when the time got changed by the user |
88 | */ | 88 | */ |
89 | void timeChanged(const QTime &); | 89 | void timeChanged(const QTime &); |
90 | }; | 90 | }; |
91 | 91 | ||
92 | /** | 92 | /** |
93 | * | 93 | * |
94 | * @short A small dialog to pick a time | 94 | * @short A small dialog to pick a time |
95 | * @version 1.0 | 95 | * @version 1.0 |
96 | * @author Stefan Eilers | 96 | * @author Stefan Eilers |
97 | * | 97 | * |
98 | **/ | 98 | **/ |
99 | 99 | ||
100 | class OTimePickerDialog: public OTimePickerDialogBase | 100 | class OTimePickerDialog: public OTimePickerDialogBase |
101 | { | 101 | { |
102 | Q_OBJECT | 102 | Q_OBJECT |
103 | 103 | ||
104 | public: | 104 | public: |
105 | OTimePickerDialog ( QWidget* parent = 0, const char* name = NULL, WFlags fl = 0 ); | 105 | OTimePickerDialog ( QWidget* parent = 0, const char* name = NULL, WFlags fl = 0 ); |
106 | ~OTimePickerDialog() { }; | 106 | ~OTimePickerDialog() { }; |
107 | 107 | ||
108 | QTime time()const; | 108 | QTime time()const; |
109 | 109 | ||
110 | public slots: | 110 | public slots: |
111 | void setTime( const QTime& time ); | 111 | void setTime( const QTime& time ); |
112 | void setHour( const QString& hour ); | 112 | void setHour( const QString& hour ); |
113 | void setMinute( const QString& minute ); | 113 | void setMinute( const QString& minute ); |
114 | 114 | ||
115 | private: | 115 | private: |
116 | OTimePicker *m_timePicker; | 116 | OTimePicker *m_timePicker; |
117 | QTime m_time; | 117 | QTime m_time; |
118 | class Private; | 118 | class Private; |
119 | Private* d; | 119 | Private* d; |
120 | }; | 120 | }; |
121 | 121 | ||
122 | } | 122 | } |
123 | } | 123 | } |
124 | 124 | ||
125 | /* for Qt2 */ | 125 | /* for Qt2 */ |
126 | #if ( QT_VERSION-0 >= 0x030000 ) | 126 | #if ( QT_VERSION-0 >= 0x030000 ) |
127 | #error "Fix the UI File to use namespaces" | 127 | #error "Fix the UI File to use namespaces" |
128 | #else | ||
129 | typedef Opie::Ui::OTimePicker OUIOTimePicker; | ||
130 | #endif | 128 | #endif |
131 | #endif | 129 | #endif |
132 | |||
diff --git a/libopie2/opieui/oversatileview.h b/libopie2/opieui/oversatileview.h index 61b61db..8cba65c 100644 --- a/libopie2/opieui/oversatileview.h +++ b/libopie2/opieui/oversatileview.h | |||
@@ -1,399 +1,399 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the Opie Project | 2 | This file is part of the Opie Project |
3 | 3 | ||
4 | =. (C) 2003 Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de> | 4 | =. (C) 2003 Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de> |
5 | .=l. | 5 | .=l. |
6 | .>+-= | 6 | .>+-= |
7 | _;:, .> :=|. This program is free software; you can | 7 | _;:, .> :=|. This program is free software; you can |
8 | .> <`_, > . <= redistribute it and/or modify it under | 8 | .> <`_, > . <= redistribute it and/or modify it under |
9 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 9 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
10 | .="- .-=="i, .._ License as published by the Free Software | 10 | .="- .-=="i, .._ License as published by the Free Software |
11 | - . .-<_> .<> Foundation; either version 2 of the License, | 11 | - . .-<_> .<> Foundation; either version 2 of the License, |
12 | ._= =} : or (at your option) any later version. | 12 | ._= =} : or (at your option) any later version. |
13 | .%`+i> _;_. | 13 | .%`+i> _;_. |
14 | .i_,=:_. -<s. This program is distributed in the hope that | 14 | .i_,=:_. -<s. This program is distributed in the hope that |
15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
16 | : .. .:, . . . without even the implied warranty of | 16 | : .. .:, . . . without even the implied warranty of |
17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
19 | ..}^=.= = ; Library General Public License for more | 19 | ..}^=.= = ; Library General Public License for more |
20 | ++= -. .` .: details. | 20 | ++= -. .` .: details. |
21 | : = ...= . :.=- | 21 | : = ...= . :.=- |
22 | -. .:....=;==+<; You should have received a copy of the GNU | 22 | -. .:....=;==+<; You should have received a copy of the GNU |
23 | -_. . . )=. = Library General Public License along with | 23 | -_. . . )=. = Library General Public License along with |
24 | -- :-=` this library; see the file COPYING.LIB. | 24 | -- :-=` this library; see the file COPYING.LIB. |
25 | If not, write to the Free Software Foundation, | 25 | If not, write to the Free Software Foundation, |
26 | Inc., 59 Temple Place - Suite 330, | 26 | Inc., 59 Temple Place - Suite 330, |
27 | Boston, MA 02111-1307, USA. | 27 | Boston, MA 02111-1307, USA. |
28 | 28 | ||
29 | */ | 29 | */ |
30 | 30 | ||
31 | #ifndef OVERSATILEVIEW_H | 31 | #ifndef OVERSATILEVIEW_H |
32 | #define OVERSATILEVIEW_H | 32 | #define OVERSATILEVIEW_H |
33 | 33 | ||
34 | /* QT */ | 34 | /* QT */ |
35 | 35 | ||
36 | #include <qwidgetstack.h> | 36 | #include <qwidgetstack.h> |
37 | #include <qiconview.h> | 37 | #include <qiconview.h> |
38 | 38 | ||
39 | /* OPIE */ | 39 | /* OPIE */ |
40 | 40 | ||
41 | #include <opie2/oapplication.h> | 41 | #include <opie2/oapplication.h> |
42 | 42 | ||
43 | /* FORWARDS */ | 43 | /* FORWARDS */ |
44 | 44 | ||
45 | class QHeader; | 45 | class QHeader; |
46 | class QIconSet; | 46 | class QIconSet; |
47 | class QIconViewItem; | 47 | class QIconViewItem; |
48 | class QListViewItem; | 48 | class QListViewItem; |
49 | class QPopupMenu; | 49 | class QPopupMenu; |
50 | class QString; | 50 | class QString; |
51 | 51 | ||
52 | #ifndef QT_NO_DRAGANDDROP | 52 | #ifndef QT_NO_DRAGANDDROP |
53 | class QIconDragItem; | 53 | class QIconDragItem; |
54 | #endif | 54 | #endif |
55 | 55 | ||
56 | namespace Opie { | 56 | namespace Opie { |
57 | namespace Ui { | 57 | namespace Ui { |
58 | class OListView; | 58 | class OListView; |
59 | 59 | ||
60 | class OVersatileView : public QWidgetStack | 60 | class OVersatileView : public QWidgetStack |
61 | { | 61 | { |
62 | Q_OBJECT | 62 | Q_OBJECT |
63 | 63 | ||
64 | friend class OVersatileViewItem; | 64 | friend class OVersatileViewItem; |
65 | 65 | ||
66 | //==============================================================================================// | 66 | //==============================================================================================// |
67 | // OVersatileView High Level API | 67 | // OVersatileView High Level API |
68 | //==============================================================================================// | 68 | //==============================================================================================// |
69 | 69 | ||
70 | public: | 70 | public: |
71 | OVersatileView( QWidget* parent = 0, const char* name = 0, int mode = 0 ); | 71 | OVersatileView( QWidget* parent = 0, const char* name = 0, int mode = 0 ); |
72 | ~OVersatileView(); | 72 | ~OVersatileView(); |
73 | 73 | ||
74 | QPopupMenu* contextMenu() const; | 74 | QPopupMenu* contextMenu() const; |
75 | 75 | ||
76 | void setSynchronization( bool sync ); | 76 | void setSynchronization( bool sync ); |
77 | bool synchronization(); | 77 | bool synchronization(); |
78 | 78 | ||
79 | enum ViewMode { Tree = 0, Icons }; | 79 | enum ViewMode { Tree = 0, Icons }; |
80 | int viewMode(); | 80 | int viewMode(); |
81 | 81 | ||
82 | QIconView* iconView() const; | 82 | QIconView* iconView() const; |
83 | OListView* listView() const; | 83 | OListView* listView() const; |
84 | 84 | ||
85 | enum WarningPolicy { None = 0, Warn, WarnReturn }; | 85 | enum WarningPolicy { None = 0, Warn, WarnReturn }; |
86 | 86 | ||
87 | void setWarningPolicy( int ) const; // warn, if calling a method which doesn't apply to the current viewmode | 87 | void setWarningPolicy( int ) const; // warn, if calling a method which doesn't apply to the current viewmode |
88 | bool warningPolicy() const; | 88 | bool warningPolicy() const; |
89 | 89 | ||
90 | void setDefaultPixmaps( int mode, QPixmap& leaf, QPixmap& opened, QPixmap& closed ); | 90 | void setDefaultPixmaps( int mode, QPixmap& leaf, QPixmap& opened, QPixmap& closed ); |
91 | 91 | ||
92 | public slots: | 92 | public slots: |
93 | void setViewMode( int mode ); | 93 | void setViewMode( int mode ); |
94 | void setIconViewMode(); | 94 | void setIconViewMode(); |
95 | void setTreeViewMode(); | 95 | void setTreeViewMode(); |
96 | 96 | ||
97 | protected: | 97 | protected: |
98 | virtual bool isValidViewMode( int mode ) const; | 98 | virtual bool isValidViewMode( int mode ) const; |
99 | virtual void popupContextMenu( OVersatileViewItem* item, const QPoint& pos, int col = 0 ); | 99 | virtual void popupContextMenu( OVersatileViewItem* item, const QPoint& pos, int col = 0 ); |
100 | 100 | ||
101 | private: | 101 | private: |
102 | int _viewmode; | 102 | int _viewmode; |
103 | bool _synchronization; | 103 | bool _synchronization; |
104 | mutable int _warningpolicy; | 104 | mutable int _warningpolicy; |
105 | 105 | ||
106 | OListView* _listview; | 106 | OListView* _listview; |
107 | QIconView* _iconview; | 107 | QIconView* _iconview; |
108 | 108 | ||
109 | QPixmap _treeleaf; | 109 | QPixmap _treeleaf; |
110 | QPixmap _treeopened; | 110 | QPixmap _treeopened; |
111 | QPixmap _treeclosed; | 111 | QPixmap _treeclosed; |
112 | 112 | ||
113 | QPixmap _iconleaf; | 113 | QPixmap _iconleaf; |
114 | QPixmap _iconopened; | 114 | QPixmap _iconopened; |
115 | QPixmap _iconclosed; | 115 | QPixmap _iconclosed; |
116 | 116 | ||
117 | QPopupMenu* _contextmenu; | 117 | QPopupMenu* _contextmenu; |
118 | 118 | ||
119 | int _iconstyle; | 119 | int _iconstyle; |
120 | int _treestyle; | 120 | int _treestyle; |
121 | 121 | ||
122 | private slots: | 122 | private slots: |
123 | 123 | ||
124 | void contextMenuRequested( QListViewItem*, const QPoint&, int ); | 124 | void contextMenuRequested( QListViewItem*, const QPoint&, int ); |
125 | void contextMenuRequested( QIconViewItem*, const QPoint& ); | 125 | void contextMenuRequested( QIconViewItem*, const QPoint& ); |
126 | 126 | ||
127 | // type converting signal forwarders | 127 | // type converting signal forwarders |
128 | 128 | ||
129 | void selectionChanged( QListViewItem * ); | 129 | void selectionChanged( QListViewItem * ); |
130 | void currentChanged( QListViewItem * ); | 130 | void currentChanged( QListViewItem * ); |
131 | void clicked( QListViewItem * ); | 131 | void clicked( QListViewItem * ); |
132 | void pressed( QListViewItem * ); | 132 | void pressed( QListViewItem * ); |
133 | void doubleClicked( QListViewItem * ); | 133 | void doubleClicked( QListViewItem * ); |
134 | void returnPressed( QListViewItem * ); | 134 | void returnPressed( QListViewItem * ); |
135 | void onItem( QListViewItem * ); | 135 | void onItem( QListViewItem * ); |
136 | 136 | ||
137 | void selectionChanged( QIconViewItem * ); | 137 | void selectionChanged( QIconViewItem * ); |
138 | void currentChanged( QIconViewItem * ); | 138 | void currentChanged( QIconViewItem * ); |
139 | void clicked( QIconViewItem * ); | 139 | void clicked( QIconViewItem * ); |
140 | void pressed( QIconViewItem * ); | 140 | void pressed( QIconViewItem * ); |
141 | void doubleClicked( QIconViewItem * ); | 141 | void doubleClicked( QIconViewItem * ); |
142 | void returnPressed( QIconViewItem * ); | 142 | void returnPressed( QIconViewItem * ); |
143 | void onItem( QIconViewItem * ); | 143 | void onItem( QIconViewItem * ); |
144 | 144 | ||
145 | void expanded( QListViewItem * item ); // QListView | 145 | void expanded( QListViewItem * item ); // QListView |
146 | void collapsed( QListViewItem * item ); // QListView | 146 | void collapsed( QListViewItem * item ); // QListView |
147 | 147 | ||
148 | signals: | 148 | signals: |
149 | 149 | ||
150 | void contextMenuRequested( OVersatileViewItem * item, const QPoint& pos, int col ); | 150 | void contextMenuRequested( Opie::Ui::OVersatileViewItem * item, const QPoint& pos, int col ); |
151 | 151 | ||
152 | /*#ifndef QT_NO_DRAGANDDROP | 152 | /*#ifndef QT_NO_DRAGANDDROP |
153 | void dropped( QDropEvent *e, const QValueList<QIconDragItem> &lst ); // QIconView | 153 | void dropped( QDropEvent *e, const QValueList<QIconDragItem> &lst ); // QIconView |
154 | #endif | 154 | #endif |
155 | void itemRenamed( OVersatileViewItem *item, const QString & ); // QIconView | 155 | void itemRenamed( OVersatileViewItem *item, const QString & ); // QIconView |
156 | void itemRenamed( OVersatileViewItem *item ); // QIconView | 156 | void itemRenamed( OVersatileViewItem *item ); // QIconView |
157 | */ | 157 | */ |
158 | 158 | ||
159 | //==============================================================================================// | 159 | //==============================================================================================// |
160 | // "Derived" API - Case 1: Methods existing either only in QListView or only in QIconView | 160 | // "Derived" API - Case 1: Methods existing either only in QListView or only in QIconView |
161 | //==============================================================================================// | 161 | //==============================================================================================// |
162 | 162 | ||
163 | public: | 163 | public: |
164 | 164 | ||
165 | /* | 165 | /* |
166 | enum Arrangement { // QIconView | 166 | enum Arrangement { // QIconView |
167 | LeftToRight = 0, | 167 | LeftToRight = 0, |
168 | TopToBottom | 168 | TopToBottom |
169 | }; | 169 | }; |
170 | enum ResizeMode { // QIconView | 170 | enum ResizeMode { // QIconView |
171 | Fixed = 0, | 171 | Fixed = 0, |
172 | Adjust | 172 | Adjust |
173 | }; | 173 | }; |
174 | enum ItemTextPos { // QIconView | 174 | enum ItemTextPos { // QIconView |
175 | Bottom = 0, | 175 | Bottom = 0, |
176 | Right | 176 | Right |
177 | }; | 177 | }; |
178 | */ | 178 | */ |
179 | 179 | ||
180 | // | 180 | // |
181 | // only in QListView | 181 | // only in QListView |
182 | // | 182 | // |
183 | 183 | ||
184 | int treeStepSize() const; // QListView | 184 | int treeStepSize() const; // QListView |
185 | virtual void setTreeStepSize( int ); // QListView | 185 | virtual void setTreeStepSize( int ); // QListView |
186 | 186 | ||
187 | QHeader * header() const; // QListView | 187 | QHeader * header() const; // QListView |
188 | 188 | ||
189 | virtual int addColumn( const QString &label, int size = -1); // QListView | 189 | virtual int addColumn( const QString &label, int size = -1); // QListView |
190 | virtual int addColumn( const QIconSet& iconset, const QString &label, int size = -1); // QListView | 190 | virtual int addColumn( const QIconSet& iconset, const QString &label, int size = -1); // QListView |
191 | void removeColumn( int index ); // #### make virtual in next major release! // QListView | 191 | void removeColumn( int index ); // #### make virtual in next major release! // QListView |
192 | virtual void setColumnText( int column, const QString &label ); // QListView | 192 | virtual void setColumnText( int column, const QString &label ); // QListView |
193 | virtual void setColumnText( int column, const QIconSet& iconset, const QString &label ); // QListView | 193 | virtual void setColumnText( int column, const QIconSet& iconset, const QString &label ); // QListView |
194 | QString columnText( int column ) const; // QListView | 194 | QString columnText( int column ) const; // QListView |
195 | virtual void setColumnWidth( int column, int width ); // QListView | 195 | virtual void setColumnWidth( int column, int width ); // QListView |
196 | int columnWidth( int column ) const; // QListView | 196 | int columnWidth( int column ) const; // QListView |
197 | enum WidthMode { Manual, Maximum }; // QListView | 197 | enum WidthMode { Manual, Maximum }; // QListView |
198 | virtual void setColumnWidthMode( int column, WidthMode ); // QListView | 198 | virtual void setColumnWidthMode( int column, WidthMode ); // QListView |
199 | WidthMode columnWidthMode( int column ) const; // QListView | 199 | WidthMode columnWidthMode( int column ) const; // QListView |
200 | int columns() const; // QListView | 200 | int columns() const; // QListView |
201 | 201 | ||
202 | virtual void setColumnAlignment( int, int ); // QListView | 202 | virtual void setColumnAlignment( int, int ); // QListView |
203 | int columnAlignment( int ) const; // QListView | 203 | int columnAlignment( int ) const; // QListView |
204 | 204 | ||
205 | OVersatileViewItem * itemAt( const QPoint & screenPos ) const; // QListView | 205 | OVersatileViewItem * itemAt( const QPoint & screenPos ) const; // QListView |
206 | QRect itemRect( const OVersatileViewItem * ) const; // QListView | 206 | QRect itemRect( const OVersatileViewItem * ) const; // QListView |
207 | int itemPos( const OVersatileViewItem * ); // QListView | 207 | int itemPos( const OVersatileViewItem * ); // QListView |
208 | 208 | ||
209 | bool isSelected( const OVersatileViewItem * ) const; // QListView // also in QIconViewItem but not in QIconView *shrug* | 209 | bool isSelected( const OVersatileViewItem * ) const; // QListView // also in QIconViewItem but not in QIconView *shrug* |
210 | 210 | ||
211 | virtual void setMultiSelection( bool enable ); // QListView | 211 | virtual void setMultiSelection( bool enable ); // QListView |
212 | bool isMultiSelection() const; // QListView | 212 | bool isMultiSelection() const; // QListView |
213 | 213 | ||
214 | OVersatileViewItem * selectedItem() const; // QListView | 214 | OVersatileViewItem * selectedItem() const; // QListView |
215 | virtual void setOpen( OVersatileViewItem *, bool ); // QListView | 215 | virtual void setOpen( OVersatileViewItem *, bool ); // QListView |
216 | bool isOpen( const OVersatileViewItem * ) const; // QListView | 216 | bool isOpen( const OVersatileViewItem * ) const; // QListView |
217 | 217 | ||
218 | OVersatileViewItem * firstChild() const; // QListView | 218 | OVersatileViewItem * firstChild() const; // QListView |
219 | int childCount() const; // QListView | 219 | int childCount() const; // QListView |
220 | 220 | ||
221 | virtual void setAllColumnsShowFocus( bool ); // QListView | 221 | virtual void setAllColumnsShowFocus( bool ); // QListView |
222 | bool allColumnsShowFocus() const; // QListView | 222 | bool allColumnsShowFocus() const; // QListView |
223 | 223 | ||
224 | virtual void setItemMargin( int ); // QListView | 224 | virtual void setItemMargin( int ); // QListView |
225 | int itemMargin() const; // QListView | 225 | int itemMargin() const; // QListView |
226 | 226 | ||
227 | virtual void setRootIsDecorated( bool ); // QListView | 227 | virtual void setRootIsDecorated( bool ); // QListView |
228 | bool rootIsDecorated() const; // QListView | 228 | bool rootIsDecorated() const; // QListView |
229 | 229 | ||
230 | void setShowSortIndicator( bool show ); // QListView | 230 | void setShowSortIndicator( bool show ); // QListView |
231 | bool showSortIndicator() const; // QListView | 231 | bool showSortIndicator() const; // QListView |
232 | 232 | ||
233 | int index( const OVersatileViewItem *item ) const; // QIconView | 233 | int index( const OVersatileViewItem *item ) const; // QIconView |
234 | 234 | ||
235 | public slots: | 235 | public slots: |
236 | void triggerUpdate(); // QListView | 236 | void triggerUpdate(); // QListView |
237 | 237 | ||
238 | signals: | 238 | signals: |
239 | void expanded( OVersatileViewItem *item ); // QListView | 239 | void expanded( Opie::Ui::OVersatileViewItem *item ); // QListView |
240 | void collapsed( OVersatileViewItem *item ); // QListView | 240 | void collapsed( Opie::Ui::OVersatileViewItem *item ); // QListView |
241 | 241 | ||
242 | // | 242 | // |
243 | // only in QIconView | 243 | // only in QIconView |
244 | // | 244 | // |
245 | 245 | ||
246 | public: | 246 | public: |
247 | uint count() const; // QIconView | 247 | uint count() const; // QIconView |
248 | 248 | ||
249 | OVersatileViewItem *firstItem() const; // QIconView | 249 | OVersatileViewItem *firstItem() const; // QIconView |
250 | OVersatileViewItem *lastItem() const; // QIconView | 250 | OVersatileViewItem *lastItem() const; // QIconView |
251 | 251 | ||
252 | OVersatileViewItem *findItem( const QPoint &pos ) const; // QIconView | 252 | OVersatileViewItem *findItem( const QPoint &pos ) const; // QIconView |
253 | OVersatileViewItem *findItem( const QString &text ) const; // QIconView | 253 | OVersatileViewItem *findItem( const QString &text ) const; // QIconView |
254 | 254 | ||
255 | OVersatileViewItem* findFirstVisibleItem( const QRect &r ) const; // QIconView | 255 | OVersatileViewItem* findFirstVisibleItem( const QRect &r ) const; // QIconView |
256 | OVersatileViewItem* findLastVisibleItem( const QRect &r ) const; // QIconView | 256 | OVersatileViewItem* findLastVisibleItem( const QRect &r ) const; // QIconView |
257 | 257 | ||
258 | virtual void setGridX( int rx ); // QIconView | 258 | virtual void setGridX( int rx ); // QIconView |
259 | virtual void setGridY( int ry ); // QIconView | 259 | virtual void setGridY( int ry ); // QIconView |
260 | int gridX() const; // QIconView | 260 | int gridX() const; // QIconView |
261 | int gridY() const; // QIconView | 261 | int gridY() const; // QIconView |
262 | virtual void setSpacing( int sp ); // QIconView | 262 | virtual void setSpacing( int sp ); // QIconView |
263 | int spacing() const; // QIconView | 263 | int spacing() const; // QIconView |
264 | virtual void setItemTextPos( QIconView::ItemTextPos pos ); // QIconView | 264 | virtual void setItemTextPos( QIconView::ItemTextPos pos ); // QIconView |
265 | QIconView::ItemTextPos itemTextPos() const; // QIconView | 265 | QIconView::ItemTextPos itemTextPos() const; // QIconView |
266 | virtual void setItemTextBackground( const QBrush &b ); // QIconView | 266 | virtual void setItemTextBackground( const QBrush &b ); // QIconView |
267 | QBrush itemTextBackground() const; // QIconView | 267 | QBrush itemTextBackground() const; // QIconView |
268 | virtual void setArrangement( QIconView::Arrangement am ); // QIconView | 268 | virtual void setArrangement( QIconView::Arrangement am ); // QIconView |
269 | QIconView::Arrangement arrangement() const; // QIconView | 269 | QIconView::Arrangement arrangement() const; // QIconView |
270 | virtual void setResizeMode( QIconView::ResizeMode am ); // QIconView | 270 | virtual void setResizeMode( QIconView::ResizeMode am ); // QIconView |
271 | QIconView::ResizeMode resizeMode() const; // QIconView | 271 | QIconView::ResizeMode resizeMode() const; // QIconView |
272 | virtual void setMaxItemWidth( int w ); // QIconView | 272 | virtual void setMaxItemWidth( int w ); // QIconView |
273 | int maxItemWidth() const; // QIconView | 273 | int maxItemWidth() const; // QIconView |
274 | virtual void setMaxItemTextLength( int w ); // QIconView | 274 | virtual void setMaxItemTextLength( int w ); // QIconView |
275 | int maxItemTextLength() const; // QIconView | 275 | int maxItemTextLength() const; // QIconView |
276 | virtual void setAutoArrange( bool b ); // QIconView | 276 | virtual void setAutoArrange( bool b ); // QIconView |
277 | bool autoArrange() const; // QIconView | 277 | bool autoArrange() const; // QIconView |
278 | virtual void setShowToolTips( bool b ); // QIconView | 278 | virtual void setShowToolTips( bool b ); // QIconView |
279 | bool showToolTips() const; // QIconView | 279 | bool showToolTips() const; // QIconView |
280 | 280 | ||
281 | bool sorting() const; // QIconView | 281 | bool sorting() const; // QIconView |
282 | bool sortDirection() const; // QIconView | 282 | bool sortDirection() const; // QIconView |
283 | 283 | ||
284 | virtual void setItemsMovable( bool b ); // QIconView | 284 | virtual void setItemsMovable( bool b ); // QIconView |
285 | bool itemsMovable() const; // QIconView | 285 | bool itemsMovable() const; // QIconView |
286 | virtual void setWordWrapIconText( bool b ); // QIconView | 286 | virtual void setWordWrapIconText( bool b ); // QIconView |
287 | bool wordWrapIconText() const; // QIconView | 287 | bool wordWrapIconText() const; // QIconView |
288 | 288 | ||
289 | public slots: | 289 | public slots: |
290 | virtual void arrangeItemsInGrid( const QSize &grid, bool update = TRUE ); // QIconView | 290 | virtual void arrangeItemsInGrid( const QSize &grid, bool update = TRUE ); // QIconView |
291 | virtual void arrangeItemsInGrid( bool update = TRUE ); // QIconView | 291 | virtual void arrangeItemsInGrid( bool update = TRUE ); // QIconView |
292 | virtual void updateContents(); // QIconView | 292 | virtual void updateContents(); // QIconView |
293 | 293 | ||
294 | signals: | 294 | signals: |
295 | /*#ifndef QT_NO_DRAGANDDROP | 295 | /*#ifndef QT_NO_DRAGANDDROP |
296 | void dropped( QDropEvent *e, const QValueList<QIconDragItem> &lst ); // QIconView | 296 | void dropped( QDropEvent *e, const QValueList<QIconDragItem> &lst ); // QIconView |
297 | #endif | 297 | #endif |
298 | */ | 298 | */ |
299 | void moved(); // QIconView | 299 | void moved(); // QIconView |
300 | void itemRenamed( OVersatileViewItem *item, const QString & ); // QIconView | 300 | void itemRenamed( Opie::Ui::OVersatileViewItem *item, const QString & ); // QIconView |
301 | void itemRenamed( OVersatileViewItem *item ); // QIconView | 301 | void itemRenamed( Opie::Ui::OVersatileViewItem *item ); // QIconView |
302 | 302 | ||
303 | //==============================================================================================// | 303 | //==============================================================================================// |
304 | // "Derived" API - Case 2: Methods existing in QListView and QIconView with the same signatures | 304 | // "Derived" API - Case 2: Methods existing in QListView and QIconView with the same signatures |
305 | //==============================================================================================// | 305 | //==============================================================================================// |
306 | 306 | ||
307 | public: | 307 | public: |
308 | enum SelectionMode { | 308 | enum SelectionMode { |
309 | Single = 0, | 309 | Single = 0, |
310 | Multi, | 310 | Multi, |
311 | Extended, | 311 | Extended, |
312 | NoSelection | 312 | NoSelection |
313 | }; | 313 | }; |
314 | 314 | ||
315 | virtual void clear(); | 315 | virtual void clear(); |
316 | 316 | ||
317 | virtual void setFont( const QFont & ); | 317 | virtual void setFont( const QFont & ); |
318 | virtual void setPalette( const QPalette & ); | 318 | virtual void setPalette( const QPalette & ); |
319 | 319 | ||
320 | virtual void takeItem( OVersatileViewItem * ); | 320 | virtual void takeItem( OVersatileViewItem * ); |
321 | 321 | ||
322 | void setSelectionMode( SelectionMode mode ); | 322 | void setSelectionMode( SelectionMode mode ); |
323 | SelectionMode selectionMode() const; | 323 | SelectionMode selectionMode() const; |
324 | 324 | ||
325 | virtual void selectAll( bool select ); | 325 | virtual void selectAll( bool select ); |
326 | virtual void clearSelection(); | 326 | virtual void clearSelection(); |
327 | virtual void invertSelection(); | 327 | virtual void invertSelection(); |
328 | 328 | ||
329 | void ensureItemVisible( const OVersatileViewItem * ); | 329 | void ensureItemVisible( const OVersatileViewItem * ); |
330 | virtual void repaintItem( const OVersatileViewItem * ) const; | 330 | virtual void repaintItem( const OVersatileViewItem * ) const; |
331 | 331 | ||
332 | virtual void setCurrentItem( OVersatileViewItem * ); | 332 | virtual void setCurrentItem( OVersatileViewItem * ); |
333 | OVersatileViewItem * currentItem() const; | 333 | OVersatileViewItem * currentItem() const; |
334 | 334 | ||
335 | // bool eventFilter( QObject * o, QEvent * ); // use QWidgetStack implementation | 335 | // bool eventFilter( QObject * o, QEvent * ); // use QWidgetStack implementation |
336 | 336 | ||
337 | // QSize minimumSizeHint() const; // use QWidgetStack implementation | 337 | // QSize minimumSizeHint() const; // use QWidgetStack implementation |
338 | // QSizePolicy sizePolicy() const; // use QWidgetStack implementation | 338 | // QSizePolicy sizePolicy() const; // use QWidgetStack implementation |
339 | // QSize sizeHint() const; // use QWidgetStack implementation | 339 | // QSize sizeHint() const; // use QWidgetStack implementation |
340 | 340 | ||
341 | signals: | 341 | signals: |
342 | void selectionChanged(); | 342 | void selectionChanged(); |
343 | void selectionChanged( OVersatileViewItem * ); | 343 | void selectionChanged( Opie::Ui::OVersatileViewItem * ); |
344 | void currentChanged( OVersatileViewItem * ); | 344 | void currentChanged( Opie::Ui::OVersatileViewItem * ); |
345 | void clicked( OVersatileViewItem * ); | 345 | void clicked( Opie::Ui::OVersatileViewItem * ); |
346 | void pressed( OVersatileViewItem * ); | 346 | void pressed( Opie::Ui::OVersatileViewItem * ); |
347 | 347 | ||
348 | void doubleClicked( OVersatileViewItem * ); | 348 | void doubleClicked( Opie::Ui::OVersatileViewItem * ); |
349 | void returnPressed( OVersatileViewItem * ); | 349 | void returnPressed( Opie::Ui::OVersatileViewItem * ); |
350 | 350 | ||
351 | void onItem( OVersatileViewItem * ); | 351 | void onItem( Opie::Ui::OVersatileViewItem * ); |
352 | void onViewport(); | 352 | void onViewport(); |
353 | 353 | ||
354 | //==============================================================================================// | 354 | //==============================================================================================// |
355 | // "Derived" API - Case 2: Methods existing in QListView and QIconView with differing signatures | 355 | // "Derived" API - Case 2: Methods existing in QListView and QIconView with differing signatures |
356 | //==============================================================================================// | 356 | //==============================================================================================// |
357 | 357 | ||
358 | /* | 358 | /* |
359 | 359 | ||
360 | public: | 360 | public: |
361 | virtual void insertItem( OVersatileViewItem * ); // QListView | 361 | virtual void insertItem( OVersatileViewItem * ); // QListView |
362 | virtual void insertItem( OVersatileViewItem *item, OVersatileViewItem *after = 0L ); // QIconView | 362 | virtual void insertItem( OVersatileViewItem *item, OVersatileViewItem *after = 0L ); // QIconView |
363 | 363 | ||
364 | virtual void setSelected( OVersatileViewItem *, bool ); // QListView | 364 | virtual void setSelected( OVersatileViewItem *, bool ); // QListView |
365 | virtual void setSelected( OVersatileViewItem *item, bool s, bool cb = FALSE ); // QIconView | 365 | virtual void setSelected( OVersatileViewItem *item, bool s, bool cb = FALSE ); // QIconView |
366 | 366 | ||
367 | virtual void setSorting( int column, bool increasing = TRUE ); // QListView | 367 | virtual void setSorting( int column, bool increasing = TRUE ); // QListView |
368 | void setSorting( bool sort, bool ascending = TRUE ); // QIconView | 368 | void setSorting( bool sort, bool ascending = TRUE ); // QIconView |
369 | 369 | ||
370 | void sort(); // #### make virtual in next major release // QListView | 370 | void sort(); // #### make virtual in next major release // QListView |
371 | virtual void sort( bool ascending = TRUE ); // QIconView | 371 | virtual void sort( bool ascending = TRUE ); // QIconView |
372 | 372 | ||
373 | */ | 373 | */ |
374 | 374 | ||
375 | signals: | 375 | signals: |
376 | void clicked( OVersatileViewItem *, const QPoint &, int ); // QListView | 376 | void clicked( Opie::Ui::OVersatileViewItem *, const QPoint &, int ); // QListView |
377 | void clicked( OVersatileViewItem *, const QPoint & ); // QIconView | 377 | void clicked( Opie::Ui::OVersatileViewItem *, const QPoint & ); // QIconView |
378 | 378 | ||
379 | void pressed( OVersatileViewItem *, const QPoint &, int ); // QListView | 379 | void pressed( Opie::Ui::OVersatileViewItem *, const QPoint &, int ); // QListView |
380 | void pressed( OVersatileViewItem *, const QPoint & ); // QIconView | 380 | void pressed( Opie::Ui::OVersatileViewItem *, const QPoint & ); // QIconView |
381 | 381 | ||
382 | void rightButtonClicked( OVersatileViewItem* item, const QPoint& pos ); // QIconView | 382 | void rightButtonClicked( Opie::Ui::OVersatileViewItem* item, const QPoint& pos ); // QIconView |
383 | void rightButtonClicked( OVersatileViewItem *, const QPoint&, int ); // QListView | 383 | void rightButtonClicked( Opie::Ui::OVersatileViewItem *, const QPoint&, int ); // QListView |
384 | 384 | ||
385 | void rightButtonPressed( OVersatileViewItem* item, const QPoint& pos ); // QIconView | 385 | void rightButtonPressed( Opie::Ui::OVersatileViewItem* item, const QPoint& pos ); // QIconView |
386 | void rightButtonPressed( OVersatileViewItem *, const QPoint&, int ); // QListView | 386 | void rightButtonPressed( Opie::Ui::OVersatileViewItem *, const QPoint&, int ); // QListView |
387 | 387 | ||
388 | void mouseButtonPressed( int, OVersatileViewItem *, const QPoint& , int ); // QListView | 388 | void mouseButtonPressed( int, Opie::Ui::OVersatileViewItem *, const QPoint& , int ); // QListView |
389 | void mouseButtonPressed( int button, OVersatileViewItem* item, const QPoint& pos ); // QIconView | 389 | void mouseButtonPressed( int button, Opie::Ui::OVersatileViewItem* item, const QPoint& pos ); // QIconView |
390 | 390 | ||
391 | void mouseButtonClicked( int, OVersatileViewItem *, const QPoint&, int ); // QListView | 391 | void mouseButtonClicked( int, Opie::Ui::OVersatileViewItem *, const QPoint&, int ); // QListView |
392 | void mouseButtonClicked( int button, OVersatileViewItem* item, const QPoint& pos ); // QIconView | 392 | void mouseButtonClicked( int button, Opie::Ui::OVersatileViewItem* item, const QPoint& pos ); // QIconView |
393 | 393 | ||
394 | }; | 394 | }; |
395 | 395 | ||
396 | } | 396 | } |
397 | } | 397 | } |
398 | #endif | 398 | #endif |
399 | 399 | ||