Webdar 1.0.0
Web user interface to libdar
html_listing_page.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_LISTING_PAGE_HPP
25#define HTML_LISTING_PAGE_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 "html_dir_tree.hpp"
40#include "html_button.hpp"
41#include "html_div.hpp"
42#include "archive_init_list.hpp"
43#include "html_focus.hpp"
44
46
52
53class html_listing_page : public html_page, public actor, public events
54{
55public:
56 static const std::string event_close;
57
59 html_listing_page(const html_listing_page & ref) = delete;
60 html_listing_page(html_listing_page && ref) noexcept = delete;
61 html_listing_page & operator = (const html_listing_page & ref) = delete;
62 html_listing_page & operator = (html_listing_page && ref) noexcept = delete;
63 ~html_listing_page() = default;
64
65
67 void set_session_name(const std::string & session_name);
68
70 void set_source(const archive_init_list *ref) { tree.set_source(ref); tree.go_expand(); tree.go_show(); };
71
73 void clear() { tree.clear(); };
74
75 // inherited from actor
76 virtual void on_event(const std::string & event_name) override;
77
78protected:
80 virtual void new_css_library_available() override;
81
82
83private:
84 html_dir_tree tree;
85 html_div title;
86 html_focus focus;
87 html_button close;
88};
89
90
91#endif
class of object that are pointed/triggered to by others
Definition: actor.hpp:55
this objects is a thread object that provide access to the content of an existing archive
Definition: archive_init_list.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_dir_tree show a directory content read from an existing dar archive
Definition: html_dir_tree.hpp:76
void go_expand()
expand the directory exposing all its subdirectories
Definition: html_dir_tree.cpp:186
void set_source(const archive_init_list *ref)
where to fetch from archive content
Definition: html_dir_tree.cpp:160
void clear()
clear information learnt from a previously opened archive
Definition: html_dir_tree.cpp:139
void go_show()
show contents in the focus place
Definition: html_dir_tree.hpp:105
class html_div is the implementation of
Definition: html_div.hpp:46
html_focus class provides a mean to temporarily have an object show at a particular place in a page
Definition: html_focus.hpp:50
html_listing_page is the page that shows when listing an existing archive content
Definition: html_listing_page.hpp:54
virtual void new_css_library_available() override
inherited from html_div/body_builder
Definition: html_listing_page.cpp:105
void clear()
clear informations about previously read archive
Definition: html_listing_page.hpp:73
void set_source(const archive_init_list *ref)
mandatory call before calling get_body_part !!!
Definition: html_listing_page.hpp:70
void set_session_name(const std::string &session_name)
set title of the listing page given the session name
Definition: html_listing_page.cpp:94
virtual void on_event(const std::string &event_name) override
implementation in inherited class of the action triggered by the event given in argument
Definition: html_listing_page.cpp:84
html page root component
Definition: html_page.hpp:45