|
|
| body_builder () |
| | constructor
|
| |
| | body_builder (const body_builder &ref) |
| | copy constructor
|
| |
| | body_builder (body_builder &&ref) noexcept=delete |
| | move constructor
|
| |
| body_builder & | operator= (const body_builder &ref) |
| | assignment operator drops all existing children
|
| |
| body_builder & | operator= (body_builder &&ref) noexcept=delete |
| | move operator
|
| |
|
virtual | ~body_builder () |
| | the (virtual) destructor
|
| |
| void | set_prefix (const chemin &prefix) |
| |
| void | adopt (body_builder *obj) |
| |
|
bool | is_adopted () const |
| | whether the object has currently a parent (= is adopted)
|
| |
| void | foresake (body_builder *obj) |
| |
| void | set_visible (bool mode) |
| | ask for the object to become visible in HTML page or temporarily hidden
|
| |
| bool | get_visible () const |
| | returns the current visible status of the object
|
| |
|
bool | get_visible_recursively () const |
| | return the effective visible status of an object taking into account all of ancestors that adopted it
|
| |
|
void | add_css_class (const std::string &name) |
| | set this object with a additional css_class (assuming it is defined in a css_library available for this object)
|
| |
|
void | add_css_class (const css_class_group &cg) |
| | set this object with an additional set of css_classes (assuming they are all defined in a css_library available for this object)
|
| |
|
bool | has_css_class (const std::string &name) const |
| | check the presence of the given class name
|
| |
|
void | remove_css_class (const std::string &name) |
| | remove the provided css_class name from the list of css_class names this object has been assigned to
|
| |
|
void | remove_css_class (const css_class_group &cg) |
| | remove the provided css_class_group from the list
|
| |
|
void | clear_css_classes () |
| | clear the whole list of css_class names
|
| |
|
const std::set< std::string > & | get_css_classes_as_a_set () const |
| | provide the list of css_class names that this object has been set with
|
| |
|
css_class_group | get_css_class_group () const |
| | provide the list of css_class names as a css_class_group
|
| |
| std::string | get_css_classes (const std::string &extra="") const |
| | return the class_name as inlined css, suitable to be added in a html marker
|
| |
| void | define_css_class_in_library (const css_class &csscl) |
| |
|
void | define_css_class_in_library (const std::string &name, const css &cssdef) |
| |
|
bool | is_css_class_defined_in_library (const std::string &name) const |
| | check whether a css_class of given name already exists in a reachable css_library
|
| |
| std::string | get_body_part (const chemin &path, const request &req) |
| |
| void | ignore_body_changed_from_my_children (bool mode) |
| | ignore my_body_part_has_changed() invoked from adopted children and myself
|
| |
|
bool | get_ignore_body_changed_from_my_children () const |
| | get the current status of ignore_body_changed_from_my_children()
|
| |
| void | set_no_CR (bool no_cr=true) |
| | ask for the implementation not to add a new line after this control
|
| |
| void | assign_anchor (bool mode) |
| | assign an anchor to this object (the object's inherited_get_body_part() will be wrapped into an HTML anchor: )
|
| |
| std::string | get_assigned_anchor () const |
| | return the anchor value that has been assiged to this object (without the leading #)
|
| |
| virtual void | bind_to_anchor (const std::string &val) |
| | ask inherited components to use this anchor in case they redirect to an new URL or generate new URLs within their body part.
|
| |
class body_builder is the root class of object generating HTML body
- the inherited_get_body_part() method let inherited class define what is the HTML body to be generated based on the request passed in argument. Also passed in argument is the path, which is comes from the URI of the request. From the outside, this is the get_body_part() that is to be used it implements a caching layout over inherited_get_body_part(), manage visibility() attribute. About the caching layout, an inherited class can flush cache and force a new evaluation of its generated body by calling my_body_part_has_changed().
- A body_builder object is expected to be located at given path of the requested URL and this let define its behavior according to the path of the request and its own place in the path tree. This place is defined by the adoption() mechanism:
- body_builder objects can adopt other body_builder object creating a tree topology of body_builder. The path of an object adopted by a parent object is a subdirectory of the parent's path. It is a unique name randomly chosen by the parent at adoption time. See get_path(), get_recorded_name()
- the visibility property of an body_builder let it keep its place in the path and adoption tree without returning any HTML code temporarily, this is set using set_visible() method and managed inside get_body_part()
- the get_body_part() of a parent can thus rely on the get_body_part() of its adopted children, this is the freedom of the parent class do decide how to compose or ignore its childen and the possible HTML code they can return, but several method are provided for common tasks: get_body_part_from_target_child() as well as get_body_part_from_all_children().
- Several protected hooks and methods are provided for inherited class to be informed of their adoption or foresake: has_adopted() has_been_adopted_by(), will_foresake(), will_be_foresaken_by()
- the class also handle the CSS components associated to HTML objects or to child objects by mean of a css_library (usually only present in the root object of the tree) and accessible by any children to store CSS class name+definition and refer to them when needed. See store_css_library(), has_local_css_library(), lookup_css_library() and new_css_library_available() to manage and access to a css_library global to the adoption tree. See add_css_class() has_css_class() remove_css_class() clear_css_classes() get_css_classes_as_a_set(), get_css_class_group(), get_css_classes() to assign one or more css classes to a body_builder inherited object. See define_css_class_in_library() to associate a CSS class name to its definition and store this in the closest css_library available in the adoption tree (it is advised to only have one at the root of the tree)
- objects of this class also produce HTML code referring to what should be displayed on on the browser (get_body_part())
- Note
- more details about css. body_builder object can be associated to the name of one or more css_class or css_class_group at any time, those are just labels. The class definition is stored in a css_library. If a body_builder object has created a css_library (calling store_css_library()) all its adopted body_builder objects can access it and upload their class definitions using lookup_css_library(). a class can be informed of the availability of a css_library overriding the protected method new_css_library_available() and implement there the css class definition they or their components have been associated to by mean of add_css_class(). Last from the outside of a class it is possible to define a css_class using the public method define_css_class_in_library(), but for this to work a css_library must be reachable in an ancestors (in regard to the adoption relationship) of this object.
| virtual std::string body_builder::inherited_get_body_part |
( |
const chemin & |
path, |
|
|
const request & |
req |
|
) |
| |
|
protectedpure virtual |
implementation of get_body_part() method for inherited classes
- Note
- this method defines what the class will return from the public method body_builder::get_body_part() which also make some housekeeping at body_builder level. In particular, the body_builder class record the "body_changed" status that is reset before calling inherited_get_body_part() and modified by the inherited class when they call the my_body_part_has_changed(). get_body_part() also caches the result of inherited_get_body_part() to avoid calling inherited_get_body_part() if for the same request it has not signaled (calling my_body_part_has_changed()) that for example an event lead its status to change and would require inherited_get_body_part() to be reevaluated
Implemented in arriere_boutique< T >, arriere_boutique< html_ciphering >, arriere_boutique< html_compression_params >, arriere_boutique< html_entrepot_landing >, arriere_boutique< html_form_overwrite_action >, arriere_boutique< html_form_sig_block_size >, arriere_boutique< html_mask_form_filename >, arriere_boutique< html_mask_form_path >, arriere_boutique< html_options_compare >, arriere_boutique< html_options_create >, arriere_boutique< html_options_extract >, arriere_boutique< html_options_isolate >, arriere_boutique< html_options_merge >, arriere_boutique< html_options_read >, arriere_boutique< html_options_repair >, arriere_boutique< html_options_test >, arriere_boutique< html_slicing >, guichet, html_aiguille, html_archive_compare, html_archive_create, html_archive_extract, html_archive_isolate, html_archive_merge, html_archive_read, html_archive_repair, html_bibliotheque, html_button, html_ciphering, html_compression_params, html_datetime, html_derouleur, html_dir_tree, html_div, html_double_button, html_entrepot, html_entrepot_landing, html_fichier, html_focus, html_form, html_form_dynamic_table, html_form_fieldset, html_form_gnupg_list, html_form_ignore_as_symlink, html_form_input, html_form_input_file, html_form_mask_bool, html_form_mask_expression, html_form_mask_file, html_form_mask_subdir, html_form_overwrite_action, html_form_overwrite_base_criterium, html_form_overwrite_combining_criterium, html_form_radio, html_form_same_fs, html_form_select, html_form_sig_block_size, html_fsa_scope, html_hr, html_image, html_label, html_legend, html_level, html_libdar_running_page, html_libdar_running_popup, html_mask_form_filename, html_mask_form_path, html_menu, html_options_compare, html_options_create, html_options_extract, html_options_isolate, html_options_list, html_options_merge, html_options_read, html_options_repair, html_options_test, html_over_guichet, html_page, html_popup, html_select_file, html_slicing, html_span, html_statistics, html_table, html_tabs, html_text, html_url, html_void, html_web_user_interaction, and saisie.