Webdar 1.0.0
Web user interface to libdar
html_form_overwrite_conditional_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_CONDITIONAL_ACTION_HPP
25#define HTML_FORM_OVERWRITE_CONDITIONAL_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 "html_overwrite_action.hpp"
38#include "html_form_overwrite_combining_criterium.hpp"
39#include "body_builder.hpp"
40#include "actor.hpp"
41#include "html_form_fieldset.hpp"
42#include "html_form_overwrite_action.hpp"
43#include "jsoner.hpp"
44#include "events.hpp"
45#include "actor.hpp"
46
48
50 public jsoner,
51 public actor,
52 public events
53{
54public:
55 static const std::string changed;
56
63
65
68
70
73
75
78
80 virtual std::unique_ptr<libdar::crit_action> get_overwriting_action() const override;
81
83 virtual void load_json(const json & source) override;
84
86 virtual json save_json() const override;
87
89 virtual void clear_json() override;
90
92 virtual void on_event(const std::string & event_name) override;
93
94protected:
95
97 virtual void new_css_library_available() override;
98
99private:
103
104 static constexpr const char* act_true_changed = "true changed";
105 static constexpr const char* act_false_changed = "false changed";
106
107 static constexpr const char* action_type_undefined = "undefined";
108 static constexpr const char* action_type_const = "constant";
109 static constexpr const char* action_type_condition = "condition";
110
111 static constexpr const char* css_cond = "html_form_overwrite_cond_act";
112
113 static constexpr const unsigned int format_version = 1;
114 static constexpr const char* myclass_id = "html_form_overwrite_conditional_action";
115
116 static constexpr const char* jlabel_condition = "condition";
117 static constexpr const char* jlabel_when_true = "when-true";
118 static constexpr const char* jlabel_when_false = "when-false";
119
120};
121
122#endif
class of object that are pointed/triggered to by others
Definition: actor.hpp:55
class events
Definition: events.hpp:52
html component to be adopted by an html_form class
Definition: html_form_overwrite_action.hpp:63
html component used for to logically combine (and / or) criteria to setup an overwriting policies
Definition: html_form_overwrite_combining_criterium.hpp:60
html component to be adopted by an html_form that implements conditional actions for overwriting poli...
Definition: html_form_overwrite_conditional_action.hpp:53
virtual std::unique_ptr< libdar::crit_action > get_overwriting_action() const override
obtain the crit_conditional_action object for libdar option
Definition: html_form_overwrite_conditional_action.cpp:69
html_form_overwrite_combining_criterium & get_access_to_condition()
provide access to the condition object
Definition: html_form_overwrite_conditional_action.hpp:67
virtual json save_json() const override
inherited from jsoner
Definition: html_form_overwrite_conditional_action.cpp:123
virtual void new_css_library_available() override
inherited from body_builder
Definition: html_form_overwrite_conditional_action.cpp:152
html_form_overwrite_action & get_access_to_action_true()
provide access to the action used when condition is false
Definition: html_form_overwrite_conditional_action.hpp:72
html_form_overwrite_action & get_access_to_action_false()
provide access to the action used when condition is false
Definition: html_form_overwrite_conditional_action.hpp:77
virtual void on_event(const std::string &event_name) override
inherited from actor
Definition: html_form_overwrite_conditional_action.cpp:143
virtual void load_json(const json &source) override
inherited from jsoner
Definition: html_form_overwrite_conditional_action.cpp:94
virtual void clear_json() override
inherited from jsoner
Definition: html_form_overwrite_conditional_action.cpp:136
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