Diffstat (limited to 'libopie2/opieui/opopupmenu.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opieui/opopupmenu.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libopie2/opieui/opopupmenu.h b/libopie2/opieui/opopupmenu.h index 54e4301..419a954 100644 --- a/libopie2/opieui/opopupmenu.h +++ b/libopie2/opieui/opopupmenu.h | |||
@@ -1,81 +1,83 @@ | |||
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 { | ||
35 | namespace Ui { | ||
34 | /** | 36 | /** |
35 | * Title widget for use in @ref OPopupMenu. | 37 | * Title widget for use in @ref OPopupMenu. |
36 | * | 38 | * |
37 | * You usually don't have to create this manually since | 39 | * You usually don't have to create this manually since |
38 | * @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 |
39 | * you wish to customize it's look. | 41 | * you wish to customize it's look. |
40 | * | 42 | * |
41 | * @author Daniel M. Duley <mosfet@kde.org> | 43 | * @author Daniel M. Duley <mosfet@kde.org> |
42 | * @short OPopupMenu title widget. | 44 | * @short OPopupMenu title widget. |
43 | */ | 45 | */ |
44 | class OPopupTitle : public QWidget | 46 | class OPopupTitle : public QWidget |
45 | { | 47 | { |
46 | Q_OBJECT | 48 | Q_OBJECT |
47 | 49 | ||
48 | public: | 50 | public: |
49 | /** | 51 | /** |
50 | * Constructs a title widget with the user specified gradient, pixmap, | 52 | * Constructs a title widget with the user specified gradient, pixmap, |
51 | * and colors. | 53 | * and colors. |
52 | */ | 54 | */ |
53 | OPopupTitle(QWidget *parent=0, const char *name=0); | 55 | OPopupTitle(QWidget *parent=0, const char *name=0); |
54 | /** | 56 | /** |
55 | * @deprecated | 57 | * @deprecated |
56 | * Constructs a title widget with the specified gradient and colors. | 58 | * Constructs a title widget with the specified gradient and colors. |
57 | */ | 59 | */ |
58 | OPopupTitle(OPixmapEffect::GradientType gradient, const QColor &color, | 60 | OPopupTitle(OPixmapEffect::GradientType gradient, const QColor &color, |
59 | const QColor &textColor, QWidget *parent=0, | 61 | const QColor &textColor, QWidget *parent=0, |
60 | const char *name=0); | 62 | const char *name=0); |
61 | /** | 63 | /** |
62 | * @deprecated | 64 | * @deprecated |
63 | * Constructs a title widget with the specified pixmap and colors. | 65 | * Constructs a title widget with the specified pixmap and colors. |
64 | */ | 66 | */ |
65 | OPopupTitle(const OPixmap &background, const QColor &color, | 67 | OPopupTitle(const OPixmap &background, const QColor &color, |
66 | const QColor &textColor, QWidget *parent=0, | 68 | const QColor &textColor, QWidget *parent=0, |
67 | const char *name=0); | 69 | const char *name=0); |
68 | /** | 70 | /** |
69 | * Sets the title string and optional icon for the title widget. | 71 | * Sets the title string and optional icon for the title widget. |
70 | * | 72 | * |
71 | * You will want to call this before inserting into a menu. | 73 | * You will want to call this before inserting into a menu. |
72 | */ | 74 | */ |
73 | void setTitle(const QString &text, const QPixmap *icon=NULL); | 75 | void setTitle(const QString &text, const QPixmap *icon=NULL); |
74 | /** | 76 | /** |
75 | * Returns the current title. | 77 | * Returns the current title. |
76 | */ | 78 | */ |
77 | QString title() const { return(titleStr); } | 79 | QString title() const { return(titleStr); } |
78 | /** | 80 | /** |
79 | * Returns the current icon. | 81 | * Returns the current icon. |
80 | */ | 82 | */ |
81 | QPixmap icon() const { return(miniicon); } | 83 | QPixmap icon() const { return(miniicon); } |
@@ -211,49 +213,52 @@ public: | |||
211 | * @since 3.2 | 213 | * @since 3.2 |
212 | */ | 214 | */ |
213 | void cancelContextMenuShow(); | 215 | void cancelContextMenuShow(); |
214 | 216 | ||
215 | /** | 217 | /** |
216 | * Returns the OPopupMenu associated with the current context menu | 218 | * Returns the OPopupMenu associated with the current context menu |
217 | * @since 3.2 | 219 | * @since 3.2 |
218 | */ | 220 | */ |
219 | static OPopupMenu* contextMenuFocus(); | 221 | static OPopupMenu* contextMenuFocus(); |
220 | 222 | ||
221 | /** | 223 | /** |
222 | * 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 |
223 | * @since 3.2 | 225 | * @since 3.2 |
224 | */ | 226 | */ |
225 | static int contextMenuFocusItem(); | 227 | static int contextMenuFocusItem(); |
226 | 228 | ||
227 | signals: | 229 | signals: |
228 | /** | 230 | /** |
229 | * 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 |
230 | * @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 |
231 | * @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 |
232 | * @param ctxMenu The context menu itself | 234 | * @param ctxMenu The context menu itself |
233 | * @since 3.2 | 235 | * @since 3.2 |
234 | */ | 236 | */ |
235 | void aboutToShowContextMenu(OPopupMenu* menu, int menuItem, QPopupMenu* ctxMenu); | 237 | void aboutToShowContextMenu(OPopupMenu* menu, int menuItem, QPopupMenu* ctxMenu); |
236 | 238 | ||
237 | protected: | 239 | protected: |
238 | virtual void closeEvent(QCloseEvent *); | 240 | virtual void closeEvent(QCloseEvent *); |
239 | virtual void keyPressEvent(QKeyEvent* e); | 241 | virtual void keyPressEvent(QKeyEvent* e); |
240 | virtual bool eventFilter(QObject* obj, QEvent* event); | 242 | virtual bool eventFilter(QObject* obj, QEvent* event); |
241 | virtual void hideEvent(QHideEvent*); | 243 | virtual void hideEvent(QHideEvent*); |
242 | 244 | ||
243 | virtual void virtual_hook( int id, void* data ); | 245 | virtual void virtual_hook( int id, void* data ); |
244 | 246 | ||
245 | protected slots: | 247 | protected slots: |
246 | /// @since 3.1 | 248 | /// @since 3.1 |
247 | QString underlineText(const QString& text, uint length); | 249 | QString underlineText(const QString& text, uint length); |
248 | /// @since 3.1 | 250 | /// @since 3.1 |
249 | void resetKeyboardVars(bool noMatches = false); | 251 | void resetKeyboardVars(bool noMatches = false); |
250 | void itemHighlighted(int whichItem); | 252 | void itemHighlighted(int whichItem); |
251 | void showCtxMenu(QPoint pos); | 253 | void showCtxMenu(QPoint pos); |
252 | void ctxMenuHiding(); | 254 | void ctxMenuHiding(); |
253 | 255 | ||
254 | private: | 256 | private: |
255 | class OPopupMenuPrivate; | 257 | class OPopupMenuPrivate; |
256 | OPopupMenuPrivate *d; | 258 | OPopupMenuPrivate *d; |
257 | }; | 259 | }; |
258 | 260 | ||
261 | } | ||
262 | } | ||
263 | |||
259 | #endif | 264 | #endif |