FifeGUI 0.2.0
A C++ GUI library designed for games.
focuslistener.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_FOCUSLISTENER_HPP_
6#define INCLUDE_FIFECHAN_FOCUSLISTENER_HPP_
7
8#include <string>
9
10#include "fifechan/event.hpp"
11#include "fifechan/platform.hpp"
12
13namespace fcn
14{
22 class FIFEGUI_API FocusListener
23 {
24 public:
25 virtual ~FocusListener() = default;
26
27 FocusListener(FocusListener const &) = delete;
28 FocusListener& operator=(FocusListener const &) = delete;
29 FocusListener(FocusListener&&) = delete;
30 FocusListener& operator=(FocusListener&&) = delete;
31
37 virtual void focusGained(Event const & event) { }
38
44 virtual void focusLost(Event const & event) { }
45
46 protected:
53 FocusListener() = default;
54 };
55} // namespace fcn
56
57#endif // INCLUDE_FIFECHAN_FOCUSLISTENER_HPP_
Base class for all GUI event objects.
Definition event.hpp:24
virtual void focusLost(Event const &event)
Called when a widget loses focus.
virtual void focusGained(Event const &event)
Called when a widget gains focus.
FocusListener()=default
Constructor.