Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | Related Pages

DataFormFieldContainer Class Reference

An abstract base class for a XEP-0004 Data Form. More...

#include <dataformfieldcontainer.h>

Inherited by DataForm, DataFormItem, and DataFormReported.

Inheritance diagram for DataFormFieldContainer:

Inheritance graph
[legend]
List of all members.

Public Types

typedef std::list< DataFormField * > FieldList

Public Member Functions

 DataFormFieldContainer ()
 DataFormFieldContainer (const DataFormFieldContainer &dffc)
virtual ~DataFormFieldContainer ()
bool hasField (const std::string &field) const
DataFormFieldfield (const std::string &field) const
FieldListfields ()
virtual void setFields (FieldList &fields)
virtual void addField (DataFormField *field)
DataFormFieldaddField (DataFormField::FieldType type, const std::string &name, const std::string &value=EmptyString, const std::string &label=EmptyString)

Detailed Description

An abstract base class for a XEP-0004 Data Form.

You shouldn't need to use this class directly. Use DataForm instead.

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

Definition at line 35 of file dataformfieldcontainer.h.


Member Typedef Documentation

typedef std::list<DataFormField*> FieldList
 

A list of XEP-0004 Data Form Fields.

Definition at line 57 of file dataformfieldcontainer.h.


Constructor & Destructor Documentation

DataFormFieldContainer  ) 
 

Creates a new FieldContainer.

Definition at line 21 of file dataformfieldcontainer.cpp.

DataFormFieldContainer const DataFormFieldContainer dffc  ) 
 

Creates a new FieldContainer, copying all fields from the given FieldContainer.

Parameters:
dffc The FieldContainer to copy.

Definition at line 25 of file dataformfieldcontainer.cpp.

~DataFormFieldContainer  )  [virtual]
 

Virtual destructor.

Definition at line 34 of file dataformfieldcontainer.cpp.


Member Function Documentation

DataFormField* addField DataFormField::FieldType  type,
const std::string &  name,
const std::string &  value = EmptyString,
const std::string &  label = EmptyString
[inline]
 

Adds a single new Field and returns a pointer to that field.

Parameters:
type The field's type.
name The field's name (the value of the 'var' attribute).
value The field's value.
label The field's label.
Since:
0.9.4

Definition at line 103 of file dataformfieldcontainer.h.

virtual void addField DataFormField field  )  [inline, virtual]
 

Use this function to add a single field to the list of existing fields.

Parameters:
field The field to add.
Since:
0.9

Definition at line 93 of file dataformfieldcontainer.h.

DataFormField * field const std::string &  field  )  const
 

Use this function to fetch a pointer to a field of the form. If no such field exists, 0 is returned.

Parameters:
field The name of the field (the content of the 'var' attribute).
Returns:
A copy of the field with the given name if it exists, 0 otherwise.

Definition at line 49 of file dataformfieldcontainer.cpp.

FieldList& fields  )  [inline]
 

Use this function to retrieve the list of fields of a form.

Returns:
The list of fields the form contains.

Definition at line 79 of file dataformfieldcontainer.h.

bool hasField const std::string &  field  )  const [inline]
 

Use this function to check whether this form contains a field with the given name.

Parameters:
field The name of the field (the content of the 'var' attribute).
Returns:
Whether or not the form contains the named field.

Definition at line 64 of file dataformfieldcontainer.h.

virtual void setFields FieldList fields  )  [inline, virtual]
 

Use this function to set the fields the form contains.

Parameters:
fields The list of fields.
Note:
Any previously set fields will be deleted. Always set all fields, not a delta.

Definition at line 86 of file dataformfieldcontainer.h.


The documentation for this class was generated from the following files:
Generated on Tue Apr 22 15:10:14 2008 for gloox by  doxygen 1.4.1