24#ifndef HTML_AIGUILLE_HPP
25#define HTML_AIGUILLE_HPP
45#include "body_builder.hpp"
63 static constexpr const signed int noactive = -1;
84 void add_section(
const std::string & name,
const std::string & title);
117 unsigned int size()
const {
return order.size(); };
138 virtual void section_added(
const std::string & name,
const std::string & title) {};
141 virtual void section_removed(
const std::string & name) {};
151 std::list<body_builder*> adopted;
154 std::deque<std::string> order;
155 std::map<std::string, section> sections;
156 std::map<body_builder*, std::string> obj_to_section;
157 signed int active_section;
160 void set_visibility(
signed int section_num,
bool visible);
class body_builder is the root class of object generating HTML body
Definition: body_builder.hpp:99
void adopt(body_builder *obj)
Definition: body_builder.cpp:117
class chemin definition
Definition: chemin.hpp:51
class html_aiguille is a pure virtual class
Definition: html_aiguille.hpp:61
virtual std::string inherited_get_body_part(const chemin &path, const request &req) override
implementation of get_body_part() method for inherited classes
Definition: html_aiguille.cpp:256
void clear()
clear all adopted data and remove all sections
Definition: html_aiguille.cpp:42
virtual void void_child_will_foresake(body_builder *voidobj, body_builder *obj) override
inherited from html_void_parent_notifier
Definition: html_aiguille.cpp:231
unsigned int size() const
return the total number of section
Definition: html_aiguille.hpp:117
void set_active_section(const std::string &name)
manually set the visible section, based on section name
Definition: html_aiguille.cpp:188
std::string num_to_section_name(unsigned int num) const
return the name of the section knowing its index
Definition: html_aiguille.hpp:123
void adopt_in_section(const std::string §ion_name, body_builder *obj)
adopt another objet in the section which name is provided
Definition: html_aiguille.cpp:90
signed int get_active_section() const
get the current active section
Definition: html_aiguille.hpp:114
void add_section(const std::string &name, const std::string &title)
add a new sections
Definition: html_aiguille.cpp:51
unsigned int section_name_to_num(const std::string &name) const
return the index of the provided section name
Definition: html_aiguille.cpp:217
void remove_section(const std::string §ion_name)
foresake objects and remove section of that name
Definition: html_aiguille.cpp:156
void clear_section(const std::string §ion_name)
foresake all adopted objets in the given section
Definition: html_aiguille.cpp:113
to be used eventually by class of object adopting an html_void object
Definition: html_void.hpp:57
class html_void is only used to provide global visibility switch to all its adopted children
Definition: html_void.hpp:88
class holding fields of an HTTP request (method, URI, header, cookies, and so on)
Definition: request.hpp:45
defines two classes html_void and html_void_parent_notifier