Webdar 1.0.0
Web user interface to libdar
html_form_same_fs.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_SAME_FS_HPP
25#define HTML_FORM_SAME_FS_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_form_dynamic_table.hpp"
38#include "jsoner.hpp"
39#include "actor.hpp"
40#include "events.hpp"
41
43
46
74
77 public jsoner,
78 public actor,
79 public events
80{
81public:
82 static const std::string changed;
83
86 html_form_same_fs(html_form_same_fs && ref) noexcept = delete;
87 html_form_same_fs & operator = (const html_form_same_fs & ref) = delete;
88 html_form_same_fs & operator = (html_form_same_fs && ref) noexcept = delete;
89 ~html_form_same_fs() = default;
90
92 std::vector<std::string> get_included_fs_path() const;
93
95 std::vector<std::string> get_excluded_fs_path() const;
96
98 virtual std::unique_ptr<body_builder> provide_object_of_type(unsigned int num,
99 const std::string & context,
100 std::string & changed_event) const override;
101
103 virtual void load_json(const json & source) override;
104
106 virtual json save_json() const override;
107
109 virtual void clear_json() override;
110
112 virtual void on_event(const std::string & event_name) override;
113
114protected:
116 virtual std::string inherited_get_body_part(const chemin & path,
117 const request & req) override;
118
120 virtual void new_css_library_available() override;
121
122private:
124
125 std::vector<std::string> gather_content_of_type(unsigned int type) const;
126
127 static constexpr const unsigned int format_version = 1;
128 static constexpr const char* myclass_id = "html_form_same_fs";
129
130 static constexpr const char* jlabel_contents = "contents";
131
132};
133
134#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_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
class html_form_same_fs provide interface for the user to filter base on mounted file system
Definition: html_form_same_fs.hpp:80
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_same_fs.cpp:79
virtual void clear_json() override
inherited from jsoner
Definition: html_form_same_fs.cpp:155
virtual void on_event(const std::string &event_name) override
inherited from actor
Definition: html_form_same_fs.cpp:160
std::vector< std::string > get_included_fs_path() const
return the included fs
Definition: html_form_same_fs.cpp:69
virtual void new_css_library_available() override
inherited from body_builder
Definition: html_form_same_fs.cpp:175
virtual void load_json(const json &source) override
inherited from jsoner
Definition: html_form_same_fs.cpp:118
virtual std::string inherited_get_body_part(const chemin &path, const request &req) override
inherited methods from body_builder
Definition: html_form_same_fs.cpp:169
std::vector< std::string > get_excluded_fs_path() const
return the excluded fs
Definition: html_form_same_fs.cpp:74
virtual json save_json() const override
inherited from jsoner
Definition: html_form_same_fs.cpp:144
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