Simplified the Constraint removal logic
[platform/core/uifw/dali-core.git] / dali / public-api / animation / constraint.h
1 #ifndef __DALI_CONSTRAINT_H__
2 #define __DALI_CONSTRAINT_H__
3
4 /*
5  * Copyright (c) 2014 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 // EXTERNAL INCLUDES
22 #include <boost/function.hpp>
23
24 // INTERNAL INCLUDES
25 #include <dali/public-api/animation/alpha-functions.h>
26 #include <dali/public-api/animation/constraint-source.h>
27 #include <dali/public-api/animation/interpolator-functions.h>
28 #include <dali/public-api/object/any.h>
29 #include <dali/public-api/object/handle.h>
30 #include <dali/public-api/object/property.h>
31 #include <dali/public-api/object/property-input.h>
32
33 namespace Dali DALI_IMPORT_API
34 {
35 struct TimePeriod;
36
37 namespace Internal DALI_INTERNAL
38 {
39 class Constraint;
40 }
41
42 /**
43  * @brief An abstract base class for Constraints.
44  * This can be used to constrain a property of an actor, after animations have been applied.
45  * Constraints are applied in the following order:
46  *   - Constraints are applied to on-stage actors in a depth-first traversal.
47  *   - For each actor, the constraints are applied in the same order as the calls to Actor::ApplyConstraint().
48  *   - Constraints are not applied to off-stage actors.
49  */
50 class DALI_IMPORT_API Constraint : public BaseHandle
51 {
52 public:
53
54   typedef Any AnyFunction; ///< Generic function pointer for constraint and interpolator functions
55
56   /**
57    * @brief The action that will happen when the constraint is removed.
58    *
59    * Constraints can be applied gradually; see SetApplyTime() for more details.
60    * When a constraint is fully-applied the final value may be "baked" i.e. saved permanently.
61    * Alternatively the constrained value may be discarded when the constraint is removed.
62    */
63   enum RemoveAction
64   {
65     Bake,   ///< When the constraint is fully-applied, the constrained value is saved.
66     Discard ///< When the constraint is removed, the constrained value is discarded.
67   };
68
69   static const AlphaFunction DEFAULT_ALPHA_FUNCTION; ///< AlphaFunctions::Linear
70   static const RemoveAction  DEFAULT_REMOVE_ACTION;  ///< Bake
71
72   /**
73    * @brief Create an uninitialized Constraint; this can be initialized with Constraint::New().
74    *
75    * Calling member functions with an uninitialized Dali::Object is not allowed.
76    */
77   Constraint();
78
79   /**
80    * @brief Create a constraint which targets a property.
81    *
82    * The templated parameter P, is the type of the property to constrain.
83    * Animation will be performed using the default interpolator.
84    * @param [in] target The index of the property to constrain.
85    * @param [in] func A function which returns the constrained property value.
86    * @return The new constraint.
87    */
88   template <class P>
89   static Constraint New( Property::Index target,
90                          boost::function<P (const P& current)> func )
91   {
92     return New( target,
93                 PropertyTypes::Get<P>(),
94                 func,
95                 GetDefaultInterpolator( PropertyTypes::Get<P>() ) );
96   }
97
98   /**
99    * @brief Create a constraint which targets a property.
100    *
101    * The templated parameter P, is the type of the property to constrain.
102    * @param [in] target The index of the property to constrain.
103    * @param [in] func A function which returns the constrained property value.
104    * @param [in] interpolator A function used to interpolate between the start value, and the value returned by func.
105    * @return The new constraint.
106    */
107   template <class P>
108   static Constraint NewWithInterpolator( Property::Index target,
109                                          boost::function<P (const P& current)> func,
110                                          boost::function<P (const P&, const P&, float)> interpolator )
111   {
112     return New( target,
113                 PropertyTypes::Get<P>(),
114                 func,
115                 interpolator );
116   }
117
118   /**
119    * @brief Create a constraint which targets a property.
120    *
121    * The templated parameter P, is the type of the property to constrain.
122    * Animation will be performed using the default interpolator.
123    * @param [in] target The index of the property to constrain.
124    * @param [in] source1 The source of a property; the current value will be passed as the 2nd parameter of func.
125    * @param [in] func A function which returns the constrained property value.
126    * @return The new constraint.
127    */
128   template <class P>
129   static Constraint New( Property::Index target,
130                          ConstraintSource source1,
131                          boost::function<P (const P& current, const PropertyInput& input1)> func )
132   {
133     return New( target,
134                 PropertyTypes::Get<P>(),
135                 source1,
136                 func,
137                 GetDefaultInterpolator( PropertyTypes::Get<P>() ) );
138   }
139
140   /**
141    * @brief Create a constraint which targets a property.
142    *
143    * The templated parameter P, is the type of the property to constrain.
144    * @param [in] target The index of the property to constrain.
145    * @param [in] source1 The source of a property; the current value will be passed as the 2nd parameter of func.
146    * @param [in] func A function which returns the constrained property value.
147    * @param [in] interpolator A function used to interpolate between the start value, and the value returned by func.
148    * @return The new constraint.
149    */
150   template <class P>
151   static Constraint NewWithInterpolator( Property::Index target,
152                                          ConstraintSource source1,
153                                          boost::function<P (const P& current, const PropertyInput& input1)> func,
154                                          boost::function<P (const P&, const P&, float)> interpolator )
155   {
156     return New( target,
157                 PropertyTypes::Get<P>(),
158                 source1,
159                 func,
160                 interpolator );
161   }
162
163   /**
164    * @brief Create a constraint which targets a property.
165    *
166    * The templated parameter P, is the type of the property to constrain.
167    * Animation will be performed using the default interpolator.
168    * @param [in] target The index of the property to constrain.
169    * @param [in] source1 The source of a property; the current value will be passed as the 2nd parameter of func.
170    * @param [in] source2 The source of a property; the current value will be passed as the 3rd parameter of func.
171    * @param [in] func A function which returns the constrained property value.
172    * @return The new constraint.
173    */
174   template <class P>
175   static Constraint New( Property::Index target,
176                          ConstraintSource source1,
177                          ConstraintSource source2,
178                          boost::function<P (const P& current, const PropertyInput& input1, const PropertyInput& input2)> func )
179   {
180     return New( target,
181                 PropertyTypes::Get<P>(),
182                 source1,
183                 source2,
184                 func,
185                 GetDefaultInterpolator(PropertyTypes::Get<P>()) );
186   }
187
188   /**
189    * @brief Create a constraint which targets a property.
190    *
191    * The templated parameter P, is the type of the property to constrain.
192    * @param [in] target The index of the property to constrain.
193    * @param [in] source1 The source of a property; the current value will be passed as the 2nd parameter of func.
194    * @param [in] source2 The source of a property; the current value will be passed as the 3rd parameter of func.
195    * @param [in] func A function which returns the constrained property value.
196    * @param [in] interpolator A function used to interpolate between the start value, and the value returned by func.
197    * @return The new constraint.
198    */
199   template <class P>
200   static Constraint NewWithInterpolator( Property::Index target,
201                                          ConstraintSource source1,
202                                          ConstraintSource source2,
203                                          boost::function<P (const P& current, const PropertyInput& input1, const PropertyInput& input2)> func,
204                                          boost::function<P (const P&, const P&, float)> interpolator )
205   {
206     return New( target,
207                 PropertyTypes::Get<P>(),
208                 source1,
209                 source2,
210                 func,
211                 interpolator );
212   }
213
214   /**
215    * @brief Create a constraint which targets a property.
216    *
217    * The templated parameter P, is the type of the property to constrain.
218    * Animation will be performed using the default interpolator.
219    * @param [in] target The index of the property to constrain.
220    * @param [in] source1 The source of a property; the current value will be passed as the 2nd parameter of func.
221    * @param [in] source2 The source of a property; the current value will be passed as the 3rd parameter of func.
222    * @param [in] source3 The source of a property; the current value will be passed as the 4th parameter of func.
223    * @param [in] func A function which returns the constrained property value.
224    * @return The new constraint.
225    */
226   template <class P>
227   static Constraint New( Property::Index target,
228                          ConstraintSource source1,
229                          ConstraintSource source2,
230                          ConstraintSource source3,
231                          boost::function<P (const P& current, const PropertyInput& input1, const PropertyInput& input2, const PropertyInput& input3)> func )
232   {
233     return New( target,
234                 PropertyTypes::Get<P>(),
235                 source1,
236                 source2,
237                 source3,
238                 func,
239                 GetDefaultInterpolator(PropertyTypes::Get<P>()) );
240   }
241
242   /**
243    * @brief Create a constraint which targets a property.
244    *
245    * The templated parameter P, is the type of the property to constrain.
246    * @param [in] target The index of the property to constrain.
247    * @param [in] source1 The source of a property; the current value will be passed as the 2nd parameter of func.
248    * @param [in] source2 The source of a property; the current value will be passed as the 3rd parameter of func.
249    * @param [in] source3 The source of a property; the current value will be passed as the 4th parameter of func.
250    * @param [in] func A function which returns the constrained property value.
251    * @param [in] interpolator A function used to interpolate between the start value, and the value returned by func.
252    * @return The new constraint.
253    */
254   template <class P>
255   static Constraint NewWithInterpolator( Property::Index target,
256                                          ConstraintSource source1,
257                                          ConstraintSource source2,
258                                          ConstraintSource source3,
259                                          boost::function<P (const P& current, const PropertyInput& input1, const PropertyInput& input2, const PropertyInput& input3)> func,
260                                          boost::function<P (const P&, const P&, float)> interpolator )
261   {
262     return New( target,
263                 PropertyTypes::Get<P>(),
264                 source1,
265                 source2,
266                 source3,
267                 func,
268                 interpolator );
269   }
270
271   /**
272    * @brief Create a constraint which targets a property.
273    *
274    * The templated parameter P, is the type of the property to constrain.
275    * Animation will be performed using the default interpolator.
276    * @param [in] target The index of the property to constrain.
277    * @param [in] source1 The source of a property; the current value will be passed as the 2nd parameter of func.
278    * @param [in] source2 The source of a property; the current value will be passed as the 3rd parameter of func.
279    * @param [in] source3 The source of a property; the current value will be passed as the 4th parameter of func.
280    * @param [in] source4 The source of a property; the current value will be passed as the 5th parameter of func.
281    * @param [in] func A function which returns the constrained property value.
282    * @return The new constraint.
283    */
284   template <class P>
285   static Constraint New( Property::Index target,
286                          ConstraintSource source1,
287                          ConstraintSource source2,
288                          ConstraintSource source3,
289                          ConstraintSource source4,
290                          boost::function<P (const P& current,
291                                             const PropertyInput& input1,
292                                             const PropertyInput& input2,
293                                             const PropertyInput& input3,
294                                             const PropertyInput& input4)> func )
295   {
296     return New( target,
297                 PropertyTypes::Get<P>(),
298                 source1,
299                 source2,
300                 source3,
301                 source4,
302                 func,
303                 GetDefaultInterpolator(PropertyTypes::Get<P>()) );
304   }
305
306   /**
307    * @brief Create a constraint which targets a property.
308    *
309    * The templated parameter P, is the type of the property to constrain.
310    * @param [in] target The index of the property to constrain.
311    * @param [in] source1 The source of a property; the current value will be passed as the 2nd parameter of func.
312    * @param [in] source2 The source of a property; the current value will be passed as the 3rd parameter of func.
313    * @param [in] source3 The source of a property; the current value will be passed as the 4th parameter of func.
314    * @param [in] source4 The source of a property; the current value will be passed as the 5th parameter of func.
315    * @param [in] func A function which returns the constrained property value.
316    * @param [in] interpolator A function used to interpolate between the start value, and the value returned by func.
317    * @return The new constraint.
318    */
319   template <class P>
320   static Constraint NewWithInterpolator( Property::Index target,
321                                          ConstraintSource source1,
322                                          ConstraintSource source2,
323                                          ConstraintSource source3,
324                                          ConstraintSource source4,
325                                          boost::function<P (const P& current,
326                                                             const PropertyInput& input1,
327                                                             const PropertyInput& input2,
328                                                             const PropertyInput& input3,
329                                                             const PropertyInput& input4)> func,
330                                          boost::function<P (const P&, const P&, float)> interpolator )
331   {
332     return New( target,
333                 PropertyTypes::Get<P>(),
334                 source1,
335                 source2,
336                 source3,
337                 source4,
338                 func,
339                 interpolator );
340   }
341
342   /**
343    * @brief Create a constraint which targets a property.
344    *
345    * The templated parameter P, is the type of the property to constrain.
346    * Animation will be performed using the default interpolator.
347    * @param [in] target The index of the property to constrain.
348    * @param [in] source1 The source of a property; the current value will be passed as the 2nd parameter of func.
349    * @param [in] source2 The source of a property; the current value will be passed as the 3rd parameter of func.
350    * @param [in] source3 The source of a property; the current value will be passed as the 4th parameter of func.
351    * @param [in] source4 The source of a property; the current value will be passed as the 5th parameter of func.
352    * @param [in] source5 The source of a property; the current value will be passed as the 6th parameter of func.
353    * @param [in] func A function which returns the constrained property value.
354    * @return The new constraint.
355    */
356   template <class P>
357   static Constraint New( Property::Index target,
358                          ConstraintSource source1,
359                          ConstraintSource source2,
360                          ConstraintSource source3,
361                          ConstraintSource source4,
362                          ConstraintSource source5,
363                          boost::function<P (const P& current,
364                                             const PropertyInput& input1,
365                                             const PropertyInput& input2,
366                                             const PropertyInput& input3,
367                                             const PropertyInput& input4,
368                                             const PropertyInput& input5)> func )
369   {
370     return New( target,
371                 PropertyTypes::Get<P>(),
372                 source1,
373                 source2,
374                 source3,
375                 source4,
376                 source5,
377                 func,
378                 GetDefaultInterpolator(PropertyTypes::Get<P>()) );
379   }
380
381   /**
382    * @brief Create a constraint which targets a property.
383    *
384    * The templated parameter P, is the type of the property to constrain.
385    * @param [in] target The index of the property to constrain.
386    * @param [in] source1 The source of a property; the current value will be passed as the 2nd parameter of func.
387    * @param [in] source2 The source of a property; the current value will be passed as the 3rd parameter of func.
388    * @param [in] source3 The source of a property; the current value will be passed as the 4th parameter of func.
389    * @param [in] source4 The source of a property; the current value will be passed as the 5th parameter of func.
390    * @param [in] source5 The source of a property; the current value will be passed as the 6th parameter of func.
391    * @param [in] func A function which returns the constrained property value.
392    * @param [in] interpolator A function used to interpolate between the start value, and the value returned by func.
393    * @return The new constraint.
394    */
395   template <class P>
396   static Constraint NewWithInterpolator( Property::Index target,
397                                          ConstraintSource source1,
398                                          ConstraintSource source2,
399                                          ConstraintSource source3,
400                                          ConstraintSource source4,
401                                          ConstraintSource source5,
402                                          boost::function<P (const P& current,
403                                                             const PropertyInput& input1,
404                                                             const PropertyInput& input2,
405                                                             const PropertyInput& input3,
406                                                             const PropertyInput& input4,
407                                                             const PropertyInput& input5)> func,
408                                          boost::function<P (const P&, const P&, float)> interpolator )
409   {
410     return New( target,
411                 PropertyTypes::Get<P>(),
412                 source1,
413                 source2,
414                 source3,
415                 source4,
416                 source5,
417                 func,
418                 interpolator );
419   }
420
421   /**
422    * @brief Create a constraint which targets a property.
423    *
424    * The templated parameter P, is the type of the property to constrain.
425    * Animation will be performed using the default interpolator.
426    * @param [in] target The index of the property to constrain.
427    * @param [in] source1 The source of a property; the current value will be passed as the 2nd parameter of func.
428    * @param [in] source2 The source of a property; the current value will be passed as the 3rd parameter of func.
429    * @param [in] source3 The source of a property; the current value will be passed as the 4th parameter of func.
430    * @param [in] source4 The source of a property; the current value will be passed as the 5th parameter of func.
431    * @param [in] source5 The source of a property; the current value will be passed as the 6th parameter of func.
432    * @param [in] source6 The source of a property; the current value will be passed as the 7th parameter of func.
433    * @param [in] func A function which returns the constrained property value.
434    * @return The new constraint.
435    */
436   template <class P>
437   static Constraint New( Property::Index target,
438                          ConstraintSource source1,
439                          ConstraintSource source2,
440                          ConstraintSource source3,
441                          ConstraintSource source4,
442                          ConstraintSource source5,
443                          ConstraintSource source6,
444                          boost::function<P (const P& current,
445                                             const PropertyInput& input1,
446                                             const PropertyInput& input2,
447                                             const PropertyInput& input3,
448                                             const PropertyInput& input4,
449                                             const PropertyInput& input5,
450                                             const PropertyInput& input6)> func )
451   {
452     return New( target,
453                 PropertyTypes::Get<P>(),
454                 source1,
455                 source2,
456                 source3,
457                 source4,
458                 source5,
459                 source6,
460                 func,
461                 GetDefaultInterpolator(PropertyTypes::Get<P>()) );
462   }
463
464   /**
465    * @brief Create a constraint which targets a property.
466    *
467    * The templated parameter P, is the type of the property to constrain.
468    * @param [in] target The index of the property to constrain.
469    * @param [in] source1 The source of a property; the current value will be passed as the 2nd parameter of func.
470    * @param [in] source2 The source of a property; the current value will be passed as the 3rd parameter of func.
471    * @param [in] source3 The source of a property; the current value will be passed as the 4th parameter of func.
472    * @param [in] source4 The source of a property; the current value will be passed as the 5th parameter of func.
473    * @param [in] source5 The source of a property; the current value will be passed as the 6th parameter of func.
474    * @param [in] source6 The source of a property; the current value will be passed as the 7th parameter of func.
475    * @param [in] func A function which returns the constrained property value.
476    * @param [in] interpolator A function used to interpolate between the start value, and the value returned by func.
477    * @return The new constraint.
478    */
479   template <class P>
480   static Constraint NewWithInterpolator( Property::Index target,
481                                          ConstraintSource source1,
482                                          ConstraintSource source2,
483                                          ConstraintSource source3,
484                                          ConstraintSource source4,
485                                          ConstraintSource source5,
486                                          ConstraintSource source6,
487                                          boost::function<P (const P& current,
488                                                             const PropertyInput& input1,
489                                                             const PropertyInput& input2,
490                                                             const PropertyInput& input3,
491                                                             const PropertyInput& input4,
492                                                             const PropertyInput& input5,
493                                                             const PropertyInput& input6)> func,
494                                          boost::function<P (const P&, const P&, float)> interpolator )
495   {
496     return New( target,
497                 PropertyTypes::Get<P>(),
498                 source1,
499                 source2,
500                 source3,
501                 source4,
502                 source5,
503                 source6,
504                 func,
505                 interpolator );
506   }
507
508   /**
509    * @brief Downcast an Object handle to Constraint handle.
510    *
511    * If handle points to a Constraint object the
512    * downcast produces valid handle. If not the returned handle is left uninitialized.
513    * @param[in] handle to An object
514    * @return handle to a Constraint object or an uninitialized handle
515    */
516   static Constraint DownCast( BaseHandle handle );
517
518   /**
519    * @brief Destructor
520    *
521    * This is non-virtual since derived Handle types must not contain data or virtual methods.
522    */
523   ~Constraint();
524
525   /**
526    * @brief This copy constructor is required for (smart) pointer semantics.
527    *
528    * @param [in] handle A reference to the copied handle
529    */
530   Constraint(const Constraint& handle);
531
532   /**
533    * @brief This assignment operator is required for (smart) pointer semantics.
534    *
535    * @param [in] rhs  A reference to the copied handle
536    * @return A reference to this
537    */
538   Constraint& operator=(const Constraint& rhs);
539
540   /**
541    * @brief This method is defined to allow assignment of the NULL value,
542    * and will throw an exception if passed any other value.
543    *
544    * Assigning to NULL is an alias for Reset().
545    * @param [in] rhs  A NULL pointer
546    * @return A reference to this handle
547    */
548   Constraint& operator=(BaseHandle::NullType* rhs);
549
550   /**
551    * @brief Set the time taken for the constraint to be fully applied.
552    *
553    * The default is zero, meaning that the constraint is applied immediately.
554    * @param [in] timePeriod The constraint will be applied during this time period.
555    */
556   void SetApplyTime( TimePeriod timePeriod );
557
558   /**
559    * @brief Retrieve the time taken for the constraint to be fully applied.
560    *
561    * @return The apply time.
562    */
563   TimePeriod GetApplyTime() const;
564
565   /**
566    * @deprecated Use animation API directly instead.
567    */
568   void SetRemoveTime( TimePeriod timePeriod );
569
570   /**
571    * @deprecated Use animation API directly instead.
572    */
573   TimePeriod GetRemoveTime() const;
574
575   /**
576    * @brief Set the alpha function for a constraint; the default is AlphaFunctions::Linear.
577    *
578    * @param [in] func The alpha function to use when applying/removing the constraint.
579    */
580   void SetAlphaFunction( AlphaFunction func );
581
582   /**
583    * @brief Retrieve the alpha function of a constraint.
584    *
585    * @return The function.
586    */
587   AlphaFunction GetAlphaFunction();
588
589   /**
590    * @brief Set whether the constraint will "bake" a value when fully-applied.
591    *
592    * Otherwise the constrained value will be discarded, when the constraint is removed.
593    * The default value is Constraint::Bake.
594    * @param[in] action The remove-action.
595    */
596   void SetRemoveAction( RemoveAction action );
597
598   /**
599    * @brief Query whether the constraint will "bake" a value when fully-applied.
600    *
601    * Otherwise the constrained value will be discarded, when the constraint is removed.
602    * @return The apply-action.
603    */
604   RemoveAction GetRemoveAction() const;
605
606   /**
607    * @brief Set a tag for the constraint so it can be identified later
608    *
609    * @param[in] tag An integer to identify the constraint
610    */
611   void SetTag( const unsigned int tag );
612
613   /**
614    * @brief Get the tag
615    *
616    * @return The tag
617    */
618   unsigned int GetTag() const;
619
620 public: // Not intended for use by Application developers
621
622   /**
623    * @brief This constructor is used by Dali New() methods
624    * @param [in] constraint A pointer to a newly allocated Dali resource
625    */
626   explicit DALI_INTERNAL Constraint( Internal::Constraint* constraint );
627
628 private: // Not intended for use by Application developers
629
630   /**
631    * @brief Construct a new constraint which targets a property.
632    *
633    * @param [in] target The index of the property to constrain.
634    * @param [in] targetType The type of the constrained property.
635    * @param [in] func The constraint function.
636    * @param [in] interpolator A function used to interpolate between the start value, and the value returned by func.
637    * @return The new constraint.
638    */
639   static Constraint New( Property::Index target,
640                          Property::Type targetType,
641                          AnyFunction func,
642                          AnyFunction interpolator );
643
644   /**
645    * @brief Construct a new constraint which targets a property.
646    *
647    * @param [in] target The index of the property to constrain.
648    * @param [in] targetType The type of the constrained property.
649    * @param [in] source1 The source of a property; the current value will be passed as the 2nd parameter of func.
650    * @param [in] func The constraint function.
651    * @param [in] interpolator A function used to interpolate between the start value, and the value returned by func.
652    * @return The new constraint.
653    */
654   static Constraint New( Property::Index target,
655                          Property::Type targetType,
656                          ConstraintSource source1,
657                          AnyFunction func,
658                          AnyFunction interpolator );
659
660   /**
661    * @brief Construct a new constraint which targets a property.
662    *
663    * @param [in] target The index of the property to constrain.
664    * @param [in] targetType The type of the constrained property.
665    * @param [in] source1 The source of a property; the current value will be passed as the 2nd parameter of func.
666    * @param [in] source2 The source of a property; the current value will be passed as the 3rd parameter of func.
667    * @param [in] func The constraint function.
668    * @param [in] interpolator A function used to interpolate between the start value, and the value returned by func.
669    * @return The new constraint.
670    */
671   static Constraint New( Property::Index target,
672                          Property::Type targetType,
673                          ConstraintSource source1,
674                          ConstraintSource source2,
675                          AnyFunction func,
676                          AnyFunction interpolator );
677
678   /**
679    * @brief Construct a new constraint which targets a property.
680    *
681    * @param [in] target The index of the property to constrain.
682    * @param [in] targetType The type of the constrained property.
683    * @param [in] source1 The source of a property; the current value will be passed as the 2nd parameter of func.
684    * @param [in] source2 The source of a property; the current value will be passed as the 3rd parameter of func.
685    * @param [in] source3 The source of a property; the current value will be passed as the 4th parameter of func.
686    * @param [in] func The constraint function.
687    * @param [in] interpolator A function used to interpolate between the start value, and the value returned by func.
688    * @return The new constraint.
689    */
690   static Constraint New( Property::Index target,
691                          Property::Type targetType,
692                          ConstraintSource source1,
693                          ConstraintSource source2,
694                          ConstraintSource source3,
695                          AnyFunction func,
696                          AnyFunction interpolator );
697
698   /**
699    * @brief Construct a new constraint which targets a property.
700    *
701    * @param [in] target The index of the property to constrain.
702    * @param [in] targetType The type of the constrained property.
703    * @param [in] source1 The source of a property; the current value will be passed as the 2nd parameter of func.
704    * @param [in] source2 The source of a property; the current value will be passed as the 3rd parameter of func.
705    * @param [in] source3 The source of a property; the current value will be passed as the 4th parameter of func.
706    * @param [in] source4 The source of a property; the current value will be passed as the 5th parameter of func.
707    * @param [in] func The constraint function.
708    * @param [in] interpolator A function used to interpolate between the start value, and the value returned by func.
709    * @return The new constraint.
710    */
711   static Constraint New( Property::Index target,
712                          Property::Type targetType,
713                          ConstraintSource source1,
714                          ConstraintSource source2,
715                          ConstraintSource source3,
716                          ConstraintSource source4,
717                          AnyFunction func,
718                          AnyFunction interpolator );
719
720   /**
721    * @brief Construct a new constraint which targets a property.
722    *
723    * @param [in] target The index of the property to constrain.
724    * @param [in] targetType The type of the constrained property.
725    * @param [in] source1 The source of a property; the current value will be passed as the 2nd parameter of func.
726    * @param [in] source2 The source of a property; the current value will be passed as the 3rd parameter of func.
727    * @param [in] source3 The source of a property; the current value will be passed as the 4th parameter of func.
728    * @param [in] source4 The source of a property; the current value will be passed as the 5th parameter of func.
729    * @param [in] source5 The source of a property; the current value will be passed as the 6th parameter of func.
730    * @param [in] func The constraint function.
731    * @param [in] interpolator A function used to interpolate between the start value, and the value returned by func.
732    * @return The new constraint.
733    */
734   static Constraint New( Property::Index target,
735                          Property::Type targetType,
736                          ConstraintSource source1,
737                          ConstraintSource source2,
738                          ConstraintSource source3,
739                          ConstraintSource source4,
740                          ConstraintSource source5,
741                          AnyFunction func,
742                          AnyFunction interpolator );
743
744   /**
745    * @brief Construct a new constraint which targets a property.
746    *
747    * @param [in] target The index of the property to constrain.
748    * @param [in] targetType The type of the constrained property.
749    * @param [in] source1 The source of a property; the current value will be passed as the 2nd parameter of func.
750    * @param [in] source2 The source of a property; the current value will be passed as the 3rd parameter of func.
751    * @param [in] source3 The source of a property; the current value will be passed as the 4th parameter of func.
752    * @param [in] source4 The source of a property; the current value will be passed as the 5th parameter of func.
753    * @param [in] source5 The source of a property; the current value will be passed as the 6th parameter of func.
754    * @param [in] source6 The source of a property; the current value will be passed as the 7th parameter of func.
755    * @param [in] func The constraint function.
756    * @param [in] interpolator A function used to interpolate between the start value, and the value returned by func.
757    * @return The new constraint.
758    */
759   static Constraint New( Property::Index target,
760                          Property::Type targetType,
761                          ConstraintSource source1,
762                          ConstraintSource source2,
763                          ConstraintSource source3,
764                          ConstraintSource source4,
765                          ConstraintSource source5,
766                          ConstraintSource source6,
767                          AnyFunction func,
768                          AnyFunction interpolator );
769 };
770
771 } // namespace Dali
772
773 #endif // __DALI_CONSTRAINT_H__