FifeGUI 0.3.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// 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{
26 class FIFEGUI_API FocusListener
27 {
28 public:
29 virtual ~FocusListener() = default;
30
31 FocusListener(FocusListener const &) = delete;
32 FocusListener& operator=(FocusListener const &) = delete;
33 FocusListener(FocusListener&&) = delete;
34 FocusListener& operator=(FocusListener&&) = delete;
35
41 virtual void focusGained(Event const & event)
42 {
43 }
44
50 virtual void focusLost(Event const & event)
51 {
52 }
53
54 protected:
61 FocusListener() = default;
62 };
63} // namespace fcn
64
65#endif // INCLUDE_FIFECHAN_FOCUSLISTENER_HPP_
Base class for all GUI event objects.
Definition event.hpp:25
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
Protected default constructor.
Used replacement tokens by configure_file():