- -- MANPAGE(`form_fieldtype.3x')
-
- type Field_Type is abstract tagged null record;
- type Field_Type_Access is access all Field_Type'Class;
-
- function Native_Type (Ftype : Field_Type)
- return C_Field_Type is abstract;
- -- This function returns the C libraries handle to the field type.
- -- May be you need this if you want to interface to lower level
- -- routines in the form library.
-
- -- ANCHOR(`set_field_type()',`Set_Type')
- procedure Set_Type (Fld : in Field;
- Fld_Type : in Field_Type) is abstract;
- -- AKA
- -- But: we hide the vararg mechanism of the C interface. You always
- -- have to pass a single Field_Type parameter.
-
- type C_Defined_Field_Type is abstract new Field_Type with null record;
- -- This is the root of all field typed defined in C, i.e. this are
- -- the predefined field types in the form library.
-
- type Alpha_Field is new C_Defined_Field_Type
- with record
- Minimum_Field_Width : Natural := 0;
- end record;
- procedure Set_Type (Fld : in Field;
- Fld_Type : in Alpha_Field);
- function Native_Type (Ftype : Alpha_Field)
- return C_Field_Type;
-
- type Alpha_Numeric_Field is new C_Defined_Field_Type with
- record
- Minimum_Field_Width : Natural := 0;
- end record;
- procedure Set_Type (Fld : in Field;
- Fld_Type : in Alpha_Numeric_Field);
- function Native_Type (Ftype : Alpha_Numeric_Field)
- return C_Field_Type;
-
- type Integer_Field is new C_Defined_Field_Type with
- record
- Precision : Natural;
- Lower_Limit : Integer;
- Upper_Limit : Integer;
- end record;
- procedure Set_Type (Fld : in Field;
- Fld_Type : in Integer_Field);
- function Native_Type (Ftype : Integer_Field)
- return C_Field_Type;
-
- type Numeric_Field is new C_Defined_Field_Type with
- record
- Precision : Natural;
- Lower_Limit : Float;
- Upper_Limit : Float;
- end record;
- procedure Set_Type (Fld : in Field;
- Fld_Type : in Numeric_Field);
- function Native_Type (Ftype : Numeric_Field)
- return C_Field_Type;
-
- type String_Access is access String;
-
- type Regular_Expression_Field is new C_Defined_Field_Type with
- record
- Regular_Expression : String_Access;
- end record;
- procedure Set_Type (Fld : in Field;
- Fld_Type : in Regular_Expression_Field);
- function Native_Type (Ftype : Regular_Expression_Field)
- return C_Field_Type;
-
- type Enum_Array is array (Positive range <>)
- of String_Access;
-
- type Enumeration_Info (C : Positive) is
- record
- Names : Enum_Array (1 .. C);
- Case_Sensitive : Boolean := False;
- Match_Must_Be_Unique : Boolean := False;
- end record;
-
- type Enumeration_Field is new C_Defined_Field_Type with private;
-
- function Create (Info : Enumeration_Info;
- Auto_Release_Names : Boolean := False)
- return Enumeration_Field;
- -- Make an fieldtype from the info. Enumerations are special, because
- -- they normally don't copy the enum values into a private store, so
- -- we have to care for the lifetime of the info we provide.
- -- The Auto_Release_Names flag may be used to automatically releases
- -- the strings in the Names array of the Enumeration_Info.
-
- function Make_Enumeration_Type (Info : Enumeration_Info;
- Auto_Release_Names : Boolean := False)
- return Enumeration_Field renames Create;
-
- procedure Release (Enum : in out Enumeration_Field);
- -- But we may want to release the field to release the memory allocated
- -- by it internally. After that the Enumeration field is no longer usable.
-
- procedure Set_Type (Fld : in Field;
- Fld_Type : in Enumeration_Field);
- function Native_Type (Ftype : Enumeration_Field)
- return C_Field_Type;
-
- -- The next type defintions are all ncurses extensions. They are typically
- -- not available in other curses implementations.
-
- type Internet_V4_Address_Field is new C_Defined_Field_Type
- with null record;
- procedure Set_Type (Fld : in Field;
- Fld_Type : in Internet_V4_Address_Field);
- function Native_Type (Ftype : Internet_V4_Address_Field)
- return C_Field_Type;
-
-
- type Ada_Defined_Field_Type is abstract new Field_Type with null record;
- -- This is the root of the mechanism we use to create field types in
- -- Ada95. You don't have to redefine the Set_Field_Type and
- -- Native_Field_Type methods, because they work generically on this
- -- class.
-
- procedure Set_Type (Fld : Field;
- Fld_Type : Ada_Defined_Field_Type);
-
- function Native_Type (Ftype : Ada_Defined_Field_Type)
- return C_Field_Type;
-
- -- MANPAGE(`form_field_validation.3x')
-
- -- ANCHOR(`field_type()',`Get_Type')
- function Get_Type (Fld : in Field) return Field_Type_Access;
- -- AKA
- -- ALIAS(`field_arg()')
- -- In Ada95 we can combine these