text: Add support for control keys to the protocol
[profile/ivi/weston.git] / protocol / text.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <protocol name="text">
3
4   <copyright>
5     Copyright © 2012 Intel Corporation
6
7     Permission to use, copy, modify, distribute, and sell this
8     software and its documentation for any purpose is hereby granted
9     without fee, provided that the above copyright notice appear in
10     all copies and that both that copyright notice and this permission
11     notice appear in supporting documentation, and that the name of
12     the copyright holders not be used in advertising or publicity
13     pertaining to distribution of the software without specific,
14     written prior permission.  The copyright holders make no
15     representations about the suitability of this software for any
16     purpose.  It is provided "as is" without express or implied
17     warranty.
18
19     THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
20     SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
21     FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
22     SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
23     WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
24     AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
25     ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
26     THIS SOFTWARE.
27   </copyright>
28
29   <interface name="text_model" version="1">
30     <description summary="text model">
31       A model for text input. Adds support for text input and input methods to
32       applications. A text_model object is created from a text_model_factory and
33       corresponds typically to a text entry in an application. Requests are used
34       to activate/deactivate the model and set information like surrounding and
35       selected text or the content type. The information about entered text is
36       sent to the model via the pre-edit and commit events. Using this interface
37       removes the need for applications to directly process hardware key events
38       and compose text out of them.
39     </description>
40     <request name="set_surrounding_text">
41       <description summary="sets the surrounding text">
42         Sets the plain surrounding text around the input position. Cursor is the
43         position within the surrounding text. Anchor is the position of the
44         selection anchor within the surrounding text. If there is no selected
45         text anchor is the same as cursor.
46       </description>
47       <arg name="text" type="string"/>
48       <arg name="cursor" type="uint"/>
49       <arg name="anchor" type="uint"/>
50     </request>
51     <request name="activate">
52       <description summary="request activation">
53         Requests the model to be activated (typically when the text entry gets
54         focus). The seat argument is a wl_seat which maintains the focus for
55         this activation. The surface argument is a wl_surface assigned to the
56         model and tracked for focus lost. The activated event is emitted on
57         successful activation.
58       </description>
59       <arg name="seat" type="object" interface="wl_seat"/>
60       <arg name="surface" type="object" interface="wl_surface"/>
61     </request>
62     <request name="deactivate">
63       <description summary="request deactivation">
64         Requests the model to be deactivated (typically when the text entry
65         lost focus). The seat argument is a wl_seat which was used for
66         activation.
67       </description>
68       <arg name="seat" type="object" interface="wl_seat"/>
69     </request>
70     <request name="set_micro_focus">
71       <arg name="x" type="int"/>
72       <arg name="y" type="int"/>
73       <arg name="width" type="int"/>
74       <arg name="height" type="int"/>
75     </request>
76     <request name="set_preedit"/>
77     <request name="set_content_type"/>
78
79     <event name="commit_string">
80       <arg name="text" type="string"/>
81       <arg name="index" type="uint"/>
82     </event>
83     <event name="preedit_string">
84       <arg name="text" type="string"/>
85       <arg name="index" type="uint"/>
86     </event>
87     <event name="delete_surrounding_text">
88       <arg name="index" type="int"/>
89       <arg name="length" type="uint"/>
90     </event>
91     <event name="preedit_styling"/>
92     <event name="key">
93       <arg name="key" type="uint"/>
94       <arg name="state" type="uint"/>
95     </event>
96     <event name="selection_replacement"/>
97     <event name="direction"/>
98     <event name="locale"/>
99     <event name="activated">
100       <description summary="activated event">
101         Notify the model when it is activated. Typically in response to an
102         activate request.
103       </description>
104     </event>
105     <event name="deactivated">
106       <description summary="deactivated event">
107         Notify the model when it is deactivated. Either in response to a
108         deactivate request or when the assigned surface lost focus or was
109         destroyed.
110       </description>
111     </event>
112   </interface>
113
114   <interface name="text_model_factory" version="1">
115     <description summary="text model factory">
116       A factory for text models. This object is a singleton global.
117     </description>
118     <request name="create_text_model">
119       <description summary="create text model">
120         Creates a new text model object.
121       </description>
122       <arg name="id" type="new_id" interface="text_model"/>
123     </request>
124   </interface>
125 </protocol>