Webdar 1.0.0
Web user interface to libdar
html_void.hpp
Go to the documentation of this file.
1/*********************************************************************/
2// webdar - a web server and interface program to libdar
3// Copyright (C) 2013-2025 Denis Corbin
4//
5// This file is part of Webdar
6//
7// Webdar is free software: you can redistribute it and/or modify
8// it under the terms of the GNU General Public License as published by
9// the Free Software Foundation, either version 3 of the License, or
10// (at your option) any later version.
11//
12// Webdar is distributed in the hope that it will be useful,
13// but WITHOUT ANY WARRANTY; without even the implied warranty of
14// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15// GNU General Public License for more details.
16//
17// You should have received a copy of the GNU General Public License
18// along with Webdar. If not, see <http://www.gnu.org/licenses/>
19//
20//----
21// to contact the author: dar.linux@free.fr
22/*********************************************************************/
23
24#ifndef HTML_VOID_HPP
25#define HTML_VOID_HPP
26
28
35
36#include "my_config.h"
37
38 // C system header files
39extern "C"
40{
41
42}
43
44 // C++ system header files
45#include "body_builder.hpp"
46
47 // webdar headers
48
49
51
55
57{
58public:
62 html_void_parent_notifier & operator = (const html_void_parent_notifier & ref) = default;
63 html_void_parent_notifier & operator = (html_void_parent_notifier && ref) noexcept = default;
64 virtual ~html_void_parent_notifier() = default;
65
67
70
72
75 virtual void void_child_has_adopted(body_builder* voidobj, body_builder* obj) {};
76
78
81 virtual void void_child_will_foresake(body_builder* voidobj, body_builder* obj) {};
82
83};
84
86
88{
89public:
90 html_void() {}
91 html_void(const html_void & ref) = default;
92 html_void(html_void && ref) noexcept = delete;
93 html_void & operator = (const html_void & ref) = default;
94 html_void & operator = (html_void && ref) noexcept = delete;
95 ~html_void() = default;
96
97protected:
99 virtual std::string inherited_get_body_part(const chemin & path,
100 const request & req) override;
101
103 virtual void my_visibility_has_changed() override;
104
106 virtual void has_adopted(body_builder *obj) override;
107
109 virtual void will_foresake(body_builder *obj) override;
110
111private:
112 html_void_parent_notifier* parent_notifier();
113
114};
115
116
117#endif
class body_builder is the root class of object generating HTML body
Definition: body_builder.hpp:99
class chemin definition
Definition: chemin.hpp:51
to be used eventually by class of object adopting an html_void object
Definition: html_void.hpp:57
virtual void void_child_visibility_has_changed(body_builder *voidobj)
propagates body_builder::my_visibility_has_changed()
Definition: html_void.hpp:69
virtual void void_child_has_adopted(body_builder *voidobj, body_builder *obj)
propagates body_builder::has_adopted()
Definition: html_void.hpp:75
virtual void void_child_will_foresake(body_builder *voidobj, body_builder *obj)
propagates body_builder::will_foresake()
Definition: html_void.hpp:81
class html_void is only used to provide global visibility switch to all its adopted children
Definition: html_void.hpp:88
virtual void has_adopted(body_builder *obj) override
inherited from body_builder
Definition: html_void.cpp:57
virtual void my_visibility_has_changed() override
inherited from body_builder
Definition: html_void.cpp:49
virtual void will_foresake(body_builder *obj) override
inherited from body_builder
Definition: html_void.cpp:65
virtual std::string inherited_get_body_part(const chemin &path, const request &req) override
inherited from body_builder
Definition: html_void.cpp:43
class holding fields of an HTTP request (method, URI, header, cookies, and so on)
Definition: request.hpp:45