Merge "Added api function to specify speed factor of an animation" into tizen
[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    * @brief Set the alpha function for a constraint; the default is AlphaFunctions::Linear.
567    *
568    * @param [in] func The alpha function to use when applying/removing the constraint.
569    */
570   void SetAlphaFunction( AlphaFunction func );
571
572   /**
573    * @brief Retrieve the alpha function of a constraint.
574    *
575    * @return The function.
576    */
577   AlphaFunction GetAlphaFunction();
578
579   /**
580    * @brief Set whether the constraint will "bake" a value when fully-applied.
581    *
582    * Otherwise the constrained value will be discarded, when the constraint is removed.
583    * The default value is Constraint::Bake.
584    * @param[in] action The remove-action.
585    */
586   void SetRemoveAction( RemoveAction action );
587
588   /**
589    * @brief Query whether the constraint will "bake" a value when fully-applied.
590    *
591    * Otherwise the constrained value will be discarded, when the constraint is removed.
592    * @return The apply-action.
593    */
594   RemoveAction GetRemoveAction() const;
595
596   /**
597    * @brief Set a tag for the constraint so it can be identified later
598    *
599    * @param[in] tag An integer to identify the constraint
600    */
601   void SetTag( const unsigned int tag );
602
603   /**
604    * @brief Get the tag
605    *
606    * @return The tag
607    */
608   unsigned int GetTag() const;
609
610 public: // Not intended for use by Application developers
611
612   /**
613    * @brief This constructor is used by Dali New() methods
614    * @param [in] constraint A pointer to a newly allocated Dali resource
615    */
616   explicit DALI_INTERNAL Constraint( Internal::Constraint* constraint );
617
618 private: // Not intended for use by Application developers
619
620   /**
621    * @brief Construct a new constraint which targets a property.
622    *
623    * @param [in] target The index of the property to constrain.
624    * @param [in] targetType The type of the constrained property.
625    * @param [in] func The constraint function.
626    * @param [in] interpolator A function used to interpolate between the start value, and the value returned by func.
627    * @return The new constraint.
628    */
629   static Constraint New( Property::Index target,
630                          Property::Type targetType,
631                          AnyFunction func,
632                          AnyFunction interpolator );
633
634   /**
635    * @brief Construct a new constraint which targets a property.
636    *
637    * @param [in] target The index of the property to constrain.
638    * @param [in] targetType The type of the constrained property.
639    * @param [in] source1 The source of a property; the current value will be passed as the 2nd parameter of func.
640    * @param [in] func The constraint function.
641    * @param [in] interpolator A function used to interpolate between the start value, and the value returned by func.
642    * @return The new constraint.
643    */
644   static Constraint New( Property::Index target,
645                          Property::Type targetType,
646                          ConstraintSource source1,
647                          AnyFunction func,
648                          AnyFunction interpolator );
649
650   /**
651    * @brief Construct a new constraint which targets a property.
652    *
653    * @param [in] target The index of the property to constrain.
654    * @param [in] targetType The type of the constrained property.
655    * @param [in] source1 The source of a property; the current value will be passed as the 2nd parameter of func.
656    * @param [in] source2 The source of a property; the current value will be passed as the 3rd parameter of func.
657    * @param [in] func The constraint function.
658    * @param [in] interpolator A function used to interpolate between the start value, and the value returned by func.
659    * @return The new constraint.
660    */
661   static Constraint New( Property::Index target,
662                          Property::Type targetType,
663                          ConstraintSource source1,
664                          ConstraintSource source2,
665                          AnyFunction func,
666                          AnyFunction interpolator );
667
668   /**
669    * @brief Construct a new constraint which targets a property.
670    *
671    * @param [in] target The index of the property to constrain.
672    * @param [in] targetType The type of the constrained property.
673    * @param [in] source1 The source of a property; the current value will be passed as the 2nd parameter of func.
674    * @param [in] source2 The source of a property; the current value will be passed as the 3rd parameter of func.
675    * @param [in] source3 The source of a property; the current value will be passed as the 4th parameter of func.
676    * @param [in] func The constraint function.
677    * @param [in] interpolator A function used to interpolate between the start value, and the value returned by func.
678    * @return The new constraint.
679    */
680   static Constraint New( Property::Index target,
681                          Property::Type targetType,
682                          ConstraintSource source1,
683                          ConstraintSource source2,
684                          ConstraintSource source3,
685                          AnyFunction func,
686                          AnyFunction interpolator );
687
688   /**
689    * @brief Construct a new constraint which targets a property.
690    *
691    * @param [in] target The index of the property to constrain.
692    * @param [in] targetType The type of the constrained property.
693    * @param [in] source1 The source of a property; the current value will be passed as the 2nd parameter of func.
694    * @param [in] source2 The source of a property; the current value will be passed as the 3rd parameter of func.
695    * @param [in] source3 The source of a property; the current value will be passed as the 4th parameter of func.
696    * @param [in] source4 The source of a property; the current value will be passed as the 5th parameter of func.
697    * @param [in] func The constraint function.
698    * @param [in] interpolator A function used to interpolate between the start value, and the value returned by func.
699    * @return The new constraint.
700    */
701   static Constraint New( Property::Index target,
702                          Property::Type targetType,
703                          ConstraintSource source1,
704                          ConstraintSource source2,
705                          ConstraintSource source3,
706                          ConstraintSource source4,
707                          AnyFunction func,
708                          AnyFunction interpolator );
709
710   /**
711    * @brief Construct a new constraint which targets a property.
712    *
713    * @param [in] target The index of the property to constrain.
714    * @param [in] targetType The type of the constrained property.
715    * @param [in] source1 The source of a property; the current value will be passed as the 2nd parameter of func.
716    * @param [in] source2 The source of a property; the current value will be passed as the 3rd parameter of func.
717    * @param [in] source3 The source of a property; the current value will be passed as the 4th parameter of func.
718    * @param [in] source4 The source of a property; the current value will be passed as the 5th parameter of func.
719    * @param [in] source5 The source of a property; the current value will be passed as the 6th parameter of func.
720    * @param [in] func The constraint function.
721    * @param [in] interpolator A function used to interpolate between the start value, and the value returned by func.
722    * @return The new constraint.
723    */
724   static Constraint New( Property::Index target,
725                          Property::Type targetType,
726                          ConstraintSource source1,
727                          ConstraintSource source2,
728                          ConstraintSource source3,
729                          ConstraintSource source4,
730                          ConstraintSource source5,
731                          AnyFunction func,
732                          AnyFunction interpolator );
733
734   /**
735    * @brief Construct a new constraint which targets a property.
736    *
737    * @param [in] target The index of the property to constrain.
738    * @param [in] targetType The type of the constrained property.
739    * @param [in] source1 The source of a property; the current value will be passed as the 2nd parameter of func.
740    * @param [in] source2 The source of a property; the current value will be passed as the 3rd parameter of func.
741    * @param [in] source3 The source of a property; the current value will be passed as the 4th parameter of func.
742    * @param [in] source4 The source of a property; the current value will be passed as the 5th parameter of func.
743    * @param [in] source5 The source of a property; the current value will be passed as the 6th parameter of func.
744    * @param [in] source6 The source of a property; the current value will be passed as the 7th parameter of func.
745    * @param [in] func The constraint function.
746    * @param [in] interpolator A function used to interpolate between the start value, and the value returned by func.
747    * @return The new constraint.
748    */
749   static Constraint New( Property::Index target,
750                          Property::Type targetType,
751                          ConstraintSource source1,
752                          ConstraintSource source2,
753                          ConstraintSource source3,
754                          ConstraintSource source4,
755                          ConstraintSource source5,
756                          ConstraintSource source6,
757                          AnyFunction func,
758                          AnyFunction interpolator );
759 };
760
761 } // namespace Dali
762
763 #endif // __DALI_CONSTRAINT_H__