Enum gtk4::InputPurpose [−][src]
#[non_exhaustive]
pub enum InputPurpose {
FreeForm,
Alpha,
Digits,
Number,
Phone,
Url,
Email,
Name,
Password,
Pin,
Terminal,
// some variants omitted
}
Expand description
Describes primary purpose of the input widget.
This information is useful for on-screen keyboards and similar input methods to decide which keys should be presented to the user.
Note that the purpose is not meant to impose a totally strict rule about allowed characters, and does not replace input validation. It is fine for an on-screen keyboard to let the user override the character set restriction that is expressed by the purpose. The application is expected to validate the entry contents, even if it specified a purpose.
The difference between Digits
and
Number
is that the former accepts only digits
while the latter also some punctuation (like commas or points, plus,
minus) and “e” or “E” as in 3.14E+000.
This enumeration may be extended in the future; input methods should interpret unknown values as “free form”.
Variants (Non-exhaustive)
This enum is marked as non-exhaustive
Allow any character
Allow only alphabetic characters
Allow only digits
Edited field expects numbers
Edited field expects phone number
Edited field expects URL
Edited field expects email address
Edited field expects the name of a person
Like FreeForm
, but characters are hidden
Like Digits
, but characters are hidden
Allow any character, in addition to control codes
Trait Implementations
type Checker = GenericValueTypeChecker<Self>
type Checker = GenericValueTypeChecker<Self>
Value type checker.
Get the contained value from a Value
. Read more
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Returns the type identifier of Self
.
Auto Trait Implementations
impl RefUnwindSafe for InputPurpose
impl Send for InputPurpose
impl Sync for InputPurpose
impl Unpin for InputPurpose
impl UnwindSafe for InputPurpose
Blanket Implementations
Mutably borrows from an owned value. Read more
Returns a SendValue
clone of self
.