diff options
Diffstat (limited to 'src/gui/widgets/qmenu_p.h')
-rw-r--r-- | src/gui/widgets/qmenu_p.h | 43 |
1 files changed, 42 insertions, 1 deletions
diff --git a/src/gui/widgets/qmenu_p.h b/src/gui/widgets/qmenu_p.h index 74367c4..a45f12f 100644 --- a/src/gui/widgets/qmenu_p.h +++ b/src/gui/widgets/qmenu_p.h @@ -61,6 +61,9 @@ #include "QtCore/qbasictimer.h" #include "private/qwidget_p.h" +#ifdef Q_OS_SYMBIAN +class CEikMenuPane; +#endif QT_BEGIN_NAMESPACE #ifndef QT_NO_MENU @@ -120,6 +123,15 @@ struct QWceMenuAction { QWceMenuAction() : menuHandle(0), command(0) {} }; #endif +#ifdef Q_OS_SYMBIAN +struct QSymbianMenuAction { + uint command; + int parent; + CEikMenuPane* menuPane; + QPointer<QAction> action; + QSymbianMenuAction() : command(0) {} +}; +#endif class QMenuPrivate : public QWidgetPrivate { @@ -135,6 +147,9 @@ public: #if defined(Q_OS_WINCE) && !defined(QT_NO_MENUBAR) ,wce_menu(0) #endif +#ifdef Q_OS_SYMBIAN + ,symbian_menu(0) +#endif #ifdef QT3_SUPPORT ,emitHighlighted(false) #endif @@ -148,6 +163,10 @@ public: #if defined(Q_OS_WINCE) && !defined(QT_NO_MENUBAR) delete wce_menu; #endif +#ifdef Q_OS_SYMBIAN + delete symbian_menu; +#endif + } void init(); @@ -318,7 +337,29 @@ public: HMENU wceMenu(bool create = false); QAction* wceCommands(uint command); #endif - +#if defined(Q_OS_SYMBIAN) + struct QSymbianMenuPrivate { + QList<QSymbianMenuAction*> actionItems; + QSymbianMenuPrivate(); + ~QSymbianMenuPrivate(); + void addAction(QAction *, QSymbianMenuAction* =0); + void addAction(QSymbianMenuAction *, QSymbianMenuAction* =0); + void syncAction(QSymbianMenuAction *); + inline void syncAction(QAction *a) { syncAction(findAction(a)); } + void removeAction(QSymbianMenuAction *); + void rebuild(bool reCreate = false); + inline void removeAction(QAction *a) { removeAction(findAction(a)); } + inline QSymbianMenuAction *findAction(QAction *a) { + for(int i = 0; i < actionItems.size(); i++) { + QSymbianMenuAction *act = actionItems[i]; + if(a == act->action) + return act; + } + return 0; + } + } *symbian_menu; + bool symbianCommands(int command); +#endif QPointer<QWidget> noReplayFor; }; |