5#ifndef INCLUDE_FIFECHAN_WIDGET_HPP_
6#define INCLUDE_FIFECHAN_WIDGET_HPP_
13#include "fifechan/color.hpp"
14#include "fifechan/rectangle.hpp"
15#include "fifechan/size.hpp"
16#include "fifechan/widgetlistener.hpp"
386 virtual Widget* getParent()
const;
394 virtual Widget* getTop()
const;
403 void setWidth(
int width);
412 int getWidth()
const;
421 void setHeight(
int height);
430 int getHeight()
const;
440 void setSize(
int width,
int height);
486 void setPosition(
int x,
int y);
495 void setDimension(
Rectangle const & dimension);
511 unsigned int getChildrenCount()
const;
518 unsigned int getVisibleChildrenCount()
const;
526 void setMinSize(
Size const & size);
534 Size const & getMinSize()
const;
542 void setMaxSize(
Size const & size);
550 Size const & getMaxSize()
const;
559 void setFixedSize(
Size const & size);
567 Size const & getFixedSize()
const;
575 bool isFixedSize()
const;
584 void setFocusable(
bool focusable);
592 bool isFocusable()
const;
599 virtual bool isFocused()
const;
609 void setEnabled(
bool enabled);
618 bool isEnabled()
const;
626 void setVisible(
bool visible);
634 bool isVisible()
const;
641 bool isSetVisible()
const;
649 virtual void setBaseColor(
Color const & color);
657 Color const & getBaseColor()
const;
665 virtual void setForegroundColor(
Color const & color);
672 Color const & getForegroundColor()
const;
680 virtual void setBackgroundColor(
Color const & color);
687 Color const & getBackgroundColor()
const;
695 virtual void setSelectionColor(
Color const & color);
703 Color const & getSelectionColor()
const;
711 virtual void setOutlineColor(
Color const & color);
719 Color const & getOutlineColor()
const;
727 virtual void setBorderColor(
Color const & color);
735 Color const & getBorderColor()
const;
743 virtual void setSelectionMode(SelectionMode mode);
751 SelectionMode getSelectionMode()
const;
758 virtual void requestFocus();
764 virtual void requestMoveToTop();
770 virtual void requestMoveToBottom();
781 virtual void _draw(
Graphics* graphics);
791 virtual void _logic();
803 virtual void _setFocusHandler(
FocusHandler* focusHandler);
936 void setActionEventId(std::string
const & actionEventId);
944 std::string
const & getActionEventId()
const;
952 virtual void getAbsolutePosition(
int& x,
int& y)
const;
964 virtual void _setParent(
Widget* parent);
974 Font* getFont()
const;
982 static void setGlobalFont(
Font* font);
991 virtual void setFont(
Font* font);
1008 static bool widgetExists(
Widget const * widget);
1019 bool isTabInEnabled()
const;
1030 void setTabInEnabled(
bool enabled);
1041 bool isTabOutEnabled()
const;
1052 void setTabOutEnabled(
bool enabled);
1060 virtual bool isModalFocusable()
const;
1068 virtual bool isModalMouseInputFocusable()
const;
1077 virtual void requestModalFocus();
1087 virtual void requestModalMouseInputFocus();
1095 virtual void releaseModalFocus();
1103 virtual void releaseModalMouseInputFocus();
1111 virtual bool isModalFocused()
const;
1120 virtual bool isModalMouseInputFocused()
const;
1149 virtual Widget* getWidgetAt(
int x,
int y,
Widget* exclude);
1175 virtual std::list<Widget*> getWidgetsIn(
Rectangle const & area,
Widget* ignore);
1182 virtual std::list<MouseListener*>
const & _getMouseListeners();
1189 virtual std::list<KeyListener*>
const & _getKeyListeners();
1196 virtual std::list<FocusListener*>
const & _getFocusListeners();
1238 void setInternalFocusHandler(
FocusHandler* internalFocusHandler);
1249 virtual void moveToTop(
Widget* widget);
1260 virtual void moveToBottom(
Widget* widget);
1267 virtual void focusNext();
1274 virtual void focusPrevious();
1294 void setId(std::string
const &
id);
1305 std::string
const & getId()
const;
1316 virtual void showPart(
Rectangle rectangle);
1351 static void _setGuiDeathListener(
DeathListener* deathListener);
1366 void setVerticalExpand(
bool expand);
1374 bool isVerticalExpand()
const;
1382 void setHorizontalExpand(
bool expand);
1390 bool isHorizontalExpand()
const;
1409 virtual void adaptLayout(
bool top);
1466 void getLastPosition(
int& x,
int& y)
const;
1474 void setLastPosition(
int x,
int y);
1481 bool isLastPositionSet()
const;
1487 void distributeActionEvent();
1492 void distributeResizedEvent();
1497 void distributeMovedEvent();
1502 void distributeHiddenEvent();
1507 void distributeShownEvent();
1515 void distributeAncestorMovedEvent(
Widget* ancestor);
1523 void distributeAncestorHiddenEvent(
Widget* ancestor);
1531 void distributeAncestorShownEvent(
Widget* ancestor);
1542 void add(
Widget* widget);
1553 virtual void remove(
Widget* widget);
1563 virtual void removeAllChildren();
1574 virtual Widget* findWidgetById(std::string
const &
id);
1580 void resizeToChildren();
1586 void calculateSize();
1593 std::list<Widget*>
const & getChildren()
const;
1783 Size mMaxSize{std::numeric_limits<int>::max(), std::numeric_limits<int>::max()};
1857 using T = std::underlying_type_t<Widget::SelectionMode>;
1863 using T = std::underlying_type_t<Widget::SelectionMode>;
Interface for listening to action events from widgets.
Interface for listening to widget destruction events.
A basic font implementation capable only of drawing rectangles (placeholder).
Manages focus navigation and assignment among widgets within a Gui instance.
Interface for listening to focus gain/loss events.
Abstract interface for font rendering.
Abstract interface providing primitive drawing functions (lines, rectangles, etc.).
Interface for listening to keyboard events.
Interface for listening to mouse events.
Represents a rectangular area (X, Y, Width, Height).
Represents dimensions defined by width and height.
Handles changes in widget visibility states.