summaryrefslogtreecommitdiff
path: root/LibGUI/GMenuItem.h
diff options
context:
space:
mode:
Diffstat (limited to 'LibGUI/GMenuItem.h')
-rw-r--r--LibGUI/GMenuItem.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/LibGUI/GMenuItem.h b/LibGUI/GMenuItem.h
index 9c391d9574..0cda499e2d 100644
--- a/LibGUI/GMenuItem.h
+++ b/LibGUI/GMenuItem.h
@@ -1,15 +1,17 @@
#pragma once
#include <AK/AKString.h>
+#include <AK/Badge.h>
class GAction;
+class GMenu;
class GMenuItem {
public:
enum Type { Invalid, Action, Separator };
- explicit GMenuItem(Type);
- explicit GMenuItem(Retained<GAction>&&);
+ GMenuItem(unsigned menu_id, Type);
+ GMenuItem(unsigned menu_id, Retained<GAction>&&);
~GMenuItem();
Type type() const { return m_type; }
@@ -18,9 +20,19 @@ public:
GAction* action() { return m_action.ptr(); }
unsigned identifier() const { return m_identifier; }
+ bool is_enabled() const { return m_enabled; }
+ void set_enabled(bool);
+
+ void set_menu_id(Badge<GMenu>, unsigned menu_id) { m_menu_id = menu_id; }
+ void set_identifier(Badge<GMenu>, unsigned identifier) { m_identifier = identifier; }
+
private:
+ void update_window_server();
+
Type m_type { Invalid };
+ unsigned m_menu_id { 0 };
unsigned m_identifier { 0 };
+ bool m_enabled { true };
RetainPtr<GAction> m_action;
};