Enum Class InputPurpose

java.lang.Object
java.lang.Enum<InputPurpose>
org.gnome.gtk.InputPurpose
All Implemented Interfaces:
Serializable, Comparable<InputPurpose>, Constable, Enumeration

@Generated("org.javagi.JavaGI") public enum InputPurpose extends Enum<InputPurpose> implements Enumeration

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”.

  • Enum Constant Details

    • FREE_FORM

      public static final InputPurpose FREE_FORM
      Allow any character
    • ALPHA

      public static final InputPurpose ALPHA
      Allow only alphabetic characters
    • DIGITS

      public static final InputPurpose DIGITS
      Allow only digits
    • NUMBER

      public static final InputPurpose NUMBER
      Edited field expects numbers
    • PHONE

      public static final InputPurpose PHONE
      Edited field expects phone number
    • URL

      public static final InputPurpose URL
      Edited field expects URL
    • EMAIL

      public static final InputPurpose EMAIL
      Edited field expects email address
    • NAME

      public static final InputPurpose NAME
      Edited field expects the name of a person
    • PASSWORD

      public static final InputPurpose PASSWORD
      Like FREE_FORM, but characters are hidden
    • PIN

      public static final InputPurpose PIN
      Like DIGITS, but characters are hidden
    • TERMINAL

      public static final InputPurpose TERMINAL
      Allow any character, in addition to control codes
  • Method Details

    • values

      public static InputPurpose[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static InputPurpose valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • of

      public static InputPurpose of(int value)
      Create a new InputPurpose for the provided value
      Parameters:
      value - the enum value
      Returns:
      the enum for the provided value
    • getValue

      public int getValue()
      Get the numeric value of this enum
      Specified by:
      getValue in interface Enumeration
      Returns:
      the enum value
    • of

      public static InputPurpose of(MemorySegment address)
      Create a new InputPurpose for the value in the provided memory address.
      Parameters:
      address - the memory address holding a enum value
      Returns:
      the enum for the value in the provided memory address
    • getType

      public static @Nullable Type getType()
      Get the GType of the InputPurpose class.
      Returns:
      the GType