Revert "License conversion from Flora to Apache 2.0"
[platform/core/uifw/dali-core.git] / dali / internal / event / animation / animator-connector-base.h
1 #ifndef __DALI_INTERNAL_ANIMATOR_CONNECTOR_BASE_H__
2 #define __DALI_INTERNAL_ANIMATOR_CONNECTOR_BASE_H__
3
4 //
5 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
6 //
7 // Licensed under the Flora License, Version 1.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
10 //
11 //     http://floralicense.org/license/
12 //
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.
18 //
19
20 // EXTERNAL INCLUDES
21 #include <boost/function.hpp>
22
23 // INTERNAL INCLUDES
24 #include <dali/internal/common/owner-pointer.h>
25 #include <dali/internal/common/owner-container.h>
26 #include <dali/public-api/animation/alpha-functions.h>
27 #include <dali/public-api/animation/time-period.h>
28 #include <dali/public-api/common/dali-common.h>
29
30 namespace Dali
31 {
32
33 namespace Internal
34 {
35
36 class Animation;
37 class AnimatorConnectorBase;
38
39 typedef OwnerPointer<AnimatorConnectorBase> AnimatorConnectorPtr;
40
41 typedef OwnerContainer< AnimatorConnectorBase* > AnimatorConnectorContainer;
42
43 typedef AnimatorConnectorContainer::Iterator AnimatorConnectorIter;
44 typedef AnimatorConnectorContainer::ConstIterator AnimatorConnectorConstIter;
45
46 /**
47  * An abstract base class for animator connectors.
48  */
49 class AnimatorConnectorBase
50 {
51 public:
52
53   /**
54    * Constructor.
55    */
56   AnimatorConnectorBase(AlphaFunction alpha, const TimePeriod& period)
57   : mParent(NULL),
58     mAlphaFunction(alpha),
59     mTimePeriod(period)
60   {
61   }
62
63   /**
64    * Virtual destructor.
65    */
66   virtual ~AnimatorConnectorBase()
67   {
68   }
69
70   /**
71    * Set the parent of the AnimatorConnector.
72    * @pre The connector does not already have a parent.
73    * @param [in] parent The parent object.
74    */
75   virtual void SetParent(Animation& parent) = 0;
76
77   /**
78    * Retrieve the parent of the AnimatorConnector.
79    * @return The parent object, or NULL.
80    */
81   Animation* GetParent()
82   {
83     return mParent;
84   }
85
86 protected:
87
88   Animation* mParent; ///< The parent owns the connector.
89
90   AlphaFunction mAlphaFunction;
91   TimePeriod mTimePeriod;
92 };
93
94 } // namespace Internal
95
96 } // namespace Dali
97
98 #endif // __DALI_INTERNAL_ANIMATOR_CONNECTOR_BASE_H__