Package: gtk

GEnum gtk:input-purpose

Declaration

(gobject:define-genum "GtkInputPurpose" input-purpose
  (:export t
   :type-initializer "gtk_input_purpose_get_type")
  (:free-form 0)
  (:alpha 1)
  (:digits 2)
  (:number 3)
  (:phone 4)
  (:url 5)
  (:email 6)
  (:name 7)
  (:password 8)
  (:pin 9)
  (:terminal 10))  

Values

:free-form
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 :free-form, but characters are hidden.
:pin
Like :digits, but characters are hidden.
:terminal
Allow any character, in addition to control codes.

Details

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 text entry contents, even if it specified a purpose.

The difference between the :digits and :number values 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'.
 

See also

2024-4-24