Warning, file /system/qtcurve/qt4/style/macmenu.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001 /***************************************************************************** 0002 * Copyright 2007 Thomas Luebking <thomas.luebking@web.de> * 0003 * Copyright 2007 - 2010 Craig Drummond <craig.p.drummond@gmail.com> * 0004 * Copyright 2013 - 2015 Yichao Yu <yyc1992@gmail.com> * 0005 * * 0006 * This program is free software; you can redistribute it and/or modify * 0007 * it under the terms of the GNU Lesser General Public License as * 0008 * published by the Free Software Foundation; either version 2.1 of the * 0009 * License, or (at your option) version 3, or any later version accepted * 0010 * by the membership of KDE e.V. (or its successor approved by the * 0011 * membership of KDE e.V.), which shall act as a proxy defined in * 0012 * Section 6 of version 3 of the license. * 0013 * * 0014 * This program is distributed in the hope that it will be useful, * 0015 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 0016 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * 0017 * Lesser General Public License for more details. * 0018 * * 0019 * You should have received a copy of the GNU Lesser General Public * 0020 * License along with this library. If not, * 0021 * see <http://www.gnu.org/licenses/>. * 0022 *****************************************************************************/ 0023 0024 #ifndef MAC_MENU_H 0025 #define MAC_MENU_H 0026 0027 #include <QMap> 0028 #include <QObject> 0029 #include <QPointer> 0030 0031 class QMenuBar; 0032 class QAction; 0033 class QActionEvent; 0034 0035 namespace Bespin { 0036 class FullscreenWatcher: public QObject { 0037 public: 0038 FullscreenWatcher(): QObject() 0039 { 0040 } 0041 protected: 0042 bool eventFilter(QObject *o, QEvent *ev); 0043 }; 0044 0045 class MacMenu: public QObject { 0046 Q_OBJECT 0047 public: 0048 static void manage(QMenuBar *menu); 0049 static void release(QMenuBar *menu); 0050 static bool isActive(); 0051 void popup(qlonglong key, int idx, int x, int y); 0052 void hover(qlonglong key, int idx, int x, int y); 0053 void popDown(qlonglong key); 0054 void raise(qlonglong key); 0055 0056 public Q_SLOTS: 0057 void activate(); 0058 void deactivate(); 0059 0060 protected: 0061 bool eventFilter(QObject *o, QEvent *ev); 0062 void deactivate(QWidget *window); 0063 void activate(QWidget *window); 0064 friend class FullscreenWatcher; 0065 0066 private Q_SLOTS: 0067 void menuClosed(); 0068 void _release(QObject*); 0069 0070 private: 0071 Q_DISABLE_COPY(MacMenu) 0072 MacMenu(); 0073 void activate(QMenuBar *menu); 0074 void changeAction(QMenuBar *menu, QActionEvent *ev); 0075 void deactivate(QMenuBar *menu); 0076 typedef QPointer<QMenuBar> QMenuBar_p; 0077 typedef QList<QMenuBar_p> MenuList; 0078 MenuList items; 0079 QMenuBar *menuBar(qlonglong key); 0080 QMap<QMenuBar_p, QList<QAction*> > actions; 0081 bool usingMacMenu; 0082 QString service; 0083 }; 0084 } // namespace 0085 0086 #endif // MAC_MENU_H