PLaSK library
|
Store information about event connected with geometry object. More...
#include <plask/geometry/object.hpp>
Public Types | |
enum | Flags : FlagsType { EVENT_DELETE = 1 << 0 , EVENT_RESIZE = 1 << 1 , EVENT_DELEGATED = 1 << 2 , EVENT_CHILDREN_INSERT = 1 << 3 , EVENT_CHILDREN_REMOVE = 1 << 4 , EVENT_CHILDREN_GENERIC = 1 << 5 , EVENT_EDGES , EVENT_STEPS = 1 << 7 , EVENT_USER_DEFINED = 1 << 8 } |
Event flags (which describes event properties). More... | |
Public Types inherited from plask::EventWithSourceAndFlags< GeometryObject, unsigned > | |
typedef unsigned | FlagsType |
Public Member Functions | |
FlagsType | flagsForParent () const |
Get event's flags for parent in tree of geometry (useful to calculate flags for event which should be generated by parent of object which is a source of this event). | |
FlagsType | flagsForParentWithChildrenWasChangedInformation () const |
Get event's flags for parent in tree of geometry, for parents which want to delegate information about changes of children list. | |
bool | hasFlag (Flags flag) const |
Check if given flag is set. | |
bool | isDelete () const |
Check if EVENT_DELETE flag is set, which mean that source of event is deleted. | |
bool | isResize () const |
Check if EVENT_RESIZE flag is set, which mean that source of event could be resized. | |
bool | isDelgatedFromChild () const |
Check if EVENT_DELEGATED flag is set, which mean that source delegate event from its child. | |
bool | hasChangedChildrenList () const |
Check if CHILD_LIST flag is set, which mean that children list of source could be changed. | |
bool | hasChangedEdges () const |
Check if EVENT_EDGES flag is set, which mean that edges connected with source could changed. | |
const GeometryObject * | originalSource () const |
Get original source of event which can differ from source if event was delegated. | |
Event (GeometryObject *source, FlagsType flags=0) | |
Construct event. | |
Event (GeometryObject *source, const GeometryObject *originalSource, FlagsType flags) | |
Construct event. | |
Public Member Functions inherited from plask::EventWithSourceAndFlags< GeometryObject, unsigned > | |
const GeometryObject * | source () const |
Get source of event. | |
GeometryObject * | source () |
Get source of event. | |
const T * | source () const |
Get source of event casted (using dynamic_cast) to given type T. | |
T * | source () |
Get source of event casted (using dynamic_cast) to given type T. | |
FlagsType | flags () const |
Get event's flags. | |
FlagsType | flagsWithout (FlagsType flagsToRemove) const |
Get event's flags with excluded flagsToRemove . | |
bool | hasAllFlags (FlagsType flags) const |
Check if given all of flags are set. | |
bool | hasAnyFlag (FlagsType flags) const |
Check if one of given flags are set. | |
EventWithSourceAndFlags (GeometryObject *source, FlagsType flags=0) | |
Construct event. | |
virtual | ~EventWithSourceAndFlags () |
Virtual destructor for eventual subclassing. | |
Store information about event connected with geometry object.
Subroles of this can contains additional information about specific type of event.
Note: when object is being deleted (isDelete() returns true
), source() can't be successfully dynamic cast to subroles of GeometryObject, because source() is already partially deleted.
Definition at line 99 of file object.hpp.
Event flags (which describes event properties).
Definition at line 106 of file object.hpp.
|
inlineexplicit |
Construct event.
source | source and original source of event |
flags | which describes event's properties |
Definition at line 196 of file object.hpp.
|
inlineexplicit |
Construct event.
source | source of event |
originalSource | original source of event |
flags | which describes event's properties |
Definition at line 205 of file object.hpp.
|
inline |
Get event's flags for parent in tree of geometry (useful to calculate flags for event which should be generated by parent of object which is a source of this event).
Definition at line 126 of file object.hpp.
|
inline |
Get event's flags for parent in tree of geometry, for parents which want to delegate information about changes of children list.
(uses mainly by parents of hidden child to calculate flags for event which should be generated by parent of object which is a source of this event).
Note: In most cases You should use flagsForParent() instead.
Definition at line 139 of file object.hpp.
|
inline |
Check if CHILD_LIST flag is set, which mean that children list of source could be changed.
true
only if CHILD_LIST flag is set Definition at line 175 of file object.hpp.
|
inline |
Check if EVENT_EDGES flag is set, which mean that edges connected with source could changed.
true
only if EVENT_EDGES flag is set Definition at line 183 of file object.hpp.
Check if given flag
is set.
flag | flag to check |
true
only if flag
is set Definition at line 151 of file object.hpp.
|
inline |
Check if EVENT_DELETE flag is set, which mean that source of event is deleted.
true
only if EVENT_DELETE flag is set Definition at line 157 of file object.hpp.
|
inline |
Check if EVENT_DELEGATED flag is set, which mean that source delegate event from its child.
true
only if EVENT_DELEGATED flag is set Definition at line 169 of file object.hpp.
|
inline |
Check if EVENT_RESIZE flag is set, which mean that source of event could be resized.
true
only if EVENT_RESIZE flag is set Definition at line 163 of file object.hpp.
|
inline |
Get original source of event which can differ from source if event was delegated.
Definition at line 189 of file object.hpp.