Trait that provides system-level boolean flag management. More...
#include <Flaggable.h>
Public Types | |
| using | State |
| The enum type this manager stores flags for. | |
Public Member Functions | |
| bool | checkFlag (State state) const |
| Return the current value of a flag. | |
| void | disableFlag (State state) |
Set a flag to false. | |
| void | enableFlag (State state) |
Set a flag to true. | |
| void | setFlag (State state, bool status) |
| Set a flag to an explicit value. | |
| void | toggleFlag (State state) |
Flip a flag between true and false. | |
Trait that provides system-level boolean flag management.
Flaggable layers FlagManager<ml::Flag> onto the Trait base, giving any inheriting class the ability to read and write the framework's built-in ml::Flag values.
It is one of the three core traits automatically included in every ml::Core object (Subscribable, Flaggable, Positionable). Framework dispatchers check ml::Flag values to gate built-in behavior:
| Flag | Effect |
|---|---|
ml::Flag::DRAGGABLE | Enables drag handling in DraggableDispatcher |
ml::Flag::HOVERED | Set by HoverableDispatcher while the mouse is over the component |
ml::Flag::FOCUSED | Set by ClickableDispatcher when the component has keyboard focus |
For custom (manifest-declared) flags, see CustomFlaggable and MultiCustomFlaggable, which are composed into components separately.
Definition at line 49 of file Flaggable.h.
|
inherited |
The enum type this manager stores flags for.
Definition at line 62 of file FlagManager.h.
|
inherited |
Return the current value of a flag.
Returns false for any flag that has never been explicitly set.
| state | The flag to query. |
true if the flag is enabled; false otherwise.
|
inherited |
Set a flag to false.
| state | The flag to disable. |
|
inherited |
Set a flag to true.
| state | The flag to enable. |
|
inherited |
Set a flag to an explicit value.
| state | The flag to modify. |
| status | true to enable, false to disable. |
|
inherited |
Flip a flag between true and false.
| state | The flag to toggle. |