fcitx5_dbus/utils/
capability_flags.rs

1use crate::utils::macros;
2use bitflags::bitflags;
3
4macros::dbus_type! {
5    pub struct CapabilityFlag(u64);
6}
7
8#[rustfmt::skip]
9bitflags! {impl CapabilityFlag: u64 {
10    const NoFlag                  = 0;
11
12    // Deprecated, because this flag is not compatible with fcitx 4.
13    const ClientSideUI            = 1 << 0;
14
15    const Preedit                 = 1 << 1;
16    const ClientSideControlState  = 1 << 2;
17    const Password                = 1 << 3;
18    const FormattedPreedit        = 1 << 4;
19    const ClientUnfocusCommit     = 1 << 5;
20    const SurroundingText         = 1 << 6;
21    const Email                   = 1 << 7;
22    const Digit                   = 1 << 8;
23    const Uppercase               = 1 << 9;
24    const Lowercase               = 1 << 10;
25    const NoAutoUpperCase         = 1 << 11;
26    const Url                     = 1 << 12;
27    const Dialable                = 1 << 13;
28    const Number                  = 1 << 14;
29    const NoOnScreenKeyboard      = 1 << 15;
30    const SpellCheck              = 1 << 16;
31    const NoSpellCheck            = 1 << 17;
32    const WordCompletion          = 1 << 18;
33    const UppercaseWords          = 1 << 19;
34    const UppwercaseSentences     = 1 << 20;
35    const Alpha                   = 1 << 21;
36    const Name                    = 1 << 22;
37    const GetIMInfoOnFocus        = 1 << 23;
38    const RelativeRect            = 1 << 24;
39
40    // 25 ~ 31 are reserved for fcitx 4 compatibility;
41    // New addition in fcitx 5;
42    const Terminal               = 1 << 32;
43    const Date                   = 1 << 33;
44    const Time                   = 1 << 34;
45    const Multiline              = 1 << 35;
46    const Sensitive              = 1 << 36;
47    const KeyEventOrderFix       = 1 << 37;
48
49
50    // Whether client will set KeyState::Repeat on the key event.
51    // @see KeyState::Repeat
52    // @since fcitx5 5.0.4
53    const ReportKeyRepeat        = 1 << 38;
54
55     // Whether client display input panel by itself.
56     // @since fcitx5 5.0.5
57    const ClientSideInputPanel   = 1 << 39;
58
59    // Whether client request input method to be disabled.
60    // Usually this means only allow to type with raw keyboard.
61    // @since fcitx5 5.0.20
62    const Disable                = 1 << 40;
63
64    // Whether client support commit string with cursor location.
65    // @since fcitx5 5.1.2
66    const CommitStringWithCursor = 1 << 41;
67
68    const PasswordOrSensitive    = Self::Password.bits() | Self::Sensitive.bits();
69}}