Merge "Remove the actor from exclusive list in RenderTaskList when the actor is destr...
[platform/core/uifw/dali-core.git] / dali / public-api / animation / constraint-source.h
1 #ifndef __DALI_CONSTRAINT_SOURCE_H__
2 #define __DALI_CONSTRAINT_SOURCE_H__
3
4 /*
5  * Copyright (c) 2015 Samsung Electronics Co., Ltd.
6  *
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
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
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
21 // INTERNAL INCLUDES
22 #include <dali/public-api/object/handle.h>
23 #include <dali/public-api/object/property.h>
24
25 namespace Dali
26 {
27 /**
28  * @addtogroup dali_core_animation
29  * @{
30  */
31
32 /**
33  * @brief Constraint source types.
34  *
35  * This specifies the location of a property, which is used as an input for a constraint function.
36  */
37 enum SourceType
38 {
39   OBJECT_PROPERTY, ///< The property comes from an arbitrary object.
40   LOCAL_PROPERTY,  ///< The property comes from the object which the constraint is applied to.
41   PARENT_PROPERTY  ///< The property comes from the parent of the object, which the constraint is applied to.
42 };
43
44
45 /**
46  * @brief Identifies a property from an object.
47  */
48 struct DALI_IMPORT_API LocalSource
49 {
50   /**
51    * @brief Create a local constraint source.
52    *
53    * @param [in] index The index of a property provided by the constrained object.
54    */
55   LocalSource( Property::Index index );
56
57   Property::Index propertyIndex; ///< The index of a property provided by the constrained object.
58 };
59
60 /**
61  * @brief Identifies a property from the parent of an object.
62  */
63 struct DALI_IMPORT_API ParentSource
64 {
65   /**
66    * @brief Create a local constraint source.
67    *
68    * @param [in] index The index of a property, provided by the parent of the constrained object.
69    */
70   ParentSource( Property::Index index );
71
72   Property::Index propertyIndex; ///< The index of a property provided by the parent of the constrained object.
73 };
74
75 /**
76  * @brief Identifies a property from any object.
77  */
78 struct DALI_IMPORT_API Source
79 {
80   /**
81    * @brief Create a constraint source.
82    *
83    * @param [in] object The object providing the property.
84    * @param [in] index The index of a property provided by object.
85    */
86   Source( Handle& object, Property::Index index );
87
88   Property::Index propertyIndex; ///< The index of a property provided by object.
89
90   Handle object; ///< The target object
91 };
92
93 /**
94  * @brief The source of an input property for a constraint.
95  */
96 struct DALI_IMPORT_API ConstraintSource
97 {
98   /**
99    * @brief Create a constraint source.
100    *
101    * @param [in] source A constraint source from an arbitrary object.
102    */
103   ConstraintSource( Source source );
104
105   /**
106    * @brief Create a constraint source.
107    *
108    * @param [in] local A local constraint source.
109    */
110   ConstraintSource( LocalSource local );
111
112   /**
113    * @brief Create a constraint source.
114    *
115    * @param [in] parent A parent constraint source.
116    */
117   ConstraintSource( ParentSource parent );
118
119   SourceType sourceType; ///< The source type
120
121   Property::Index propertyIndex; ///< The index of the source property
122
123   Handle object; ///< The target object; only valid if sourceType == OBJECT_PROPERTY
124 };
125
126 /**
127  * @}
128  */
129 } // namespace Dali
130
131 #endif // __DALI_CONSTRAINT_SOURCE_H__