Changeset 561 for trunk/src/gui/widgets/qmenubar_p.h
- Timestamp:
- Feb 11, 2010, 11:19:06 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property svn:mergeinfo
set to (toggle deleted branches)
/branches/vendor/nokia/qt/4.6.1 merged eligible /branches/vendor/nokia/qt/current merged eligible /branches/vendor/trolltech/qt/current 3-149
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
trunk/src/gui/widgets/qmenubar_p.h
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the QtGui module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 58 58 #include <private/qmenu_p.h> // Mac needs what in this file! 59 59 60 #ifdef Q_ OS_WINCE60 #ifdef Q_WS_WINCE 61 61 #include "qguifunctions_wince.h" 62 #endif 63 64 #ifndef QT_NO_MENUBAR 65 #ifdef Q_WS_S60 66 class CCoeControl; 67 class CEikMenuBar; 68 #endif 62 69 #endif 63 70 … … 70 77 Q_DECLARE_PUBLIC(QMenuBar) 71 78 public: 72 QMenuBarPrivate() : itemsDirty(0), itemsWidth(0), itemsStart(-1), currentAction(0), mouseDown(0), 73 closePopupMode(0), defaultPopDown(1), popupState(0), keyboardState(0), altPressed(0) 79 QMenuBarPrivate() : itemsDirty(0), currentAction(0), mouseDown(0), 80 closePopupMode(0), defaultPopDown(1), popupState(0), keyboardState(0), altPressed(0), 81 nativeMenuBar(-1), doChildEffects(false) 82 #ifdef QT3_SUPPORT 83 , doAutoResize(false) 84 #endif 74 85 #ifdef Q_WS_MAC 75 86 , mac_menubar(0) 76 87 #endif 77 88 78 #ifdef Q_ OS_WINCE89 #ifdef Q_WS_WINCE 79 90 , wce_menubar(0), wceClassicMenu(false) 80 91 #endif 81 { } 92 #ifdef Q_WS_S60 93 , symbian_menubar(0) 94 #endif 95 96 { } 82 97 ~QMenuBarPrivate() 83 98 { … … 85 100 delete mac_menubar; 86 101 #endif 87 #ifdef Q_ OS_WINCE102 #ifdef Q_WS_WINCE 88 103 delete wce_menubar; 89 104 #endif 105 #ifdef Q_WS_S60 106 delete symbian_menubar; 107 #endif 90 108 } 91 109 92 110 void init(); 93 Q StyleOptionMenuItem getStyleOption(const QAction *action) const;111 QAction *getNextAction(const int start, const int increment) const; 94 112 95 113 //item calculations 96 114 uint itemsDirty : 1; 97 int itemsWidth, itemsStart;98 115 99 116 QVector<int> shortcutIndexMap; 100 mutable QMap<QAction*, QRect> actionRects; 101 mutable QList<QAction*> actionList; 102 void calcActionRects(int max_width, int start, QMap<QAction*, QRect> &actionRects, QList<QAction*> &actionList) const; 117 mutable QVector<QRect> actionRects; 118 void calcActionRects(int max_width, int start) const; 103 119 QRect actionRect(QAction *) const; 104 120 void updateGeometries(); … … 116 132 117 133 //keyboard mode for keyboard navigation 134 void focusFirstAction(); 118 135 void setKeyboardMode(bool); 119 136 uint keyboardState : 1, altPressed : 1; 120 137 QPointer<QWidget> keyboardFocusWidget; 121 138 139 140 int nativeMenuBar : 3; // Only has values -1, 0, and 1 122 141 //firing of events 123 142 void activateAction(QAction *, QAction::ActionEvent); … … 128 147 void _q_updateLayout(); 129 148 130 #ifdef Q_ OS_WINCE149 #ifdef Q_WS_WINCE 131 150 void _q_updateDefaultAction(); 132 151 #endif … … 178 197 } 179 198 } *mac_menubar; 199 bool macWidgetHasNativeMenubar(QWidget *widget); 180 200 void macCreateMenuBar(QWidget *); 181 201 void macDestroyMenuBar(); 182 202 OSMenuRef macMenu(); 183 203 #endif 184 #ifdef Q_ OS_WINCE204 #ifdef Q_WS_WINCE 185 205 void wceCreateMenuBar(QWidget *); 186 206 void wceDestroyMenuBar(); … … 221 241 bool wceEmitSignals(QList<QWceMenuAction*> actions, uint command); 222 242 #endif 243 #ifdef Q_WS_S60 244 void symbianCreateMenuBar(QWidget *); 245 void symbianDestroyMenuBar(); 246 struct QSymbianMenuBarPrivate { 247 QList<QSymbianMenuAction*> actionItems; 248 QMenuBarPrivate *d; 249 QSymbianMenuBarPrivate(QMenuBarPrivate *menubar); 250 ~QSymbianMenuBarPrivate(); 251 void addAction(QAction *, QSymbianMenuAction* =0); 252 void addAction(QSymbianMenuAction *, QSymbianMenuAction* =0); 253 void syncAction(QSymbianMenuAction *); 254 inline void syncAction(QAction *a) { syncAction(findAction(a)); } 255 void removeAction(QSymbianMenuAction *); 256 void rebuild(); 257 inline void removeAction(QAction *a) { removeAction(findAction(a)); } 258 inline QSymbianMenuAction *findAction(QAction *a) { 259 for(int i = 0; i < actionItems.size(); i++) { 260 QSymbianMenuAction *act = actionItems[i]; 261 if(a == act->action) 262 return act; 263 } 264 return 0; 265 } 266 void insertNativeMenuItems(const QList<QAction*> &actions); 267 268 } *symbian_menubar; 269 static int symbianCommands(int command); 270 271 #endif 223 272 }; 224 273 #endif
Note:
See TracChangeset
for help on using the changeset viewer.