OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_IME_INPUT_H_ | 5 #ifndef CHROME_BROWSER_IME_INPUT_H_ |
6 #define CHROME_BROWSER_IME_INPUT_H_ | 6 #define CHROME_BROWSER_IME_INPUT_H_ |
7 | 7 |
8 #include <windows.h> | 8 #include <windows.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
11 | 11 |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 | 228 |
229 // Disable the IME attached to the given window, i.e. prohibits any user-input | 229 // Disable the IME attached to the given window, i.e. prohibits any user-input |
230 // events from being dispatched to the IME. | 230 // events from being dispatched to the IME. |
231 // In Chrome, this function is used when: | 231 // In Chrome, this function is used when: |
232 // * a renreder process sets its input focus to a password input. | 232 // * a renreder process sets its input focus to a password input. |
233 // Parameters | 233 // Parameters |
234 // * window_handle [in] (HWND) | 234 // * window_handle [in] (HWND) |
235 // Represents the window handle of the caller. | 235 // Represents the window handle of the caller. |
236 void DisableIME(HWND window_handle); | 236 void DisableIME(HWND window_handle); |
237 | 237 |
| 238 // Cancels an ongoing composition of the IME attached to the given window. |
| 239 // Parameters |
| 240 // * window_handle [in] (HWND) |
| 241 // Represents the window handle of the caller. |
| 242 void CancelIME(HWND window_handle); |
| 243 |
238 protected: | 244 protected: |
239 // Determines whether or not the given attribute represents a target | 245 // Determines whether or not the given attribute represents a target |
240 // (a.k.a. a selection). | 246 // (a.k.a. a selection). |
241 bool IsTargetAttribute(char attribute) const { | 247 bool IsTargetAttribute(char attribute) const { |
242 return (attribute == ATTR_TARGET_CONVERTED || | 248 return (attribute == ATTR_TARGET_CONVERTED || |
243 attribute == ATTR_TARGET_NOTCONVERTED); | 249 attribute == ATTR_TARGET_NOTCONVERTED); |
244 } | 250 } |
245 | 251 |
246 // Retrieve the target area. | 252 // Retrieve the target area. |
247 void GetCaret(HIMC imm_context, LPARAM lparam, | 253 void GetCaret(HIMC imm_context, LPARAM lparam, |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 | 299 |
294 // Represents whether or not the current input context has created a system | 300 // Represents whether or not the current input context has created a system |
295 // caret to set the position of its IME candidate window. | 301 // caret to set the position of its IME candidate window. |
296 // * true: it creates a system caret. | 302 // * true: it creates a system caret. |
297 // * false: it does not create a system caret. | 303 // * false: it does not create a system caret. |
298 bool system_caret_; | 304 bool system_caret_; |
299 | 305 |
300 // The rectangle of the input caret retrieved from a renderer process. | 306 // The rectangle of the input caret retrieved from a renderer process. |
301 gfx::Rect caret_rect_; | 307 gfx::Rect caret_rect_; |
302 | 308 |
303 DISALLOW_EVIL_CONSTRUCTORS(ImeInput); | 309 DISALLOW_COPY_AND_ASSIGN(ImeInput); |
304 }; | 310 }; |
305 | 311 |
306 #endif // CHROME_BROWSER_IME_INPUT_H_ | 312 #endif // CHROME_BROWSER_IME_INPUT_H_ |
OLD | NEW |