Warning, /libraries/plasma-wayland-protocols/src/protocols/text-input.xml is written in an unsupported language. File is not indexed.

0001 <?xml version="1.0" encoding="UTF-8"?>
0002 <protocol name="text">
0003 
0004   <copyright>
0005     SPDX-FileCopyrightText: 2012, 2013 Intel Corporation
0006 
0007     SPDX-License-Identifier: MIT-CMU
0008   </copyright>
0009 
0010   <interface name="wl_text_input" version="1">
0011     <description summary="text input">
0012       An object used for text input. Adds support for text input and input
0013       methods to applications. A text-input object is created from a
0014       wl_text_input_manager and corresponds typically to a text entry in an
0015       application.
0016       Requests are used to activate/deactivate the text-input object and set
0017       state information like surrounding and selected text or the content type.
0018       The information about entered text is sent to the text-input object via
0019       the pre-edit and commit events. Using this interface removes the need
0020       for applications to directly process hardware key events and compose text
0021       out of them.
0022 
0023       Text is generally UTF-8 encoded, indices and lengths are in bytes.
0024 
0025       Serials are used to synchronize the state between the text input and
0026       an input method. New serials are sent by the text input in the
0027       commit_state request and are used by the input method to indicate
0028       the known text input state in events like preedit_string, commit_string,
0029       and keysym. The text input can then ignore events from the input method
0030       which are based on an outdated state (for example after a reset).
0031     </description>
0032     <request name="activate">
0033       <description summary="request activation">
0034         Requests the text-input object to be activated (typically when the
0035         text entry gets focus).
0036         The seat argument is a wl_seat which maintains the focus for this
0037         activation. The surface argument is a wl_surface assigned to the
0038         text-input object and tracked for focus lost. The enter event
0039         is emitted on successful activation.
0040       </description>
0041       <arg name="seat" type="object" interface="wl_seat"/>
0042       <arg name="surface" type="object" interface="wl_surface"/>
0043     </request>
0044     <request name="deactivate">
0045       <description summary="request deactivation">
0046         Requests the text-input object to be deactivated (typically when the
0047         text entry lost focus). The seat argument is a wl_seat which was used
0048         for activation.
0049       </description>
0050       <arg name="seat" type="object" interface="wl_seat"/>
0051     </request>
0052     <request name="show_input_panel">
0053       <description summary="show input panels">
0054         Requests input panels (virtual keyboard) to show.
0055       </description>
0056     </request>
0057     <request name="hide_input_panel">
0058       <description summary="hide input panels">
0059         Requests input panels (virtual keyboard) to hide.
0060       </description>
0061     </request>
0062     <request name="reset">
0063       <description summary="reset">
0064         Should be called by an editor widget when the input state should be
0065         reset, for example after the text was changed outside of the normal
0066         input method flow.
0067       </description>
0068     </request>
0069     <request name="set_surrounding_text">
0070       <description summary="sets the surrounding text">
0071         Sets the plain surrounding text around the input position. Text is
0072         UTF-8 encoded. Cursor is the byte offset within the
0073         surrounding text. Anchor is the byte offset of the
0074         selection anchor within the surrounding text. If there is no selected
0075         text anchor is the same as cursor.
0076       </description>
0077       <arg name="text" type="string"/>
0078       <arg name="cursor" type="uint"/>
0079       <arg name="anchor" type="uint"/>
0080     </request>
0081     <enum name="content_hint">
0082       <description summary="content hint">
0083         Content hint is a bitmask to allow to modify the behavior of the text
0084         input.
0085       </description>
0086       <entry name="none" value="0x0" summary="no special behaviour"/>
0087       <entry name="default" value="0x7" summary="auto completion, correction and capitalization"/>
0088       <entry name="password" value="0xc0" summary="hidden and sensitive text"/>
0089       <entry name="auto_completion" value="0x1" summary="suggest word completions"/>
0090       <entry name="auto_correction" value="0x2" summary="suggest word corrections"/>
0091       <entry name="auto_capitalization" value="0x4" summary="switch to uppercase letters at the start of a sentence"/>
0092       <entry name="lowercase" value="0x8" summary="prefer lowercase letters"/>
0093       <entry name="uppercase" value="0x10" summary="prefer uppercase letters"/>
0094       <entry name="titlecase" value="0x20" summary="prefer casing for titles and headings (can be language dependent)"/>
0095       <entry name="hidden_text" value="0x40" summary="characters should be hidden"/>
0096       <entry name="sensitive_data" value="0x80" summary="typed text should not be stored"/>
0097       <entry name="latin" value="0x100" summary="just latin characters should be entered"/>
0098       <entry name="multiline" value="0x200" summary="the text input is multiline"/>
0099     </enum>
0100     <enum name="content_purpose">
0101       <description summary="content purpose">
0102         The content purpose allows to specify the primary purpose of a text
0103         input.
0104 
0105         This allows an input method to show special purpose input panels with
0106         extra characters or to disallow some characters.
0107       </description>
0108       <entry name="normal" value="0" summary="default input, allowing all characters"/>
0109       <entry name="alpha" value="1" summary="allow only alphabetic characters"/>
0110       <entry name="digits" value="2" summary="allow only digits"/>
0111       <entry name="number" value="3" summary="input a number (including decimal separator and sign)"/>
0112       <entry name="phone" value="4" summary="input a phone number"/>
0113       <entry name="url" value="5" summary="input an URL"/>
0114       <entry name="email" value="6" summary="input an email address"/>
0115       <entry name="name" value="7" summary="input a name of a person"/>
0116       <entry name="password" value="8" summary="input a password (combine with password or sensitive_data hint)"/>
0117       <entry name="date" value="9" summary="input a date"/>
0118       <entry name="time" value="10" summary="input a time"/>
0119       <entry name="datetime" value="11" summary="input a date and time"/>
0120       <entry name="terminal" value="12" summary="input for a terminal"/>
0121     </enum>
0122     <request name="set_content_type">
0123       <description summary="set content purpose and hint">
0124         Sets the content purpose and content hint. While the purpose is the
0125         basic purpose of an input field, the hint flags allow to modify some
0126         of the behavior.
0127 
0128         When no content type is explicitly set, a normal content purpose with
0129         default hints (auto completion, auto correction, auto capitalization)
0130         should be assumed.
0131       </description>
0132       <arg name="hint" type="uint"/>
0133       <arg name="purpose" type="uint"/>
0134     </request>
0135     <request name="set_cursor_rectangle">
0136       <arg name="x" type="int"/>
0137       <arg name="y" type="int"/>
0138       <arg name="width" type="int"/>
0139       <arg name="height" type="int"/>
0140     </request>
0141     <request name="set_preferred_language">
0142       <description summary="sets preferred language">
0143         Sets a specific language. This allows for example a virtual keyboard to
0144         show a language specific layout. The "language" argument is a RFC-3066
0145         format language tag.
0146 
0147         It could be used for example in a word processor to indicate language of
0148         currently edited document or in an instant message application which tracks
0149         languages of contacts.
0150       </description>
0151       <arg name="language" type="string"/>
0152     </request>
0153     <request name="commit_state">
0154       <arg name="serial" type="uint" summary="used to identify the known state"/>
0155     </request>
0156     <request name="invoke_action">
0157       <arg name="button" type="uint"/>
0158       <arg name="index" type="uint"/>
0159     </request>
0160     <event name="enter">
0161       <description summary="enter event">
0162         Notify the text-input object when it received focus. Typically in
0163         response to an activate request.
0164       </description>
0165       <arg name="surface" type="object" interface="wl_surface"/>
0166     </event>
0167     <event name="leave">
0168       <description summary="leave event">
0169         Notify the text-input object when it lost focus. Either in response
0170         to a deactivate request or when the assigned surface lost focus or was
0171         destroyed.
0172       </description>
0173     </event>
0174     <event name="modifiers_map">
0175       <description summary="modifiers map">
0176         Transfer an array of 0-terminated modifiers names. The position in
0177         the array is the index of the modifier as used in the modifiers
0178         bitmask in the keysym event.
0179       </description>
0180       <arg name="map" type="array"/>
0181     </event>
0182     <event name="input_panel_state">
0183       <description summary="state of the input panel">
0184         Notify when the visibility state of the input panel changed.
0185       </description>
0186       <arg name="state" type="uint"/>
0187     </event>
0188     <event name="preedit_string">
0189       <description summary="pre-edit">
0190         Notify when a new composing text (pre-edit) should be set around the
0191         current cursor position. Any previously set composing text should
0192         be removed.
0193 
0194         The commit text can be used to replace the preedit text on reset
0195         (for example on unfocus).
0196 
0197         The text input should also handle all preedit_style and preedit_cursor
0198         events occurring directly before preedit_string.
0199       </description>
0200       <arg name="serial" type="uint" summary="serial of the latest known text input state"/>
0201       <arg name="text" type="string"/>
0202       <arg name="commit" type="string"/>
0203     </event>
0204     <enum name="preedit_style">
0205       <entry name="default" value="0" summary="default style for composing text"/>
0206       <entry name="none" value="1" summary="style should be the same as in non-composing text"/>
0207       <entry name="active" value="2"/>
0208       <entry name="inactive" value="3"/>
0209       <entry name="highlight" value="4"/>
0210       <entry name="underline" value="5"/>
0211       <entry name="selection" value="6"/>
0212       <entry name="incorrect" value="7"/>
0213     </enum>
0214     <event name="preedit_styling">
0215       <description summary="pre-edit styling">
0216         Sets styling information on composing text. The style is applied for
0217         length bytes from index relative to the beginning of the composing
0218         text (as byte offset). Multiple styles can
0219         be applied to a composing text by sending multiple preedit_styling
0220         events.
0221 
0222         This event is handled as part of a following preedit_string event.
0223       </description>
0224       <arg name="index" type="uint"/>
0225       <arg name="length" type="uint"/>
0226       <arg name="style" type="uint"/>
0227     </event>
0228     <event name="preedit_cursor">
0229       <description summary="pre-edit cursor">
0230         Sets the cursor position inside the composing text (as byte
0231         offset) relative to the start of the composing text. When index is a
0232         negative number no cursor is shown.
0233 
0234         This event is handled as part of a following preedit_string event.
0235       </description>
0236       <arg name="index" type="int"/>
0237     </event>
0238     <event name="commit_string">
0239       <description summary="commit">
0240         Notify when text should be inserted into the editor widget. The text to
0241         commit could be either just a single character after a key press or the
0242         result of some composing (pre-edit). It could be also an empty text
0243         when some text should be removed (see delete_surrounding_text) or when
0244         the input cursor should be moved (see cursor_position).
0245 
0246         Any previously set composing text should be removed.
0247       </description>
0248       <arg name="serial" type="uint" summary="serial of the latest known text input state"/>
0249       <arg name="text" type="string"/>
0250     </event>
0251     <event name="cursor_position">
0252       <description summary="set cursor to new position">
0253         Notify when the cursor or anchor position should be modified.
0254 
0255         This event should be handled as part of a following commit_string
0256         event.
0257       </description>
0258       <arg name="index" type="int"/>
0259       <arg name="anchor" type="int"/>
0260     </event>
0261     <event name="delete_surrounding_text">
0262       <description summary="delete surrounding text">
0263         Notify when the text around the current cursor position should be
0264         deleted.
0265 
0266         Index is relative to the current cursor (in bytes).
0267         Length is the length of deleted text (in bytes).
0268 
0269         This event should be handled as part of a following commit_string
0270         event.
0271       </description>
0272       <arg name="index" type="int"/>
0273       <arg name="length" type="uint"/>
0274     </event>
0275     <event name="keysym">
0276       <description summary="keysym">
0277         Notify when a key event was sent. Key events should not be used
0278         for normal text input operations, which should be done with
0279         commit_string, delete_surrounding_text, etc. The key event follows
0280         the wl_keyboard key event convention. Sym is a XKB keysym, state a
0281         wl_keyboard key_state. Modifiers are a mask for effective modifiers
0282         (where the modifier indices are set by the modifiers_map event)
0283       </description>
0284       <arg name="serial" type="uint" summary="serial of the latest known text input state"/>
0285       <arg name="time" type="uint"/>
0286       <arg name="sym" type="uint"/>
0287       <arg name="state" type="uint"/>
0288       <arg name="modifiers" type="uint"/>
0289     </event>
0290     <event name="language">
0291       <description summary="language">
0292         Sets the language of the input text. The "language" argument is a RFC-3066
0293         format language tag.
0294       </description>
0295       <arg name="serial" type="uint" summary="serial of the latest known text input state"/>
0296       <arg name="language" type="string"/>
0297     </event>
0298     <enum name="text_direction">
0299       <entry name="auto" value="0" summary="automatic text direction based on text and language"/>
0300       <entry name="ltr" value="1" summary="left-to-right"/>
0301       <entry name="rtl" value="2" summary="right-to-left"/>
0302     </enum>
0303     <event name="text_direction">
0304       <description summary="text direction">
0305         Sets the text direction of input text.
0306 
0307         It is mainly needed for showing input cursor on correct side of the
0308         editor when there is no input yet done and making sure neutral
0309         direction text is laid out properly.
0310       </description>
0311       <arg name="serial" type="uint" summary="serial of the latest known text input state"/>
0312       <arg name="direction" type="uint"/>
0313     </event>
0314   </interface>
0315 
0316   <interface name="wl_text_input_manager" version="1">
0317     <description summary="text input manager">
0318       A factory for text-input objects. This object is a global singleton.
0319     </description>
0320     <request name="create_text_input">
0321       <description summary="create text input">
0322         Creates a new text-input object.
0323       </description>
0324       <arg name="id" type="new_id" interface="wl_text_input"/>
0325     </request>
0326   </interface>
0327 </protocol>