-#ifndef __DALI_INTERNAL_ACTOR_OBSERVER_H__
-#define __DALI_INTERNAL_ACTOR_OBSERVER_H__
+#ifndef DALI_INTERNAL_ACTOR_OBSERVER_H
+#define DALI_INTERNAL_ACTOR_OBSERVER_H
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*/
// INTERNAL INCLUDES
+#include <dali/public-api/signals/callback.h>
#include <dali/internal/event/common/object-impl.h>
namespace Dali
ActorObserver();
/**
+ * Constructor with a callback which is called when the observed actor is removed from the scene.
+ *
+ * The callback should have the following signature:
+ * @code
+ * void MyCallback( Actor* actor );
+ * @endcode
+ * Where actor is a pointer to the object that has been removed from the scene.
+ *
+ * @param[in] callback The callback to connect to.
+ *
+ * @note Ownership of callback is passed onto this class.
+ */
+ ActorObserver( CallbackBase* callback );
+
+ /**
* Non virtual destructor
*/
~ActorObserver();
virtual void ObjectDestroyed(Object& object);
private:
- Actor* mActor; ///< Raw pointer to an Actor.
- bool mActorDisconnected; ///< Indicates whether the actor has been disconnected from the scene
+ Actor* mActor; ///< Raw pointer to an Actor.
+ bool mActorDisconnected; ///< Indicates whether the actor has been disconnected from the scene
+ CallbackBase* mRemoveCallback; ///< Callback to call when the observed actor is removed from the scene
};
} // namespace Internal
} // namespace Dali
-#endif // __DALI_INTERNAL_ACTOR_OBSERVER_H__
+#endif // DALI_INTERNAL_ACTOR_OBSERVER_H