Webdar 1.0.0
Web user interface to libdar
html_form_overwrite_chain_action.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_FORM_OVERWRITE_CHAIN_ACTION_HPP
25#define HTML_FORM_OVERWRITE_CHAIN_ACTION_HPP
26
27 // C system header files
28#include "my_config.h"
29extern "C"
30{
31
32}
33
34 // C++ system header files
35
36 // webdar headers
37#include "actor.hpp"
38#include "html_overwrite_action.hpp"
39#include "html_form_fieldset.hpp"
40#include "html_table.hpp"
41#include "html_button.hpp"
42#include "html_form_input.hpp"
43#include "html_hr.hpp"
44#include "html_form_dynamic_table.hpp"
45#include "jsoner.hpp"
46#include "events.hpp"
47#include "actor.hpp"
48
51
53
56 public jsoner,
57 public events,
58 public actor
59
60{
61public:
62 static const std::string changed;
63
64 html_form_overwrite_chain_action(const std::string & label);
68 html_form_overwrite_chain_action & operator = (html_form_overwrite_chain_action && ref) noexcept = delete;
70
72
74 void add_new_entry() { table.add_line(0); };
75
77
80
82 virtual std::unique_ptr<libdar::crit_action> get_overwriting_action() const override;
83
85 virtual std::unique_ptr<body_builder> provide_object_of_type(unsigned int num,
86 const std::string & context,
87 std::string & changed_event) const override;
88
90 virtual void load_json(const json & source) override { table.load_json(source); };
91
93 virtual json save_json() const override { return table.save_json(); };
94
96 virtual void clear_json() override { table.clear_json(); };
97
99 virtual void on_event(const std::string & event_name) override;
100
101private:
104
105};
106
107#endif
class of object that are pointed/triggered to by others
Definition: actor.hpp:55
class events
Definition: events.hpp:52
class html_form_dynamic_table_object_provider
Definition: html_form_dynamic_table.hpp:60
class html_form_dynamic_table web user dynamically add new lines in a table
Definition: html_form_dynamic_table.hpp:121
virtual void clear_json() override
inherited from jsoner
Definition: html_form_dynamic_table.cpp:264
void add_line(unsigned int typenum)
manually add an line in the table with the object type give in number
Definition: html_form_dynamic_table.cpp:102
virtual json save_json() const override
inherited from jsoner
Definition: html_form_dynamic_table.cpp:226
virtual void load_json(const json &source) override
inherited from jsoner
Definition: html_form_dynamic_table.cpp:150
class html_form_fieldset implements HTML fieldset feature
Definition: html_form_fieldset.hpp:51
html component to be adopted by an html_form class
Definition: html_form_overwrite_action.hpp:63
html component to be adopted by an html_form that implements a chain of actions for overwriting polic...
Definition: html_form_overwrite_chain_action.hpp:60
virtual std::unique_ptr< libdar::crit_action > get_overwriting_action() const override
obtain the crit_chain_action object for libdar option
Definition: html_form_overwrite_chain_action.cpp:91
virtual void on_event(const std::string &event_name) override
inherited from actor
Definition: html_form_overwrite_chain_action.cpp:149
html_form_overwrite_action & get_last_added()
get the access of the latest added entry (base or combining criterium)
Definition: html_form_overwrite_chain_action.cpp:70
virtual void load_json(const json &source) override
inherited from jsoner
Definition: html_form_overwrite_chain_action.hpp:90
virtual void clear_json() override
inherited from jsoner
Definition: html_form_overwrite_chain_action.hpp:96
virtual std::unique_ptr< body_builder > provide_object_of_type(unsigned int num, const std::string &context, std::string &changed_event) const override
inherited from html_form_dynamic_table_object_provider
Definition: html_form_overwrite_chain_action.cpp:123
virtual json save_json() const override
inherited from jsoner
Definition: html_form_overwrite_chain_action.hpp:93
void add_new_entry()
add a new entry in the chain
Definition: html_form_overwrite_chain_action.hpp:74
html component used for constant actions in overwriting policies
Definition: html_overwrite_action.hpp:48
class jsoner
Definition: jsoner.hpp:73
defines the event class
defines jsoner class and class exception_json