]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - c++/cursesf.h
ncurses 5.4
[ncurses.git] / c++ / cursesf.h
index 40f4146172c355084fe274b77aa7ddbdf5c2691b..91b390b2387c0ef77496f3d30e69609638f0d944 100644 (file)
@@ -1,6 +1,6 @@
 // * This makes emacs happy -*-Mode: C++;-*-
 /****************************************************************************
- * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2003,2004 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
  ****************************************************************************/
 
 /****************************************************************************
- *   Author: Juergen Pfeifer <juergen.pfeifer@gmx.net> 1997                 *
+ *   Author: Juergen Pfeifer, 1997                                          *
  ****************************************************************************/
 
-// $Id: cursesf.h,v 1.12 2000/07/15 21:08:25 tom Exp $
+// $Id: cursesf.h,v 1.19 2004/01/15 00:43:46 tom Exp $
 
-#ifndef _CURSESF_H
-#define _CURSESF_H
+#ifndef NCURSES_CURSESF_H_incl
+#define NCURSES_CURSESF_H_incl 1
 
 #include <cursesp.h>
 #include <string.h>
@@ -47,11 +47,11 @@ extern "C" {
 // The abstract base class for buitin and user defined Fieldtypes.
 // -------------------------------------------------------------------------
 //
-class NCursesFormField; // forward declaration
+class NCURSES_IMPEXP NCursesFormField; // forward declaration
 
 // Class to represent builtin field types as well as C++ written new
 // fieldtypes (see classes UserDefineFieldType...
-class NCursesFieldType {
+class NCURSES_IMPEXP NCursesFieldType {
   friend class NCursesFormField;
 
 protected:
@@ -80,7 +80,7 @@ public:
 // The class representing a forms field, wrapping the lowlevel FIELD struct
 // -------------------------------------------------------------------------
 //
-class NCursesFormField {
+class NCURSES_IMPEXP NCursesFormField {
   friend class NCursesForm;
 
 protected:
@@ -265,7 +265,7 @@ public:
     OnError(::set_field_buffer(field,buffer,val));
   }
 
-  // Retrieve the value of a fields buffer. The defaukt buffer is nr. 0
+  // Retrieve the value of a fields buffer. The default buffer is nr. 0
   inline char* value(int buffer = 0) const {
     return ::field_buffer(field,buffer);
   }
@@ -288,7 +288,7 @@ public:
 // The class representing a form, wrapping the lowlevel FORM struct
 // -------------------------------------------------------------------------
 //
-class NCursesForm : public NCursesPanel {
+class NCURSES_IMPEXP NCursesForm : public NCursesPanel {
 protected:
   FORM* form;  // the lowlevel structure
 
@@ -541,7 +541,7 @@ public:
 // data belongs to some class T. Use T as template argument
 // to create a UserField.
 // -------------------------------------------------------------------------
-template<class T> class NCursesUserField : public NCursesFormField
+template<class T> class NCURSES_IMPEXP NCursesUserField : public NCursesFormField
 {
 public:
   NCursesUserField (int rows,
@@ -574,7 +574,7 @@ public:
 // The same mechanism is used to attach user data to a form
 // -------------------------------------------------------------------------
 //
-template<class T> class NCursesUserForm : public NCursesForm
+template<class T> class NCURSES_IMPEXP NCursesUserForm : public NCursesForm
 {
 protected:
   // 'Internal' constructor, builds an object without association to a
@@ -590,12 +590,6 @@ protected:
   }
 
 public:
-  NCursesUserForm (NCursesFormField Fields[],
-                  bool with_frame=FALSE,
-                  bool autoDelete_Fields=FALSE)
-    : NCursesForm (Fields, with_frame, autoDelete_Fields) {
-  };
-
   NCursesUserForm (NCursesFormField Fields[],
                   const T* p_UserData = (T*)0,
                   bool with_frame=FALSE,
@@ -637,7 +631,7 @@ public:
 // Builtin Fieldtypes
 // -------------------------------------------------------------------------
 //
-class Alpha_Field : public NCursesFieldType {
+class NCURSES_IMPEXP Alpha_Field : public NCursesFieldType {
 private:
   int min_field_width;
 
@@ -652,7 +646,7 @@ public:
   }
 };
 
-class Alphanumeric_Field : public NCursesFieldType {
+class NCURSES_IMPEXP Alphanumeric_Field : public NCursesFieldType {
 private:
   int min_field_width;
 
@@ -667,7 +661,7 @@ public:
   }
 };
 
-class Integer_Field : public NCursesFieldType {
+class NCURSES_IMPEXP Integer_Field : public NCursesFieldType {
 private:
   int precision;
   long lower_limit, upper_limit;
@@ -684,7 +678,7 @@ public:
   }
 };
 
-class Numeric_Field : public NCursesFieldType {
+class NCURSES_IMPEXP Numeric_Field : public NCursesFieldType {
 private:
   int precision;
   double lower_limit, upper_limit;
@@ -701,7 +695,7 @@ public:
   }
 };
 
-class Regular_Expression_Field : public NCursesFieldType {
+class NCURSES_IMPEXP Regular_Expression_Field : public NCursesFieldType {
 private:
   char* regex;
 
@@ -712,8 +706,8 @@ private:
 public:
   Regular_Expression_Field(const char *expr)
     : NCursesFieldType(TYPE_REGEXP) {
-      regex = new char[1+::strlen(expr)];
-      (strcpy)(regex,expr);
+      regex = new char[1 + ::strlen(expr)];
+      (::strcpy)(regex,expr);
   }
 
   ~Regular_Expression_Field() {
@@ -721,9 +715,9 @@ public:
   }
 };
 
-class Enumeration_Field : public NCursesFieldType {
+class NCURSES_IMPEXP Enumeration_Field : public NCursesFieldType {
 private:
-  char** list;
+  const char** list;
   int case_sensitive;
   int non_unique_matches;
 
@@ -732,7 +726,7 @@ private:
                             list,case_sensitive,non_unique_matches));
   }
 public:
-  Enumeration_Field(char* enums[],
+  Enumeration_Field(const char* enums[],
                    bool case_sens=FALSE,
                    bool non_unique=FALSE)
     : NCursesFieldType(TYPE_ENUM),
@@ -742,7 +736,7 @@ public:
   }
 };
 
-class IPV4_Address_Field : public NCursesFieldType {
+class NCURSES_IMPEXP IPV4_Address_Field : public NCursesFieldType {
 private:
   void set(NCursesFormField& f) {
     OnError(::set_field_type(f.get_field(),fieldtype));
@@ -757,7 +751,7 @@ public:
 // Abstract base class for User-Defined Fieldtypes
 // -------------------------------------------------------------------------
 //
-class UserDefinedFieldType : public NCursesFieldType {
+class NCURSES_IMPEXP UserDefinedFieldType : public NCursesFieldType {
   friend class UDF_Init; // Internal helper to set up statics
 private:
   // For all C++ defined fieldtypes we need only one generic lowlevel
@@ -793,7 +787,7 @@ public:
 // Abstract base class for User-Defined Fieldtypes with Choice functions
 // -------------------------------------------------------------------------
 //
-class UserDefinedFieldType_With_Choice : public UserDefinedFieldType {
+class NCURSES_IMPEXP UserDefinedFieldType_With_Choice : public UserDefinedFieldType {
   friend class UDF_Init; // Internal helper to set up statics
 private:
   // For all C++ defined fieldtypes with choice functions we need only one
@@ -820,5 +814,5 @@ public:
   }
 };
 
-#endif // _CURSESF_H
+#endif // NCURSES_CURSESF_H_incl