]> ncurses.scripts.mit.edu Git - ncurses.git/blob - Ada95/html/terminal_interface-curses-forms-field_types-user_s.html
ncurses 4.2
[ncurses.git] / Ada95 / html / terminal_interface-curses-forms-field_types-user_s.html
1 <HTML>
2 <HEAD>
3 <TITLE></TITLE>
4 </HEAD>
5 <BODY BGCOLOR="#99ccbb" TEXT="#000000" LINK="#4060b0" VLINK="#000080" ALINK="#ff4040">
6 <PRE>
7 <I>------------------------------------------------------------------------------</I>
8 <I>--                                                                          --</I>
9 <I>--                           <A HREF="http://www.gnat.com">GNAT</A> ncurses Binding                           --</I>
10 <I>--                                                                          --</I>
11 <I>--               Terminal_Interface.Curses.Forms.Field_Types.User           --</I>
12 <I>--                                                                          --</I>
13 <I>--                                 S P E C                                  --</I>
14 <I>--                                                                          --</I>
15 <I>------------------------------------------------------------------------------</I>
16 <I>-- Copyright (c) 1998 Free Software Foundation, Inc.                        --</I>
17 <I>--                                                                          --</I>
18 <I>-- Permission is hereby granted, free of charge, to any person obtaining a  --</I>
19 <I>-- copy of this software and associated documentation files (the            --</I>
20 <I>-- "Software"), to deal in the Software without restriction, including      --</I>
21 <I>-- without limitation the rights to use, copy, modify, merge, publish,      --</I>
22 <I>-- distribute, distribute with modifications, sublicense, and/or sell       --</I>
23 <I>-- copies of the Software, and to permit persons to whom the Software is    --</I>
24 <I>-- furnished to do so, subject to the following conditions:                 --</I>
25 <I>--                                                                          --</I>
26 <I>-- The above copyright notice and this permission notice shall be included  --</I>
27 <I>-- in all copies or substantial portions of the Software.                   --</I>
28 <I>--                                                                          --</I>
29 <I>-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  --</I>
30 <I>-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               --</I>
31 <I>-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   --</I>
32 <I>-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   --</I>
33 <I>-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    --</I>
34 <I>-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    --</I>
35 <I>-- THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               --</I>
36 <I>--                                                                          --</I>
37 <I>-- Except as contained in this notice, the name(s) of the above copyright   --</I>
38 <I>-- holders shall not be used in advertising or otherwise to promote the     --</I>
39 <I>-- sale, use or other dealings in this Software without prior written       --</I>
40 <I>-- authorization.                                                           --</I>
41 <I>------------------------------------------------------------------------------</I>
42 <I>--  <A HREF="http://home.t-online.de/home/Juergen.Pfeifer">J&uuml;rgen Pfeifer</A>, Email: <A HREF="mailto:Juergen.Pfeifer@T-Online.de">Juergen.Pfeifer@T-Online.de</A>                      --</I>
43 <I>--  Version Control:</I>
44 <I>--  @Revision: 1.1 @</I>
45 <I>------------------------------------------------------------------------------</I>
46 <B>with</B> Ada.Unchecked_Deallocation;
47 <B>with</B> Terminal_Interface.Curses.<A HREF="terminal_interface-curses-aux_s.html#32:35">Aux</A>;
48
49 <B>package</B> Terminal_Interface.Curses.Forms.Field_Types.User <B>is</B>
50
51    type User_Defined_Field_Type <B>is</B> <B>abstract</B> <B>new</B> Field_Type <B>with</B> <B>null</B> <B>record</B>;
52    <I>--  This is the root of the mechanism we use to create field types in</I>
53    <I>--  Ada95. You should your own type derive from this one and implement</I>
54    <I>--  the Field_Check and Character_Check functions for your own type.</I>
55
56    type User_Defined_Field_Type_Access <B>is</B> <B>access</B> <B>all</B>
57      User_Defined_Field_Type'Class;
58
59    <B>function</B> Field_Check
60      (Fld : Field;
61       Typ : User_Defined_Field_Type) <B>return</B> Boolean
62       <B>is</B> <B>abstract</B>;
63    <I>--  If True is returned, the field is considered valid, otherwise it is</I>
64    <I>--  invalid.</I>
65
66    <B>function</B> Character_Check
67      (Ch  : Character;
68       Typ : User_Defined_Field_Type) <B>return</B> Boolean
69       <B>is</B> <B>abstract</B>;
70    <I>--  If True is returned, the character is considered as valid for the</I>
71    <I>--  field, otherwise as invalid.</I>
72
73    <B>procedure</B> Set_Field_Type (Fld : <B>in</B> Field;
74                              Typ : <B>in</B> User_Defined_Field_Type);
75    <I>--  This should work for all types derived from User_Defined_Field_Type.</I>
76    <I>--  No need to reimplement it for your derived type.</I>
77
78    <I>--  +----------------------------------------------------------------------</I>
79    <I>--  | Private Part.</I>
80    <I>--  | Used by the Choice child package.</I>
81 <B>private</B>
82    <B>use</B> type Interfaces.C.Int;
83
84    <B>function</B> Generic_Field_Check (Fld : Field;
85                                  Usr : System.Address) <B>return</B> <A HREF="terminal_interface-curses-aux_s.html#36:12">C_Int</A>;
86    <B>pragma</B> Convention (C, Generic_Field_Check);
87    <I>--  This is the generic Field_Check_Function for the low-level fieldtype</I>
88    <I>--  representing all the User_Defined_Field_Type derivates. It routes</I>
89    <I>--  the call to the Field_Check implementation for the type.</I>
90
91    <B>function</B> Generic_Char_Check (Ch  : <A HREF="terminal_interface-curses-aux_s.html#36:12">C_Int</A>;
92                                 Usr : System.Address) <B>return</B> <A HREF="terminal_interface-curses-aux_s.html#36:12">C_Int</A>;
93    <B>pragma</B> Convention (C, Generic_Char_Check);
94    <I>--  This is the generic Char_Check_Function for the low-level fieldtype</I>
95    <I>--  representing all the User_Defined_Field_Type derivates. It routes</I>
96    <I>--  the call to the Character_Check implementation for the type.</I>
97
98 <B>end</B> Terminal_Interface.Curses.Forms.Field_Types.User;
99
100 </PRE>
101
102 <P><HR><P>
103 <P>
104 This is BETA software. The interface is subject to change without notice.<P>
105 <!-- Do NOT delete my name or the tool name from below; -->
106 <!-- giving me credit is a condition of use of ada2html -->
107 <P><I>This hypertext format was generated by <A HREF="http://www.adahome.com/Tutorials/Lovelace/dwheeler.htm">David A. Wheeler</A>'s <A HREF="http://www.adahome.com/Resources/Tools/ada2html/ada2html.htm">ada2html</A></I>
108 </BODY>
109 </HTML>
110