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/events/event.hpp"
11#include "fifechan/platform.hpp"
12
13namespace fcn
14{
25 class FIFEGUI_API WidgetListener
26 {
27 public:
28 virtual ~WidgetListener() = default;
29
31 WidgetListener(WidgetListener const &) = default;
38
44 virtual void widgetResized(Event const & event) { }
45
51 virtual void widgetMoved(Event const & event) { }
52
59 virtual void widgetHidden(Event const & event) { }
60
67 virtual void widgetShown(Event const & event) { }
68
74 virtual void ancestorMoved(Event const & event) { }
75
82 virtual void ancestorHidden(Event const & event) { }
83
90 virtual void ancestorShown(Event const & event) { }
91
92 protected:
99 WidgetListener() = default;
100 };
101} // namespace fcn
102
103#endif // INCLUDE_FIFECHAN_WIDGETLISTENER_HPP_
Base class for all GUI event objects.
Definition event.hpp:24
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
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.