Fcitx
capabilityflags.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2017-2017 CSSlayer <wengxt@gmail.com>
3  *
4  * SPDX-License-Identifier: LGPL-2.1-or-later
5  *
6  */
7 #ifndef _FCITX_UTILS_CAPABILITYFLAGS_H_
8 #define _FCITX_UTILS_CAPABILITYFLAGS_H_
9 
10 #include <cstdint>
11 #include <fcitx-utils/flags.h>
12 
13 /// \addtogroup FcitxUtils
14 /// \{
15 /// \file
16 /// \brief Enum type for input context capability.
17 
18 namespace fcitx {
19 
20 /// \brief Input context CapabilityFlags.
21 enum class CapabilityFlag : uint64_t {
22  NoFlag = 0,
23  // Deprecated, because this flag is not compatible with fcitx 4.
24  ClientSideUI = (1 << 0),
25  Preedit = (1 << 1),
26  ClientSideControlState = (1 << 2),
27  Password = (1 << 3),
28  FormattedPreedit = (1 << 4),
29  ClientUnfocusCommit = (1 << 5),
30  SurroundingText = (1 << 6),
31  Email = (1 << 7),
32  Digit = (1 << 8),
33  Uppercase = (1 << 9),
34  Lowercase = (1 << 10),
35  NoAutoUpperCase = (1 << 11),
36  Url = (1 << 12),
37  Dialable = (1 << 13),
38  Number = (1 << 14),
39  NoOnScreenKeyboard = (1 << 15),
40  SpellCheck = (1 << 16),
41  NoSpellCheck = (1 << 17),
42  WordCompletion = (1 << 18),
43  UppercaseWords = (1 << 19),
44  UppwercaseSentences = (1 << 20),
45  Alpha = (1 << 21),
46  Name = (1 << 22),
47  GetIMInfoOnFocus = (1 << 23),
48  RelativeRect = (1 << 24),
49  // 25 ~ 31 are reserved for fcitx 4 compatibility.
50 
51  // New addition in fcitx 5.
52  Terminal = (1ULL << 32),
53  Date = (1ULL << 33),
54  Time = (1ULL << 34),
55  Multiline = (1ULL << 35),
56  Sensitive = (1ULL << 36),
57  KeyEventOrderFix = (1ULL << 37),
58  /**
59  * Whether client will set KeyState::Repeat on the key event.
60  *
61  * @see KeyState::Repeat
62  * @since 5.0.4
63  */
64  ReportKeyRepeat = (1ULL << 38),
65  /**
66  * @brief Whether client display input panel by itself.
67  *
68  * @since 5.0.5
69  */
70  ClientSideInputPanel = (1ULL << 39),
71 
72  /**
73  * Whether client request input method to be disabled.
74  *
75  * Usually this means only allow to type with raw keyboard.
76  *
77  * @since 5.0.20
78  */
79  Disable = (1ULL << 40),
80 
81  /**
82  * Whether client support commit string with cursor location.
83  * @since 5.1.2
84  */
85  CommitStringWithCursor = (1ULL << 41),
86 
87  PasswordOrSensitive = Password | Sensitive,
88 };
89 
91 } // namespace fcitx
92 
93 #endif // _FCITX_UTILS_CAPABILITYFLAGS_H_
Whether client request input method to be disabled.
Definition: action.cpp:17
Class represents the current state of surrounding text of an input context.
Whether client support commit string with cursor location.
Whether client will set KeyState::Repeat on the key event.
Whether client display input panel by itself.
Class provides bit flag support for Enum.
Definition: flags.h:33
Helper template class to make easier to use type safe enum flags.
CapabilityFlag
Input context CapabilityFlags.