CppCMS
Classes | Public Member Functions | Friends
cppcms::form Class Reference

The form is a container used to collect other widgets and forms into a single unit. More...

#include <cppcms/form.h>

Inheritance diagram for cppcms::form:
booster::noncopyable cppcms::base_form cppcms::form_flags

List of all members.

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 formoperator+ (form &f)
CPPCMS_DEPRECATED formoperator+ (widgets::base_widget &f)
virtual void parent (base_form *subform)
virtual formparent ()
iterator begin ()
iterator end ()

Friends

class iterator

Detailed Description

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.


Member Function Documentation

void cppcms::form::add ( form subform)

Add subform to form. The ownership is not transferred to the parent.

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.

Add widget to form. The ownership is transferred to the parent and the widget will be destroyed together with the parent.

Returns the iterator to the first widget.

virtual void cppcms::form::clear ( ) [virtual]

Clear all subforms and widgets from all loaded data.

Implements cppcms::base_form.

Returns the end of the range iterator.

virtual void cppcms::form::load ( http::context cont) [virtual]

Load all the widget information from http::context cont.

Implements cppcms::base_form.

CPPCMS_DEPRECATED form& cppcms::form::operator+ ( form f) [inline]
Deprecated:
Use add(form &) instead

Shortcut to add.

CPPCMS_DEPRECATED form& cppcms::form::operator+ ( widgets::base_widget f) [inline]
Deprecated:
Use add(widgets::base_widget &) instead

Shortcut to add.

virtual void cppcms::form::parent ( base_form subform) [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 form* cppcms::form::parent ( ) [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 void cppcms::form::render ( form_context context) [virtual]

Render all the widgets and sub-forms to the output, using the flags defined in the context.

Implements cppcms::base_form.

virtual bool cppcms::form::validate ( ) [virtual]

Validate all subforms and widgets. If at least one of them fails, false is returned. Otherwise, true is returned.

Implements cppcms::base_form.


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