CppCMS
|
The form is a container used to collect other widgets and forms into a single unit. More...
#include <cppcms/form.h>
Classes | |
class | iterator |
Input iterator used to iterate over all the widgets in a form. More... | |
Public Member Functions | |
virtual void | render (form_context &context) |
virtual void | load (http::context &cont) |
virtual bool | validate () |
virtual void | clear () |
void | add (form &subform) |
void | attach (form *subform) |
void | add (widgets::base_widget &widget) |
void | attach (widgets::base_widget *widget) |
CPPCMS_DEPRECATED form & | operator+ (form &f) |
CPPCMS_DEPRECATED form & | operator+ (widgets::base_widget &f) |
virtual void | parent (base_form *subform) |
virtual form * | parent () |
iterator | begin () |
iterator | end () |
Friends | |
class | iterator |
Additional Inherited Members | |
Public Types inherited from cppcms::form_flags | |
enum | html_type { as_html = 0, as_xhtml = 1 } |
enum | html_list_type { as_p = 0, as_table = 1, as_ul = 2, as_dl = 3, as_space = 4 } |
enum | widget_part_type { first_part = 0, second_part = 1 } |
The form is a container used to collect other widgets and forms into a single unit.
Generally various widgets and forms are combined into a single form in order to simplify their rendering and validation of the forms that include more than one widget.
void cppcms::form::add | ( | form & | subform | ) |
Add subform to form. The ownership is not transferred to the parent.
void cppcms::form::add | ( | widgets::base_widget & | widget | ) |
Add widget to form. The ownership is not transferred to to the parent.
void cppcms::form::attach | ( | form * | subform | ) |
Add subform to form. The ownership is transferred to the parent and the subform will be destroyed together with the parent.
void cppcms::form::attach | ( | widgets::base_widget * | widget | ) |
Add widget to form. The ownership is transferred to the parent and the widget will be destroyed together with the parent.
iterator cppcms::form::begin | ( | ) |
Returns the iterator to the first widget.
|
virtual |
Clear all subforms and widgets from all loaded data.
Implements cppcms::base_form.
iterator cppcms::form::end | ( | ) |
Returns the end of the range iterator.
|
virtual |
Load all the widget information from http::context cont.
Implements cppcms::base_form.
Shortcut to add.
|
inline |
Shortcut to add.
|
virtual |
Set the parent of this form. It is used internally; you should not use it. It is called when the form is added or attached to another form.
Implements cppcms::base_form.
|
virtual |
Get the parent of this form. If this is the topmost form, NULL is returned. It is assumed that the parent is always a form.
Implements cppcms::base_form.
|
virtual |
Render all the widgets and sub-forms to the output, using the flags defined in the context.
Implements cppcms::base_form.
|
virtual |
Validate all subforms and widgets. If at least one of them fails, false is returned. Otherwise, true is returned.
Implements cppcms::base_form.