FifeGUI 0.3.0
A C++ GUI library designed for games.
widgetlistener.hpp
1// SPDX-License-Identifier: LGPL-2.1-or-later OR BSD-3-Clause
2// SPDX-FileCopyrightText: 2004 - 2008 Olof Naessén and Per Larsson
3// SPDX-FileCopyrightText: 2013 - 2026 Fifengine contributors
4
5#ifndef INCLUDE_FIFECHAN_WIDGETLISTENER_HPP_
6#define INCLUDE_FIFECHAN_WIDGETLISTENER_HPP_
7
8// Standard library includes
9#include <string>
10
11// Platform config include
12#include "fifechan/platform.hpp"
13
14// Project headers (subdirs before local)
15#include "fifechan/events/event.hpp"
16
17namespace fcn
18{
29 class FIFEGUI_API WidgetListener
30 {
31 public:
32 virtual ~WidgetListener() = default;
33
37 WidgetListener(WidgetListener const &) = default;
38
43
48
53
59 virtual void widgetResized(Event const & event)
60 {
61 }
62
68 virtual void widgetMoved(Event const & event)
69 {
70 }
71
78 virtual void widgetHidden(Event const & event)
79 {
80 }
81
88 virtual void widgetShown(Event const & event)
89 {
90 }
91
97 virtual void ancestorMoved(Event const & event)
98 {
99 }
100
107 virtual void ancestorHidden(Event const & event)
108 {
109 }
110
117 virtual void ancestorShown(Event const & event)
118 {
119 }
120
121 protected:
128 WidgetListener() = default;
129 };
130} // namespace fcn
131
132#endif // INCLUDE_FIFECHAN_WIDGETLISTENER_HPP_
Base class for all GUI event objects.
Definition event.hpp:25
WidgetListener & operator=(WidgetListener &&)=default
Move assignment operator.
virtual void widgetMoved(Event const &event)
Invoked when a widget is moved.
virtual void widgetHidden(Event const &event)
Invoked when a widget is hidden, i.e it's set to be not visible.
WidgetListener & operator=(WidgetListener const &)=default
Copy assignment operator.
virtual void widgetShown(Event const &event)
Invoked when a widget is shown, i.e it's set to be visible.
WidgetListener()=default
Protected default constructor.
WidgetListener(WidgetListener const &)=default
Copy constructor.
virtual void widgetResized(Event const &event)
Invoked when a widget changes its size.
virtual void ancestorMoved(Event const &event)
Invoked when an ancestor of a widget is moved.
virtual void ancestorShown(Event const &event)
Invoked when an ancestor of a widget is shown, i.e its set to be visible.
WidgetListener(WidgetListener &&)=default
Move constructor.
virtual void ancestorHidden(Event const &event)
Invoked when an ancestor of a widget is hidden, i.e its set to be not visible.
Used replacement tokens by configure_file():