KWaylandServer

textinput.h
1 /*
2  SPDX-FileCopyrightText: 2020 Bhushan Shah <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
5 */
6 #pragma once
7 
8 #include <KWaylandServer/kwaylandserver_export.h>
9 
10 #include <QVariant>
11 #include <QtGlobal>
12 #include <qobjectdefs.h>
13 
14 #include <inttypes.h>
15 
16 namespace KWaylandServer
17 {
18 Q_NAMESPACE_EXPORT(KWAYLANDSERVER_EXPORT)
19 /**
20  * ContentHint allows to modify the behavior of the text input.
21  */
22 enum class TextInputContentHint {
23  /**
24  * no special behaviour
25  */
26  None = 0,
27  /**
28  * suggest word completions
29  */
30  AutoCompletion = 1 << 0,
31  /**
32  * suggest word corrections
33  */
34  AutoCorrection = 1 << 1,
35  /**
36  * switch to uppercase letters at the start of a sentence
37  */
38  AutoCapitalization = 1 << 2,
39  /**
40  * prefer lowercase letters
41  */
42  LowerCase = 1 << 3,
43  /**
44  * prefer uppercase letters
45  */
46  UpperCase = 1 << 4,
47  /**
48  * prefer casing for titles and headings (can be language dependent)
49  */
50  TitleCase = 1 << 5,
51  /**
52  * characters should be hidden
53  */
54  HiddenText = 1 << 6,
55  /**
56  * typed text should not be stored
57  */
58  SensitiveData = 1 << 7,
59  /**
60  * just latin characters should be entered
61  */
62  Latin = 1 << 8,
63  /**
64  * the text input is multi line
65  */
66  MultiLine = 1 << 9,
67 };
68 
69 Q_DECLARE_FLAGS(TextInputContentHints, TextInputContentHint)
70 Q_ENUM_NS(TextInputContentHint)
71 
72 /**
73  * The ContentPurpose allows to specify the primary purpose of a text input.
74  *
75  * This allows an input method to show special purpose input panels with
76  * extra characters or to disallow some characters.
77  */
78 enum class TextInputContentPurpose {
79  /**
80  * default input, allowing all characters
81  */
82  Normal,
83  /**
84  * allow only alphabetic characters
85  */
86  Alpha,
87  /**
88  * allow only digits
89  */
90  Digits,
91  /**
92  * input a number (including decimal separator and sign)
93  */
94  Number,
95  /**
96  * input a phone number
97  */
98  Phone,
99  /**
100  * input an URL
101  */
102  Url,
103  /**
104  * input an email address
105  */
106  Email,
107  /**
108  * input a name of a person
109  */
110  Name,
111  /**
112  * input a password
113  */
114  Password,
115  /**
116  * input a date
117  */
118  Date,
119  /**
120  * input a time
121  */
122  Time,
123  /**
124  * input a date and time
125  */
126  DateTime,
127  /**
128  * input for a terminal
129  */
130  Terminal,
131  /**
132  * input is numeric password
133  */
134  Pin,
135 };
136 Q_ENUM_NS(TextInputContentPurpose)
137 
138 enum class TextInputChangeCause {
139  /**
140  * Change caused by input method
141  */
142  InputMethod,
143 
144  /**
145  * Something else other than input method caused change
146  */
147  Other,
148 };
149 Q_ENUM_NS(TextInputChangeCause)
150 
151 }
152 
153 Q_DECLARE_METATYPE(KWaylandServer::TextInputContentHint)
154 Q_DECLARE_METATYPE(KWaylandServer::TextInputContentHints)
155 Q_DECLARE_OPERATORS_FOR_FLAGS(KWaylandServer::TextInputContentHints)
156 Q_DECLARE_METATYPE(KWaylandServer::TextInputContentPurpose)
157 Q_DECLARE_METATYPE(KWaylandServer::TextInputChangeCause)
Email
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Sat Oct 23 2021 23:08:28 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.