Webdar 1.0.0
Web user interface to libdar
html_tooltip.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_TOOLTIP_HPP
25#define HTML_TOOLTIP_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 "body_builder.hpp"
39
41
49
51{
52public:
55 html_tooltip(const html_tooltip & ref) = default;
56 html_tooltip(html_tooltip && ref) noexcept = delete;
57 html_tooltip & operator = (const html_tooltip & ref) = default;
58 html_tooltip & operator = (html_tooltip && ref) noexcept = delete;
59 ~html_tooltip() = default;
60
62 const std::string & get_tooltip() const { return tooltip; };
63
65 void set_tooltip(const std::string & helper);
66
67protected:
68
70 virtual void new_css_library_available() override;
71
73
75 virtual void has_adopted(body_builder *obj) { throw WEBDAR_BUG; };
76
77
79 std::string get_tooltip_body_part() const;
80
81
82private:
83 std::string tooltip;
84
85 static constexpr const char* css_tooltip = "tooltip";
86 static constexpr const char* css_tooltiptext = "tooltiptext";
87};
88
89#endif
class body_builder is the root class of object generating HTML body
Definition: body_builder.hpp:99
class html_tooltip is a partial body_builder implementation for inherited class to implement tooltips
Definition: html_tooltip.hpp:51
void set_tooltip(const std::string &helper)
set the helper to the tooltip (helper popup)
Definition: html_tooltip.cpp:45
std::string get_tooltip_body_part() const
Definition: html_tooltip.cpp:149
html_tooltip()
Definition: html_tooltip.hpp:54
virtual void has_adopted(body_builder *obj)
inherited from body builder
Definition: html_tooltip.hpp:75
const std::string & get_tooltip() const
get the helper string to show as popup
Definition: html_tooltip.hpp:62
virtual void new_css_library_available() override
inherited from body_builder
Definition: html_tooltip.cpp:62