Support Tizen 3.0
[profile/ivi/ico-uxf-weston-plugin.git] / protocol / input-method.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <protocol name="input_method">
3   <copyright>
4     Copyright © 2012, 2013 Intel Corporation
5
6     Permission to use, copy, modify, distribute, and sell this
7     software and its documentation for any purpose is hereby granted
8     without fee, provided that the above copyright notice appear in
9     all copies and that both that copyright notice and this permission
10     notice appear in supporting documentation, and that the name of
11     the copyright holders not be used in advertising or publicity
12     pertaining to distribution of the software without specific,
13     written prior permission.  The copyright holders make no
14     representations about the suitability of this software for any
15     purpose.  It is provided "as is" without express or implied
16     warranty.
17
18     THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
19     SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
20     FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
21     SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
22     WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
23     AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
24     ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
25     THIS SOFTWARE.
26   </copyright>
27
28
29   <interface name="wl_input_method_context" version="1">
30     <description summary="input method context">
31       Corresponds to a text model on input method side. An input method context
32       is created on text mode activation on the input method side. It allows to
33       receive information about the text model from the application via events.
34       Input method contexts do not keep state after deactivation and should be
35       destroyed after deactivation is handled.
36
37       Text is generally UTF-8 encoded, indices and lengths are in bytes.
38
39       Serials are used to synchronize the state between the text input and
40       an input method. New serials are sent by the text input in the
41       commit_state request and are used by the input method to indicate
42       the known text input state in events like preedit_string, commit_string,
43       and keysym. The text input can then ignore events from the input method
44       which are based on an outdated state (for example after a reset).
45     </description>
46     <request name="destroy" type="destructor"/>
47     <request name="commit_string">
48       <description summary="commit string">
49         Send the commit string text for insertion to the application.
50
51         The text to commit could be either just a single character after a key
52         press or the result of some composing (pre-edit). It could be also an
53         empty text when some text should be removed (see
54         delete_surrounding_text) or when the input cursor should be moved (see
55         cursor_position).
56
57         Any previously set composing text will be removed.
58       </description>
59       <arg name="serial" type="uint" summary="serial of the latest known text input state"/>
60       <arg name="text" type="string"/>
61     </request>
62     <request name="preedit_string">
63       <description summary="pre-edit string">
64         Send the pre-edit string text to the application text input.
65
66         The commit text can be used to replace the preedit text on reset (for
67         example on unfocus).
68
69         Also previously sent preedit_style and preedit_cursor requests are
70         processed bt the text_input also.
71       </description>
72       <arg name="serial" type="uint" summary="serial of the latest known text input state"/>
73       <arg name="text" type="string"/>
74       <arg name="commit" type="string"/>
75     </request>
76     <request name="preedit_styling">
77       <description summary="pre-edit styling">
78         Sets styling information on composing text. The style is applied for
79         length in bytes from index relative to the beginning of
80         the composing text (as byte offset). Multiple styles can
81         be applied to a composing text.
82
83         This request should be sent before sending preedit_string request.
84       </description>
85       <arg name="index" type="uint"/>
86       <arg name="length" type="uint"/>
87       <arg name="style" type="uint"/>
88     </request>
89     <request name="preedit_cursor">
90       <description summary="pre-edit cursor">
91         Sets the cursor position inside the composing text (as byte offset)
92         relative to the start of the composing text.
93
94         When index is negative no cursor should be displayed.
95
96         This request should be sent before sending preedit_string request.
97       </description>
98       <arg name="index" type="int"/>
99     </request>
100     <request name="delete_surrounding_text">
101       <description summary="delete text">
102
103
104         This request will be handled on text_input side as part of a directly
105         following commit_string request.
106       </description>
107       <arg name="index" type="int"/>
108       <arg name="length" type="uint"/>
109     </request>
110     <request name="cursor_position">
111       <description summary="set cursor to a new position">
112         Sets the cursor and anchor to a new position. Index is the new cursor
113         position in bytess (when >= 0 relative to the end of inserted text
114         else relative to beginning of inserted text). Anchor is the new anchor
115         position in bytes (when >= 0 relative to the end of inserted text, else
116         relative to beginning of inserted text). When there should be no
117         selected text anchor should be the same as index.
118
119         This request will be handled on text_input side as part of a directly
120         following commit_string request.
121       </description>
122       <arg name="index" type="int"/>
123       <arg name="anchor" type="int"/>
124     </request>
125     <request name="modifiers_map">
126       <arg name="map" type="array"/>
127     </request>
128     <request name="keysym">
129       <description summary="keysym">
130         Notify when a key event was sent. Key events should not be used for
131         normal text input operations, which should be done with commit_string,
132         delete_surrounfing_text, etc. The key event follows the wl_keyboard key
133         event convention. Sym is a XKB keysym, state a wl_keyboard key_state.
134       </description>
135       <arg name="serial" type="uint" summary="serial of the latest known text input state"/>
136       <arg name="time" type="uint"/>
137       <arg name="sym" type="uint"/>
138       <arg name="state" type="uint"/>
139       <arg name="modifiers" type="uint"/>
140     </request>
141     <request name="grab_keyboard">
142       <description summary="grab hardware keyboard">
143         Allows an input method to receive hardware keyboard input and process
144         key events to generate text events (with pre-edit) over the wire. This
145         allows input methods which compose multiple key events for inputting
146         text like it is done for CJK languages.
147       </description>
148        <arg name="keyboard" type="new_id" interface="wl_keyboard"/>
149     </request>
150     <request name="key">
151       <description summary="forward key event">
152         Should be used when filtering key events with grab_keyboard.
153
154         When the wl_keyboard::key event is not processed by the input
155         method itself and should be sent to the client instead, forward it
156         with this request. The arguments should be the ones from the
157         wl_keyboard::key event.
158
159         For generating custom key events use the keysym request instead.
160       </description>
161       <arg name="serial" type="uint" summary="serial from wl_keyboard::key"/>
162       <arg name="time" type="uint" summary="time from wl_keyboard::key"/>
163       <arg name="key" type="uint" summary="key from wl_keyboard::key"/>
164       <arg name="state" type="uint" summary="state from wl_keyboard::key"/>
165     </request>
166     <request name="modifiers">
167       <description summary="forward modifiers event">
168         Should be used when filtering key events with grab_keyboard.
169
170         When the wl_keyboard::modifiers event should be also send to the
171         client, forward it with this request. The arguments should be the ones
172         from the wl_keyboard::modifiers event.
173       </description>
174       <arg name="serial" type="uint" summary="serial from wl_keyboard::modifiers"/>
175       <arg name="mods_depressed" type="uint" summary="mods_depressed from wl_keyboard::modifiers"/>
176       <arg name="mods_latched" type="uint" summary="mods_latched from wl_keyboard::modifiers"/>
177       <arg name="mods_locked" type="uint" summary="mods_locked from wl_keyboard::modifiers"/>
178       <arg name="group" type="uint" summary="group from wl_keyboard::modifiers"/>
179     </request>
180     <request name="language">
181       <arg name="serial" type="uint" summary="serial of the latest known text input state"/>
182       <arg name="language" type="string"/>
183     </request>
184     <request name="text_direction">
185       <arg name="serial" type="uint" summary="serial of the latest known text input state"/>
186       <arg name="direction" type="uint"/>
187     </request>
188     <event name="surrounding_text">
189       <description summary="surrounding text event">
190         The plain surrounding text around the input position. Cursor is the
191         position in bytes within the surrounding text relative to the beginning
192         of the text. Anchor is the position in bytes of the selection anchor
193         within the surrounding text relative to the beginning of the text. If
194         there is no selected text anchor is the same as cursor.
195       </description>
196       <arg name="text" type="string"/>
197       <arg name="cursor" type="uint"/>
198       <arg name="anchor" type="uint"/>
199     </event>
200     <event name="reset">
201     </event>
202     <event name="content_type">
203       <arg name="hint" type="uint"/>
204       <arg name="purpose" type="uint"/>
205     </event>
206     <event name="invoke_action">
207       <arg name="button" type="uint"/>
208       <arg name="index" type="uint"/>
209     </event>
210     <event name="commit_state">
211       <arg name="serial" type="uint" summary="serial of text input state"/>
212     </event>
213     <event name="preferred_language">
214       <arg name="language" type="string"/>
215     </event>
216   </interface>
217
218   <interface name="wl_input_method" version="1">
219     <description summary="input method">
220       An input method object is responsible to compose text in response to
221       input from hardware or virtual keyboards. There is one input method
222       object per seat. On activate there is a new input method context object
223       created which allows the input method to communicate with the text model.
224     </description>
225     <event name="activate">
226       <description summary="activate event">
227         A text model was activated. Creates an input method context object
228         which allows communication with the text model.
229       </description>
230       <arg name="id" type="new_id" interface="wl_input_method_context"/>
231     </event>
232     <event name="deactivate">
233       <description summary="activate event">
234         The text model corresponding to the context argument was deactivated.
235         The input method context should be destroyed after deactivation is
236         handled.
237       </description>
238       <arg name="context" type="object" interface="wl_input_method_context"/>
239     </event>
240   </interface>
241
242   <interface name="wl_input_panel" version="1">
243     <description summary="interface for implementing keyboards">
244       Only one client can bind this interface at a time.
245     </description>
246
247     <request name="get_input_panel_surface">
248       <arg name="id" type="new_id" interface="wl_input_panel_surface"/>
249       <arg name="surface" type="object" interface="wl_surface"/>
250     </request>
251   </interface>
252
253   <interface name="wl_input_panel_surface" version="1">
254     <enum name="position">
255       <entry name="center_bottom" value="0"/>
256     </enum>
257
258     <request name="set_toplevel">
259       <description summary="set the surface type as a keyboard">
260         A keybaord surface is only shown, when a text model is active
261       </description>
262       <arg name="output" type="object" interface="wl_output"/>
263       <arg name="position" type="uint"/>
264     </request>
265
266     <request name="set_overlay_panel">
267       <description summary="set the surface type as an overlay panel">
268         An overlay panel is shown near the input cursor above the application
269         window when a text model is active.
270       </description>
271     </request>
272   </interface>
273 </protocol>