Webdar 1.0.0
Web user interface to libdar
html_options_test.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_OPTIONS_TEST_HPP
25#define HTML_OPTIONS_TEST_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 "actor.hpp"
40#include "html_form.hpp"
41#include "html_form_fieldset.hpp"
42#include "html_form_input.hpp"
43#include "html_derouleur.hpp"
44#include "html_mask_form_filename.hpp"
45#include "html_mask_form_path.hpp"
46#include "guichet.hpp"
47#include "jsoner.hpp"
48#include "bibliotheque_subconfig.hpp"
49#include "events.hpp"
50
52
54 public actor,
55 public jsoner,
57 public events
58{
59public:
60 static const std::string changed;
61
63 html_options_test(const html_options_test & ref) = delete;
64 html_options_test(html_options_test && ref) noexcept = delete;
65 html_options_test & operator = (const html_options_test & ref) = delete;
66 html_options_test & operator = (html_options_test && ref) noexcept = delete;
67 ~html_options_test() = default;
68
70 void set_biblio(const std::shared_ptr<bibliotheque> & ptr);
71
73 libdar::archive_options_test get_options() const;
74
76 virtual void load_json(const json & source) override;
77
79 virtual json save_json() const override;
80
82 virtual void clear_json() override;
83
85 virtual bibliotheque::using_set get_using_set() const override;
86
88 virtual void on_event(const std::string & event_name) override;
89
92
93protected:
94
95 // inherited from bdy_builder
96 virtual std::string inherited_get_body_part(const chemin & path,
97 const request & req) override;
98
99 // inherited from bdy_builder
100 virtual void new_css_library_available() override;
101
102private:
103 bool ignore_events;
104
105 html_derouleur deroule;
106
107 html_form form;
109 html_form_input empty;
110
111 html_form form_show;
112 html_form_fieldset fs_show;
113 html_form_input info_details;
114 html_form_input display_treated;
115 html_form_input display_treated_only_dir;
116 html_form_input display_skipped;
117
118 guichet guichet_filename_mask;
119 std::shared_ptr<html_mask_form_filename> filename_mask;
120
121 guichet guichet_path_mask;
122 std::shared_ptr<html_mask_form_path> path_mask;
123
124 void reset_non_pointer_fields();
125 void trigger_change();
126
127 static constexpr const unsigned int format_version = 1;
128 static constexpr const char* myclass_id = "html_options_test";
129
130 static constexpr const char* jlabel_dry_run = "dry-run";
131 static constexpr const char* jlabel_info_details = "info-details";
132 static constexpr const char* jlabel_disp_treated = "display-treated";
133 static constexpr const char* jlabel_disp_only_dir = "display-only-dirs";
134 static constexpr const char* jlabel_disp_skipped = "display-skipped";
135 static constexpr const char* jlabel_file_mask = "file-mask";
136 static constexpr const char* jlabel_path_mask = "path-mask";
137
138};
139
140#endif
class of object that are pointed/triggered to by others
Definition: actor.hpp:55
class bibliotheque_subconfig is an interface (pure virtual class)
Definition: bibliotheque_subconfig.hpp:50
std::set< coordinates > using_set
list of configs a given config depends on
Definition: bibliotheque.hpp:117
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 guichet let one fetch config from a bibliotheque, save as or setup manually for a given compone...
Definition: guichet.hpp:92
class html_derouleur is a pure virtual class
Definition: html_derouleur.hpp:55
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
html component for the user to provide parameters of libdar archive testing operation
Definition: html_options_test.hpp:58
virtual void on_event(const std::string &event_name) override
inherited from actor
Definition: html_options_test.cpp:266
void set_biblio(const std::shared_ptr< bibliotheque > &ptr)
mandatory call to invoke ASAP after constructor
Definition: html_options_test.cpp:142
libdar::archive_options_test get_options() const
extract component info as an option set for libdar
Definition: html_options_test.cpp:157
virtual bibliotheque::using_set get_using_set() const override
inherited from biblioteque_subconfig
Definition: html_options_test.cpp:256
virtual json save_json() const override
inherited from jsoner
Definition: html_options_test.cpp:220
virtual void new_css_library_available() override
Definition: html_options_test.cpp:298
virtual void load_json(const json &source) override
inherited from jsoner
Definition: html_options_test.cpp:174
virtual void clear_json() override
inherited from jsoner
Definition: html_options_test.cpp:237
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_options_test.cpp:292
void set_to_webdar_defaults()
set the object to webdar defaults
Definition: html_options_test.cpp:282
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