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 ** |
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) |