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