| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_XKEYBOARD_H_ | 5 #ifndef CHROMEOS_IME_XKEYBOARD_H_ |
| 6 #define CHROMEOS_IME_XKEYBOARD_H_ | 6 #define CHROMEOS_IME_XKEYBOARD_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 "chromeos/chromeos_export.h" | 12 #include "chromeos/chromeos_export.h" |
| 13 | 13 |
| 14 namespace chromeos { | 14 namespace chromeos { |
| 15 namespace input_method { | 15 namespace input_method { |
| 16 | 16 |
| 17 struct AutoRepeatRate { | 17 struct AutoRepeatRate { |
| 18 AutoRepeatRate() : initial_delay_in_ms(0), repeat_interval_in_ms(0) {} | 18 AutoRepeatRate() : initial_delay_in_ms(0), repeat_interval_in_ms(0) {} |
| 19 unsigned int initial_delay_in_ms; | 19 unsigned int initial_delay_in_ms; |
| 20 unsigned int repeat_interval_in_ms; | 20 unsigned int repeat_interval_in_ms; |
| 21 }; | 21 }; |
| 22 | 22 |
| 23 enum ModifierLockStatus { | |
| 24 kDisableLock = 0, | |
| 25 kEnableLock, | |
| 26 kDontChange, | |
| 27 }; | |
| 28 | |
| 29 enum ModifierKey { | 23 enum ModifierKey { |
| 30 kSearchKey = 0, // Customizable. | 24 kSearchKey = 0, // Customizable. |
| 31 kControlKey, // Customizable. | 25 kControlKey, // Customizable. |
| 32 kAltKey, // Customizable. | 26 kAltKey, // Customizable. |
| 33 kVoidKey, | 27 kVoidKey, |
| 34 kCapsLockKey, | 28 kCapsLockKey, |
| 35 kEscapeKey, | 29 kEscapeKey, |
| 36 // IMPORTANT: You should update kCustomizableKeys[] in .cc file, if you | 30 // IMPORTANT: You should update kCustomizableKeys[] in .cc file, if you |
| 37 // add a customizable key. | 31 // add a customizable key. |
| 38 kNumModifierKeys, | 32 kNumModifierKeys, |
| (...skipping 19 matching lines...) Expand all Loading... |
| 58 // XKB asymmetrically propagates keyboard modifier indicator state changes to | 52 // XKB asymmetrically propagates keyboard modifier indicator state changes to |
| 59 // slave keyboards. If the state change is initiated from a client to the | 53 // slave keyboards. If the state change is initiated from a client to the |
| 60 // "core/master keyboard", XKB changes global state and pushes an indication | 54 // "core/master keyboard", XKB changes global state and pushes an indication |
| 61 // change down to all keyboards. If the state change is initiated by one slave | 55 // change down to all keyboards. If the state change is initiated by one slave |
| 62 // (physical) keyboard, it changes global state but only pushes an indicator | 56 // (physical) keyboard, it changes global state but only pushes an indicator |
| 63 // state change down to that one keyboard. | 57 // state change down to that one keyboard. |
| 64 // This function changes LEDs on all keyboards by explicitly updating the | 58 // This function changes LEDs on all keyboards by explicitly updating the |
| 65 // core/master keyboard. | 59 // core/master keyboard. |
| 66 virtual void ReapplyCurrentModifierLockStatus() = 0; | 60 virtual void ReapplyCurrentModifierLockStatus() = 0; |
| 67 | 61 |
| 68 // Sets the Caps Lock and Num Lock status. Do not call the function from | 62 // Disables the num lock. |
| 69 // non-UI threads. | 63 virtual void DisableNumLock() = 0; |
| 70 virtual void SetLockedModifiers(ModifierLockStatus new_caps_lock_status, | |
| 71 ModifierLockStatus new_num_lock_status) = 0; | |
| 72 | |
| 73 // Sets the num lock status to |enable_num_lock|. Do not call the function | |
| 74 // from non-UI threads. | |
| 75 virtual void SetNumLockEnabled(bool enable_num_lock) = 0; | |
| 76 | 64 |
| 77 // Sets the caps lock status to |enable_caps_lock|. Do not call the function | 65 // Sets the caps lock status to |enable_caps_lock|. Do not call the function |
| 78 // from non-UI threads. | 66 // from non-UI threads. |
| 79 virtual void SetCapsLockEnabled(bool enable_caps_lock) = 0; | 67 virtual void SetCapsLockEnabled(bool enable_caps_lock) = 0; |
| 80 | 68 |
| 81 // Returns true if num lock is enabled. Do not call the function from non-UI | |
| 82 // threads. | |
| 83 virtual bool NumLockIsEnabled() = 0; | |
| 84 | |
| 85 // Returns true if caps lock is enabled. Do not call the function from non-UI | 69 // Returns true if caps lock is enabled. Do not call the function from non-UI |
| 86 // threads. | 70 // threads. |
| 87 virtual bool CapsLockIsEnabled() = 0; | 71 virtual bool CapsLockIsEnabled() = 0; |
| 88 | 72 |
| 89 // Returns a mask (e.g. 1U<<4) for Num Lock. On error, returns 0. Do not call | |
| 90 // the function from non-UI threads. | |
| 91 // TODO(yusukes): Move this and webdriver::GetXModifierMask() functions in | |
| 92 // chrome/test/webdriver/keycode_text_conversion_x.cc to ui/base/x/x11_util. | |
| 93 // The two functions are almost the same. | |
| 94 virtual unsigned int GetNumLockMask() = 0; | |
| 95 | |
| 96 // Set true on |out_caps_lock_enabled| if Caps Lock is enabled. Set true on | |
| 97 // |out_num_lock_enabled| if Num Lock is enabled. Both out parameters can be | |
| 98 // NULL. Do not call the function from non-UI threads. | |
| 99 virtual void GetLockedModifiers(bool* out_caps_lock_enabled, | |
| 100 bool* out_num_lock_enabled) = 0; | |
| 101 | |
| 102 // Turns on and off the auto-repeat of the keyboard. Returns true on success. | 73 // Turns on and off the auto-repeat of the keyboard. Returns true on success. |
| 103 // Do not call the function from non-UI threads. | 74 // Do not call the function from non-UI threads. |
| 104 virtual bool SetAutoRepeatEnabled(bool enabled) = 0; | 75 virtual bool SetAutoRepeatEnabled(bool enabled) = 0; |
| 105 | 76 |
| 106 // Sets the auto-repeat rate of the keyboard, initial delay in ms, and repeat | 77 // Sets the auto-repeat rate of the keyboard, initial delay in ms, and repeat |
| 107 // interval in ms. Returns true on success. Do not call the function from | 78 // interval in ms. Returns true on success. Do not call the function from |
| 108 // non-UI threads. | 79 // non-UI threads. |
| 109 virtual bool SetAutoRepeatRate(const AutoRepeatRate& rate) = 0; | 80 virtual bool SetAutoRepeatRate(const AutoRepeatRate& rate) = 0; |
| 110 | 81 |
| 111 // Returns true if auto repeat is enabled. This function is protected: for | 82 // Returns true if auto repeat is enabled. This function is protected: for |
| (...skipping 11 matching lines...) Expand all Loading... |
| 123 | 94 |
| 124 // Note: At this moment, classes other than InputMethodManager should not | 95 // Note: At this moment, classes other than InputMethodManager should not |
| 125 // instantiate the XKeyboard class. | 96 // instantiate the XKeyboard class. |
| 126 static XKeyboard* Create(); | 97 static XKeyboard* Create(); |
| 127 }; | 98 }; |
| 128 | 99 |
| 129 } // namespace input_method | 100 } // namespace input_method |
| 130 } // namespace chromeos | 101 } // namespace chromeos |
| 131 | 102 |
| 132 #endif // CHROMEOS_IME_XKEYBOARD_H_ | 103 #endif // CHROMEOS_IME_XKEYBOARD_H_ |
| OLD | NEW |