diff options
author | Jan Arne Petersen <jpetersen@openismus.com> | 2013-01-16 21:26:43 +0100 |
---|---|---|
committer | Kristian Høgsberg <krh@bitplanet.net> | 2013-02-15 17:00:15 -0500 |
commit | 26ffa814d90ad97dc7474bc454e3776c48aa21d1 (patch) | |
tree | d3d7e03178f3e3ceac0754ddcdc9acc70e8638e9 /protocol | |
parent | 0a1cf393c6a2fc202046e287224d5f8487cd0230 (diff) |
text: Add content type support to text protocol
Support content types in text protocol. Content is defined by a hint
bitmask and a purpose field.
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
Diffstat (limited to 'protocol')
-rw-r--r-- | protocol/input-method.xml | 4 | ||||
-rw-r--r-- | protocol/text.xml | 52 |
2 files changed, 55 insertions, 1 deletions
diff --git a/protocol/input-method.xml b/protocol/input-method.xml index 03991f12..a57fabd2 100644 --- a/protocol/input-method.xml +++ b/protocol/input-method.xml @@ -123,6 +123,10 @@ <event name="reset"> <arg name="serial" type="uint"/> </event> + <event name="content_type"> + <arg name="hint" type="uint"/> + <arg name="purpose" type="uint"/> + </event> </interface> <interface name="input_method" version="1"> diff --git a/protocol/text.xml b/protocol/text.xml index bd74ee11..e657292a 100644 --- a/protocol/text.xml +++ b/protocol/text.xml @@ -83,8 +83,58 @@ <arg name="height" type="int"/> </request> <request name="set_preedit"/> - <request name="set_content_type"/> + <enum name="content_hint"> + <description summary="content hint"> + Content hint is a bitmask to allow to modify the behavior of the text input + </description> + <entry name="none" value="0x0" summary="no special behaviour"/> + <entry name="default" value="0x7" summary="auto completion, correction and capitalization"/> + <entry name="password" value="0xc" summary="hidden and sensitive text"/> + <entry name="auto_completion" value="0x1" summary="suggest word completions"/> + <entry name="auto_correction" value="0x2" summary="suggest word corrections"/> + <entry name="auto_capitalization" value="0x4" summary="switch to uppercase letters at the start of a sentence"/> + <entry name="lowercase" value="0x8" summary="prefer lowercase letters"/> + <entry name="uppercase" value="0x10" summary="prefer uppercase letters"/> + <entry name="titlecase" value="0x20" summary="prefer casing for titles and headings (can be language dependend)"/> + <entry name="hidden_text" value="0x40" summary="characters should be hidden"/> + <entry name="sensitive_data" value="0x80" summary="typed text should not be stored"/> + <entry name="latin" value="0x100" summary="just latin characters should be entered"/> + <entry name="multiline" value="0x200" summary="the text input is multiline"/> + </enum> + <enum name="content_purpose"> + <description summary="content purpose"> + The content purpose allows to specify the primary purpose of a text input. + This allows an input method to show special purpose input panels with extra + characters or to disallow some characters. + </description> + <entry name="normal" value="0" summary="default input, allowing all characters"/> + <entry name="alpha" value="1" summary="allow only alphabetic characters"/> + <entry name="digits" value="2" summary="allow only digits"/> + <entry name="number" value="3" summary="input a number (including decimal separator and sign)"/> + <entry name="phone" value="4" summary="input a phone number"/> + <entry name="url" value="5" summary="input an URL"/> + <entry name="email" value="6" summary="input an email address"/> + <entry name="name" value="7" summary="input a name of a person"/> + <entry name="password" value="8" summary="input a password (combine with password or sensitive_data hint)"/> + <entry name="date" value="9" summary="input a date"/> + <entry name="time" value="10" summary="input a time"/> + <entry name="datetime" value="11" summary="input a date and time"/> + <entry name="terminal" value="12" summary="input for a terminal"/> + </enum> + <request name="set_content_type"> + <description summary="set content purpose and hint"> + Sets the content purpose and content hint. While the purpose is the + basic purpose of an input field, the hint flags allow to modify some + of the behavior. + + When no content type is explicitly set, a normal content purpose with + default hints (auto completion, auto correction, auto capitalization) + should be assumed. + </description> + <arg name="hint" type="uint"/> + <arg name="purpose" type="uint"/> + </request> <event name="commit_string"> <description summary="commit"> Notify when text should be inserted into the editor widget. The text |