1 #ifndef __DALI_INTERNAL_ANIMATOR_CONNECTOR_BASE_H__
2 #define __DALI_INTERNAL_ANIMATOR_CONNECTOR_BASE_H__
5 * Copyright (c) 2017 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/object-impl.h>
23 #include <dali/public-api/animation/alpha-function.h>
24 #include <dali/public-api/animation/time-period.h>
25 #include <dali/public-api/common/dali-common.h>
36 * An abstract base class for animator connectors.
38 * The scene-graph objects are created by a Object e.g. Actor is a proxy for SceneGraph::Node.
39 * AnimatorConnectorBase observes the proxy object, in order to detect when a scene-graph object is created.
41 class AnimatorConnectorBase: public Object::Observer
48 AnimatorConnectorBase(
50 Property::Index propertyIndex,
53 const TimePeriod& period)
56 mAlphaFunction(alpha),
58 mPropertyIndex( propertyIndex ),
59 mComponentIndex( componentIndex )
61 object.AddObserver( *this );
67 virtual ~AnimatorConnectorBase()
72 * Set the parent of the AnimatorConnector.
73 * @pre The connector does not already have a parent.
74 * @param [in] parent The parent object.
76 virtual void SetParent(Animation& parent) = 0;
79 * Retrieve the parent of the AnimatorConnector.
80 * @return The parent object, or NULL.
82 Animation* GetParent() const
87 Object* GetObject() const
92 Property::Index GetPropertyIndex() const
94 return mPropertyIndex;
97 int GetComponentIndex() const
99 return mComponentIndex;
105 * From Object::Observer
107 virtual void SceneObjectAdded( Object& object )
112 * From Object::Observer
114 virtual void SceneObjectRemoved( Object& object )
119 * From Object::Observer
121 virtual void ObjectDestroyed( Object& object )
128 Animation* mParent; ///< The parent owns the connector.
129 Object* mObject; ///< Not owned by the animator connector. Valid until ObjectDestroyed() is called.
131 AlphaFunction mAlphaFunction;
132 TimePeriod mTimePeriod;
134 Property::Index mPropertyIndex;
139 } // namespace Internal
143 #endif // __DALI_INTERNAL_ANIMATOR_CONNECTOR_BASE_H__