Webdar 1.0.0
Web user interface to libdar
html_error.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_ERROR_HPP
25#define HTML_ERROR_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
37 // webdar headers
38#include "html_page.hpp"
39#include "events.hpp"
40#include "html_text.hpp"
41#include "html_button.hpp"
42
43
45
46class html_error : public html_page, public events, public actor
47{
48public:
49 static const char* acknowledged;
50
51 html_error();
52 html_error(const html_error & ref) = delete;
53 html_error(html_error && ref) noexcept = delete;
54 html_error & operator = (const html_error & ref) = delete;
55 html_error & operator = (html_error && ref) noexcept = delete;
56 ~html_error() = default;
57
58 void set_message(const std::string & msg);
59
61 virtual void on_event(const std::string & event_name) override;
62
64 void set_session_name(const std::string & sessname);
65
66protected:
67 // inherited from body_builder
68 virtual void new_css_library_available() override;
69
70private:
71 html_div global;
72 html_text the_error;
73 html_button close;
74
75 // css classes
76 static const char* class_message;
77 static const char* class_global;
78 static const char* class_button;
79
80 // events
81 static const char* close_event;
82};
83
84#endif
class of object that are pointed/triggered to by others
Definition: actor.hpp:55
class events
Definition: events.hpp:52
simple html component providing the usual button feature of GUIs, better using html_double_button ins...
Definition: html_button.hpp:48
class html_div is the implementation of
Definition: html_div.hpp:46
html page reporting an error
Definition: html_error.hpp:47
virtual void new_css_library_available() override
inherited from body_builder
Definition: html_error.cpp:93
virtual void on_event(const std::string &event_name) override
inherited from class actor
Definition: html_error.cpp:79
void set_session_name(const std::string &sessname)
defines the name of the session
Definition: html_error.cpp:87
html page root component
Definition: html_page.hpp:45
class html_text manage text and header in html document
Definition: html_text.hpp:52
defines the event class