PHTTPField Class Referenceabstract

This class is the abstract base class for fields in a `PHTTPForm` resource type. More...

`#include <httpform.h>`

Inheritance diagram for PHTTPField:

## Public Member Functions

| PHTTPField (const char *bname, const char *title, const char *help)
virtual Comparison | Compare (const PObject &obj) const
| Compare the fields using the field names. More...
const PCaselessString & | GetName () const
| Get the identifier name of the field. More...
const PCaselessString & | GetBaseName () const
| Get the identifier name of the field. More...
virtual void | SetName (const PString &newName)
| Set the name for the field. More...
virtual const PHTTPField * | LocateName (const PString &name) const
| Locate the field naem, recusing down for composite fields. More...
const PString & | GetTitle () const
| Get the title of the field. More...
const PString & | GetHelp () const
| Get the title of the field. More...
void | SetHelp (const PString &text)
void | SetHelp (const PString &hotLinkURL, const PString &linkText)
void | SetHelp (const PString &hotLinkURL, const PString &imageURL, const PString &imageText)
virtual PHTTPField * | NewField () const =0
| Create a new field of the same class as the current field. More...
virtual void | ExpandFieldNames (PString &text, PINDEX start, PINDEX &finish) const
virtual void | GetHTMLTag (PHTML &html) const =0
| Convert the field to HTML form tag for inclusion into the HTTP page. More...
virtual PString | GetHTMLInput (const PString &input) const
| Convert the field input to HTML for inclusion into the HTTP page. More...
virtual PString | GetHTMLSelect (const PString &selection) const
| Convert the field input to HTML for inclusion into the HTTP page. More...
virtual void | GetHTMLHeading (PHTML &html) const
| Convert the field to HTML for inclusion into the HTTP page. More...
virtual PString | GetValue (PBoolean dflt=false) const =0
| Get the string value of the field. More...
virtual void | SetValue (const PString &newValue)=0
| Set the value of the field. More...
virtual void | LoadFromConfig (PConfig &cfg)
| Get the value of the PConfig to the sub-field. More...
virtual void | SaveToConfig (PConfig &cfg) const
| Set the value of the sub-field into the PConfig. More...
virtual PBoolean | Validated (const PString &newVal, PStringStream &msg) const
| Validate the new field value before `SetValue()` is called. More...
virtual void | GetAllNames (PStringArray &names) const
| Retrieve all the names in the field and subfields. More...
virtual void | SetAllValues (const PStringToString &data)
| Set the value of the field in a list of fields. More...
virtual PBoolean | ValidateAll (const PStringToString &data, PStringStream &msg) const
| Validate the new field value in a list before `SetValue()` is called. More...
PBoolean | NotYetInHTML () const
void | SetInHTML ()
Public Member Functions inherited from PObject
virtual | ~PObject ()
virtual PObject * | Clone () const
| Create a copy of the class on the heap. More...
virtual PINDEX | HashFunction () const
| This function yields a hash value required by the `PDictionary` class. More...
virtual Comparison | CompareObjectMemoryDirect (const PObject &obj) const
| Determine the byte wise comparison of two objects. More...
bool | operator== (const PObject &obj) const
| Compare the two objects. More...
bool | operator!= (const PObject &obj) const
| Compare the two objects. More...
bool | operator< (const PObject &obj) const
| Compare the two objects. More...
bool | operator> (const PObject &obj) const
| Compare the two objects. More...
bool | operator<= (const PObject &obj) const
| Compare the two objects. More...
bool | operator>= (const PObject &obj) const
| Compare the two objects. More...
virtual const char * | GetClass (unsigned ancestor=0) const
| Get the current dynamic type of the object instance. More...
PBoolean | IsClass (const char *cls) const
virtual PBoolean | InternalIsDescendant (const char *clsName) const
| Determine if the dynamic type of the current instance is a descendent of the specified class. More...
virtual void | PrintOn (ostream &strm) const
| Output the contents of the object to the stream. More...
virtual void | ReadFrom (istream &strm)
| Input the contents of the object from the stream. More...

## Protected Attributes

PCaselessString | baseName
PCaselessString | fullName
PString | title
PString | help
PBoolean | notInHTML

## Additional Inherited Members

Public Types inherited from PObject
enum | Comparison { LessThan = -1, EqualTo = 0, GreaterThan = 1 }
| Result of the comparison operation performed by the `Compare()` function. More...
Static Public Member Functions inherited from PObject
static Comparison | InternalCompareObjectMemoryDirect (const PObject *obj1, const PObject *obj2, PINDEX size)
| Internal function caled from CompareObjectMemoryDirect() More...
static const char * | Class ()
| Get the name of the class as a C string. More...
Protected Member Functions inherited from PObject
| PObject ()
| Constructor for PObject, made protected so cannot ever create one on its own. More...

## Detailed Description

This class is the abstract base class for fields in a `PHTTPForm` resource type.

## Constructor & Destructor Documentation

## PHTTPField()

PHTTPField::PHTTPField | ( | const char * | bname,
|  | const char * | title,
|  | const char * | help
| ) |  |

## Member Function Documentation

## Compare()

virtual Comparison PHTTPField::Compare | ( | const PObject & | obj | ) | const

virtual

Compare the fields using the field names.

Returns
  Comparison of the name fields of the two fields.

Reimplemented from PObject.

## ExpandFieldNames()

virtual void PHTTPField::ExpandFieldNames | ( | PString & | text,
|  | PINDEX | start,
|  | PINDEX & | finish
| ) |  | const

virtual

Reimplemented in PHTTPFieldArray, and PHTTPCompositeField.

Referenced by SetHelp().

## GetAllNames()

virtual void PHTTPField::GetAllNames | ( | PStringArray & | names | ) | const

virtual

Retrieve all the names in the field and subfields.

Returns
  Array of strings for each subfield.

Reimplemented in PHTTPCompositeField.

Referenced by SetHelp().

## GetBaseName()

const PCaselessString& PHTTPField::GetBaseName | ( |  | ) | const

inline

Get the identifier name of the field.

Returns
  String for field name.

References baseName, LocateName(), and SetName().

## GetHelp()

const PString& PHTTPField::GetHelp | ( |  | ) | const

inline

Get the title of the field.

Returns
  String for title placed next to the field.

References help.

## GetHTMLHeading()

virtual void PHTTPField::GetHTMLHeading | ( | PHTML & | html | ) | const

virtual

Convert the field to HTML for inclusion into the HTTP page.

Reimplemented in PHTTPSubForm, and PHTTPCompositeField.

Referenced by SetHelp().

## GetHTMLInput()

virtual PString PHTTPField::GetHTMLInput | ( | const PString & | input | ) | const

virtual

Convert the field input to HTML for inclusion into the HTTP page.

Reimplemented in PHTTPRadioField, PHTTPBooleanField, and PHTTPCompositeField.

Referenced by SetHelp().

## GetHTMLSelect()

virtual PString PHTTPField::GetHTMLSelect | ( | const PString & | selection | ) | const

virtual

Convert the field input to HTML for inclusion into the HTTP page.

Referenced by SetHelp().

## GetHTMLTag()

virtual void PHTTPField::GetHTMLTag | ( | PHTML & | html | ) | const

pure virtual

Convert the field to HTML form tag for inclusion into the HTTP page.

Implemented in PHTTPSelectField, PHTTPRadioField, PHTTPBooleanField, PHTTPIntegerField, PHTTPPasswordField, PHTTPStringField, PHTTPFieldArray, PHTTPSubForm, and PHTTPCompositeField.

Referenced by SetHelp().

## GetName()

const PCaselessString& PHTTPField::GetName | ( |  | ) | const

inline

Get the identifier name of the field.

Returns
  String for field name.

References fullName.

## GetTitle()

const PString& PHTTPField::GetTitle | ( |  | ) | const

inline

Get the title of the field.

Returns
  String for title placed next to the field.

References title.

## GetValue()

virtual PString PHTTPField::GetValue | ( | PBoolean | dflt = `false` | ) | const

pure virtual

Get the string value of the field.

Returns
  String for field value.

Implemented in PHTTPSelectField, PHTTPRadioField, PHTTPBooleanField, PHTTPIntegerField, PHTTPPasswordField, PHTTPStringField, and PHTTPCompositeField.

Referenced by SetHelp().

## LoadFromConfig()

virtual void PHTTPField::LoadFromConfig | ( | PConfig & | cfg | ) |

virtual

Get the value of the PConfig to the sub-field.

If the field is not composite then it always sets the value as for the non-indexed version.

Reimplemented in PHTTPBooleanField, PHTTPIntegerField, PHTTPFieldArray, and PHTTPCompositeField.

Referenced by SetHelp().

## LocateName()

virtual const PHTTPField* PHTTPField::LocateName | ( | const PString & | name | ) | const

virtual

Locate the field naem, recusing down for composite fields.

Returns
  Pointer to located field, or NULL if not found.

Reimplemented in PHTTPCompositeField.

Referenced by GetBaseName().

## NewField()

virtual PHTTPField* PHTTPField::NewField | ( |  | ) | const

pure virtual

Create a new field of the same class as the current field.

Returns
  New field object instance.

Implemented in PHTTPSelectField, PHTTPRadioField, PHTTPBooleanField, PHTTPIntegerField, PHTTPDateField, PHTTPPasswordField, PHTTPStringField, PHTTPFieldArray, PHTTPSubForm, and PHTTPCompositeField.

Referenced by SetHelp().

## NotYetInHTML()

PBoolean PHTTPField::NotYetInHTML | ( |  | ) | const

inline

References notInHTML.

## SaveToConfig()

virtual void PHTTPField::SaveToConfig | ( | PConfig & | cfg | ) | const

virtual

Set the value of the sub-field into the PConfig.

If the field is not composite then it always sets the value as for the non-indexed version.

Reimplemented in PHTTPBooleanField, PHTTPIntegerField, PHTTPFieldArray, and PHTTPCompositeField.

Referenced by SetHelp().

## SetAllValues()

virtual void PHTTPField::SetAllValues | ( | const PStringToString & | data | ) |

virtual

Set the value of the field in a list of fields.

Reimplemented in PHTTPFieldArray, and PHTTPCompositeField.

Referenced by SetHelp().

## SetHelp() [1/3]

void PHTTPField::SetHelp | ( | const PString & | text | ) |

inline

References ExpandFieldNames(), GetAllNames(), GetHTMLHeading(), GetHTMLInput(), GetHTMLSelect(), GetHTMLTag(), GetValue(), LoadFromConfig(), NewField(), SaveToConfig(), SetAllValues(), SetValue(), ValidateAll(), and Validated().

## SetHelp() [2/3]

void PHTTPField::SetHelp | ( | const PString & | hotLinkURL,
|  | const PString & | linkText
| ) |  |

## SetHelp() [3/3]

void PHTTPField::SetHelp | ( | const PString & | hotLinkURL,
|  | const PString & | imageURL,
|  | const PString & | imageText
| ) |  |

## SetInHTML()

void PHTTPField::SetInHTML | ( |  | ) |

inline

References notInHTML.

## SetName()

virtual void PHTTPField::SetName | ( | const PString & | newName | ) |

virtual

Set the name for the field.

Reimplemented in PHTTPCompositeField.

Referenced by GetBaseName().

## SetValue()

virtual void PHTTPField::SetValue | ( | const PString & | newValue | ) |

pure virtual

Set the value of the field.

Implemented in PHTTPSelectField, PHTTPRadioField, PHTTPBooleanField, PHTTPIntegerField, PHTTPDateField, PHTTPPasswordField, PHTTPStringField, and PHTTPCompositeField.

Referenced by SetHelp().

## ValidateAll()

virtual PBoolean PHTTPField::ValidateAll | ( | const PStringToString & | data,
|  | PStringStream & | msg
| ) |  | const

virtual

Validate the new field value in a list before `SetValue()` is called.

Returns
  PBoolean if the all the new field values are OK.

Reimplemented in PHTTPCompositeField.

Referenced by SetHelp().

## Validated()

virtual PBoolean PHTTPField::Validated | ( | const PString & | newVal,
|  | PStringStream & | msg
| ) |  | const

virtual

Validate the new field value before `SetValue()` is called.

Returns
  PBoolean if the new field value is OK.

Reimplemented in PHTTPIntegerField, and PHTTPDateField.

Referenced by SetHelp().

## Member Data Documentation

## baseName

PCaselessString PHTTPField::baseName

protected

Referenced by GetBaseName().

## fullName

PCaselessString PHTTPField::fullName

protected

Referenced by GetName().

## help

PString PHTTPField::help

protected

Referenced by GetHelp().

## notInHTML

PBoolean PHTTPField::notInHTML

protected

Referenced by NotYetInHTML(), and SetInHTML().

## title

PString PHTTPField::title

protected

Referenced by GetTitle().

The documentation for this class was generated from the following file:

- httpform.h