1 // Copyright 2020 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef UI_OZONE_PUBLIC_PLATFORM_MENU_UTILS_H_ 6 #define UI_OZONE_PUBLIC_PLATFORM_MENU_UTILS_H_ 7 8 #include <string> 9 10 #include "base/component_export.h" 11 #include "ui/events/keycodes/keyboard_codes_posix.h" 12 13 namespace ui { 14 15 enum class DomCode; 16 17 // Platform-specific functions related to menus. COMPONENT_EXPORT(OZONE_BASE)18class COMPONENT_EXPORT(OZONE_BASE) PlatformMenuUtils { 19 public: 20 PlatformMenuUtils(); 21 PlatformMenuUtils(const PlatformMenuUtils&) = delete; 22 PlatformMenuUtils& operator=(const PlatformMenuUtils&) = delete; 23 virtual ~PlatformMenuUtils(); 24 25 // Returns a bitmask of EventFlags showing the state of Alt, Shift and Ctrl 26 // keys that came with the most recent UI event. 27 virtual int GetCurrentKeyModifiers() const; 28 29 // Converts the keyboard code into a keysym label compatible with DBus menu 30 // protocol. 31 virtual std::string ToDBusKeySym(KeyboardCode code) const; 32 }; 33 34 } // namespace ui 35 36 #endif // UI_OZONE_PUBLIC_PLATFORM_MENU_UTILS_H_ 37