Index: ui/ozone/public/keyboard_layouts.h |
diff --git a/ui/ozone/public/keyboard_layouts.h b/ui/ozone/public/keyboard_layouts.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..421fa4513ebb37457f3170e883c50979d6cc7cbf |
--- /dev/null |
+++ b/ui/ozone/public/keyboard_layouts.h |
@@ -0,0 +1,55 @@ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef UI_OZONE_PUBLIC_KEYBOARD_LAYOUTS_H_ |
+#define UI_OZONE_PUBLIC_KEYBOARD_LAYOUTS_H_ |
+ |
+#include "base/strings/string16.h" |
+#include "ui/events/keycodes/keyboard_codes.h" |
+#include "ui/ozone/ozone_export.h" |
+ |
+namespace ui { |
+ |
+enum class DomCode; |
+enum class DomKey; |
+ |
+class OZONE_EXPORT KeyboardLayoutsOzone { |
kpschoedel
2014/11/20 16:18:38
https://docs.google.com/document/d/1AjtS4zAA4KW7yE
|
+ public: |
+ KeyboardLayoutsOzone(){}; |
+ virtual ~KeyboardLayoutsOzone(){}; |
+ |
+ // Returns true if it is possible to change the current layout. |
+ virtual bool CanSetCurrentLayout() = 0; |
+ |
+ // Sets the current layout; returns true on success. |
+ virtual bool SetCurrentLayoutByName(const std::string& layout_name) = 0; |
+ |
+ // Returns true if the current layout makes use of the ISO Level 5 Shift key. |
+ virtual bool UsesISOLevel5Shift() = 0; |
+ |
+ // Returns true if the current layout makes use of the AltGr |
+ // (ISO Level 3 Shift) key. |
+ virtual bool UsesAltGr() = 0; |
+ |
+ // Provides the interpretation of a physical key. |
+ // |
+ // The caller must supply valid addresses for all the output parameters; |
+ // the function must not use their initial values. |
+ // |
+ // If the function can determine an interpretation of the (dom_code, flags) |
+ // values, it must set *dom_key and must set *character, may optionally |
+ // set *key_code, and returns true. A layout function that does not directly |
+ // know the correct KeyboardCode should not touch *key_code. |
+ // |
+ // Otherwise, it must not set any of the output parameters, and returns false. |
+ virtual bool Lookup(DomCode dom_code, |
+ int flags, |
+ DomKey* dom_key, |
+ base::char16* character, |
+ KeyboardCode* key_code) = 0; |
+}; |
+ |
+} // namespace ui |
+ |
+#endif // UI_OZONE_PUBLIC_KEYBOARD_LAYOUTS_H_ |