Chromium Code Reviews| 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 CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_ENGINE_INTERFACE_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_ENGINE_INTERFACE_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_ENGINE_INTERFACE_H_ | 6 #define CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_ENGINE_INTERFACE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 165 const std::string& text, | 165 const std::string& text, |
| 166 int cursor_pos, | 166 int cursor_pos, |
| 167 int anchor_pos) = 0; | 167 int anchor_pos) = 0; |
| 168 | 168 |
| 169 // Called when Chrome terminates on-going text input session. | 169 // Called when Chrome terminates on-going text input session. |
| 170 virtual void OnReset(const std::string& engine_id) = 0; | 170 virtual void OnReset(const std::string& engine_id) = 0; |
| 171 }; | 171 }; |
| 172 | 172 |
| 173 virtual ~InputMethodEngineInterface() {} | 173 virtual ~InputMethodEngineInterface() {} |
| 174 | 174 |
| 175 virtual const input_method::InputMethodDescriptor& GetDescriptor() const = 0; | |
| 176 | |
| 177 // Called when the input metho initialization is done. | |
| 178 virtual void NotifyImeReady() = 0; | |
| 179 | |
| 180 // Set the current composition and associated properties. | 175 // Set the current composition and associated properties. |
| 181 virtual bool SetComposition(int context_id, | 176 virtual bool SetComposition(int context_id, |
| 182 const char* text, | 177 const char* text, |
| 183 int selection_start, | 178 int selection_start, |
| 184 int selection_end, | 179 int selection_end, |
| 185 int cursor, | 180 int cursor, |
| 186 const std::vector<SegmentInfo>& segments, | 181 const std::vector<SegmentInfo>& segments, |
| 187 std::string* error) = 0; | 182 std::string* error) = 0; |
| 188 | 183 |
| 189 // Clear the current composition. | 184 // Clear the current composition. |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 224 // Set the list of items that appears in the language menu when this IME is | 219 // Set the list of items that appears in the language menu when this IME is |
| 225 // active. | 220 // active. |
| 226 virtual bool SetMenuItems(const std::vector<MenuItem>& items) = 0; | 221 virtual bool SetMenuItems(const std::vector<MenuItem>& items) = 0; |
| 227 | 222 |
| 228 // Update the state of the menu items. | 223 // Update the state of the menu items. |
| 229 virtual bool UpdateMenuItems(const std::vector<MenuItem>& items) = 0; | 224 virtual bool UpdateMenuItems(const std::vector<MenuItem>& items) = 0; |
| 230 | 225 |
| 231 // Returns true if this IME is active, false if not. | 226 // Returns true if this IME is active, false if not. |
| 232 virtual bool IsActive() const = 0; | 227 virtual bool IsActive() const = 0; |
| 233 | 228 |
| 229 // Returns the current active engine id. | |
|
Yuki
2014/08/06 04:42:23
s/engine/component/ at least.
Better to mention to
Shu Chen
2014/08/06 05:45:03
Done.
| |
| 230 virtual const std::string& GetActiveComponentId() const = 0; | |
| 231 | |
| 234 // Deletes |number_of_chars| unicode characters as the basis of |offset| from | 232 // Deletes |number_of_chars| unicode characters as the basis of |offset| from |
| 235 // the surrounding text. The |offset| is relative position based on current | 233 // the surrounding text. The |offset| is relative position based on current |
| 236 // caret. | 234 // caret. |
| 237 // NOTE: Currently we are falling back to backspace forwarding workaround, | 235 // NOTE: Currently we are falling back to backspace forwarding workaround, |
| 238 // because delete_surrounding_text is not supported in Chrome. So this | 236 // because delete_surrounding_text is not supported in Chrome. So this |
| 239 // function is restricted for only preceding text. | 237 // function is restricted for only preceding text. |
| 240 // TODO(nona): Support full spec delete surrounding text. | 238 // TODO(nona): Support full spec delete surrounding text. |
| 241 virtual bool DeleteSurroundingText(int context_id, | 239 virtual bool DeleteSurroundingText(int context_id, |
| 242 int offset, | 240 int offset, |
| 243 size_t number_of_chars, | 241 size_t number_of_chars, |
| 244 std::string* error) = 0; | 242 std::string* error) = 0; |
| 245 | 243 |
| 246 // Hides the input view window (from API call). | 244 // Hides the input view window (from API call). |
| 247 virtual void HideInputView() = 0; | 245 virtual void HideInputView() = 0; |
| 248 }; | 246 }; |
| 249 | 247 |
| 250 } // namespace chromeos | 248 } // namespace chromeos |
| 251 | 249 |
| 252 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_ENGINE_INTERFACE_H_ | 250 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_ENGINE_INTERFACE_H_ |
| OLD | NEW |