Webdar 1.0.0
Web user interface to libdar
html_form_mask_file.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_MASK_FILE_HPP
25#define HTML_FORM_MASK_FILE_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 "body_builder.hpp"
38#include "html_mask.hpp"
39#include "html_form_input.hpp"
40#include "html_form_fieldset.hpp"
41#include "html_form_input_file.hpp"
42#include "actor.hpp"
43#include "jsoner.hpp"
44#include "events.hpp"
45
47
50
73
74
76 public html_mask,
77 public actor,
78 public jsoner,
79 public events
80{
81public:
82 static const std::string changed;
83
84 html_form_mask_file(const std::shared_ptr<const libdar::path> & fs_root);
85 html_form_mask_file(const html_form_mask_file & ref) = delete;
86 html_form_mask_file(html_form_mask_file && ref) noexcept = delete;
87 html_form_mask_file & operator = (const html_form_mask_file & ref) = delete;
88 html_form_mask_file & operator = (html_form_mask_file && ref) noexcept = delete;
89 ~html_form_mask_file() = default;
90
92 void clear();
93
95 virtual std::unique_ptr<libdar::mask> get_mask() const override;
96
98
103 virtual bool is_relative() const override { return false; };
104
105
107 virtual void load_json(const json & source) override;
108
110 virtual json save_json() const override;
111
113 virtual void clear_json() override { clear(); };
114
115
117 virtual void on_event(const std::string & event_name) override;
118
119
120protected:
122 virtual std::string inherited_get_body_part(const chemin & path,
123 const request & req) override;
124
126 virtual void new_css_library_available() override;
127
128private:
129 bool ignore_events;
130 std::shared_ptr<const libdar::path> prefix;
131
132 html_form_input_file filename;
133 html_form_input exclude_checkbox;
134 html_form_input casesensit;
136
137 std::string tell_action() const;
138
139 static constexpr const unsigned int format_version = 1;
140 static constexpr const char* myclass_id = "html_form_mask_file";
141
142 static constexpr const char* jlabel_filename = "filename";
143 static constexpr const char* jlabel_exclude = "excluding";
144 static constexpr const char* jlabel_casesensit = "casesensit";
145
146};
147
148#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_file provides a mean to the user to navigate in a file system to select a file ...
Definition: html_form_input_file.hpp:60
class html_form_input implements HTML input feature
Definition: html_form_input.hpp:57
class html_form_mask_file provide interface to include or exclude a list of entry taken from a text f...
Definition: html_form_mask_file.hpp:80
virtual std::unique_ptr< libdar::mask > get_mask() const override
inherited from html_mask
Definition: html_form_mask_file.cpp:111
virtual void new_css_library_available() override
inherited from body_builder
Definition: html_form_mask_file.cpp:212
virtual void on_event(const std::string &event_name) override
inherited from actor
Definition: html_form_mask_file.cpp:190
virtual bool is_relative() const override
inherited from html_mask
Definition: html_form_mask_file.hpp:103
virtual json save_json() const override
inherited from jsoner
Definition: html_form_mask_file.cpp:177
virtual std::string inherited_get_body_part(const chemin &path, const request &req) override
inherited methods from body_builder
Definition: html_form_mask_file.cpp:206
virtual void load_json(const json &source) override
inherited from jsoner
Definition: html_form_mask_file.cpp:137
void clear()
reset object to default
Definition: html_form_mask_file.cpp:93
virtual void clear_json() override
inherited from jsoner
Definition: html_form_mask_file.hpp:113
class html_mask defines the interface of all masks
Definition: html_mask.hpp:44
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