Guiliani  Version 2.4 revision 5970 (build 3)
CGUICmdBehaviour Class Referenceabstract

#include <GUISingleCmdBehaviour.h>

Inheritance diagram for CGUICmdBehaviour:

Protected Member Functions

 CGUICmdBehaviour ()
 
virtual ~CGUICmdBehaviour ()
 
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 &eKeyID, 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 &eKeyID, const eC_UInt &uiModifiers)
 
virtual eC_Bool DoKeyUp (const GUIKeyIdentifier_t &eKeyID, 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 DoScrollDown (const eC_Value &vAbsX, const eC_Value &vAbsY)
 
virtual eC_Bool DoScrollLeft (const eC_Value &vAbsX, const eC_Value &vAbsY)
 
virtual eC_Bool DoScrollRight (const eC_Value &vAbsX, const eC_Value &vAbsY)
 
virtual eC_Bool DoScrollUp (const eC_Value &vAbsX, const eC_Value &vAbsY)
 
virtual void ExecuteCommand (const BehaviourType_t &eFromBehaviour)=0
 Executes the command for the given behaviour, if it is equal to the stored one. More...
 
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 void LoseFocus ()
 
virtual void OnCreate ()
 
virtual void OnDelete ()
 
virtual void OnHide ()
 
virtual void OnShow ()
 
- Protected Member Functions inherited from CGUIBehaviourDecorator
 CGUIBehaviourDecorator (CGUIObject *const pObject=NULL)
 
 CGUIBehaviourDecorator (const CGUIBehaviourDecorator &kSource)
 
virtual void AssociatedObjectChanges (CGUIObject *const pNewAssociatedObject)
 
CGUIObjectGetAssociatedObject () const
 
- Protected Member Functions inherited from CGUIStreamableObject
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
 

Additional Inherited Members

- Public Member Functions inherited from CGUIBehaviourDecorator
virtual ~CGUIBehaviourDecorator ()
 
virtual CGUIBehaviourDecoratorClone () const
 
virtual eC_Bool IsCompositeBehaviour () const
 
- Public Member Functions inherited from CGUIBehaviour
virtual eC_Bool DoUserEvent (CGUIEvent *const pEvent)
 
virtual eC_Bool DoMouseMove (const eC_Value &vAbsX=eC_FromInt(-1), const eC_Value &vAbsY=eC_FromInt(-1))
 
- Public Member Functions inherited from CGUIStreamableObject
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 inherited from CGUIBehaviour
static const eC_Char XMLTAG_BEHAVIOURCLASSID [] = "BehaviourClassID"
 XML tag to be used when writing a behaviour class ID into a stream.
 
- Static Public Attributes inherited from CGUIStreamableObject
static const eC_Char XMLTAG_CLASSVERSION [] = "ClassVersion"
 

Detailed Description

Base class which Associates a command with one event slot. The event will be forwarded to the associated object.

See also
CGUISingleCmdBehaviour, CGUIMultiCmdBehaviour

Constructor & Destructor Documentation

◆ CGUICmdBehaviour()

CGUICmdBehaviour::CGUICmdBehaviour ( )
inlineprotected

Constructor.

◆ ~CGUICmdBehaviour()

virtual CGUICmdBehaviour::~CGUICmdBehaviour ( )
inlineprotectedvirtual

Destructor.

Member Function Documentation

◆ Decrease()

eC_Bool CGUICmdBehaviour::Decrease ( )
protectedvirtual

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.

Returns
True If the event has been handled.
false Else.

Reimplemented from CGUIBehaviour.

◆ DoButtonDown()

eC_Bool CGUICmdBehaviour::DoButtonDown ( const eC_Value &  vAbsX,
const eC_Value &  vAbsY 
)
protectedvirtual

Called when the mouse button or finger is pressed down over an object.

Note
DoButtonDown() should work on the absolute positions of this object, that were set at the time of the passed redraw, as the user expects to click on what he sees and not to click on the object in a newer and probably intermediate state that he currently does not see in this state. Thus, to calculate the relative position (where the object was pressed relative to the origin of this object) from the vAbsY argument you must do it like this: vMyRelYPos = vAbsY - GetAbsYPos().
Parameters
vAbsXX-position in screen coordinates where the click occurred
vAbsYY-position in screen coordinates where the click occurred
Returns
True The event has been handled.
False The event has not been handled. In this base implementation always returns False.

Reimplemented from CGUIBehaviour.

◆ DoButtonUp()

eC_Bool CGUICmdBehaviour::DoButtonUp ( const eC_Value &  vAbsX,
const eC_Value &  vAbsY 
)
protectedvirtual

Called when the mouse button or finger is released. The object under the mouse at the time of releasing will receive this event.

Note
DoButtonUp() should work on the absolute positions of this object, that were set at the time of the passed redraw, as the user expects to click on what he sees and not to click on an object in a newer and probably intermediate state that he currently does not see in this state. Thus, to calculate the relative position (where the button was released relative to the origin of this object) from the vAbsY argument you must do it like this: vMyRelYPos = vAbsY - GetAbsYPos().
Parameters
vAbsXX-position in screen coordinates where the mouse was released.
vAbsYY-position in screen coordinates where the mouse was released.
Returns
True The event has been handled.
False The event has not been handled. In this base implementation always returns False.

Reimplemented from CGUIBehaviour.

◆ DoChar()

eC_Bool CGUICmdBehaviour::DoChar ( const eC_UInt &  uiKey,
const GUIKeyIdentifier_t eKeyIdentifier,
const eC_UInt &  uiModifiers 
)
protectedvirtual

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.

Parameters
uiKeyCharacter of the pressed key.
eKeyIdentifierThe Guiliani key identifier.
uiModifiersThe key modifiers bitfield.
Returns
True If the event has been handled.
false Else.

Reimplemented from CGUIBehaviour.

◆ DoClick()

eC_Bool CGUICmdBehaviour::DoClick ( const eC_Value &  vAbsX = eC_FromInt(-1),
const eC_Value &  vAbsY = eC_FromInt(-1) 
)
protectedvirtual

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.

Note
DoClick() should work on the absolute positions of this object, that were set at the time of the passed redraw, as the user expects to click on what he sees and not to click on an object in a newer and probably intermediate state that he currently does not see. Thus, to calculate the relative position (where the mouse button was pressed and released at the same position for in a certain time span, relative to the origin of this object) from the vAbsY argument you must do it like this: vMyRelYPos = vAbsY - GetAbsYPos().
Parameters
vAbsXX-position in screen coordinates where the click occurred
vAbsYY-position in screen coordinates where the click occurred
Returns
True The event has been handled.
False The event has not been handled. In this base implementation it always returns False.

Reimplemented from CGUIBehaviour.

◆ DoDoubleClick()

eC_Bool CGUICmdBehaviour::DoDoubleClick ( const eC_Value &  vAbsX = eC_FromInt(-1),
const eC_Value &  vAbsY = eC_FromInt(-1) 
)
protectedvirtual

Called when an object is clicked twice within a given time span.

See also
CGUIEventHandler::SetDoubleClickTime()
Note
DoDoubleClick() should work on the absolute positions of this object, that were set at the time of the passed redraw, as the user expects to click on what he sees and not to click on the object in a newer and probably intermediate state that he currently does not see in this state. Thus, to calculate the relative position (where the two clicks were done relative to the origin of this object) from the vAbsY argument you must do it like this: vMyRelYPos = vAbsY - GetAbsYPos().
Parameters
vAbsXX-position in screen coordinates where the click occurred
vAbsYY-position in screen coordinates where the click occurred
Returns
True The event has been handled.
False The event has not been handled. In this base implementation it always returns False.

Reimplemented from CGUIBehaviour.

◆ DoDrag()

eC_Bool CGUICmdBehaviour::DoDrag ( const eC_Value &  vDeltaX,
const eC_Value &  vDeltaY,
const eC_Value &  vAbsX,
const eC_Value &  vAbsY 
)
protectedvirtual

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.

Parameters
vDeltaXrelative movement in x-direction since the last call of DoDrag/ButtonDown
vDeltaYrelative movement in y-direction since the last call of DoDrag/ButtonDown
vAbsXcurrent X-position in screen coordinates of the mouse
vAbsYcurrent Y-position in screen coordinates of the mouse
Returns
True If the event has been handled.
false Else.

Reimplemented from CGUIBehaviour.

◆ DoDragEnd()

eC_Bool CGUICmdBehaviour::DoDragEnd ( const eC_Value &  vAbsX,
const eC_Value &  vAbsY 
)
protectedvirtual

Called on the dragged object (=the object on which the initial ButtonDown-event occurred) when the mouse button is released after a drag event.

Parameters
vAbsXcurrent X-position in screen coordinates of the mouse
vAbsYcurrent Y-position in screen coordinates of the mouse
Returns
True If the event has been handled.
false Else.

Reimplemented from CGUIBehaviour.

◆ DoKeyDown()

eC_Bool CGUICmdBehaviour::DoKeyDown ( const GUIKeyIdentifier_t eKeyIdentifier,
const eC_UInt &  uiModifiers 
)
protectedvirtual

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.

Parameters
eKeyIdentifierThe Guiliani key identifier.
uiModifiersThe key modifiers bitfield.
Returns
True If the event has been handled.
false Else.

Reimplemented from CGUIBehaviour.

◆ DoKeyUp()

eC_Bool CGUICmdBehaviour::DoKeyUp ( const GUIKeyIdentifier_t eKeyIdentifier,
const eC_UInt &  uiModifiers 
)
protectedvirtual

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.

Parameters
eKeyIdentifierThe Guiliani key identifier.
uiModifiersThe key modifiers bitfield.
Returns
True If the event has been handled.
false Else.

Reimplemented from CGUIBehaviour.

◆ DoLongClick()

eC_Bool CGUICmdBehaviour::DoLongClick ( const eC_Value &  vAbsX = eC_FromInt(-1),
const eC_Value &  vAbsY = eC_FromInt(-1) 
)
protectedvirtual

Called when an object is pressed for a longer period of time.

See also
CGUIEventHandler::SetLongClickTime()
Note
DoLongClick() should work on the absolute positions of this object, that were set at the time of the passed redraw, as the user expects to click on what he sees and not to click on an object in a newer and probably intermediate state that he currently does not see. Thus, to calculate the relative position (where the mouse button was pressed and held down at the same position for a certain amount of time, relative to the origin of this object) from the vAbsY argument you must do it like this: vMyRelYPos = vAbsY - GetAbsYPos().
Parameters
vAbsXX-position in screen coordinates where the click occurred
vAbsYY-position in screen coordinates where the click occurred
Returns
True The event has been handled.
False The event has not been handled. In this base implementation it always returns False.

Reimplemented from CGUIBehaviour.

◆ DoMouseEnter()

eC_Bool CGUICmdBehaviour::DoMouseEnter ( const eC_Value &  vAbsX,
const eC_Value &  vAbsY 
)
protectedvirtual

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.

See also
CGUIObject::IsHighlightable()
Parameters
vAbsXX-position in screen coordinates where the mouse entered the object
vAbsYY-position in screen coordinates where the mouse entered the object
Returns
True If the event has been handled.
false Else.

Reimplemented from CGUIBehaviour.

◆ DoMouseLeave()

eC_Bool CGUICmdBehaviour::DoMouseLeave ( const eC_Value &  vAbsX,
const eC_Value &  vAbsY 
)
protectedvirtual

Called when the mouse leaves the area which is covered by an object. Objects will not receive DoMouseLeave events if they are not highlightable.

See also
CGUIObject::IsHighlightable()
Parameters
vAbsXX-position of the mouse in screen coordinates after it left the object
vAbsYY-position of the mouse in screen coordinates after it left the object
Returns
True If the event has been handled.
false Else.

Reimplemented from CGUIBehaviour.

◆ DoScrollDown()

eC_Bool CGUICmdBehaviour::DoScrollDown ( const eC_Value &  vAbsX,
const eC_Value &  vAbsY 
)
protectedvirtual

Called when the mouse wheel was scrolled in downward direction.

Parameters
vAbsXX-position of the mouse in screen coordinates
vAbsYY-position of the mouse in screen coordinates
Returns
True If the event has been handled.
false Else.

Reimplemented from CGUIBehaviour.

◆ DoScrollLeft()

eC_Bool CGUICmdBehaviour::DoScrollLeft ( const eC_Value &  vAbsX,
const eC_Value &  vAbsY 
)
protectedvirtual

Called when the mouse wheel was scrolled in upward direction while the scroll direction modifier was pressed.

Parameters
vAbsXX-position of the mouse in screen coordinates
vAbsYY-position of the mouse in screen coordinates
See also
CGUIEventHandler::SetScrollModifiers()
Returns
True If the event has been handled.
false Else.

Reimplemented from CGUIBehaviour.

◆ DoScrollRight()

eC_Bool CGUICmdBehaviour::DoScrollRight ( const eC_Value &  vAbsX,
const eC_Value &  vAbsY 
)
protectedvirtual

Called when the mouse wheel was scrolled in downward direction while the scroll direction modifier was pressed.

Parameters
vAbsXX-position of the mouse in screen coordinates
vAbsYY-position of the mouse in screen coordinates
See also
CGUIEventHandler::SetScrollModifiers()
Returns
True If the event has been handled.
false Else.

Reimplemented from CGUIBehaviour.

◆ DoScrollUp()

eC_Bool CGUICmdBehaviour::DoScrollUp ( const eC_Value &  vAbsX,
const eC_Value &  vAbsY 
)
protectedvirtual

Called when the mouse wheel was scrolled in upward direction.

Parameters
vAbsXX-position of the mouse in screen coordinates
vAbsYY-position of the mouse in screen coordinates
Returns
True If the event has been handled.
false Else.

Reimplemented from CGUIBehaviour.

◆ ExecuteCommand()

virtual void CGUICmdBehaviour::ExecuteCommand ( const BehaviourType_t &  eFromBehaviour)
protectedpure virtual

Executes the command for the given behaviour, if it is equal to the stored one.

Parameters
eFromBehaviourBehaviour slot from which this method was called.

Implemented in CGUISingleCmdBehaviour, and CGUIMultiCmdBehaviour.

◆ FocusNext()

eC_Bool CGUICmdBehaviour::FocusNext ( CGUIObject *const  pRefObj = NULL,
const eC_Bool &  bSubTreeOfRefObjDone = false 
)
protectedvirtual

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.

Parameters
pRefObjusually is a child of this object which indicates the current position in the child list.
bSubTreeOfRefObjDoneindicates if the subtree that is under pRefObj has already been asked to take focus, or if not.
Returns
True If the event has been handled.
false Else.

Reimplemented from CGUIBehaviour.

◆ FocusPrevious()

eC_Bool CGUICmdBehaviour::FocusPrevious ( CGUIObject *const  pRefObj = NULL,
const eC_Bool &  bSubTreeOfRefObjDone = false 
)
protectedvirtual

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.

Parameters
pRefObjusually is a child of this object which indicates the current position in the child list.
bSubTreeOfRefObjDoneindicates if the subtree that is under pRefObj has already been asked to take focus, or if not.
Returns
True If the event has been handled.
false Else.

Reimplemented from CGUIBehaviour.

◆ GetFocus()

void CGUICmdBehaviour::GetFocus ( )
protectedvirtual

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.

See also
LoseFocus, CGUIEventHandler::GetFocussedObject()

Reimplemented from CGUIBehaviour.

◆ Increase()

eC_Bool CGUICmdBehaviour::Increase ( )
protectedvirtual

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.

Returns
True If the event has been handled.
false Else.

Reimplemented from CGUIBehaviour.

◆ LoseFocus()

void CGUICmdBehaviour::LoseFocus ( )
protectedvirtual

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.

See also
GetFocus

Reimplemented from CGUIBehaviour.

◆ OnCreate()

void CGUICmdBehaviour::OnCreate ( )
protectedvirtual

Slot for handling creation of object. Will be called after the object was created and all attributes have been set.

Reimplemented from CGUIBehaviour.

◆ OnDelete()

void CGUICmdBehaviour::OnDelete ( )
protectedvirtual

Slot for handling deletion of object. Will be called within the destructor, so do not throw any exceptions.

Reimplemented from CGUIBehaviour.

◆ OnHide()

void CGUICmdBehaviour::OnHide ( )
protectedvirtual

Slot for handling change to invisible.

Reimplemented from CGUIBehaviour.

◆ OnShow()

void CGUICmdBehaviour::OnShow ( )
protectedvirtual

Slot for handling change to visible.

Reimplemented from CGUIBehaviour.


The documentation for this class was generated from the following files: