5#ifndef INCLUDE_FIFECHAN_FOCUSHANDLER_HPP_
6#define INCLUDE_FIFECHAN_FOCUSHANDLER_HPP_
10#include "fifechan/event.hpp"
11#include "fifechan/platform.hpp"
32 class FIFEGUI_API FocusHandler
35 virtual ~FocusHandler() =
default;
38 FocusHandler(FocusHandler
const &) =
delete;
39 FocusHandler& operator=(FocusHandler
const &) =
delete;
40 FocusHandler(FocusHandler&&) =
delete;
41 FocusHandler& operator=(FocusHandler&&) =
delete;
Base class for all GUI event objects.
Widget * mFocusedWidget
Holds the focused widget.
virtual Widget * getLastWidgetWithMouse()
Gets the last widget with the mouse.
std::vector< Widget * > WidgetVector
Typedef.
WidgetVector mWidgets
Holds the widgets currently being handled by the focus handler.
Widget * mDraggedWidget
Holds the dragged widget.
virtual void focusPrevious()
Focuses the previous widget added to a container.
virtual void widgetHidden(Widget *widget)
Informs the focus handler that a widget was hidden.
virtual void setLastWidgetWithMouse(Widget *lastWidgetWithMouse)
Sets the last widget with the mouse.
virtual void focusNone()
Focuses nothing.
virtual Widget * getDraggedWidget()
Gets the widget being dragged.
Widget * mLastWidgetWithModalMouseInputFocus
Holds the last widget with modal mouse input focus.
Widget * mLastWidgetPressed
Holds the last widget pressed.
virtual void add(Widget *widget)
Adds a widget to by handles by the focus handler.
virtual void setLastWidgetWithModalFocus(Widget *lastWidgetWithModalFocus)
Sets the last widget with modal focus.
virtual void releaseModalFocus(Widget *widget)
Releases modal focus if the widget has modal focus.
virtual void setLastWidgetPressed(Widget *lastWidgetPressed)
Sets the last widget pressed.
virtual Widget * getLastWidgetWithModalMouseInputFocus()
Gets the last widget with modal mouse input focus.
virtual Widget * getLastWidgetWithModalFocus()
Gets the last widget with modal focus.
virtual void remove(Widget *widget)
Removes a widget from the focus handler.
Widget * mModalMouseInputFocusedWidget
Holds the modal mouse input focused widget.
virtual bool isFocused(Widget const *widget) const
Checks if a widget is focused.
virtual void distributeFocusGainedEvent(Event const &focusEvent)
Distributes a focus gained event.
virtual void tabPrevious()
Focuses the previous widget which allows tabbing in unless current focused widget disallows tabbing o...
Widget * mLastWidgetWithModalFocus
Holds the last widget with modal focus.
virtual void requestModalFocus(Widget *widget)
Requests modal focus for a widget.
virtual void tabNext()
Focuses the next widget which allows tabbing in unless the current focused Widget disallows tabbing o...
virtual void distributeFocusLostEvent(Event const &focusEvent)
Distributes a focus lost event.
virtual void focusNext()
Focuses the next widget added to a container.
WidgetVector::iterator WidgetIterator
Typedef.
Widget * mModalFocusedWidget
Holds the modal focused widget.
virtual Widget * getModalFocused() const
Gets the widget with modal focus.
virtual void setDraggedWidget(Widget *draggedWidget)
Sets the widget being dragged.
virtual void requestFocus(Widget *widget)
Requests focus for a widget.
virtual Widget * getModalMouseInputFocused() const
Gets the widget with modal mouse input focus.
virtual Widget * getLastWidgetPressed()
Gets the last widget pressed.
virtual void requestModalMouseInputFocus(Widget *widget)
Requests modal mouse input focus for a widget.
Widget * mLastWidgetWithMouse
Holds the last widget with the mouse.
virtual void setLastWidgetWithModalMouseInputFocus(Widget *lastWidgetWithModalMouseInputFocus)
Sets the last widget with modal mouse input focus.
virtual void releaseModalMouseInputFocus(Widget *widget)
Releases modal mouse input focus if the widget has modal mouse input focus.
virtual Widget * getFocused() const
Gets the widget with focus.