src/gui/widgets/qmenu_p.h
changeset 7 f7bc934e204c
parent 3 41300fa6a67c
equal deleted inserted replaced
3:41300fa6a67c 7:f7bc934e204c
     1 /****************************************************************************
     1 /****************************************************************************
     2 **
     2 **
     3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     4 ** All rights reserved.
     4 ** All rights reserved.
     5 ** Contact: Nokia Corporation (qt-info@nokia.com)
     5 ** Contact: Nokia Corporation (qt-info@nokia.com)
     6 **
     6 **
     7 ** This file is part of the QtGui module of the Qt Toolkit.
     7 ** This file is part of the QtGui module of the Qt Toolkit.
     8 **
     8 **
    69 QT_BEGIN_NAMESPACE
    69 QT_BEGIN_NAMESPACE
    70 
    70 
    71 #ifndef QT_NO_MENU
    71 #ifndef QT_NO_MENU
    72 
    72 
    73 #ifdef Q_WS_S60
    73 #ifdef Q_WS_S60
       
    74 void qt_symbian_next_menu_from_action(QWidget* actionContainer);
    74 void qt_symbian_show_toplevel(CEikMenuPane* menuPane);
    75 void qt_symbian_show_toplevel(CEikMenuPane* menuPane);
    75 void qt_symbian_show_submenu(CEikMenuPane* menuPane, int id);
    76 void qt_symbian_show_submenu(CEikMenuPane* menuPane, int id);
    76 #endif // Q_WS_S60
    77 #endif // Q_WS_S60
    77 
    78 
    78 class QTornOffMenu;
    79 class QTornOffMenu;
    85 QT_BEGIN_NAMESPACE
    86 QT_BEGIN_NAMESPACE
    86 #  else
    87 #  else
    87 typedef void NSMenuItem;
    88 typedef void NSMenuItem;
    88 #  endif //__OBJC__
    89 #  endif //__OBJC__
    89 struct QMacMenuAction {
    90 struct QMacMenuAction {
    90     QMacMenuAction() 
    91     QMacMenuAction()
    91 #ifndef QT_MAC_USE_COCOA
    92 #ifndef QT_MAC_USE_COCOA
    92        : command(0)
    93        : command(0)
    93 #else
    94 #else
    94        : menuItem(0)
    95        : menuItem(0)
    95 #endif
    96 #endif
   122 typedef QList<QMenuMergeItem> QMenuMergeList;
   123 typedef QList<QMenuMergeItem> QMenuMergeList;
   123 #endif
   124 #endif
   124 
   125 
   125 #ifdef Q_WS_WINCE
   126 #ifdef Q_WS_WINCE
   126 struct QWceMenuAction {
   127 struct QWceMenuAction {
   127     uint command;    
   128     uint command;
   128     QPointer<QAction> action;
   129     QPointer<QAction> action;
   129     HMENU menuHandle;
   130     HMENU menuHandle;
   130     QWceMenuAction() : menuHandle(0), command(0) {}
   131     QWceMenuAction() : menuHandle(0), command(0) {}
   131 };
   132 };
   132 #endif
   133 #endif
   338 #if defined(Q_WS_WINCE) && !defined(QT_NO_MENUBAR)
   339 #if defined(Q_WS_WINCE) && !defined(QT_NO_MENUBAR)
   339     struct QWceMenuPrivate {
   340     struct QWceMenuPrivate {
   340         QList<QWceMenuAction*> actionItems;
   341         QList<QWceMenuAction*> actionItems;
   341         HMENU menuHandle;
   342         HMENU menuHandle;
   342         QWceMenuPrivate();
   343         QWceMenuPrivate();
   343         ~QWceMenuPrivate();        
   344         ~QWceMenuPrivate();
   344         void addAction(QAction *, QWceMenuAction* =0);
   345         void addAction(QAction *, QWceMenuAction* =0);
   345         void addAction(QWceMenuAction *, QWceMenuAction* =0);
   346         void addAction(QWceMenuAction *, QWceMenuAction* =0);
   346         void syncAction(QWceMenuAction *);
   347         void syncAction(QWceMenuAction *);
   347         inline void syncAction(QAction *a) { syncAction(findAction(a)); }
   348         inline void syncAction(QAction *a) { syncAction(findAction(a)); }
   348         void removeAction(QWceMenuAction *);
   349         void removeAction(QWceMenuAction *);
   349         void rebuild(bool reCreate = false);
   350         void rebuild();
   350         inline void removeAction(QAction *a) { removeAction(findAction(a)); }
   351         inline void removeAction(QAction *a) { removeAction(findAction(a)); }
   351         inline QWceMenuAction *findAction(QAction *a) {
   352         inline QWceMenuAction *findAction(QAction *a) {
   352             for(int i = 0; i < actionItems.size(); i++) {
   353             for(int i = 0; i < actionItems.size(); i++) {
   353                 QWceMenuAction *act = actionItems[i];
   354                 QWceMenuAction *act = actionItems[i];
   354                 if(a == act->action)
   355                 if(a == act->action)