Dali 3D User Interface Engine
List of all members | Public Member Functions | Private Member Functions | Private Attributes
Dali::Internal::ActorObserver Struct Reference

Stores an actor pointer and connects/disconnects to any required signals appropriately when set/unset. More...

#include <actor-observer.h>

Inheritance diagram for Dali::Internal::ActorObserver:
Inheritance graph
[legend]
Collaboration diagram for Dali::Internal::ActorObserver:
Collaboration graph
[legend]

Public Member Functions

 ActorObserver ()
 Constructor. More...
 
 ActorObserver (CallbackBase *callback)
 Constructor with a callback which is called when the observed actor is removed from the scene. More...
 
 ~ActorObserver ()
 Non virtual destructor. More...
 
ActorGetActor ()
 Return the stored Actor pointer. More...
 
void SetActor (Actor *actor)
 Assignment operator. More...
 
void ResetActor ()
 Resets the set actor and disconnects any connected signals. More...
 

Private Member Functions

 ActorObserver (const ActorObserver &)
 
ActorObserveroperator= (const ActorObserver &)
 
virtual void SceneObjectAdded (Object &object)
 This will never get called as we do not observe objects that have not been added to the scene. More...
 
virtual void SceneObjectRemoved (Object &object)
 This will be called when the actor is removed from the stage, we should clear and stop observing it. More...
 
virtual void ObjectDestroyed (Object &object)
 This will be called when the actor is destroyed. More...
 

Private Attributes

ActormActor
 Raw pointer to an Actor. More...
 
bool mActorDisconnected
 Indicates whether the actor has been disconnected from the scene. More...
 
CallbackBasemRemoveCallback
 Callback to call when the observed actor is removed from the scene. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Dali::Internal::Object::Observer
virtual ~Observer ()
 Virtual destructor. More...
 

Detailed Description

Stores an actor pointer and connects/disconnects to any required signals appropriately when set/unset.

Definition at line 36 of file actor-observer.h.

Constructor & Destructor Documentation

Dali::Internal::ActorObserver::ActorObserver ( )

Constructor.

Definition at line 36 of file actor-observer.cpp.

References DALI_LOG_TRACE_METHOD.

Dali::Internal::ActorObserver::ActorObserver ( CallbackBase callback)

Constructor with a callback which is called when the observed actor is removed from the scene.

The callback should have the following signature:

void MyCallback( Actor* actor );

Where actor is a pointer to the object that has been removed from the scene.

Parameters
[in]callbackThe callback to connect to.
Note
Ownership of callback is passed onto this class.

Definition at line 44 of file actor-observer.cpp.

Dali::Internal::ActorObserver::~ActorObserver ( )

Non virtual destructor.

Definition at line 51 of file actor-observer.cpp.

References DALI_LOG_TRACE_METHOD, mRemoveCallback, and SetActor().

Here is the call graph for this function:

Dali::Internal::ActorObserver::ActorObserver ( const ActorObserver )
private

Member Function Documentation

Actor * Dali::Internal::ActorObserver::GetActor ( )
void Dali::Internal::ActorObserver::ObjectDestroyed ( Object object)
privatevirtual

This will be called when the actor is destroyed.

We should clear the actor. No need to stop observing as the object is being destroyed anyway.

See Also
Object::Observer::ObjectDestroyed()

Implements Dali::Internal::Object::Observer.

Definition at line 112 of file actor-observer.cpp.

References DALI_LOG_INFO, DALI_LOG_TRACE_METHOD, and mActor.

ActorObserver& Dali::Internal::ActorObserver::operator= ( const ActorObserver )
private
void Dali::Internal::ActorObserver::ResetActor ( )

Resets the set actor and disconnects any connected signals.

Definition at line 85 of file actor-observer.cpp.

References DALI_LOG_INFO, mActor, mActorDisconnected, and Dali::Internal::Object::RemoveObserver().

Referenced by SetActor().

Here is the call graph for this function:

Here is the caller graph for this function:

virtual void Dali::Internal::ActorObserver::SceneObjectAdded ( Object object)
inlineprivatevirtual

This will never get called as we do not observe objects that have not been added to the scene.

Parameters
[in]objectThe object object.
See Also
Object::Observer::SceneObjectAdded()

Implements Dali::Internal::Object::Observer.

Definition at line 100 of file actor-observer.h.

void Dali::Internal::ActorObserver::SceneObjectRemoved ( Object object)
privatevirtual

This will be called when the actor is removed from the stage, we should clear and stop observing it.

Parameters
[in]objectThe object object.
See Also
Object::Observer::SceneObjectRemoved()

Implements Dali::Internal::Object::Observer.

Definition at line 96 of file actor-observer.cpp.

References DALI_LOG_TRACE_METHOD, Dali::CallbackBase::Execute(), mActor, mActorDisconnected, and mRemoveCallback.

Here is the call graph for this function:

void Dali::Internal::ActorObserver::SetActor ( Actor actor)

Assignment operator.

This disconnects the required signals from the currently set actor and connects to the required signals for the the actor specified (if set).

Definition at line 64 of file actor-observer.cpp.

References Dali::Internal::Object::AddObserver(), DALI_LOG_INFO, DALI_LOG_TRACE_METHOD, mActor, mActorDisconnected, and ResetActor().

Referenced by Dali::Internal::TouchEventProcessor::OnObservedActorDisconnected(), Dali::Internal::TapGestureProcessor::Process(), Dali::Internal::HoverEventProcessor::ProcessHoverEvent(), Dali::Internal::TouchEventProcessor::ProcessTouchEvent(), and ~ActorObserver().

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

Actor* Dali::Internal::ActorObserver::mActor
private

Raw pointer to an Actor.

Definition at line 118 of file actor-observer.h.

Referenced by GetActor(), ObjectDestroyed(), ResetActor(), SceneObjectRemoved(), and SetActor().

bool Dali::Internal::ActorObserver::mActorDisconnected
private

Indicates whether the actor has been disconnected from the scene.

Definition at line 119 of file actor-observer.h.

Referenced by GetActor(), ResetActor(), SceneObjectRemoved(), and SetActor().

CallbackBase* Dali::Internal::ActorObserver::mRemoveCallback
private

Callback to call when the observed actor is removed from the scene.

Definition at line 120 of file actor-observer.h.

Referenced by SceneObjectRemoved(), and ~ActorObserver().


The documentation for this struct was generated from the following files:
Dali Docs Home
Read more about Dali