1 #ifndef __DALI_INTERNAL_ACTOR_OBSERVER_H__
2 #define __DALI_INTERNAL_ACTOR_OBSERVER_H__
5 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
22 #include <dali/internal/event/common/proxy-object.h>
33 * Stores an actor pointer and connects/disconnects to any required signals appropriately when set/unset.
35 struct ActorObserver : public ProxyObject::Observer
39 // Construction & Destruction
47 * Non virtual destructor
54 * Return the stored Actor pointer.
55 * @return The Actor pointer.
60 * Assignment operator.
61 * This disconnects the required signals from the currently set actor and connects to the required
62 * signals for the the actor specified (if set).
64 void SetActor( Actor* actor );
67 * Resets the set actor and disconnects any connected signals.
74 ActorObserver( const ActorObserver& );
75 ActorObserver& operator=( const ActorObserver& );
80 * This will never get called as we do not observe objects that have not been added to the scene.
81 * @param[in] proxy The proxy object.
82 * @see ProxyObject::Observer::SceneObjectAdded()
84 virtual void SceneObjectAdded(ProxyObject& proxy) { }
87 * This will be called when the actor is removed from the stage, we should clear and stop
89 * @param[in] proxy The proxy object.
90 * @see ProxyObject::Observer::SceneObjectRemoved()
92 virtual void SceneObjectRemoved(ProxyObject& proxy);
95 * This will be called when the actor is destroyed. We should clear the actor.
96 * No need to stop observing as the object is being destroyed anyway.
97 * @see ProxyObject::Observer::ProxyDestroyed()
99 virtual void ProxyDestroyed(ProxyObject& proxy);
102 Actor* mActor; ///< Raw pointer to an Actor.
103 bool mActorDisconnected; ///< Indicates whether the actor has been disconnected from the scene
106 } // namespace Internal
110 #endif // __DALI_INTERNAL_ACTOR_OBSERVER_H__