Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(555)

Side by Side Diff: chromeos/ime/ime_keyboard.h

Issue 689873004: Revert of Adds ozone support for ime keyboard. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chromeos/ime/fake_ime_keyboard.cc ('k') | chromeos/ime/ime_keyboard.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 CHROMEOS_IME_IME_KEYBOARD_H_ 5 #ifndef CHROMEOS_IME_IME_KEYBOARD_H_
6 #define CHROMEOS_IME_IME_KEYBOARD_H_ 6 #define CHROMEOS_IME_IME_KEYBOARD_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/basictypes.h" 11 #include "base/basictypes.h"
12 #include "base/observer_list.h"
13 #include "chromeos/chromeos_export.h" 12 #include "chromeos/chromeos_export.h"
14 13
15 namespace chromeos { 14 namespace chromeos {
16 namespace input_method { 15 namespace input_method {
17 16
18 struct AutoRepeatRate { 17 struct AutoRepeatRate {
19 AutoRepeatRate() : initial_delay_in_ms(0), repeat_interval_in_ms(0) {} 18 AutoRepeatRate() : initial_delay_in_ms(0), repeat_interval_in_ms(0) {}
20 unsigned int initial_delay_in_ms; 19 unsigned int initial_delay_in_ms;
21 unsigned int repeat_interval_in_ms; 20 unsigned int repeat_interval_in_ms;
22 }; 21 };
(...skipping 13 matching lines...) Expand all
36 class InputMethodUtil; 35 class InputMethodUtil;
37 36
38 class CHROMEOS_EXPORT ImeKeyboard { 37 class CHROMEOS_EXPORT ImeKeyboard {
39 public: 38 public:
40 class Observer { 39 class Observer {
41 public: 40 public:
42 // Called when the caps lock state has changed. 41 // Called when the caps lock state has changed.
43 virtual void OnCapsLockChanged(bool enabled) = 0; 42 virtual void OnCapsLockChanged(bool enabled) = 0;
44 }; 43 };
45 44
46 ImeKeyboard(); 45 virtual ~ImeKeyboard() {}
47 virtual ~ImeKeyboard(); 46
48 // Adds/removes observer. 47 // Adds/removes observer.
49 virtual void AddObserver(Observer* observer); 48 virtual void AddObserver(Observer* observer) = 0;
50 virtual void RemoveObserver(Observer* observer); 49 virtual void RemoveObserver(Observer* observer) = 0;
51 50
52 // Sets the current keyboard layout to |layout_name|. This function does not 51 // Sets the current keyboard layout to |layout_name|. This function does not
53 // change the current mapping of the modifier keys. Returns true on success. 52 // change the current mapping of the modifier keys. Returns true on success.
54 virtual bool SetCurrentKeyboardLayoutByName( 53 virtual bool SetCurrentKeyboardLayoutByName(
55 const std::string& layout_name) = 0; 54 const std::string& layout_name) = 0;
56 55
57 // Sets the current keyboard layout again. We have to call the function every 56 // Sets the current keyboard layout again. We have to call the function every
58 // time when "XI_HierarchyChanged" XInput2 event is sent to Chrome. See 57 // time when "XI_HierarchyChanged" XInput2 event is sent to Chrome. See
59 // xinput_hierarchy_changed_event_listener.h for details. 58 // xinput_hierarchy_changed_event_listener.h for details.
60 virtual bool ReapplyCurrentKeyboardLayout() = 0; 59 virtual bool ReapplyCurrentKeyboardLayout() = 0;
61 60
62 // Updates keyboard LEDs on all keyboards. 61 // Updates keyboard LEDs on all keyboards.
63 // XKB asymmetrically propagates keyboard modifier indicator state changes to 62 // XKB asymmetrically propagates keyboard modifier indicator state changes to
64 // slave keyboards. If the state change is initiated from a client to the 63 // slave keyboards. If the state change is initiated from a client to the
65 // "core/master keyboard", XKB changes global state and pushes an indication 64 // "core/master keyboard", XKB changes global state and pushes an indication
66 // change down to all keyboards. If the state change is initiated by one slave 65 // change down to all keyboards. If the state change is initiated by one slave
67 // (physical) keyboard, it changes global state but only pushes an indicator 66 // (physical) keyboard, it changes global state but only pushes an indicator
68 // state change down to that one keyboard. 67 // state change down to that one keyboard.
69 // This function changes LEDs on all keyboards by explicitly updating the 68 // This function changes LEDs on all keyboards by explicitly updating the
70 // core/master keyboard. 69 // core/master keyboard.
71 virtual void ReapplyCurrentModifierLockStatus() = 0; 70 virtual void ReapplyCurrentModifierLockStatus() = 0;
72 71
73 // Disables the num lock. 72 // Disables the num lock.
74 virtual void DisableNumLock() = 0; 73 virtual void DisableNumLock() = 0;
75 74
76 // Sets the caps lock status to |enable_caps_lock|. Do not call the function 75 // Sets the caps lock status to |enable_caps_lock|. Do not call the function
77 // from non-UI threads. 76 // from non-UI threads.
78 virtual void SetCapsLockEnabled(bool enable_caps_lock); 77 virtual void SetCapsLockEnabled(bool enable_caps_lock) = 0;
79 78
80 // Returns true if caps lock is enabled. Do not call the function from non-UI 79 // Returns true if caps lock is enabled. Do not call the function from non-UI
81 // threads. 80 // threads.
82 virtual bool CapsLockIsEnabled(); 81 virtual bool CapsLockIsEnabled() = 0;
83 82
84 // Returns true if the current layout supports ISO Level 5 shift. 83 // Returns true if the current layout supports ISO Level 5 shift.
85 virtual bool IsISOLevel5ShiftAvailable() const; 84 virtual bool IsISOLevel5ShiftAvailable() const = 0;
86 85
87 // Returns true if the current layout supports alt gr. 86 // Returns true if the current layout supports alt gr.
88 virtual bool IsAltGrAvailable() const; 87 virtual bool IsAltGrAvailable() const = 0;
89 88
90 // Turns on and off the auto-repeat of the keyboard. Returns true on success. 89 // Turns on and off the auto-repeat of the keyboard. Returns true on success.
91 // Do not call the function from non-UI threads. 90 // Do not call the function from non-UI threads.
92 virtual bool SetAutoRepeatEnabled(bool enabled) = 0; 91 virtual bool SetAutoRepeatEnabled(bool enabled) = 0;
93 92
94 // Sets the auto-repeat rate of the keyboard, initial delay in ms, and repeat 93 // Sets the auto-repeat rate of the keyboard, initial delay in ms, and repeat
95 // interval in ms. Returns true on success. Do not call the function from 94 // interval in ms. Returns true on success. Do not call the function from
96 // non-UI threads. 95 // non-UI threads.
97 virtual bool SetAutoRepeatRate(const AutoRepeatRate& rate) = 0; 96 virtual bool SetAutoRepeatRate(const AutoRepeatRate& rate) = 0;
98 97
99 // Returns true if auto repeat is enabled. This function is protected: for 98 // Returns true if auto repeat is enabled. This function is protected: for
100 // testability. 99 // testability.
101 static CHROMEOS_EXPORT bool GetAutoRepeatEnabledForTesting(); 100 static CHROMEOS_EXPORT bool GetAutoRepeatEnabledForTesting();
102 101
103 // On success, set current auto repeat rate on |out_rate| and returns true. 102 // On success, set current auto repeat rate on |out_rate| and returns true.
104 // Returns false otherwise. This function is protected: for testability. 103 // Returns false otherwise. This function is protected: for testability.
105 static CHROMEOS_EXPORT bool GetAutoRepeatRateForTesting( 104 static CHROMEOS_EXPORT bool GetAutoRepeatRateForTesting(
106 AutoRepeatRate* out_rate); 105 AutoRepeatRate* out_rate);
107 106
108 // Returns false if |layout_name| contains a bad character. 107 // Returns false if |layout_name| contains a bad character.
109 static CHROMEOS_EXPORT bool CheckLayoutNameForTesting( 108 static CHROMEOS_EXPORT bool CheckLayoutNameForTesting(
110 const std::string& layout_name); 109 const std::string& layout_name);
111 110
112 // Note: At this moment, classes other than InputMethodManager should not 111 // Note: At this moment, classes other than InputMethodManager should not
113 // instantiate the ImeKeyboard class. 112 // instantiate the ImeKeyboard class.
114 static ImeKeyboard* Create(); 113 static ImeKeyboard* Create();
115
116 bool caps_lock_is_enabled_;
117 std::string last_layout_;
118
119 protected:
120 ObserverList<Observer> observers_;
121 }; 114 };
122 115
123 } // namespace input_method 116 } // namespace input_method
124 } // namespace chromeos 117 } // namespace chromeos
125 118
126 #endif // CHROMEOS_IME_IME_KEYBOARD_H_ 119 #endif // CHROMEOS_IME_IME_KEYBOARD_H_
OLDNEW
« no previous file with comments | « chromeos/ime/fake_ime_keyboard.cc ('k') | chromeos/ime/ime_keyboard.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698