Webdar
1.0.2
Web user interface to libdar
Loading...
Searching...
No Matches
home
denis
Telechargements
WEBDAR
webdar-1.0.2
src
html_libdar_running_popup.hpp
1
/*********************************************************************/
2
// webdar - a web server and interface program to libdar
3
// Copyright (C) 2013-2026 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_LIBDAR_RUNNING_POPUP_HPP
25
#define HTML_LIBDAR_RUNNING_POPUP_HPP
26
27
// C system header files
28
#include "my_config.h"
29
extern
"C"
30
{
31
32
}
33
34
// C++ system header files
35
#include <libthreadar/libthreadar.hpp>
36
37
// webdar headers
38
#include "html_popup.hpp"
39
#include "
events.hpp
"
40
#include "
actor.hpp
"
41
#include "html_web_user_interaction.hpp"
42
44
46
47
class
html_libdar_running_popup
:
public
html_popup
,
public
events
,
public
actor
48
{
49
public
:
50
// this class generates the following events:
51
static
const
std::string
libdar_has_finished
;
52
53
// constructor
54
html_libdar_running_popup
();
55
html_libdar_running_popup
(
const
html_libdar_running_popup
& ref) =
delete
;
56
html_libdar_running_popup
(
html_libdar_running_popup
&& ref)
noexcept
=
delete
;
57
html_libdar_running_popup
& operator = (
const
html_libdar_running_popup
& ref) =
delete
;
58
html_libdar_running_popup
& operator = (
html_libdar_running_popup
&& ref)
noexcept
=
delete
;
59
~html_libdar_running_popup
() =
default
;
60
62
virtual
void
on_event
(
const
std::string & event_name)
override
;
63
65
std::shared_ptr<html_web_user_interaction> &
get_html_user_interaction
() {
return
web_ui; };
66
68
void
run_and_control_thread
(libthreadar::thread* arg) { web_ui->run_and_control_thread(arg); };
69
71
void
join_controlled_thread
() { web_ui->join_controlled_thread(); };
72
74
bool
is_libdar_running
()
const
{
return
web_ui->is_libdar_running(); };
75
77
bool
has_libdar_been_aborted
()
const
{
return
web_ui->has_libdar_been_aborted(); };
78
79
protected
:
81
virtual
std::string
inherited_get_body_part
(
const
chemin
& path,
82
const
request
& req)
override
;
83
85
virtual
void
my_visibility_has_changed
()
override
;
86
87
private
:
88
bool
enable_refresh;
89
90
std::shared_ptr<html_web_user_interaction> web_ui;
91
92
};
93
94
#endif
actor.hpp
actor
class of object that are pointed/triggered to by others
Definition
actor.hpp:55
chemin
class chemin definition
Definition
chemin.hpp:51
events
class events
Definition
events.hpp:52
html_libdar_running_popup
html_libdar_running_popup wraps up an html_web_user_interaction in a html_popup component
Definition
html_libdar_running_popup.hpp:48
html_libdar_running_popup::run_and_control_thread
void run_and_control_thread(libthreadar::thread *arg)
propagate request to web_ui
Definition
html_libdar_running_popup.hpp:68
html_libdar_running_popup::has_libdar_been_aborted
bool has_libdar_been_aborted() const
whether libdar thread has been aborted (to be checked by the caller upon libdar_has_finished event)
Definition
html_libdar_running_popup.hpp:77
html_libdar_running_popup::libdar_has_finished
static const std::string libdar_has_finished
libdar execution has ended and user has acknoledged it
Definition
html_libdar_running_popup.hpp:51
html_libdar_running_popup::my_visibility_has_changed
virtual void my_visibility_has_changed() override
inherited from body_builder
Definition
html_libdar_running_popup.cpp:104
html_libdar_running_popup::is_libdar_running
bool is_libdar_running() const
whether a libdar thread is running under "this" management
Definition
html_libdar_running_popup.hpp:74
html_libdar_running_popup::inherited_get_body_part
virtual std::string inherited_get_body_part(const chemin &path, const request &req) override
inherited from body_builder
Definition
html_libdar_running_popup.cpp:64
html_libdar_running_popup::join_controlled_thread
void join_controlled_thread()
propagate request to web_ui
Definition
html_libdar_running_popup.hpp:71
html_libdar_running_popup::on_event
virtual void on_event(const std::string &event_name) override
inherited from actor
Definition
html_libdar_running_popup.cpp:111
html_libdar_running_popup::get_html_user_interaction
std::shared_ptr< html_web_user_interaction > & get_html_user_interaction()
propagate request to web_ui
Definition
html_libdar_running_popup.hpp:65
html_popup
class html_popup is the implementation of
Definition
html_popup.hpp:50
request
class holding fields of an HTTP request (method, URI, header, cookies, and so on)
Definition
request.hpp:45
events.hpp
defines the event class
Generated by
1.9.8