DataForm Class Reference

An abstraction of a JEP-0004 Data Form. More...

#include <dataform.h>

Inherits DataFormBase.

Inheritance diagram for DataForm:

Inheritance graph
[legend]
Collaboration diagram for DataForm:

Collaboration graph
[legend]
List of all members.

Public Types

enum  DataFormType {
  FORM_TYPE_FORM, FORM_TYPE_SUBMIT, FORM_TYPE_CANCEL, FORM_TYPE_RESULT,
  FORM_TYPE_INVALID
}

Public Member Functions

 DataForm (DataFormType type, const StringList &instructions, const std::string &title="")
 DataForm (Tag *tag)
virtual ~DataForm ()
Tagtag ()
const std::string & title () const
void setTitle (const std::string &title)
const StringListinstructions () const
void setInstructions (const StringList &instructions)

Detailed Description

An abstraction of a JEP-0004 Data Form.

Author:
Jakob Schroeter <js@camaya.net>
Since:
0.7

Definition at line 34 of file dataform.h.


Member Enumeration Documentation

enum DataFormType
 

Describes the possible Form Types.

Enumerator:
FORM_TYPE_FORM  The forms-processing entity is asking the forms-submitting entity to complete a form.
FORM_TYPE_SUBMIT  The forms-submitting entity is submitting data to the forms-processing entity.
FORM_TYPE_CANCEL  The forms-submitting entity has cancelled submission of data to the forms-processing entity.
FORM_TYPE_RESULT  The forms-processing entity is returning data (e.g., search results) to the forms-submitting entity, or the data is a generic data set.
FORM_TYPE_INVALID  The form is invalid. Only possible if the form was created from an Tag which doesn't correctly describe a Data Form.

Definition at line 40 of file dataform.h.


Constructor & Destructor Documentation

DataForm DataFormType  type,
const StringList instructions,
const std::string &  title = ""
 

Constructs a new, empty form.

Parameters:
type The form type.
instructions Natural-language instructions for filling out the form. Should not contain newlines (\n, \r).
title The natural-language title of the form. Should not contain newlines (\n, \r).

Definition at line 21 of file dataform.cpp.

DataForm Tag tag  ) 
 

Constructs a new DataForm from an existing Tag/XML representation.

Parameters:
tag The existing form to parse.

Definition at line 26 of file dataform.cpp.

References Tag::children(), DataForm::FORM_TYPE_CANCEL, DataForm::FORM_TYPE_FORM, DataForm::FORM_TYPE_RESULT, DataForm::FORM_TYPE_SUBMIT, Tag::hasAttribute(), DataFormBase::m_fields, Tag::name(), and DataForm::tag().

~DataForm  )  [virtual]
 

Virtual destructor.

Definition at line 59 of file dataform.cpp.


Member Function Documentation

const StringList& instructions  )  const [inline]
 

Retrieves the natural-language instructions for the form.

Returns:
The fill-in instructions for the form.

Definition at line 98 of file dataform.h.

void setInstructions const StringList instructions  )  [inline]
 

Use this function to set natural-language instructions for the form.

Parameters:
instructions The instructions for the form.
Note:
The instructions should not contain newlines (\n, \r). Instead, every line should be an element of the StringMap. This allows for platform dependent newline handling on the target platform.

Definition at line 107 of file dataform.h.

void setTitle const std::string &  title  )  [inline]
 

Use this function to set the title of the form.

Parameters:
title The new title of the form.
Note:
The title should not contain newlines (\n, \r).

Definition at line 92 of file dataform.h.

Tag * tag  ) 
 

Use this function to create a Tag representation of the form.

Returns:
A Tag hierarchically describing the form, or NULL if the form is invalid (i.e. created from a Tag not correctly describing a Data Form).

Definition at line 63 of file dataform.cpp.

References Tag::addAttrib(), Tag::addChild(), and DataForm::FORM_TYPE_INVALID.

Referenced by DataForm::DataForm().

const std::string& title  )  const [inline]
 

Use this function to retrieve the title of the form.

Returns:
The title of the form.

Definition at line 85 of file dataform.h.


The documentation for this class was generated from the following files:
Generated on Mon Jan 16 16:19:57 2006 for gloox by  doxygen 1.4.6