03991f12fc9c9e397886b3d2f2dc0d4b57eb45db
[profile/ivi/weston-ivi-shell.git] / protocol / input-method.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <protocol name="input_method">
3   <copyright>
4     Copyright © 2012 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="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     </description>
37     <request name="destroy" type="destructor"/>
38     <request name="commit_string">
39       <description summary="commit string">
40         Send the commit string text to the applications text model.
41       </description>
42       <arg name="serial" type="uint"/>
43       <arg name="text" type="string"/>
44       <arg name="index" type="uint"/>
45     </request>
46     <request name="preedit_string">
47       <description summary="pre-edit string">
48         Send the pre-edit string text to the applications text model.
49       </description>
50       <arg name="serial" type="uint"/>
51       <arg name="text" type="string"/>
52       <arg name="commit" type="string"/>
53     </request>
54     <request name="preedit_styling">
55       <arg name="serial" type="uint"/>
56       <arg name="index" type="uint"/>
57       <arg name="length" type="uint"/>
58       <arg name="style" type="uint"/>
59     </request>
60     <request name="preedit_cursor">
61       <description summary="pre-edit cursor">
62         Sets the cursor position inside the composing text (as byte index)
63         relative to the start of the composing text.
64       </description>
65       <arg name="serial" type="uint"/>
66       <arg name="index" type="int"/>
67     </request>
68     <request name="delete_surrounding_text">
69       <arg name="serial" type="uint"/>
70       <arg name="index" type="int"/>
71       <arg name="length" type="uint"/>
72     </request>
73     <request name="modifiers_map">
74       <arg name="map" type="array"/>
75     </request>
76     <request name="keysym">
77       <description summary="keysym">
78         Notify when a key event was sent. Key events should not be used
79         for normal text input operations, which should be done with
80         commit_string, delete_surrounfing_text, etc. The key event follows
81         the wl_keyboard key event convention. State is a XKB keysym, state a
82         wl_keyboard key_state.
83       </description>
84       <arg name="serial" type="uint"/>
85       <arg name="time" type="uint"/>
86       <arg name="sym" type="uint"/>
87       <arg name="state" type="uint"/>
88       <arg name="modifiers" type="uint"/>
89     </request>
90     <request name="grab_keyboard">
91       <description summary="grab hardware keyboard">
92         Allows an input method to receive hardware keyboard input and process
93         key events to generate text events (with pre-edit) over the. This allows
94         input methods which compose multiple key events for inputting text
95         like it is done for CJK languages.
96       </description>
97        <arg name="keyboard" type="new_id" interface="wl_keyboard"/>
98     </request>
99     <request name="key">
100       <arg name="serial" type="uint"/>
101       <arg name="time" type="uint"/>
102       <arg name="key" type="uint"/>
103       <arg name="state" type="uint"/>
104     </request>
105     <request name="modifiers">
106       <arg name="serial" type="uint"/>
107       <arg name="mods_depressed" type="uint"/>
108       <arg name="mods_latched" type="uint"/>
109       <arg name="mods_locked" type="uint"/>
110       <arg name="group" type="uint"/>
111     </request>
112     <event name="surrounding_text">
113       <description summary="surrounding text event">
114         The plain surrounding text around the input position. Cursor is the
115         position within the surrounding text. Anchor is the position of the
116         selection anchor within the surrounding text. If there is no selected
117         text anchor is the same as cursor.
118       </description>
119       <arg name="text" type="string"/>
120       <arg name="cursor" type="uint"/>
121       <arg name="anchor" type="uint"/>
122     </event>
123     <event name="reset">
124       <arg name="serial" type="uint"/>
125     </event>
126   </interface>
127
128   <interface name="input_method" version="1">
129     <description summary="input method">
130       An input method object is responsible to compose text in response to
131       input from hardware or virtual keyboards. There is one input method
132       object per seat. On activate there is a new input method context object
133       created which allows the input method to communicate with the text model.
134     </description>
135     <event name="activate">
136       <description summary="activate event">
137         A text model was activated. Creates an input method context object
138         which allows communication with the text model.
139       </description>
140       <arg name="id" type="new_id" interface="input_method_context"/>
141       <arg name="serial" type="uint"/>
142     </event>
143     <event name="deactivate">
144       <description summary="activate event">
145         The text model corresponding to the context argument was deactivated.
146         The input method context should be destroyed after deactivation is
147         handled.
148       </description>
149       <arg name="context" type="object" interface="input_method_context"/>
150     </event>
151   </interface>
152 </protocol>