OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef UI_OZONE_PUBLIC_KEYBOARD_LAYOUT_ENGINE_H_ | 5 #ifndef UI_OZONE_PUBLIC_KEYBOARD_LAYOUT_ENGINE_H_ |
6 #define UI_OZONE_PUBLIC_KEYBOARD_LAYOUT_ENGINE_H_ | 6 #define UI_OZONE_PUBLIC_KEYBOARD_LAYOUT_ENGINE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| 11 #include "ui/events/keycodes/dom/dom_key.h" |
11 #include "ui/events/keycodes/keyboard_codes.h" | 12 #include "ui/events/keycodes/keyboard_codes.h" |
12 #include "ui/events/ozone/layout/events_ozone_layout_export.h" | 13 #include "ui/events/ozone/layout/events_ozone_layout_export.h" |
13 | 14 |
14 namespace ui { | 15 namespace ui { |
15 | 16 |
16 enum class DomCode; | 17 enum class DomCode; |
17 enum class DomKey; | |
18 | 18 |
19 // A KeyboardLayoutEngine provides a platform-independent interface to | 19 // A KeyboardLayoutEngine provides a platform-independent interface to |
20 // key mapping. Key mapping provides a meaning (DomKey and character, | 20 // key mapping. Key mapping provides a meaning (DomKey and character, |
21 // and optionally Windows key code) for a physical key press (DomCode | 21 // and optionally Windows key code) for a physical key press (DomCode |
22 // and modifier flags). | 22 // and modifier flags). |
23 // | 23 // |
24 // This interface does not expose individual layouts because it must support | 24 // This interface does not expose individual layouts because it must support |
25 // platforms that only provide for one active system layout, and/or platforms | 25 // platforms that only provide for one active system layout, and/or platforms |
26 // where layouts have no accessible representation. | 26 // where layouts have no accessible representation. |
27 class EVENTS_OZONE_LAYOUT_EXPORT KeyboardLayoutEngine { | 27 class EVENTS_OZONE_LAYOUT_EXPORT KeyboardLayoutEngine { |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 // to 0, and *key_code to VKEY_UNKNOWN. | 59 // to 0, and *key_code to VKEY_UNKNOWN. |
60 // | 60 // |
61 // Returns false if it cannot determine the meaning (and cannot determine | 61 // Returns false if it cannot determine the meaning (and cannot determine |
62 // that there is none); in this case it does not set any of the output | 62 // that there is none); in this case it does not set any of the output |
63 // parameters. | 63 // parameters. |
64 // | 64 // |
65 // TODO(kpschoedel): remove the platform_keycode output. crbug.com/442757 | 65 // TODO(kpschoedel): remove the platform_keycode output. crbug.com/442757 |
66 virtual bool Lookup(DomCode dom_code, | 66 virtual bool Lookup(DomCode dom_code, |
67 int event_flags, | 67 int event_flags, |
68 DomKey* dom_key, | 68 DomKey* dom_key, |
69 base::char16* character, | |
70 KeyboardCode* key_code, | 69 KeyboardCode* key_code, |
71 uint32* platform_keycode) const = 0; | 70 uint32* platform_keycode) const = 0; |
72 }; | 71 }; |
73 | 72 |
74 } // namespace ui | 73 } // namespace ui |
75 | 74 |
76 #endif // UI_OZONE_PUBLIC_KEYBOARD_LAYOUT_ENGINE_H_ | 75 #endif // UI_OZONE_PUBLIC_KEYBOARD_LAYOUT_ENGINE_H_ |
OLD | NEW |