[3.0] Update doxygen comments
[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 Enumeration for constraint source types.
34  *
35  * This specifies the location of a property, which is used as an input for a constraint function.
36  * @SINCE_1_0.0
37  */
38 enum SourceType
39 {
40   OBJECT_PROPERTY, ///< The property comes from an arbitrary object. @SINCE_1_0.0
41   LOCAL_PROPERTY,  ///< The property comes from the object which the constraint is applied to. @SINCE_1_0.0
42   PARENT_PROPERTY  ///< The property comes from the parent of the object, which the constraint is applied to. @SINCE_1_0.0
43 };
44
45
46 /**
47  * @brief Identifies a property from an object.
48  * @SINCE_1_0.0
49  */
50 struct DALI_IMPORT_API LocalSource
51 {
52   /**
53    * @brief Creates a local constraint source.
54    *
55    * @SINCE_1_0.0
56    * @param[in] index The index of a property provided by the constrained object
57    */
58   LocalSource( Property::Index index );
59
60   Property::Index propertyIndex; ///< The index of a property provided by the constrained object.
61 };
62
63 /**
64  * @brief Identifies a property from the parent of an object.
65  * @SINCE_1_0.0
66  */
67 struct DALI_IMPORT_API ParentSource
68 {
69   /**
70    * @brief Creates a parent constraint source.
71    *
72    * @SINCE_1_0.0
73    * @param[in] index The index of a property, provided by the parent of the constrained object
74    */
75   ParentSource( Property::Index index );
76
77   Property::Index propertyIndex; ///< The index of a property provided by the parent of the constrained object.
78 };
79
80 /**
81  * @brief Identifies a property from any object.
82  * @SINCE_1_0.0
83  */
84 struct DALI_IMPORT_API Source
85 {
86   /**
87    * @brief Creates a constraint source.
88    *
89    * @SINCE_1_0.0
90    * @param[in] object The object providing the property
91    * @param[in] index The index of a property provided by object
92    */
93   Source( Handle& object, Property::Index index );
94
95   Property::Index propertyIndex; ///< The index of a property provided by object.
96
97   Handle object; ///< The target object
98 };
99
100 /**
101  * @brief The source of an input property for a constraint.
102  * @SINCE_1_0.0
103  */
104 struct DALI_IMPORT_API ConstraintSource
105 {
106   /**
107    * @brief Creates a constraint source.
108    *
109    * @SINCE_1_0.0
110    * @param[in] source A constraint source from an arbitrary object
111    */
112   ConstraintSource( Source source );
113
114   /**
115    * @brief Creates a constraint source.
116    *
117    * @SINCE_1_0.0
118    * @param[in] local A local constraint source
119    */
120   ConstraintSource( LocalSource local );
121
122   /**
123    * @brief Creates a constraint source.
124    *
125    * @SINCE_1_0.0
126    * @param[in] parent A parent constraint source
127    */
128   ConstraintSource( ParentSource parent );
129
130   SourceType sourceType; ///< The source type
131
132   Property::Index propertyIndex; ///< The index of the source property
133
134   Handle object; ///< The target object; only valid if sourceType == OBJECT_PROPERTY
135 };
136
137 /**
138  * @}
139  */
140 } // namespace Dali
141
142 #endif // __DALI_CONSTRAINT_SOURCE_H__