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" |
(...skipping 19 matching lines...) Expand all Loading... |
30 virtual ~KeyboardLayoutEngine() {} | 30 virtual ~KeyboardLayoutEngine() {} |
31 | 31 |
32 // Returns true if it is possible to change the current layout. | 32 // Returns true if it is possible to change the current layout. |
33 virtual bool CanSetCurrentLayout() const = 0; | 33 virtual bool CanSetCurrentLayout() const = 0; |
34 | 34 |
35 // Sets the current layout; returns true on success. | 35 // Sets the current layout; returns true on success. |
36 // Drop-in replacement for ImeKeyboard::SetCurrentKeyboardLayoutByName(); | 36 // Drop-in replacement for ImeKeyboard::SetCurrentKeyboardLayoutByName(); |
37 // the argument string is defined by that interface (crbug.com/362698). | 37 // the argument string is defined by that interface (crbug.com/362698). |
38 virtual bool SetCurrentLayoutByName(const std::string& layout_name) = 0; | 38 virtual bool SetCurrentLayoutByName(const std::string& layout_name) = 0; |
39 | 39 |
| 40 // Sets the current layout given a keyboard mapping description; |
| 41 // Returns true on success. |
| 42 virtual bool SetCurrentLayoutFromString(const std::string&) = 0; |
| 43 |
40 // Returns true if the current layout makes use of the ISO Level 5 Shift key. | 44 // Returns true if the current layout makes use of the ISO Level 5 Shift key. |
41 // Drop-in replacement for ImeKeyboard::IsISOLevel5ShiftAvailable(). | 45 // Drop-in replacement for ImeKeyboard::IsISOLevel5ShiftAvailable(). |
42 virtual bool UsesISOLevel5Shift() const = 0; | 46 virtual bool UsesISOLevel5Shift() const = 0; |
43 | 47 |
44 // Returns true if the current layout makes use of the AltGr | 48 // Returns true if the current layout makes use of the AltGr |
45 // (ISO Level 3 Shift) key. | 49 // (ISO Level 3 Shift) key. |
46 // Drop-in replacement for ImeKeyboard::IsAltGrAvailable(). | 50 // Drop-in replacement for ImeKeyboard::IsAltGrAvailable(). |
47 virtual bool UsesAltGr() const = 0; | 51 virtual bool UsesAltGr() const = 0; |
48 | 52 |
49 // Provides the meaning of a physical key. | 53 // Provides the meaning of a physical key. |
(...skipping 13 matching lines...) Expand all Loading... |
63 // parameters. | 67 // parameters. |
64 virtual bool Lookup(DomCode dom_code, | 68 virtual bool Lookup(DomCode dom_code, |
65 int event_flags, | 69 int event_flags, |
66 DomKey* dom_key, | 70 DomKey* dom_key, |
67 KeyboardCode* key_code) const = 0; | 71 KeyboardCode* key_code) const = 0; |
68 }; | 72 }; |
69 | 73 |
70 } // namespace ui | 74 } // namespace ui |
71 | 75 |
72 #endif // UI_OZONE_PUBLIC_KEYBOARD_LAYOUT_ENGINE_H_ | 76 #endif // UI_OZONE_PUBLIC_KEYBOARD_LAYOUT_ENGINE_H_ |
OLD | NEW |