1 // * This makes emacs happy -*-Mode: C++;-*-
3 /****************************************************************************
4 * Copyright 2019-2021,2022 Thomas E. Dickey *
5 * Copyright 1998-2012,2014 Free Software Foundation, Inc. *
7 * Permission is hereby granted, free of charge, to any person obtaining a *
8 * copy of this software and associated documentation files (the *
9 * "Software"), to deal in the Software without restriction, including *
10 * without limitation the rights to use, copy, modify, merge, publish, *
11 * distribute, distribute with modifications, sublicense, and/or sell *
12 * copies of the Software, and to permit persons to whom the Software is *
13 * furnished to do so, subject to the following conditions: *
15 * The above copyright notice and this permission notice shall be included *
16 * in all copies or substantial portions of the Software. *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
19 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
21 * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
22 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
23 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
24 * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
26 * Except as contained in this notice, the name(s) of the above copyright *
27 * holders shall not be used in advertising or otherwise to promote the *
28 * sale, use or other dealings in this Software without prior written *
30 ****************************************************************************/
32 /****************************************************************************
33 * Author: Juergen Pfeifer, 1997 *
34 ****************************************************************************/
36 // $Id: cursesf.h,v 1.39 2022/08/20 20:52:15 tom Exp $
38 #ifndef NCURSES_CURSESF_H_incl
39 #define NCURSES_CURSESF_H_incl 1
51 // -------------------------------------------------------------------------
52 // The abstract base class for builtin and user defined Fieldtypes.
53 // -------------------------------------------------------------------------
55 class NCURSES_CXX_IMPEXP NCursesFormField; // forward declaration
57 // Class to represent builtin field types as well as C++ written new
58 // fieldtypes (see classes UserDefineFieldType...
59 class NCURSES_CXX_IMPEXP NCursesFieldType
61 friend class NCursesFormField;
66 inline void OnError(int err) const THROW2(NCursesException const, NCursesFormException) {
68 THROW(new NCursesFormException (err));
71 NCursesFieldType(FIELDTYPE *f) : fieldtype(f) {
74 virtual ~NCursesFieldType() {}
76 // Set the fields f fieldtype to this one.
77 virtual void set(NCursesFormField& f) = 0;
81 : fieldtype(STATIC_CAST(FIELDTYPE*)(0))
85 NCursesFieldType& operator=(const NCursesFieldType& rhs)
93 NCursesFieldType(const NCursesFieldType& rhs)
94 : fieldtype(rhs.fieldtype)
101 // -------------------------------------------------------------------------
102 // The class representing a forms field, wrapping the lowlevel FIELD struct
103 // -------------------------------------------------------------------------
105 class NCURSES_CXX_IMPEXP NCursesFormField
107 friend class NCursesForm;
110 FIELD *field; // lowlevel structure
111 NCursesFieldType* ftype; // Associated field type
114 inline void OnError (int err) const THROW2(NCursesException const, NCursesFormException) {
116 THROW(new NCursesFormException (err));
120 // Create a 'Null' field. Can be used to delimit a field list
122 : field(STATIC_CAST(FIELD*)(0)),
123 ftype(STATIC_CAST(NCursesFieldType*)(0))
127 // Create a new field
128 NCursesFormField (int rows,
132 int offscreen_rows = 0,
133 int additional_buffers = 0)
135 ftype(STATIC_CAST(NCursesFieldType*)(0))
137 field = ::new_field(rows, ncols, first_row, first_col,
138 offscreen_rows, additional_buffers);
143 NCursesFormField& operator=(const NCursesFormField& rhs)
151 NCursesFormField(const NCursesFormField& rhs)
152 : field(rhs.field), ftype(rhs.ftype)
156 virtual ~NCursesFormField () THROWS(NCursesException);
158 // Duplicate the field at a new position
159 inline NCursesFormField* dup(int first_row, int first_col)
161 NCursesFormField* f = new NCursesFormField();
163 OnError(E_SYSTEM_ERROR);
166 f->field = ::dup_field(field,first_row,first_col);
173 // Link the field to a new location
174 inline NCursesFormField* link(int first_row, int first_col) {
175 NCursesFormField* f = new NCursesFormField();
177 OnError(E_SYSTEM_ERROR);
180 f->field = ::link_field(field,first_row,first_col);
187 // Get the lowlevel field representation
188 inline FIELD* get_field() const {
192 // Retrieve info about the field
193 inline void info(int& rows, int& ncols,
194 int& first_row, int& first_col,
195 int& offscreen_rows, int& additional_buffers) const {
196 OnError(::field_info(field, &rows, &ncols,
197 &first_row, &first_col,
198 &offscreen_rows, &additional_buffers));
201 // Retrieve info about the fields dynamic properties.
202 inline void dynamic_info(int& dynamic_rows, int& dynamic_cols,
203 int& max_growth) const {
204 OnError(::dynamic_field_info(field, &dynamic_rows, &dynamic_cols,
208 // For a dynamic field you may set the maximum growth limit.
209 // A zero means unlimited growth.
210 inline void set_maximum_growth(int growth = 0) {
211 OnError(::set_max_field(field,growth));
214 // Move the field to a new position
215 inline void move(int row, int col) {
216 OnError(::move_field(field,row,col));
219 // Mark the field to start a new page
220 inline void new_page(bool pageFlag = FALSE) {
221 OnError(::set_new_page(field,pageFlag));
224 // Retrieve whether or not the field starts a new page.
225 inline bool is_new_page() const {
226 return ::new_page(field);
229 // Set the justification for the field
230 inline void set_justification(int just) {
231 OnError(::set_field_just(field,just));
234 // Retrieve the fields justification
235 inline int justification() const {
236 return ::field_just(field);
238 // Set the foreground attribute for the field
239 inline void set_foreground(chtype foreground) {
240 OnError(::set_field_fore(field,foreground));
243 // Retrieve the fields foreground attribute
244 inline chtype fore() const {
245 return ::field_fore(field);
248 // Set the background attribute for the field
249 inline void set_background(chtype background) {
250 OnError(::set_field_back(field,background));
253 // Retrieve the fields background attribute
254 inline chtype back() const {
255 return ::field_back(field);
258 // Set the padding character for the field
259 inline void set_pad_character(int padding) {
260 OnError(::set_field_pad(field, padding));
263 // Retrieve the fields padding character
264 inline int pad() const {
265 return ::field_pad(field);
268 // Switch on the fields options
269 inline void options_on (Field_Options opts) {
270 OnError (::field_opts_on (field, opts));
273 // Switch off the fields options
274 inline void options_off (Field_Options opts) {
275 OnError (::field_opts_off (field, opts));
278 // Retrieve the fields options
279 inline Field_Options options () const {
280 return ::field_opts (field);
283 // Set the fields options
284 inline void set_options (Field_Options opts) {
285 OnError (::set_field_opts (field, opts));
288 // Mark the field as changed
289 inline void set_changed(bool changeFlag = TRUE) {
290 OnError(::set_field_status(field,changeFlag));
293 // Test whether or not the field is marked as changed
294 inline bool changed() const {
295 return ::field_status(field);
298 // Return the index of the field in the field array of a form
299 // or -1 if the field is not associated to a form
300 inline int (index)() const {
301 return ::field_index(field);
304 // Store a value in a fields buffer. The default buffer is nr. 0
305 inline void set_value(const char *val, int buffer = 0) {
306 OnError(::set_field_buffer(field,buffer,val));
309 // Retrieve the value of a fields buffer. The default buffer is nr. 0
310 inline char* value(int buffer = 0) const {
311 return ::field_buffer(field,buffer);
314 // Set the validation type of the field.
315 inline void set_fieldtype(NCursesFieldType& f) {
317 f.set(*this); // A good friend may do that...
320 // Retrieve the validation type of the field.
321 inline NCursesFieldType* fieldtype() const {
327 // This are the built-in hook functions in this C++ binding. In C++ we use
328 // virtual member functions (see below On_..._Init and On_..._Termination)
329 // to provide this functionality in an object oriented manner.
331 void _nc_xx_frm_init(FORM *);
332 void _nc_xx_frm_term(FORM *);
333 void _nc_xx_fld_init(FORM *);
334 void _nc_xx_fld_term(FORM *);
338 // -------------------------------------------------------------------------
339 // The class representing a form, wrapping the lowlevel FORM struct
340 // -------------------------------------------------------------------------
342 class NCURSES_CXX_IMPEXP NCursesForm : public NCursesPanel
345 FORM* form; // the lowlevel structure
348 NCursesWindow* sub; // the subwindow object
349 bool b_sub_owner; // is this our own subwindow?
350 bool b_framed; // has the form a border?
351 bool b_autoDelete; // Delete fields when deleting form?
353 NCursesFormField** my_fields; // The array of fields for this form
355 // This structure is used for the form's user data field to link the
356 // FORM* to the C++ object and to provide extra space for a user pointer.
358 void* m_user; // the pointer for the user's data
359 const NCursesForm* m_back; // backward pointer to C++ object
363 // Get the backward pointer to the C++ object from a FORM
364 static inline NCursesForm* getHook(const FORM *f) {
365 UserHook* hook = reinterpret_cast<UserHook*>(::form_userptr(f));
366 assert(hook != 0 && hook->m_owner==f);
367 return const_cast<NCursesForm*>(hook->m_back);
370 friend void _nc_xx_frm_init(FORM *);
371 friend void _nc_xx_frm_term(FORM *);
372 friend void _nc_xx_fld_init(FORM *);
373 friend void _nc_xx_fld_term(FORM *);
375 // Calculate FIELD* array for the menu
376 FIELD** mapFields(NCursesFormField* nfields[]);
380 inline void set_user(void *user) {
381 UserHook* uptr = reinterpret_cast<UserHook*>(::form_userptr (form));
382 assert (uptr != 0 && uptr->m_back==this && uptr->m_owner==form);
386 inline void *get_user() {
387 UserHook* uptr = reinterpret_cast<UserHook*>(::form_userptr (form));
388 assert (uptr != 0 && uptr->m_back==this && uptr->m_owner==form);
392 void InitForm (NCursesFormField* Fields[],
394 bool autoDeleteFields);
396 inline void OnError (int err) const THROW2(NCursesException const, NCursesFormException) {
398 THROW(new NCursesFormException (err));
401 // this wraps the form_driver call.
402 virtual int driver (int c) ;
404 // 'Internal' constructor, builds an object without association to a
406 NCursesForm( int nlines,
410 : NCursesPanel(nlines, ncols, begin_y, begin_x),
411 form (STATIC_CAST(FORM*)(0)),
421 // Create form for the default panel.
422 NCursesForm (NCursesFormField* Fields[],
423 bool with_frame=FALSE, // reserve space for a frame?
424 bool autoDelete_Fields=FALSE) // do automatic cleanup?
433 InitForm(Fields, with_frame, autoDelete_Fields);
436 // Create a form in a panel with the given position and size.
437 NCursesForm (NCursesFormField* Fields[],
442 bool with_frame=FALSE, // reserve space for a frame?
443 bool autoDelete_Fields=FALSE) // do automatic cleanup?
444 : NCursesPanel(nlines, ncols, begin_y, begin_x),
452 InitForm(Fields, with_frame, autoDelete_Fields);
455 NCursesForm& operator=(const NCursesForm& rhs)
459 NCursesPanel::operator=(rhs);
464 NCursesForm(const NCursesForm& rhs)
468 b_sub_owner(rhs.b_sub_owner),
469 b_framed(rhs.b_framed),
470 b_autoDelete(rhs.b_autoDelete),
471 my_fields(rhs.my_fields)
475 virtual ~NCursesForm() THROWS(NCursesException);
477 // Set the default attributes for the form
478 virtual void setDefaultAttributes();
480 // Retrieve current field of the form.
481 inline NCursesFormField* current_field() const {
482 return my_fields[::field_index(::current_field(form))];
485 // Set the forms subwindow
486 void setSubWindow(NCursesWindow& sub);
488 // Set these fields for the form
489 inline void setFields(NCursesFormField* Fields[]) {
490 OnError(::set_form_fields(form,mapFields(Fields)));
493 // Remove the form from the screen
494 inline void unpost (void) {
495 OnError (::unpost_form (form));
498 // Post the form to the screen if flag is true, unpost it otherwise
499 inline void post(bool flag = TRUE) {
500 OnError (flag ? ::post_form(form) : ::unpost_form (form));
504 inline void frame(const char *title=NULL, const char* btitle=NULL) NCURSES_OVERRIDE {
506 NCursesPanel::frame(title,btitle);
508 OnError(E_SYSTEM_ERROR);
511 inline void boldframe(const char *title=NULL, const char* btitle=NULL) NCURSES_OVERRIDE {
513 NCursesPanel::boldframe(title,btitle);
515 OnError(E_SYSTEM_ERROR);
518 inline void label(const char *topLabel, const char *bottomLabel) NCURSES_OVERRIDE {
520 NCursesPanel::label(topLabel,bottomLabel);
522 OnError(E_SYSTEM_ERROR);
529 // Called after the form gets repositioned in its window.
530 // This is especially true if the form is posted.
531 virtual void On_Form_Init();
533 // Called before the form gets repositioned in its window.
534 // This is especially true if the form is unposted.
535 virtual void On_Form_Termination();
537 // Called after the field became the current field
538 virtual void On_Field_Init(NCursesFormField& field);
540 // Called before this field is left as current field.
541 virtual void On_Field_Termination(NCursesFormField& field);
543 // Calculate required window size for the form.
544 void scale(int& rows, int& ncols) const {
545 OnError(::scale_form(form,&rows,&ncols));
548 // Retrieve number of fields in the form.
550 return ::field_count(form);
553 // Make the page the current page of the form.
554 void set_page(int pageNum) {
555 OnError(::set_form_page(form, pageNum));
558 // Retrieve current page number
560 return ::form_page(form);
563 // Switch on the forms options
564 inline void options_on (Form_Options opts) {
565 OnError (::form_opts_on (form, opts));
568 // Switch off the forms options
569 inline void options_off (Form_Options opts) {
570 OnError (::form_opts_off (form, opts));
573 // Retrieve the forms options
574 inline Form_Options options () const {
575 return ::form_opts (form);
578 // Set the forms options
579 inline void set_options (Form_Options opts) {
580 OnError (::set_form_opts (form, opts));
583 // Are there more data in the current field after the data shown
584 inline bool data_ahead() const {
585 return ::data_ahead(form);
588 // Are there more data in the current field before the data shown
589 inline bool data_behind() const {
590 return ::data_behind(form);
593 // Position the cursor to the current field
594 inline void position_cursor () {
595 OnError (::pos_form_cursor (form));
597 // Set the current field
598 inline void set_current(NCursesFormField& F) {
599 OnError (::set_current_field(form, F.field));
602 // Provide a default key virtualization. Translate the keyboard
603 // code c into a form request code.
604 // The default implementation provides a hopefully straightforward
605 // mapping for the most common keystrokes and form requests.
606 virtual int virtualize(int c);
609 inline NCursesFormField* operator[](int i) const {
610 if ( (i < 0) || (i >= ::field_count (form)) )
611 OnError (E_BAD_ARGUMENT);
615 // Perform the menu's operation
616 // Return the field where you left the form.
617 virtual NCursesFormField* operator()(void);
619 // Exception handlers. The default is a Beep.
620 virtual void On_Request_Denied(int c) const;
621 virtual void On_Invalid_Field(int c) const;
622 virtual void On_Unknown_Command(int c) const;
627 // -------------------------------------------------------------------------
628 // This is the typical C++ typesafe way to allow to attach
629 // user data to a field of a form. Its assumed that the user
630 // data belongs to some class T. Use T as template argument
631 // to create a UserField.
632 // -------------------------------------------------------------------------
633 template<class T> class NCURSES_CXX_IMPEXP NCursesUserField : public NCursesFormField
636 NCursesUserField (int rows,
640 const T* p_UserData = STATIC_CAST(T*)(0),
641 int offscreen_rows = 0,
642 int additional_buffers = 0)
643 : NCursesFormField (rows, ncols,
644 first_row, first_col,
645 offscreen_rows, additional_buffers) {
647 OnError(::set_field_userptr(field, STATIC_CAST(void *)(p_UserData)));
650 virtual ~NCursesUserField() THROWS(NCursesException) {};
652 inline const T* UserData (void) const {
653 return reinterpret_cast<const T*>(::field_userptr (field));
656 inline virtual void setUserData(const T* p_UserData) {
658 OnError (::set_field_userptr (field, STATIC_CAST(void *)(p_UserData)));
662 // -------------------------------------------------------------------------
663 // The same mechanism is used to attach user data to a form
664 // -------------------------------------------------------------------------
666 template<class T> class NCURSES_CXX_IMPEXP NCursesUserForm : public NCursesForm
669 // 'Internal' constructor, builds an object without association to a
671 NCursesUserForm( int nlines,
675 const T* p_UserData = STATIC_CAST(T*)(0))
676 : NCursesForm(nlines,ncols,begin_y,begin_x) {
678 set_user (const_cast<void *>(reinterpret_cast<const void*>
683 NCursesUserForm (NCursesFormField* Fields[],
684 const T* p_UserData = STATIC_CAST(T*)(0),
685 bool with_frame=FALSE,
686 bool autoDelete_Fields=FALSE)
687 : NCursesForm (Fields, with_frame, autoDelete_Fields) {
689 set_user (const_cast<void *>(reinterpret_cast<const void*>(p_UserData)));
692 NCursesUserForm (NCursesFormField* Fields[],
697 const T* p_UserData = STATIC_CAST(T*)(0),
698 bool with_frame=FALSE,
699 bool autoDelete_Fields=FALSE)
700 : NCursesForm (Fields, nlines, ncols, begin_y, begin_x,
701 with_frame, autoDelete_Fields) {
703 set_user (const_cast<void *>(reinterpret_cast<const void*>
707 virtual ~NCursesUserForm() THROWS(NCursesException) {
710 inline T* UserData (void) {
711 return reinterpret_cast<T*>(get_user ());
714 inline virtual void setUserData (const T* p_UserData) {
716 set_user (const_cast<void *>(reinterpret_cast<const void*>(p_UserData)));
721 // -------------------------------------------------------------------------
722 // Builtin Fieldtypes
723 // -------------------------------------------------------------------------
725 class NCURSES_CXX_IMPEXP Alpha_Field : public NCursesFieldType
730 void set(NCursesFormField& f) NCURSES_OVERRIDE {
731 OnError(::set_field_type(f.get_field(),fieldtype,min_field_width));
735 explicit Alpha_Field(int width)
736 : NCursesFieldType(TYPE_ALPHA),
737 min_field_width(width) {
741 class NCURSES_CXX_IMPEXP Alphanumeric_Field : public NCursesFieldType
746 void set(NCursesFormField& f) NCURSES_OVERRIDE {
747 OnError(::set_field_type(f.get_field(),fieldtype,min_field_width));
751 explicit Alphanumeric_Field(int width)
752 : NCursesFieldType(TYPE_ALNUM),
753 min_field_width(width) {
757 class NCURSES_CXX_IMPEXP Integer_Field : public NCursesFieldType
761 long lower_limit, upper_limit;
763 void set(NCursesFormField& f) NCURSES_OVERRIDE {
764 OnError(::set_field_type(f.get_field(),fieldtype,
765 precision,lower_limit,upper_limit));
769 Integer_Field(int prec, long low=0L, long high=0L)
770 : NCursesFieldType(TYPE_INTEGER),
771 precision(prec), lower_limit(low), upper_limit(high) {
775 class NCURSES_CXX_IMPEXP Numeric_Field : public NCursesFieldType
779 double lower_limit, upper_limit;
781 void set(NCursesFormField& f) NCURSES_OVERRIDE {
782 OnError(::set_field_type(f.get_field(),fieldtype,
783 precision,lower_limit,upper_limit));
787 Numeric_Field(int prec, double low=0.0, double high=0.0)
788 : NCursesFieldType(TYPE_NUMERIC),
789 precision(prec), lower_limit(low), upper_limit(high) {
793 class NCURSES_CXX_IMPEXP Regular_Expression_Field : public NCursesFieldType
798 void set(NCursesFormField& f) NCURSES_OVERRIDE {
799 OnError(::set_field_type(f.get_field(),fieldtype,regex));
802 void copy_regex(const char *source)
804 regex = new char[1 + ::strlen(source)];
805 (::strcpy)(regex, source);
809 explicit Regular_Expression_Field(const char *expr)
810 : NCursesFieldType(TYPE_REGEXP),
816 Regular_Expression_Field& operator=(const Regular_Expression_Field& rhs)
820 copy_regex(rhs.regex);
821 NCursesFieldType::operator=(rhs);
826 Regular_Expression_Field(const Regular_Expression_Field& rhs)
827 : NCursesFieldType(rhs),
830 copy_regex(rhs.regex);
833 ~Regular_Expression_Field() {
838 class NCURSES_CXX_IMPEXP Enumeration_Field : public NCursesFieldType
843 int non_unique_matches;
845 void set(NCursesFormField& f) NCURSES_OVERRIDE {
846 OnError(::set_field_type(f.get_field(),fieldtype,
847 list,case_sensitive,non_unique_matches));
850 Enumeration_Field(const char* enums[],
851 bool case_sens=FALSE,
852 bool non_unique=FALSE)
853 : NCursesFieldType(TYPE_ENUM),
855 case_sensitive(case_sens ? -1 : 0),
856 non_unique_matches(non_unique ? -1 : 0) {
859 Enumeration_Field& operator=(const Enumeration_Field& rhs)
863 NCursesFieldType::operator=(rhs);
868 Enumeration_Field(const Enumeration_Field& rhs)
869 : NCursesFieldType(rhs),
871 case_sensitive(rhs.case_sensitive),
872 non_unique_matches(rhs.non_unique_matches)
877 class NCURSES_CXX_IMPEXP IPV4_Address_Field : public NCursesFieldType
880 void set(NCursesFormField& f) NCURSES_OVERRIDE {
881 OnError(::set_field_type(f.get_field(),fieldtype));
885 IPV4_Address_Field() : NCursesFieldType(TYPE_IPV4) {
890 bool _nc_xx_fld_fcheck(FIELD *, const void*);
891 bool _nc_xx_fld_ccheck(int c, const void *);
892 void* _nc_xx_fld_makearg(va_list*);
896 // -------------------------------------------------------------------------
897 // Abstract base class for User-Defined Fieldtypes
898 // -------------------------------------------------------------------------
900 class NCURSES_CXX_IMPEXP UserDefinedFieldType : public NCursesFieldType
902 friend class UDF_Init; // Internal helper to set up statics
904 // For all C++ defined fieldtypes we need only one generic lowlevel
905 // FIELDTYPE* element.
906 static FIELDTYPE* generic_fieldtype;
909 // This are the functions required by the low level libforms functions
910 // to construct a fieldtype.
911 friend bool _nc_xx_fld_fcheck(FIELD *, const void*);
912 friend bool _nc_xx_fld_ccheck(int c, const void *);
913 friend void* _nc_xx_fld_makearg(va_list*);
915 void set(NCursesFormField& f) NCURSES_OVERRIDE {
916 OnError(::set_field_type(f.get_field(),fieldtype,&f));
920 // Redefine this function to do a field validation. The argument
921 // is a reference to the field you should validate.
922 virtual bool field_check(NCursesFormField& f) = 0;
924 // Redefine this function to do a character validation. The argument
925 // is the character to be validated.
926 virtual bool char_check (int c) = 0;
929 UserDefinedFieldType();
933 bool _nc_xx_next_choice(FIELD*, const void *);
934 bool _nc_xx_prev_choice(FIELD*, const void *);
938 // -------------------------------------------------------------------------
939 // Abstract base class for User-Defined Fieldtypes with Choice functions
940 // -------------------------------------------------------------------------
942 class NCURSES_CXX_IMPEXP UserDefinedFieldType_With_Choice : public UserDefinedFieldType
944 friend class UDF_Init; // Internal helper to set up statics
946 // For all C++ defined fieldtypes with choice functions we need only one
947 // generic lowlevel FIELDTYPE* element.
948 static FIELDTYPE* generic_fieldtype_with_choice;
950 // This are the functions required by the low level libforms functions
951 // to construct a fieldtype with choice functions.
952 friend bool _nc_xx_next_choice(FIELD*, const void *);
953 friend bool _nc_xx_prev_choice(FIELD*, const void *);
956 // Redefine this function to do the retrieval of the next choice value.
957 // The argument is a reference to the field tobe examined.
958 virtual bool next (NCursesFormField& f) = 0;
960 // Redefine this function to do the retrieval of the previous choice value.
961 // The argument is a reference to the field tobe examined.
962 virtual bool previous(NCursesFormField& f) = 0;
965 UserDefinedFieldType_With_Choice();
968 #endif /* NCURSES_CURSESF_H_incl */