| Index: ppapi/c/ppb_text_input_controller.h
|
| diff --git a/ppapi/c/ppb_text_input_controller.h b/ppapi/c/ppb_text_input_controller.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..58eab7f49295feadf3f084c75d028c636286678f
|
| --- /dev/null
|
| +++ b/ppapi/c/ppb_text_input_controller.h
|
| @@ -0,0 +1,93 @@
|
| +/* Copyright (c) 2012 The Chromium Authors. All rights reserved.
|
| + * Use of this source code is governed by a BSD-style license that can be
|
| + * found in the LICENSE file.
|
| + */
|
| +
|
| +/* From ppb_text_input_controller.idl modified Sat Jul 27 00:04:53 2013. */
|
| +
|
| +#ifndef PPAPI_C_PPB_TEXT_INPUT_CONTROLLER_H_
|
| +#define PPAPI_C_PPB_TEXT_INPUT_CONTROLLER_H_
|
| +
|
| +#include "ppapi/c/dev/ppb_text_input_dev.h"
|
| +#include "ppapi/c/pp_bool.h"
|
| +#include "ppapi/c/pp_instance.h"
|
| +#include "ppapi/c/pp_macros.h"
|
| +#include "ppapi/c/pp_point.h"
|
| +#include "ppapi/c/pp_rect.h"
|
| +#include "ppapi/c/pp_size.h"
|
| +#include "ppapi/c/pp_stdint.h"
|
| +#include "ppapi/c/pp_var.h"
|
| +
|
| +#define PPB_TEXTINPUTCONTROLLER_INTERFACE_1_0 "PPB_TextInputController;1.0"
|
| +#define PPB_TEXTINPUTCONTROLLER_INTERFACE PPB_TEXTINPUTCONTROLLER_INTERFACE_1_0
|
| +
|
| +/**
|
| + * @file
|
| + * This file defines the <code>PPB_TextInputController</code> interface.
|
| + */
|
| +
|
| +
|
| +/**
|
| + * @addtogroup Interfaces
|
| + * @{
|
| + */
|
| +/**
|
| + * <code>PPB_TextInputController</code> provides a set of functions for giving
|
| + * hints to the browser about the text input status of plugins, and functions
|
| + * for controlling input method editors (IMEs).
|
| + */
|
| +struct PPB_TextInputController_1_0 {
|
| + /**
|
| + * Informs the browser about the current text input mode of the plugin.
|
| + * Typical use of this information in the browser is to properly
|
| + * display/suppress tools for supporting text inputs (such as virtual
|
| + * keyboards in touch screen based devices, or input method editors often
|
| + * used for composing East Asian characters).
|
| + */
|
| + void (*SetTextInputType)(PP_Instance instance, PP_TextInput_Type type);
|
| + /**
|
| + * Informs the browser about the coordinates of the text input caret area.
|
| + * Typical use of this information in the browser is to layout IME windows
|
| + * etc.
|
| + */
|
| + void (*UpdateCaretPosition)(PP_Instance instance,
|
| + const struct PP_Rect* caret);
|
| + /**
|
| + * Cancels the current composition in IME.
|
| + */
|
| + void (*CancelCompositionText)(PP_Instance instance);
|
| + /**
|
| + * Informs the browser about the current text selection and surrounding
|
| + * text. <code>text</code> is a UTF-8 string that contains the current range
|
| + * of text selection in the plugin. <code>caret</code> is the byte-index of
|
| + * the caret position within <code>text</code>. <code>anchor</code> is the
|
| + * byte-index of the anchor position (i.e., if a range of text is selected,
|
| + * it is the other edge of selection different from <code>caret</code>. If
|
| + * there are no selection, <code>anchor</code> is equal to <code>caret</code>.
|
| + *
|
| + * Typical use of this information in the browser is to enable "reconversion"
|
| + * features of IME that puts back the already committed text into the
|
| + * pre-commit composition state. Another use is to improve the precision
|
| + * of suggestion of IME by taking the context into account (e.g., if the caret
|
| + * looks to be on the beginning of a sentence, suggest capital letters in a
|
| + * virtual keyboard).
|
| + *
|
| + * When the focus is not on text, call this function setting <code>text</code>
|
| + * to an empty string and <code>caret</code> and <code>anchor</code> to zero.
|
| + * Also, the plugin should send the empty text when it does not want to reveal
|
| + * the selection to IME (e.g., when the surrounding text is containing
|
| + * password text).
|
| + */
|
| + void (*UpdateSurroundingText)(PP_Instance instance,
|
| + struct PP_Var text,
|
| + uint32_t caret,
|
| + uint32_t anchor);
|
| +};
|
| +
|
| +typedef struct PPB_TextInputController_1_0 PPB_TextInputController;
|
| +/**
|
| + * @}
|
| + */
|
| +
|
| +#endif /* PPAPI_C_PPB_TEXT_INPUT_CONTROLLER_H_ */
|
| +
|
|
|