summaryrefslogtreecommitdiffstats
path: root/chrome/browser/chromeos/cros/keyboard_library.h
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/chromeos/cros/keyboard_library.h')
-rw-r--r--chrome/browser/chromeos/cros/keyboard_library.h35
1 files changed, 23 insertions, 12 deletions
diff --git a/chrome/browser/chromeos/cros/keyboard_library.h b/chrome/browser/chromeos/cros/keyboard_library.h
index 17e1b42..b5f0deb 100644
--- a/chrome/browser/chromeos/cros/keyboard_library.h
+++ b/chrome/browser/chromeos/cros/keyboard_library.h
@@ -4,6 +4,7 @@
#ifndef CHROME_BROWSER_CHROMEOS_CROS_KEYBOARD_LIBRARY_H_
#define CHROME_BROWSER_CHROMEOS_CROS_KEYBOARD_LIBRARY_H_
+#pragma once
#include "cros/chromeos_keyboard.h"
@@ -18,6 +19,9 @@ class KeyboardLibrary {
public:
virtual ~KeyboardLibrary() {}
+ // Returns the hardware layout name like "xkb:us::eng". On error, returns "".
+ virtual std::string GetHardwareKeyboardLayoutName() const = 0;
+
// Returns the current layout name like "us". On error, returns "".
virtual std::string GetCurrentKeyboardLayoutName() const = 0;
@@ -26,6 +30,9 @@ class KeyboardLibrary {
virtual bool SetCurrentKeyboardLayoutByName(
const std::string& layout_name) = 0;
+ // Remaps modifier keys. Returns true on success.
+ virtual bool RemapModifierKeys(const ModifierMap& modifier_map) = 0;
+
// Gets whehter we have separate keyboard layout per window, or not. The
// result is stored in |is_per_window|. Returns true on success.
virtual bool GetKeyboardLayoutPerWindow(bool* is_per_window) const = 0;
@@ -34,21 +41,25 @@ class KeyboardLibrary {
// is given, the same keyboard layout will be shared for all applications.
// Returns true on success.
virtual bool SetKeyboardLayoutPerWindow(bool is_per_window) = 0;
-};
-class KeyboardLibraryImpl : public KeyboardLibrary {
- public:
- KeyboardLibraryImpl() {}
- virtual ~KeyboardLibraryImpl() {}
+ // Gets the current auto-repeat mode of the keyboard. The result is stored in
+ // |enabled|. Returns true on success.
+ virtual bool GetAutoRepeatEnabled(bool* enabled) const = 0;
+
+ // Turns on and off the auto-repeat of the keyboard. Returns true on success.
+ virtual bool SetAutoRepeatEnabled(bool enabled) = 0;
+
+ // Gets the current auto-repeat rate of the keyboard. The result is stored in
+ // |out_rate|. Returns true on success.
+ virtual bool GetAutoRepeatRate(AutoRepeatRate* out_rate) const = 0;
- // KeyboardLibrary overrides.
- virtual std::string GetCurrentKeyboardLayoutName() const;
- virtual bool SetCurrentKeyboardLayoutByName(const std::string& layout_name);
- virtual bool GetKeyboardLayoutPerWindow(bool* is_per_window) const;
- virtual bool SetKeyboardLayoutPerWindow(bool is_per_window);
+ // Sets the auto-repeat rate of the keyboard, initial delay in ms, and repeat
+ // interval in ms. Returns true on success.
+ virtual bool SetAutoRepeatRate(const AutoRepeatRate& rate) = 0;
- private:
- DISALLOW_COPY_AND_ASSIGN(KeyboardLibraryImpl);
+ // Factory function, creates a new instance and returns ownership.
+ // For normal usage, access the singleton via CrosLibrary::Get().
+ static KeyboardLibrary* GetImpl(bool stub);
};
} // namespace chromeos