Webdar 1.0.0
Web user interface to libdar
html_fsa_scope.hpp
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_FSA_SCOPE_HPP
25#define HTML_FSA_SCOPE_HPP
26
27 // C system header files
28#include "my_config.h"
29extern "C"
30{
31
32}
33
34 // C++ system header files
35#include <dar/libdar.hpp>
36
37 // webdar headers
38#include "body_builder.hpp"
39#include "html_form.hpp"
40#include "html_form_fieldset.hpp"
41#include "html_form_input.hpp"
42#include "jsoner.hpp"
43#include "actor.hpp"
44#include "events.hpp"
45
47
49 public jsoner,
50 public actor,
51 public events
52{
53public:
54 static const std::string changed;
55
57 html_fsa_scope(const html_fsa_scope & ref) = delete;
58 html_fsa_scope(html_fsa_scope && ref) noexcept = delete;
59 html_fsa_scope & operator = (const html_fsa_scope & ref) = delete;
60 html_fsa_scope & operator = (html_fsa_scope && ref) noexcept = delete;
61 ~html_fsa_scope() = default;
62
64 libdar::fsa_scope get_scope() const;
65
67 virtual void load_json(const json & source) override;
68
70 virtual json save_json() const override;
71
73 virtual void clear_json() override;
74
76 virtual void on_event(const std::string & event_name) override;
77
79 virtual void bind_to_anchor(const std::string & val) override { form.bind_to_anchor(val); };
80
81protected:
82
84 virtual std::string inherited_get_body_part(const chemin & path,
85 const request & req) override;
86
87private:
88 html_form form;
90 html_form_input hfs_family;
91 html_form_input ext_family;
92
93 static constexpr const unsigned int format_version = 1;
94 static constexpr const char* myclass_id = "html_fsa_scope";
95
96 static constexpr const char* jlabel_hfs = "hfs";
97 static constexpr const char* jlabel_ext = "ext";
98
99};
100
101#endif
class of object that are pointed/triggered to by others
Definition: actor.hpp:55
class body_builder is the root class of object generating HTML body
Definition: body_builder.hpp:99
class chemin definition
Definition: chemin.hpp:51
class events
Definition: events.hpp:52
class html_form_fieldset implements HTML fieldset feature
Definition: html_form_fieldset.hpp:51
class html_form_input implements HTML input feature
Definition: html_form_input.hpp:57
class html_form implements HTML form feature
Definition: html_form.hpp:51
virtual void bind_to_anchor(const std::string &value) override
inherited from body_builder
Definition: html_form.hpp:83
html component used for the user to define a has algorithm
Definition: html_fsa_scope.hpp:52
libdar::fsa_scope get_scope() const
obtain the fsa_scope resulting from the web interface
Definition: html_fsa_scope.cpp:76
virtual void clear_json() override
inherited from jsoner
Definition: html_fsa_scope.cpp:128
virtual void on_event(const std::string &event_name) override
inherited from actor
Definition: html_fsa_scope.cpp:134
virtual json save_json() const override
inherited from jsoner
Definition: html_fsa_scope.cpp:116
virtual void bind_to_anchor(const std::string &val) override
inherited from body_builder
Definition: html_fsa_scope.hpp:79
virtual std::string inherited_get_body_part(const chemin &path, const request &req) override
inherited from body_builder
Definition: html_fsa_scope.cpp:143
virtual void load_json(const json &source) override
inherited from jsoner
Definition: html_fsa_scope.cpp:88
class jsoner
Definition: jsoner.hpp:73
class holding fields of an HTTP request (method, URI, header, cookies, and so on)
Definition: request.hpp:45
defines the event class
defines jsoner class and class exception_json