| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_ENGINE_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_ENGINE_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_ENGINE_H_ | 6 #define CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_ENGINE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 namespace chromeos { | 12 namespace chromeos { |
| 13 | 13 |
| 14 namespace input_method { | 14 namespace input_method { |
| 15 struct KeyEventHandle; | 15 struct KeyEventHandle; |
| 16 } // namespace input_method | 16 } // namespace input_method |
| 17 | 17 |
| 18 extern const char* kExtensionImePrefix; | 18 extern const char* kExtensionImePrefix; |
| 19 | 19 |
| 20 // InputMethodEngine is used to translate from the Chrome IME API to the native | 20 // InputMethodEngine is used to translate from the Chrome IME API to the native |
| 21 // API. | 21 // API. |
| 22 class InputMethodEngine { | 22 class InputMethodEngine { |
| 23 public: | 23 public: |
| 24 struct KeyboardEvent { | 24 struct KeyboardEvent { |
| 25 KeyboardEvent(); | 25 KeyboardEvent(); |
| 26 virtual ~KeyboardEvent(); | 26 virtual ~KeyboardEvent(); |
| 27 | 27 |
| 28 std::string type; | 28 std::string type; |
| 29 std::string key; | 29 std::string key; |
| 30 std::string key_code; | |
| 31 bool alt_key; | 30 bool alt_key; |
| 32 bool ctrl_key; | 31 bool ctrl_key; |
| 33 bool shift_key; | 32 bool shift_key; |
| 34 }; | 33 }; |
| 35 | 34 |
| 36 enum { | 35 enum { |
| 37 MENU_ITEM_MODIFIED_LABEL = 0x0001, | 36 MENU_ITEM_MODIFIED_LABEL = 0x0001, |
| 38 MENU_ITEM_MODIFIED_STYLE = 0x0002, | 37 MENU_ITEM_MODIFIED_STYLE = 0x0002, |
| 39 MENU_ITEM_MODIFIED_VISIBLE = 0x0004, | 38 MENU_ITEM_MODIFIED_VISIBLE = 0x0004, |
| 40 MENU_ITEM_MODIFIED_ENABLED = 0x0008, | 39 MENU_ITEM_MODIFIED_ENABLED = 0x0008, |
| 41 MENU_ITEM_MODIFIED_CHECKED = 0x0010, | 40 MENU_ITEM_MODIFIED_CHECKED = 0x0010, |
| 42 MENU_ITEM_MODIFIED_ICON = 0x0020, | 41 MENU_ITEM_MODIFIED_ICON = 0x0020, |
| 43 MENU_ITEM_MODIFIED_SHORTCUT_KEY = 0x0040, | |
| 44 }; | 42 }; |
| 45 | 43 |
| 46 enum MenuItemStyle { | 44 enum MenuItemStyle { |
| 47 MENU_ITEM_STYLE_NONE, | 45 MENU_ITEM_STYLE_NONE, |
| 48 MENU_ITEM_STYLE_CHECK, | 46 MENU_ITEM_STYLE_CHECK, |
| 49 MENU_ITEM_STYLE_RADIO, | 47 MENU_ITEM_STYLE_RADIO, |
| 50 MENU_ITEM_STYLE_SEPARATOR, | 48 MENU_ITEM_STYLE_SEPARATOR, |
| 51 }; | 49 }; |
| 52 | 50 |
| 53 enum MouseButtonEvent { | 51 enum MouseButtonEvent { |
| (...skipping 10 matching lines...) Expand all Loading... |
| 64 struct MenuItem { | 62 struct MenuItem { |
| 65 MenuItem(); | 63 MenuItem(); |
| 66 virtual ~MenuItem(); | 64 virtual ~MenuItem(); |
| 67 | 65 |
| 68 std::string id; | 66 std::string id; |
| 69 std::string label; | 67 std::string label; |
| 70 MenuItemStyle style; | 68 MenuItemStyle style; |
| 71 bool visible; | 69 bool visible; |
| 72 bool enabled; | 70 bool enabled; |
| 73 bool checked; | 71 bool checked; |
| 74 std::string icon; | |
| 75 KeyboardEvent shortcut_key; | |
| 76 | 72 |
| 77 unsigned int modified; | 73 unsigned int modified; |
| 78 std::vector<MenuItem> children; | 74 std::vector<MenuItem> children; |
| 79 }; | 75 }; |
| 80 | 76 |
| 81 struct InputContext { | 77 struct InputContext { |
| 82 int id; | 78 int id; |
| 83 std::string type; | 79 std::string type; |
| 84 }; | 80 }; |
| 85 | 81 |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 | 192 |
| 197 // Create an IME engine. | 193 // Create an IME engine. |
| 198 static InputMethodEngine* CreateEngine( | 194 static InputMethodEngine* CreateEngine( |
| 199 InputMethodEngine::Observer* observer, | 195 InputMethodEngine::Observer* observer, |
| 200 const char* engine_name, | 196 const char* engine_name, |
| 201 const char* extension_id, | 197 const char* extension_id, |
| 202 const char* engine_id, | 198 const char* engine_id, |
| 203 const char* description, | 199 const char* description, |
| 204 const char* language, | 200 const char* language, |
| 205 const std::vector<std::string>& layouts, | 201 const std::vector<std::string>& layouts, |
| 206 KeyboardEvent& shortcut_key, | |
| 207 std::string* error); | 202 std::string* error); |
| 208 }; | 203 }; |
| 209 | 204 |
| 210 } // namespace chromeos | 205 } // namespace chromeos |
| 211 | 206 |
| 212 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_ENGINE_H_ | 207 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_ENGINE_H_ |
| OLD | NEW |