FifeGUI 0.2.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#include <string>
9
10#include "fifechan/event.hpp"
11#include "fifechan/platform.hpp"
12
13namespace fcn
14{
25 class FIFEGUI_API WidgetListener
26 {
27 public:
28 virtual ~WidgetListener() = default;
29
30 WidgetListener(WidgetListener const &) = default;
31 WidgetListener& operator=(WidgetListener const &) = default;
32 WidgetListener(WidgetListener&&) = default;
33 WidgetListener& operator=(WidgetListener&&) = default;
34
40 virtual void widgetResized(Event const & event) { }
41
47 virtual void widgetMoved(Event const & event) { }
48
55 virtual void widgetHidden(Event const & event) { }
56
63 virtual void widgetShown(Event const & event) { }
64
70 virtual void ancestorMoved(Event const & event) { }
71
78 virtual void ancestorHidden(Event const & event) { }
79
86 virtual void ancestorShown(Event const & event) { }
87
88 protected:
95 WidgetListener() = default;
96 };
97} // namespace fcn
98
99#endif // INCLUDE_FIFECHAN_WIDGETLISTENER_HPP_
Base class for all GUI event objects.
Definition event.hpp:24
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.
virtual void widgetShown(Event const &event)
Invoked when a widget is shown, i.e it's set to be visible.
WidgetListener()=default
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.
virtual void ancestorHidden(Event const &event)
Invoked when an ancestor of a widget is hidden, i.e its set to be not visible.