OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef UI_OZONE_PUBLIC_KEYBOARD_LAYOUTS_H_ | |
6 #define UI_OZONE_PUBLIC_KEYBOARD_LAYOUTS_H_ | |
7 | |
8 #include "base/strings/string16.h" | |
9 #include "ui/events/keycodes/keyboard_codes.h" | |
10 #include "ui/ozone/ozone_export.h" | |
11 | |
12 namespace ui { | |
13 | |
14 enum class DomCode; | |
15 enum class DomKey; | |
16 | |
17 class OZONE_EXPORT KeyboardLayoutsOzone { | |
kpschoedel
2014/11/20 16:18:38
https://docs.google.com/document/d/1AjtS4zAA4KW7yE
| |
18 public: | |
19 KeyboardLayoutsOzone(){}; | |
20 virtual ~KeyboardLayoutsOzone(){}; | |
21 | |
22 // Returns true if it is possible to change the current layout. | |
23 virtual bool CanSetCurrentLayout() = 0; | |
24 | |
25 // Sets the current layout; returns true on success. | |
26 virtual bool SetCurrentLayoutByName(const std::string& layout_name) = 0; | |
27 | |
28 // Returns true if the current layout makes use of the ISO Level 5 Shift key. | |
29 virtual bool UsesISOLevel5Shift() = 0; | |
30 | |
31 // Returns true if the current layout makes use of the AltGr | |
32 // (ISO Level 3 Shift) key. | |
33 virtual bool UsesAltGr() = 0; | |
34 | |
35 // Provides the interpretation of a physical key. | |
36 // | |
37 // The caller must supply valid addresses for all the output parameters; | |
38 // the function must not use their initial values. | |
39 // | |
40 // If the function can determine an interpretation of the (dom_code, flags) | |
41 // values, it must set *dom_key and must set *character, may optionally | |
42 // set *key_code, and returns true. A layout function that does not directly | |
43 // know the correct KeyboardCode should not touch *key_code. | |
44 // | |
45 // Otherwise, it must not set any of the output parameters, and returns false. | |
46 virtual bool Lookup(DomCode dom_code, | |
47 int flags, | |
48 DomKey* dom_key, | |
49 base::char16* character, | |
50 KeyboardCode* key_code) = 0; | |
51 }; | |
52 | |
53 } // namespace ui | |
54 | |
55 #endif // UI_OZONE_PUBLIC_KEYBOARD_LAYOUTS_H_ | |
OLD | NEW |