diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-03-20 04:34:14 +0100 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-03-20 04:34:14 +0100 |
commit | d17a91f1851e8f0b3a3353d677ad8d1f51e921b7 (patch) | |
tree | 30316253f23ab99c106832deeb6c7d36adab27fc /Servers/WindowServer/WSMenuItem.h | |
parent | 9120b05a4044b346be397b0ae5b9b7e9a8cbd0b1 (diff) | |
download | serenity-d17a91f1851e8f0b3a3353d677ad8d1f51e921b7.zip |
Move WindowServer into Servers.
Diffstat (limited to 'Servers/WindowServer/WSMenuItem.h')
-rw-r--r-- | Servers/WindowServer/WSMenuItem.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/Servers/WindowServer/WSMenuItem.h b/Servers/WindowServer/WSMenuItem.h new file mode 100644 index 0000000000..e3dce736f8 --- /dev/null +++ b/Servers/WindowServer/WSMenuItem.h @@ -0,0 +1,38 @@ +#pragma once + +#include <AK/AKString.h> +#include <AK/Function.h> +#include <SharedGraphics/Rect.h> + +class WSMenuItem { +public: + enum Type { + None, + Text, + Separator, + }; + + explicit WSMenuItem(unsigned identifier, const String& text, const String& shortcut_text = { }); + explicit WSMenuItem(Type); + ~WSMenuItem(); + + Type type() const { return m_type; } + bool enabled() const { return m_enabled; } + + String text() const { return m_text; } + String shortcut_text() const { return m_shortcut_text; } + + void set_rect(const Rect& rect) { m_rect = rect; } + Rect rect() const { return m_rect; } + + unsigned identifier() const { return m_identifier; } + +private: + Type m_type { None }; + bool m_enabled { true }; + unsigned m_identifier { 0 }; + String m_text; + String m_shortcut_text; + Rect m_rect; +}; + |