// * 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>
// 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:
// The class representing a forms field, wrapping the lowlevel FIELD struct
// -------------------------------------------------------------------------
//
-class NCursesFormField {
+class NCURSES_IMPEXP NCursesFormField {
friend class NCursesForm;
protected:
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);
}
// 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
// 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,
// 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
}
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,
// Builtin Fieldtypes
// -------------------------------------------------------------------------
//
-class Alpha_Field : public NCursesFieldType {
+class NCURSES_IMPEXP Alpha_Field : public NCursesFieldType {
private:
int min_field_width;
}
};
-class Alphanumeric_Field : public NCursesFieldType {
+class NCURSES_IMPEXP Alphanumeric_Field : public NCursesFieldType {
private:
int min_field_width;
}
};
-class Integer_Field : public NCursesFieldType {
+class NCURSES_IMPEXP Integer_Field : public NCursesFieldType {
private:
int precision;
long lower_limit, upper_limit;
}
};
-class Numeric_Field : public NCursesFieldType {
+class NCURSES_IMPEXP Numeric_Field : public NCursesFieldType {
private:
int precision;
double lower_limit, upper_limit;
}
};
-class Regular_Expression_Field : public NCursesFieldType {
+class NCURSES_IMPEXP Regular_Expression_Field : public NCursesFieldType {
private:
char* regex;
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() {
}
};
-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;
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),
}
};
-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));
// 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
// 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
}
};
-#endif // _CURSESF_H
+#endif // NCURSES_CURSESF_H_incl