[][src]Enum gtk::InputPurpose

#[non_exhaustive]pub enum InputPurpose {
    FreeForm,
    Alpha,
    Digits,
    Number,
    Phone,
    Url,
    Email,
    Name,
    Password,
    Pin,
    Terminal,
    // some variants omitted
}

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 InputPurpose::Digits and InputPurpose::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)

Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
FreeForm

Allow any character

Alpha

Allow only alphabetic characters

Digits

Allow only digits

Number

Edited field expects numbers

Phone

Edited field expects phone number

Url

Edited field expects URL

Email

Edited field expects email address

Name

Edited field expects the name of a person

Password

Like InputPurpose::FreeForm, but characters are hidden

Pin

Like InputPurpose::Digits, but characters are hidden

Terminal

Allow any character, in addition to control codes

Trait Implementations

impl Clone for InputPurpose[src]

impl Copy for InputPurpose[src]

impl Debug for InputPurpose[src]

impl Display for InputPurpose[src]

impl Eq for InputPurpose[src]

impl<'a> FromValue<'a> for InputPurpose[src]

impl<'a> FromValueOptional<'a> for InputPurpose[src]

impl Hash for InputPurpose[src]

impl Ord for InputPurpose[src]

impl PartialEq<InputPurpose> for InputPurpose[src]

impl PartialOrd<InputPurpose> for InputPurpose[src]

impl SetValue for InputPurpose[src]

impl StaticType for InputPurpose[src]

impl StructuralEq for InputPurpose[src]

impl StructuralPartialEq for InputPurpose[src]

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToSendValue for T where
    T: ToValue + SetValue + Send + ?Sized

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> ToValue for T where
    T: SetValue + ?Sized

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.