make use of media_use_ffmpeg in BUILD.gn
[chromium-blink-merge.git] / extensions / browser / api / virtual_keyboard_private / virtual_keyboard_delegate.h
blob1258365fbab78cb20f02fc3ad6fa16f21e2ea1f3
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.
5 #ifndef EXTENSIONS_BROWSER_API_VIRTUAL_KEYBOARD_VIRTUAL_KEYBOARD_DELEGATE_H_
6 #define EXTENSIONS_BROWSER_API_VIRTUAL_KEYBOARD_VIRTUAL_KEYBOARD_DELEGATE_H_
8 #include "base/macros.h"
9 #include "base/strings/string16.h"
10 #include "base/values.h"
11 #include "content/public/browser/browser_thread.h"
13 namespace extensions {
15 class VirtualKeyboardDelegate {
16 public:
17 virtual ~VirtualKeyboardDelegate() {}
19 // Fetch information about the preferred configuration of the keyboard. On
20 // exit, |settings| is populated with the keyboard configuration. Returns true
21 // if successful.
22 virtual bool GetKeyboardConfig(base::DictionaryValue* settings) = 0;
24 // Dismiss the virtual keyboard without changing input focus. Returns true if
25 // successful.
26 virtual bool HideKeyboard() = 0;
28 // Insert |text| verbatim into a text area. Returns true if successful.
29 virtual bool InsertText(const base::string16& text) = 0;
31 // Notifiy system that keyboard loading is complete. Used in UMA stats to
32 // track loading performance. Returns true if the notification was handled.
33 virtual bool OnKeyboardLoaded() = 0;
35 // Indicate if settings are accessible and enabled based on current state.
36 // For example, settings should be blocked when the session is locked.
37 virtual bool IsLanguageSettingsEnabled() = 0;
39 // Activate and lock the virtual keyboad on screen or dismiss the keyboard
40 // regardless of the state of text focus. Used in a11y mode to allow typing
41 // hotkeys without the need for text focus. Returns true if successful.
42 virtual bool LockKeyboard(bool state) = 0;
44 // Dispatches a virtual key event. |type| indicates if the event is a keydown
45 // or keyup event. |char_value| is the unicode value for the key. |key_code|
46 // is the code assigned to the key, which is independent of the state of
47 // modifier keys. |key_name| is the standardized w3c name for the key.
48 // |modifiers| indicates which modifier keys are active. Returns true if
49 // successful.
50 virtual bool SendKeyEvent(const std::string& type,
51 int char_value,
52 int key_code,
53 const std::string& key_name,
54 int modifiers) = 0;
56 // Launches the settings app. Returns true if successful.
57 virtual bool ShowLanguageSettings() = 0;
59 // Sets virtual keyboard window mode.
60 virtual bool SetVirtualKeyboardMode(int mode_enum) = 0;
63 } // namespace extensions
65 #endif // EXTENSIONS_BROWSER_API_VIRTUAL_KEYBOARD_VIRTUAL_KEYBOARD_DELEGATE_H_