Contains other behaviours and forwards events to them. More...
#include <GUICompositeBehaviour.h>
Public Member Functions | |
CGUICompositeBehaviour () | |
virtual | ~CGUICompositeBehaviour () |
void | AddBehaviour (CGUIBehaviourDecorator *pBehaviour, eC_Bool bAtFront=false) |
virtual CGUIBehaviourDecorator * | Clone () const |
virtual eC_Bool | Decrease () |
virtual eC_Bool | DoButtonDown (const eC_Value &vAbsX, const eC_Value &vAbsY) |
virtual eC_Bool | DoButtonUp (const eC_Value &vAbsX, const eC_Value &vAbsY) |
virtual eC_Bool | DoChar (const eC_UInt &uiKey, const GUIKeyIdentifier_t &eKeyIdentifier, const eC_UInt &uiModifiers) |
virtual eC_Bool | DoClick (const eC_Value &vAbsX=eC_FromInt(-1), const eC_Value &vAbsY=eC_FromInt(-1)) |
virtual eC_Bool | DoDoubleClick (const eC_Value &vAbsX=eC_FromInt(-1), const eC_Value &vAbsY=eC_FromInt(-1)) |
virtual eC_Bool | DoDrag (const eC_Value &vDeltaX, const eC_Value &vDeltaY, const eC_Value &vAbsX, const eC_Value &vAbsY) |
virtual eC_Bool | DoDragEnd (const eC_Value &vAbsX, const eC_Value &vAbsY) |
virtual eC_Bool | DoKeyDown (const GUIKeyIdentifier_t &eKeyIdentifier, const eC_UInt &uiModifiers) |
virtual eC_Bool | DoKeyUp (const GUIKeyIdentifier_t &eKeyIdentifier, const eC_UInt &uiModifiers) |
virtual eC_Bool | DoLongClick (const eC_Value &vAbsX=eC_FromInt(-1), const eC_Value &vAbsY=eC_FromInt(-1)) |
virtual eC_Bool | DoMouseEnter (const eC_Value &vAbsX, const eC_Value &vAbsY) |
virtual eC_Bool | DoMouseLeave (const eC_Value &vAbsX, const eC_Value &vAbsY) |
virtual eC_Bool | DoMouseMove (const eC_Value &vAbsX, const eC_Value &vAbsY) |
virtual eC_Bool | DoScroll (const eC_Value &vAbsX, const eC_Value &vAbsY, const eC_Value &vDelta, const eC_Bool &bModifierActive) |
virtual eC_Bool | DoUserEvent (CGUIEvent *const pEvent) |
virtual eC_Bool | FocusNext (CGUIObject *const pRefObj=NULL, const eC_Bool &bSubTreeOfRefObjDone=false) |
virtual eC_Bool | FocusPrevious (CGUIObject *const pRefObj=NULL, const eC_Bool &bSubTreeOfRefObjDone=false) |
virtual void | GetFocus () |
virtual eC_Bool | Increase () |
virtual eC_Bool | IsCompositeBehaviour () const |
virtual void | LoseFocus () |
CGUICompositeBehaviour & | operator= (const CGUICompositeBehaviour &rSource) |
virtual void | ReadFromStream () |
void | RemoveAllBehaviours () |
Removes all behaviours from this CGUICompositeBehaviour, causing them to be deleted. | |
void | RemoveBehaviour (CGUIBehaviourDecorator *pBehaviour) |
virtual void | WriteToStream (const eC_Bool bWriteClassID=false) |
![]() | |
virtual | ~CGUIBehaviourDecorator () |
virtual CGUIBehaviourDecorator * | Clone () const |
virtual eC_Bool | IsCompositeBehaviour () const |
![]() | |
virtual eC_Bool | DoScale (const eC_Value &vDelta) |
virtual eC_Bool | DoUserEvent (CGUIEvent *const pEvent) |
virtual void | OnCreate () |
virtual void | OnDataPool (const DataPoolResource_t &eID) |
virtual void | OnDelete () |
virtual void | OnHide () |
virtual void | OnShow () |
![]() | |
const eC_String & | GetXMLTag () const |
virtual void | ReadFromStream () |
void | SetXMLTag (const eC_String &kXMLTag) |
virtual void | WriteToStream (const eC_Bool bWriteClassID=false) |
Static Public Attributes | |
static const eC_Char | XMLTAG_NUMBER_OF_BEHAVIOURS [] |
XML tag to be used when writing the number of following behaviours into a stream. | |
![]() | |
static const eC_Char | XMLTAG_BEHAVIOURCLASSID [] |
XML tag to be used when writing a behaviour class ID into a stream. | |
static const eC_Char | XMLTAG_BEHAVIOURCOUNT [] |
XML tag for count. | |
![]() | |
static const eC_Char | XMLTAG_CLASSVERSION [] |
Protected Types | |
typedef eC_TListDoubleLinked< CGUIBehaviourDecorator * > | BehaviourList |
A Behaviour list is a double-linked list of behaviour decorator pointers. | |
Protected Member Functions | |
void | CopyBehaviours (const CGUICompositeBehaviour &rSource) |
![]() | |
CGUIBehaviourDecorator (CGUIObject *const pkObject=NULL) | |
CGUIBehaviourDecorator (const CGUIBehaviourDecorator &kSource) | |
virtual void | AssociatedObjectChanges (CGUIObject *const pkNewAssociatedObject) |
CGUIObject * | GetAssociatedObject () const |
![]() | |
eC_UInt | ReadStreamingHeader (const eC_UInt &uiClassVersion, const eC_UInt &uiClassMinVersion=0) const |
void | WriteStreamingFooter (const eC_Bool &bWriteClassID) const |
void | WriteStreamingHeader (const eC_Bool &bWriteClassID, const eC_Char *const pkClassIDTag, const eC_Int &iClassID, const eC_UInt &uiClassVersion) const |
![]() | |
void | InitDeletedFlag (eC_Bool &bDeleted) |
void | ResetDeletedFlag () |
Resets the internal flag pointer to NULL. | |
CGUIDeleteNotification () | |
CGUIDeleteNotification constructor. | |
virtual | ~CGUIDeleteNotification () |
Protected Attributes | |
BehaviourList | m_Behaviours |
List of the attached behaviours. | |
Additional Inherited Members | |
![]() | |
static UUID_t | GenerateUUID () |
Contains other behaviours and forwards events to them.
If you have implemented reusable functionalities in various behaviours and want to attach them all to the same object, you may add instances of these behaviours to a CGUICompositeBehaviour and attach this one to the object.
All event handling method calls are forwarded to the child behaviours in the order in which they have been added, until one of them returns true or the end of the list is reached. So for instance a click on an object will result in calls of the DoClick() methods of all attached behaviours.
This mechanism works for all methods declared in the CGUIBehaviour class.
Example:
CGUICompositeBehaviour::CGUICompositeBehaviour | ( | ) |
CGUICompositeBehaviour constructor.
|
virtual |
CGUICompositeBehaviour destructor. Deletes all attached behaviours.
void CGUICompositeBehaviour::AddBehaviour | ( | CGUIBehaviourDecorator * | pBehaviour, |
eC_Bool | bAtFront = false |
||
) |
Adds a new behaviour to this CGUICompositeBehaviour. The added behaviour will be deleted on destruction of this parent behaviour. If the behaviour is already in the child list, this method does nothing.
[in] | pBehaviour | Pointer the new behaviour. |
[in] | bAtFront | adds the behaviour at the front of the child list (true) or at the end (false). |
|
virtual |
Creates a copy of this behaviour and all attached behaviours.
Reimplemented from CGUIBehaviourDecorator.
|
protected |
Helper method that copies the internal list of behaviours.
[in] | rSource | reference to the composite behaviour whose behaviour list should be copied. |
|
virtual |
Called when the object receives a standard GK_PAGEDOWN event. For a simple object there is nothing to do but to indicate that the event has not been handled. For a standardized event handling mechanism, this method must exist.
Reimplemented from CGUIBehaviour.
|
virtual |
Called when the mouse button or finger is pressed down over an object.
vAbsX | X-position in screen coordinates where the click occurred |
vAbsY | Y-position in screen coordinates where the click occurred |
Reimplemented from CGUIBehaviour.
|
virtual |
Called when the mouse button or finger is released. The object under the mouse at the time of releasing will receive this event.
vAbsX | X-position in screen coordinates where the mouse was released. |
vAbsY | Y-position in screen coordinates where the mouse was released. |
Reimplemented from CGUIBehaviour.
|
virtual |
Called in reaction to a ET_CHAR event, which means in general that a character key was pressed. In this slot you will get the character with the Guiliani key identifier and modifiers. In most cases the Guiliani key identifier will be GK_NONE. But there are some special cases (e.g. Smartphones) for which it makes sense to send a Guiliani-Key identifier (GK_INTERMIT) even if a character key was pressed.
uiKey | Character of the pressed key. |
eKeyIdentifier | The Guiliani key identifier. |
uiModifiers | The key modifiers bitfield. |
Reimplemented from CGUIBehaviour.
|
virtual |
Called when the object receives a click event. A click can e.g., be the result of a mouse click, a finger press/release sequence on touchscreens, or be triggered by a GK_ACTION keyboard event.
vAbsX | X-position in screen coordinates where the click occurred |
vAbsY | Y-position in screen coordinates where the click occurred |
Reimplemented from CGUIBehaviour.
|
virtual |
Called when an object is clicked twice within a given time span.
vAbsX | X-position in screen coordinates where the click occurred |
vAbsY | Y-position in screen coordinates where the click occurred |
Reimplemented from CGUIBehaviour.
|
virtual |
Called when the object receives a Drag event. Drags are typically created if the mouse is being used while a mouse-button is being pressed, or if the user moves his finger over a touchscreen.
vDeltaX | relative movement in x-direction since the last call of DoDrag/ButtonDown |
vDeltaY | relative movement in y-direction since the last call of DoDrag/ButtonDown |
vAbsX | current X-position in screen coordinates of the mouse |
vAbsY | current Y-position in screen coordinates of the mouse |
Reimplemented from CGUIBehaviour.
|
virtual |
Called on the dragged object (=the object on which the initial ButtonDown-event occurred) when the mouse button is released after a drag event.
vAbsX | current X-position in screen coordinates of the mouse |
vAbsY | current Y-position in screen coordinates of the mouse |
Reimplemented from CGUIBehaviour.
|
virtual |
Called in reaction to a ET_KEYDOWN event, which means in general that a non-character key was pressed. For that reason you will only get the Guiliani-Key identifier (possibly with modifiers) in this slot and not the character of the pressed key.
eKeyIdentifier | The Guiliani key identifier. |
uiModifiers | The key modifiers bitfield. |
Reimplemented from CGUIBehaviour.
|
virtual |
Called in reaction to a ET_KEYUP event, which means in general that a non-character key was released. For that reason you will only get the Guiliani key identifier (possibly with modifiers) in this slot and not the character of the released key.
eKeyIdentifier | The Guiliani key identifier. |
uiModifiers | The key modifiers bitfield. |
Reimplemented from CGUIBehaviour.
|
virtual |
Called when an object is pressed for a longer period of time.
vAbsX | X-position in screen coordinates where the click occurred |
vAbsY | Y-position in screen coordinates where the click occurred |
Reimplemented from CGUIBehaviour.
|
virtual |
Called when the mouse enters the area which is covered by an object. If several objects cover the same region, the topmost one receives the event. Objects will not receive DoMouseEnter events if they are not highlightable.
vAbsX | X-position in screen coordinates where the mouse entered the object |
vAbsY | Y-position in screen coordinates where the mouse entered the object |
Reimplemented from CGUIBehaviour.
|
virtual |
Called when the mouse leaves the area which is covered by an object. Objects will not receive DoMouseLeave events if they are not highlightable.
vAbsX | X-position of the mouse in screen coordinates after it left the object |
vAbsY | Y-position of the mouse in screen coordinates after it left the object |
Reimplemented from CGUIBehaviour.
|
virtual |
Called when the mouse is moved within the area covered by an object. If several objects cover the same region, the topmost one receives the event. Objects will not receive DoMouseEnter events if they are not highlightable.
vAbsX | X-position of the mouse in screen coordinates |
vAbsY | Y-position of the mouse in screen coordinates |
Reimplemented from CGUIBehaviour.
|
virtual |
Called when the mouse wheel was scrolled
vAbsX | X-position of the mouse in screen coordinates |
vAbsY | Y-position of the mouse in screen coordinates |
vDelta | number of pixels for scroll |
bModifierActive | if true the scroll modifier is active (e.g. left/right instead of up/down) |
Reimplemented from CGUIBehaviour.
|
virtual |
Slot for handling of arbitrary user events. Override this slot to catch any incoming event before it is dealt with by standard handlers.
Be aware that DoUserEvent() will be called on the currently focused object for all incoming events! This means for instance that your focused object (and its parents) will also receive events of type ET_LBUTTONDOWN when the user is clicking somewhere else on the screen.
pEvent | The event to be processed. |
Reimplemented from CGUIBehaviour.
|
virtual |
Called when the object is requested to focus the "next" object. Called when the object receives a standard GK_DOWN event or by request from Source-Code. For a simple object there is nothing to do but to indicate that the event has not been handled. For a standardized event handling mechanism, this method must exist.
pRefObj | usually is a child of this object which indicates the current position in the child list. |
bSubTreeOfRefObjDone | indicates if the subtree that is under pRefObj has already been asked to take focus, or if not. |
Reimplemented from CGUIBehaviour.
|
virtual |
Called when the object is requested to focus the "previous" object. Typically, this happens in reaction to a standard GK_UP event or by request from Source-Code. For a simple object there is nothing to do but to indicate that the event has not been handled. For a standardized event handling mechanism, this method must exist.
pRefObj | usually is a child of this object which indicates the current position in the child list. |
bSubTreeOfRefObjDone | indicates if the subtree that is under pRefObj has already been asked to take focus, or if not. |
Reimplemented from CGUIBehaviour.
|
virtual |
Called when the object, or one of its children, received the focus. If this control is a composite object then the following applies: Whether this control or a child control got the focus can be determined by checking if this control is the currently focused object in the event handler.
Reimplemented from CGUIBehaviour.
|
virtual |
Called when the object receives a standard GK_PAGEUP event. For a simple object there is nothing to do but to indicate that the event has not been handled. For a standardized event handling mechanism, this method must exist.
Reimplemented from CGUIBehaviour.
|
inlinevirtual |
Decide whether the returned CGUIBehaviourDecorator is CGUICompositeBehaviour. Please do not reimplement this method in any derived class. It is only used in the CGUIBehaviourDecorator and CGUICompositeBehaviour to distinguish those two basic types.
Reimplemented from CGUIBehaviourDecorator.
|
virtual |
Called when an object has lost the focus. In this method the focused object is already set to the object that newly received the focus.
Reimplemented from CGUIBehaviour.
CGUICompositeBehaviour & CGUICompositeBehaviour::operator= | ( | const CGUICompositeBehaviour & | rSource | ) |
Assignment operator
rSource | source-object |
|
virtual |
Reads attributes from the streaming file. Only for use with GUIFactoryManager.
Reimplemented from CGUIStreamableObject.
void CGUICompositeBehaviour::RemoveBehaviour | ( | CGUIBehaviourDecorator * | pBehaviour | ) |
Removes a behaviour from this CGUICompositeBehaviour, causing the behaviour to be deleted.
[in] | pBehaviour | The behaviour to be removed. |
|
virtual |
Writes attributes to the streaming file. A CGUIStreamWriter has to be initialized.
bWriteClassID | This flag is used to switch writing of the class ID, leading and trailing tags. When implementing a new streamable object, check this flag. If it is true, first write the class ID, then continue with this object's attributes, and finally call the base class implementation with this flag set to false (this is the default). |
Reimplemented from CGUIStreamableObject.