#ifndef TOPMENUMENUBARIMPL_H #define TOPMENUMENUBARIMPL_H #include #include #include #include #include #include #include #include #include #include "menuproxy.h" class AppMenu; typedef struct _TopMenuMonitor TopMenuMonitor; typedef struct _TopMenuAppMenuBar TopMenuAppMenuBar; class TopMenuMenuBarImpl : public MenuProxy, public QAbstractPlatformMenuBar { Q_OBJECT public: explicit TopMenuMenuBarImpl(QObject *parent = 0); ~TopMenuMenuBarImpl(); void init(QMenuBar *); void setVisible(bool visible); void actionEvent(QActionEvent*); void handleReparent(QWidget *oldParent, QWidget *newParent, QWidget *oldWindow, QWidget *newWindow); bool allowCornerWidgets() const; void popupAction(QAction*); void setNativeMenuBar(bool); bool isNativeMenuBar() const; bool shortcutsHandledByNativeMenuBar() const; bool menuBarEventFilter(QObject *, QEvent *event); protected: GtkMenuItem * addAction(QAction* action, QAction* before, QMenu* parent); void removeAction(QAction* action); void updateAction(QAction* action); private: QShortcut * createMnemonicShortcut(QAction *action, QWidget *parent); private slots: void handleShortcutActivated(); private: static bool staticInitialized; static TopMenuMonitor *menuMonitor; QWidget *m_window; TopMenuAppMenuBar *m_menubar; QList m_rootitems; AppMenu *m_appmenu; bool m_disable : 1; bool m_visible : 1; }; #endif // TOPMENUMENUBARIMPL_H