Webdar 1.0.0
Web user interface to libdar
html_form_gnupg_list.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_GNUPG_LIST_HPP
25#define HTML_FORM_GNUPG_LIST_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 "events.hpp"
40
42
45
70
71
72
75 public jsoner,
76 public events,
77 public actor
78{
79public:
80 static const std::string changed;
81
84 html_form_gnupg_list(html_form_gnupg_list && ref) noexcept = delete;
85 html_form_gnupg_list & operator = (const html_form_gnupg_list & ref) = delete;
86 html_form_gnupg_list & operator = (html_form_gnupg_list && ref) noexcept = delete;
87 ~html_form_gnupg_list() = default;
88
90 std::vector<std::string> get_gnupg_recipients() const;
91
93 std::vector<std::string> get_gnupg_signatories() const;
94
96 virtual std::unique_ptr<body_builder> provide_object_of_type(unsigned int num,
97 const std::string & context,
98 std::string & changed_event) const override;
99
101 virtual void load_json(const json & source) override;
102
104 virtual json save_json() const override;
105
107 virtual void clear_json() override;
108
109
111 virtual void on_event(const std::string & event_name) override;
112
113protected:
115 virtual std::string inherited_get_body_part(const chemin & path,
116 const request & req) override;
117
119 virtual void new_css_library_available() override;
120
121private:
122 std::vector<std::string> gather_content_of_type(unsigned int type) const;
123
125
126 static constexpr const unsigned int format_version = 1;
127 static constexpr const char* myclass_id = "html_form_gnupg_list";
128
129 static constexpr const char* jlabel_contents = "contents";
130};
131
132#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_gnupg_list provide interface for the user to give a list of gnupg signatories and gnu...
Definition: html_form_gnupg_list.hpp:78
virtual json save_json() const override
inherited from jsoner
Definition: html_form_gnupg_list.cpp:134
virtual std::string inherited_get_body_part(const chemin &path, const request &req) override
inherited methods from body_builder
Definition: html_form_gnupg_list.cpp:158
virtual void on_event(const std::string &event_name) override
inherited from actor
Definition: html_form_gnupg_list.cpp:150
std::vector< std::string > get_gnupg_recipients() const
return the recipient list filled by the webuser
Definition: html_form_gnupg_list.cpp:62
virtual void load_json(const json &source) override
inherited from jsoner
Definition: html_form_gnupg_list.cpp:108
std::vector< std::string > get_gnupg_signatories() const
return the list of signatories filled by the webuser
Definition: html_form_gnupg_list.cpp:67
virtual void new_css_library_available() override
inherited from body_builder
Definition: html_form_gnupg_list.cpp:164
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_gnupg_list.cpp:72
virtual void clear_json() override
inherited from jsoner
Definition: html_form_gnupg_list.cpp:145
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