]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - c++/cursesf.h
ncurses 6.5 - patch 20240504
[ncurses.git] / c++ / cursesf.h
index 17d4c70eddbbdbf26190110c7030c580044f7dea..e29e7adbf6f079a892f9c7297ccf916b4015ed43 100644 (file)
@@ -1,6 +1,7 @@
 // * This makes emacs happy -*-Mode: C++;-*-
+// vile:cppmode
 /****************************************************************************
- * Copyright 2019,2020 Thomas E. Dickey                                     *
+ * Copyright 2019-2021,2022 Thomas E. Dickey                                *
  * Copyright 1998-2012,2014 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -32,7 +33,7 @@
  *   Author: Juergen Pfeifer, 1997                                          *
  ****************************************************************************/
 
-// $Id: cursesf.h,v 1.35 2020/02/02 23:34:34 tom Exp $
+// $Id: cursesf.h,v 1.39 2022/08/20 20:52:15 tom Exp $
 
 #ifndef NCURSES_CURSESF_H_incl
 #define NCURSES_CURSESF_H_incl 1
@@ -51,11 +52,11 @@ extern "C" {
 // The abstract base class for builtin and user defined Fieldtypes.
 // -------------------------------------------------------------------------
 //
-class NCURSES_IMPEXP NCursesFormField; // forward declaration
+class NCURSES_CXX_IMPEXP NCursesFormField; // forward declaration
 
 // Class to represent builtin field types as well as C++ written new
 // fieldtypes (see classes UserDefineFieldType...
-class NCURSES_IMPEXP NCursesFieldType
+class NCURSES_CXX_IMPEXP NCursesFieldType
 {
   friend class NCursesFormField;
 
@@ -101,7 +102,7 @@ public:
 // The class representing a forms field, wrapping the lowlevel FIELD struct
 // -------------------------------------------------------------------------
 //
-class NCURSES_IMPEXP NCursesFormField
+class NCURSES_CXX_IMPEXP NCursesFormField
 {
   friend class NCursesForm;
 
@@ -338,7 +339,7 @@ extern "C" {
 // The class representing a form, wrapping the lowlevel FORM struct
 // -------------------------------------------------------------------------
 //
-class NCURSES_IMPEXP NCursesForm : public NCursesPanel
+class NCURSES_CXX_IMPEXP NCursesForm : public NCursesPanel
 {
 protected:
   FORM* form;  // the lowlevel structure
@@ -500,21 +501,21 @@ public:
   }
 
   // Decorations
-  inline void frame(const char *title=NULL, const char* btitle=NULL) {
+  inline void frame(const char *title=NULL, const char* btitle=NULL) NCURSES_OVERRIDE {
     if (b_framed)
       NCursesPanel::frame(title,btitle);
     else
       OnError(E_SYSTEM_ERROR);
   }
 
-  inline void boldframe(const char *title=NULL, const char* btitle=NULL) {
+  inline void boldframe(const char *title=NULL, const char* btitle=NULL) NCURSES_OVERRIDE {
     if (b_framed)
       NCursesPanel::boldframe(title,btitle);
     else
       OnError(E_SYSTEM_ERROR);
   }
 
-  inline void label(const char *topLabel, const char *bottomLabel) {
+  inline void label(const char *topLabel, const char *bottomLabel) NCURSES_OVERRIDE {
     if (b_framed)
       NCursesPanel::label(topLabel,bottomLabel);
     else
@@ -629,7 +630,7 @@ public:
 // data belongs to some class T. Use T as template argument
 // to create a UserField.
 // -------------------------------------------------------------------------
-template<class T> class NCURSES_IMPEXP NCursesUserField : public NCursesFormField
+template<class T> class NCURSES_CXX_IMPEXP NCursesUserField : public NCursesFormField
 {
 public:
   NCursesUserField (int rows,
@@ -662,7 +663,7 @@ public:
 // The same mechanism is used to attach user data to a form
 // -------------------------------------------------------------------------
 //
-template<class T> class NCURSES_IMPEXP NCursesUserForm : public NCursesForm
+template<class T> class NCURSES_CXX_IMPEXP NCursesUserForm : public NCursesForm
 {
 protected:
   // 'Internal' constructor, builds an object without association to a
@@ -721,45 +722,45 @@ public:
 // Builtin Fieldtypes
 // -------------------------------------------------------------------------
 //
-class NCURSES_IMPEXP Alpha_Field : public NCursesFieldType
+class NCURSES_CXX_IMPEXP Alpha_Field : public NCursesFieldType
 {
 private:
   int min_field_width;
 
-  void set(NCursesFormField& f) {
+  void set(NCursesFormField& f) NCURSES_OVERRIDE {
     OnError(::set_field_type(f.get_field(),fieldtype,min_field_width));
   }
 
 public:
-  Alpha_Field(int width)
+  explicit Alpha_Field(int width)
     : NCursesFieldType(TYPE_ALPHA),
       min_field_width(width) {
   }
 };
 
-class NCURSES_IMPEXP Alphanumeric_Field : public NCursesFieldType
+class NCURSES_CXX_IMPEXP Alphanumeric_Field : public NCursesFieldType
 {
 private:
   int min_field_width;
 
-  void set(NCursesFormField& f) {
+  void set(NCursesFormField& f) NCURSES_OVERRIDE {
     OnError(::set_field_type(f.get_field(),fieldtype,min_field_width));
   }
 
 public:
-  Alphanumeric_Field(int width)
+  explicit Alphanumeric_Field(int width)
     : NCursesFieldType(TYPE_ALNUM),
       min_field_width(width) {
   }
 };
 
-class NCURSES_IMPEXP Integer_Field : public NCursesFieldType
+class NCURSES_CXX_IMPEXP Integer_Field : public NCursesFieldType
 {
 private:
   int precision;
   long lower_limit, upper_limit;
 
-  void set(NCursesFormField& f) {
+  void set(NCursesFormField& f) NCURSES_OVERRIDE {
     OnError(::set_field_type(f.get_field(),fieldtype,
                             precision,lower_limit,upper_limit));
   }
@@ -771,13 +772,13 @@ public:
   }
 };
 
-class NCURSES_IMPEXP Numeric_Field : public NCursesFieldType
+class NCURSES_CXX_IMPEXP Numeric_Field : public NCursesFieldType
 {
 private:
   int precision;
   double lower_limit, upper_limit;
 
-  void set(NCursesFormField& f) {
+  void set(NCursesFormField& f) NCURSES_OVERRIDE {
     OnError(::set_field_type(f.get_field(),fieldtype,
                             precision,lower_limit,upper_limit));
   }
@@ -789,12 +790,12 @@ public:
   }
 };
 
-class NCURSES_IMPEXP Regular_Expression_Field : public NCursesFieldType
+class NCURSES_CXX_IMPEXP Regular_Expression_Field : public NCursesFieldType
 {
 private:
   char* regex;
 
-  void set(NCursesFormField& f) {
+  void set(NCursesFormField& f) NCURSES_OVERRIDE {
     OnError(::set_field_type(f.get_field(),fieldtype,regex));
   }
 
@@ -805,7 +806,7 @@ private:
   }
 
 public:
-  Regular_Expression_Field(const char *expr)
+  explicit Regular_Expression_Field(const char *expr)
     : NCursesFieldType(TYPE_REGEXP),
       regex(NULL)
   {
@@ -834,14 +835,14 @@ public:
   }
 };
 
-class NCURSES_IMPEXP Enumeration_Field : public NCursesFieldType
+class NCURSES_CXX_IMPEXP Enumeration_Field : public NCursesFieldType
 {
 private:
   const char** list;
   int case_sensitive;
   int non_unique_matches;
 
-  void set(NCursesFormField& f) {
+  void set(NCursesFormField& f) NCURSES_OVERRIDE {
     OnError(::set_field_type(f.get_field(),fieldtype,
                             list,case_sensitive,non_unique_matches));
   }
@@ -873,10 +874,10 @@ public:
   }
 };
 
-class NCURSES_IMPEXP IPV4_Address_Field : public NCursesFieldType
+class NCURSES_CXX_IMPEXP IPV4_Address_Field : public NCursesFieldType
 {
 private:
-  void set(NCursesFormField& f) {
+  void set(NCursesFormField& f) NCURSES_OVERRIDE {
     OnError(::set_field_type(f.get_field(),fieldtype));
   }
 
@@ -896,7 +897,7 @@ extern "C" {
 // Abstract base class for User-Defined Fieldtypes
 // -------------------------------------------------------------------------
 //
-class NCURSES_IMPEXP UserDefinedFieldType : public NCursesFieldType
+class NCURSES_CXX_IMPEXP UserDefinedFieldType : public NCursesFieldType
 {
   friend class UDF_Init; // Internal helper to set up statics
 private:
@@ -911,7 +912,7 @@ protected:
   friend bool _nc_xx_fld_ccheck(int c, const void *);
   friend void* _nc_xx_fld_makearg(va_list*);
 
-  void set(NCursesFormField& f) {
+  void set(NCursesFormField& f) NCURSES_OVERRIDE {
     OnError(::set_field_type(f.get_field(),fieldtype,&f));
   }
 
@@ -925,8 +926,7 @@ protected:
   virtual bool char_check (int c) = 0;
 
 public:
-  UserDefinedFieldType() : NCursesFieldType(generic_fieldtype) {
-  }
+  UserDefinedFieldType();
 };
 
 extern "C" {
@@ -939,7 +939,7 @@ extern "C" {
 // Abstract base class for User-Defined Fieldtypes with Choice functions
 // -------------------------------------------------------------------------
 //
-class NCURSES_IMPEXP UserDefinedFieldType_With_Choice : public UserDefinedFieldType
+class NCURSES_CXX_IMPEXP UserDefinedFieldType_With_Choice : public UserDefinedFieldType
 {
   friend class UDF_Init; // Internal helper to set up statics
 private:
@@ -962,9 +962,7 @@ protected:
   virtual bool previous(NCursesFormField& f) = 0;
 
 public:
-  UserDefinedFieldType_With_Choice() {
-    fieldtype = generic_fieldtype_with_choice;
-  }
+  UserDefinedFieldType_With_Choice();
 };
 
 #endif /* NCURSES_CURSESF_H_incl */