aboutsummaryrefslogtreecommitdiff
path: root/module/appmenu.h
diff options
context:
space:
mode:
authorJavier <dev.git@javispedro.com>2014-01-28 17:21:16 +0100
committerJavier <dev.git@javispedro.com>2014-01-28 17:21:16 +0100
commit982ebc96f2c77c1f9dbddd6a4c0a776c74b425de (patch)
tree6800326ba4da9c84dc14f0b442f088b1c2fb63bf /module/appmenu.h
downloadtopmenu-qt-982ebc96f2c77c1f9dbddd6a4c0a776c74b425de.tar.gz
topmenu-qt-982ebc96f2c77c1f9dbddd6a4c0a776c74b425de.zip
initial import
Diffstat (limited to 'module/appmenu.h')
-rw-r--r--module/appmenu.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/module/appmenu.h b/module/appmenu.h
new file mode 100644
index 0000000..bc7171d
--- /dev/null
+++ b/module/appmenu.h
@@ -0,0 +1,32 @@
+#ifndef APPMENU_H
+#define APPMENU_H
+
+#include "menuproxy.h"
+
+class AppMenu : public MenuProxy
+{
+ Q_OBJECT
+
+public:
+ AppMenu(QObject *parent = 0);
+ ~AppMenu();
+
+ GtkMenu * getGtkMenu();
+
+ GtkMenuItem * addAction(QAction *action);
+ GtkMenuItem * addAction(QAction* action, QAction* before, QMenu* parent);
+ void removeAction(QAction* action);
+ void updateAction(QAction* action);
+
+private:
+ void addDefaultItems();
+ static uint orderForRole(QAction::MenuRole role);
+ static QAction::MenuRole detectRole(QAction *action);
+
+private:
+ GtkMenu *m_menu;
+ QMultiMap<uint, QAction*> m_actions;
+ QAction *m_def_quit;
+};
+
+#endif // APPMENU_H