CppCMS
Public Member Functions | List of all members
cppcms::base_form Class Referenceabstract

This class is the base class for any form or form widget used in CppCMS. More...

#include <cppcms/form.h>

Inheritance diagram for cppcms::base_form:
cppcms::form_flags cppcms::form cppcms::widgets::base_widget cppcms::widgets::base_html_input cppcms::widgets::base_text cppcms::widgets::select_base cppcms::widgets::select_multiple cppcms::widgets::checkbox cppcms::widgets::file cppcms::widgets::numeric< T > cppcms::widgets::submit cppcms::widgets::text cppcms::widgets::text cppcms::widgets::textarea cppcms::widgets::radio cppcms::widgets::select

Public Member Functions

virtual void render (form_context &context)=0
 
virtual void load (http::context &context)=0
 
virtual bool validate ()=0
 
virtual void clear ()=0
 
virtual void parent (base_form *subform)=0
 
virtual base_formparent ()=0
 

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 }
 

Detailed Description

This class is the base class for any form or form widget used in CppCMS.

It provides basic, abstract operations that every widget or form should implement.

Member Function Documentation

virtual void cppcms::base_form::clear ( )
pure virtual
virtual void cppcms::base_form::load ( http::context context)
pure virtual

Load the form information from the provided http::context context. A user can call this function to load all information from the raw POST/GET data into the internal widget representation.

Implemented in cppcms::widgets::submit, cppcms::widgets::file, cppcms::widgets::select_base, cppcms::widgets::select_multiple, cppcms::widgets::checkbox, cppcms::widgets::numeric< T >, cppcms::widgets::base_text, and cppcms::form.

virtual void cppcms::base_form::parent ( base_form subform)
pure virtual

Set the parent of this form. Used internally. You should not use it.

Implemented in cppcms::widgets::base_widget, and cppcms::form.

virtual base_form* cppcms::base_form::parent ( )
pure virtual

Get the parent of this form. If this is the topmost form, NULL is returned.

Implemented in cppcms::widgets::base_widget, and cppcms::form.

virtual void cppcms::base_form::render ( form_context context)
pure virtual

Render the widget to the output set in cppcms::form_context::out() according to the control flags set in cppcms::form_flags. Usually this function is called directly by the template rendering functions.

Implemented in cppcms::widgets::hidden, cppcms::widgets::base_widget, and cppcms::form.

virtual bool cppcms::base_form::validate ( )
pure virtual

Validate the form according to defined rules. If all checks are OK, true is returned. If some widget or form fails, false is returned.

Implemented in cppcms::widgets::file, cppcms::widgets::select_base, cppcms::widgets::select_multiple, cppcms::widgets::regex_field, cppcms::widgets::password, cppcms::widgets::numeric< T >, cppcms::widgets::base_text, cppcms::widgets::base_widget, and cppcms::form.


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