1 #ifndef __DALI_CONSTRAINT_SOURCE_H__
2 #define __DALI_CONSTRAINT_SOURCE_H__
5 * Copyright (c) 2014 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/public-api/object/handle.h>
23 #include <dali/public-api/object/property.h>
29 * @brief Constraint source types.
31 * This specifies the location of a property, which is used as an input for a constraint function.
35 OBJECT_PROPERTY, ///< The property comes from an arbitrary object.
36 LOCAL_PROPERTY, ///< The property comes from the object which the constraint is applied to.
37 PARENT_PROPERTY ///< The property comes from the parent of the object, which the constraint is applied to.
42 * @brief Identifies a property from an object.
44 struct DALI_IMPORT_API LocalSource
47 * @brief Create a local constraint source.
49 * @param [in] index The index of a property provided by the constrained object.
51 LocalSource( Property::Index index );
53 Property::Index propertyIndex; ///< The index of a property provided by the constrained object.
57 * @brief Identifies a property from the parent of an object.
59 struct DALI_IMPORT_API ParentSource
62 * @brief Create a local constraint source.
64 * @param [in] index The index of a property, provided by the parent of the constrained object.
66 ParentSource( Property::Index index );
68 Property::Index propertyIndex; ///< The index of a property provided by the parent of the constrained object.
72 * @brief Identifies a property from any object.
74 struct DALI_IMPORT_API Source
77 * @brief Create a constraint source.
79 * @param [in] object The object providing the property.
80 * @param [in] index The index of a property provided by object.
82 Source( Handle& object, Property::Index index );
84 Property::Index propertyIndex; ///< The index of a property provided by object.
86 Handle object; ///< The target object
90 * @brief The source of an input property for a constraint.
92 struct DALI_IMPORT_API ConstraintSource
95 * @brief Create a constraint source.
97 * @param [in] source A constraint source from an arbitrary object.
99 ConstraintSource( Source source );
102 * @brief Create a constraint source.
104 * @param [in] local A local constraint source.
106 ConstraintSource( LocalSource local );
109 * @brief Create a constraint source.
111 * @param [in] parent A parent constraint source.
113 ConstraintSource( ParentSource parent );
115 SourceType sourceType; ///< The source type
117 Property::Index propertyIndex; ///< The index of the source property
119 Handle object; ///< The target object; only valid if sourceType == OBJECT_PROPERTY
124 #endif // __DALI_CONSTRAINT_SOURCE_H__