Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(12)

Side by Side Diff: ppapi/c/ppb_text_input_controller.h

Issue 18671004: PPAPI: Move IMEInputEvent and TextInput to stable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nitpick Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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
3 * found in the LICENSE file.
4 */
5
6 /* From ppb_text_input_controller.idl modified Thu Jul 25 23:55:41 2013. */
7
8 #ifndef PPAPI_C_PPB_TEXT_INPUT_CONTROLLER_H_
9 #define PPAPI_C_PPB_TEXT_INPUT_CONTROLLER_H_
10
11 #include "ppapi/c/dev/ppb_text_input_dev.h"
12 #include "ppapi/c/pp_instance.h"
13 #include "ppapi/c/pp_macros.h"
14 #include "ppapi/c/pp_point.h"
15 #include "ppapi/c/pp_rect.h"
16 #include "ppapi/c/pp_size.h"
17 #include "ppapi/c/pp_stdint.h"
18
19 #define PPB_TEXTINPUTCONTROLLER_INTERFACE_1_0 "PPB_TextInputController;1.0"
20 #define PPB_TEXTINPUTCONTROLLER_INTERFACE PPB_TEXTINPUTCONTROLLER_INTERFACE_1_0
21
22 /**
23 * @file
24 * This file defines the <code>PPB_TextInputController</code> interface.
25 */
26
27
28 /**
29 * @addtogroup Interfaces
30 * @{
31 */
32 /**
33 * <code>PPB_TextInputController</code> provides a set of functions for giving
34 * hints to the browser about the text input status of plugins, and functions
35 * for controlling input method editors (IMEs).
36 */
37 struct PPB_TextInputController_1_0 {
38 /**
39 * Informs the browser about the current text input mode of the plugin.
40 * Typical use of this information in the browser is to properly
41 * display/suppress tools for supporting text inputs (such as virtual
42 * keyboards in touch screen based devices, or input method editors often
43 * used for composing East Asian characters).
44 */
45 void (*SetTextInputType)(PP_Instance instance, PP_TextInput_Type type);
46 /**
47 * Informs the browser about the coordinates of the text input caret area.
48 * Typical use of this information in the browser is to layout IME windows
49 * etc.
50 */
51 void (*UpdateCaretPosition)(PP_Instance instance,
52 const struct PP_Rect* caret);
53 /**
54 * Cancels the current composition in IME.
55 */
56 void (*CancelCompositionText)(PP_Instance instance);
57 /**
58 * Informs the browser about the current text selection and surrounding
59 * text. <code>text</code> is a UTF-8 string that contains the current range
60 * of text selection in the plugin. <code>caret</code> is the byte-index of
61 * the caret position within <code>text</code>. <code>anchor</code> is the
62 * byte-index of the anchor position (i.e., if a range of text is selected,
63 * it is the other edge of selection different from <code>caret</code>. If
64 * there are no selection, <code>anchor</code> is equal to <code>caret</code>.
65 *
66 * Typical use of this information in the browser is to enable "reconversion"
67 * features of IME that puts back the already committed text into the
68 * pre-commit composition state. Another use is to improve the precision
69 * of suggestion of IME by taking the context into account (e.g., if the caret
70 * looks to be on the beginning of a sentence, suggest capital letters in a
71 * virtual keyboard).
72 *
73 * When the focus is not on text, call this function setting <code>text</code>
74 * to an empty string and <code>caret</code> and <code>anchor</code> to zero.
75 * Also, the plugin should send the empty text when it does not want to reveal
76 * the selection to IME (e.g., when the surrounding text is containing
77 * password text).
78 */
79 void (*UpdateSurroundingText)(PP_Instance instance,
80 const char* text,
81 uint32_t caret,
82 uint32_t anchor);
83 };
84
85 typedef struct PPB_TextInputController_1_0 PPB_TextInputController;
86 /**
87 * @}
88 */
89
90 #endif /* PPAPI_C_PPB_TEXT_INPUT_CONTROLLER_H_ */
91
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698