text: Add support for control keys to the protocol
[profile/ivi/weston.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="text" type="string"/>
43       <arg name="index" type="uint"/>
44     </request>
45     <request name="preedit_string">
46       <description summary="pre-edit string">
47         Send the pre-edit string text to the applications text model.
48       </description>
49       <arg name="text" type="string"/>
50       <arg name="index" type="uint"/>
51     </request>
52     <request name="delete_surrounding_text">
53       <arg name="index" type="int"/>
54       <arg name="length" type="uint"/>
55     </request>
56     <request name="key">
57       <arg name="key" type="uint"/>
58       <arg name="state" type="uint"/>
59     </request>
60     <event name="surrounding_text">
61       <description summary="surrounding text event">
62         The plain surrounding text around the input position. Cursor is the
63         position within the surrounding text. Anchor is the position of the
64         selection anchor within the surrounding text. If there is no selected
65         text anchor is the same as cursor.
66       </description>
67       <arg name="text" type="string"/>
68       <arg name="cursor" type="uint"/>
69       <arg name="anchor" type="uint"/>
70     </event>
71   </interface>
72
73   <interface name="input_method" version="1">
74     <description summary="input method">
75       An input method object is responsible to compose text in response to
76       input from hardware or virtual keyboards. There is one input method
77       object per seat. On activate there is a new input method context object
78       created which allows the input method to communicate with the text model.
79     </description>
80     <event name="activate">
81       <description summary="activate event">
82         A text model was activated. Creates an input method context object
83         which allows communication with the text model.
84       </description>
85       <arg name="id" type="new_id" interface="input_method_context"/>
86     </event>
87     <event name="deactivate">
88       <description summary="activate event">
89         The text model corresponding to the context argument was deactivated.
90         The input method context should be destroyed after deactivation is
91         handled.
92       </description>
93       <arg name="context" type="object" interface="input_method_context"/>
94     </event>
95   </interface>
96 </protocol>