Public Types | Public Member Functions

Swift::Form Class Reference

XEP-0004 Data form. More...

Inheritance diagram for Swift::Form:
Collaboration diagram for Swift::Form:

List of all members.

Public Types

enum  Type { FormType, SubmitType, CancelType, ResultType }
typedef boost::shared_ptr< Formref
typedef std::vector
< FormField::ref
FormItem

Public Member Functions

 Form (Type type=FormType)
void addField (boost::shared_ptr< FormField > field)
 Add a field to the form.
const std::vector
< boost::shared_ptr< FormField > > & 
getFields () const
void setTitle (const std::string &title)
const std::string & getTitle () const
void setInstructions (const std::string &instructions)
const std::string & getInstructions () const
Type getType () const
void setType (Type type)
std::string getFormType () const
FormField::ref getField (const std::string &name) const
void addReportedField (FormField::ref field)
const std::vector
< FormField::ref > & 
getReportedFields () const
void addItem (const FormItem &item)
const std::vector< FormItem > & getItems () const

Detailed Description

XEP-0004 Data form.

For the relevant Fields, the parsers and serialisers protect the API user against the strange multi-value instead of newline thing by transforming them.

Definition at line 23 of file Form.h.


Member Typedef Documentation

typedef std::vector<FormField::ref> Swift::Form::FormItem

Definition at line 26 of file Form.h.

typedef boost::shared_ptr<Form> Swift::Form::ref

Reimplemented from Swift::Payload.

Definition at line 25 of file Form.h.


Member Enumeration Documentation

Enumerator:
FormType 
SubmitType 
CancelType 
ResultType 

Definition at line 28 of file Form.h.


Constructor & Destructor Documentation

Swift::Form::Form ( Type  type = FormType  )  [inline]

Definition at line 31 of file Form.h.


Member Function Documentation

void Swift::Form::addField ( boost::shared_ptr< FormField field  )  [inline]

Add a field to the form.

Parameters:
field New field - must not be null.

Definition at line 36 of file Form.h.

void Swift::Form::addItem ( const FormItem item  ) 
void Swift::Form::addReportedField ( FormField::ref  field  ) 
FormField::ref Swift::Form::getField ( const std::string &  name  )  const
const std::vector<boost::shared_ptr<FormField> >& Swift::Form::getFields (  )  const [inline]

Definition at line 37 of file Form.h.

std::string Swift::Form::getFormType (  )  const
const std::string& Swift::Form::getInstructions (  )  const [inline]

Definition at line 42 of file Form.h.

const std::vector<FormItem>& Swift::Form::getItems (  )  const
const std::vector<FormField::ref>& Swift::Form::getReportedFields (  )  const
const std::string& Swift::Form::getTitle (  )  const [inline]

Definition at line 39 of file Form.h.

Type Swift::Form::getType (  )  const [inline]

Definition at line 44 of file Form.h.

void Swift::Form::setInstructions ( const std::string &  instructions  )  [inline]

Definition at line 41 of file Form.h.

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

Definition at line 38 of file Form.h.

void Swift::Form::setType ( Type  type  )  [inline]

Definition at line 45 of file Form.h.