Release 4.0.0-preview1-00301
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / VisualMaps.cs
1 /*
2  * Copyright(c) 2017 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17
18
19 namespace Tizen.NUI
20 {
21     using System.Text;
22     using System.Collections.Generic;
23     using Tizen.NUI.BaseComponents;
24
25     /// <summary>
26     /// A class encapsulating the transform map of the visual.
27     /// </summary>
28     public class VisualMap
29     {
30         private Vector2 _visualSize = null;
31         private Vector2 _visualOffset = null;
32         private Vector2 _visualOffsetPolicy = null;
33         private Vector2 _visualSizePolicy = null;
34         private Visual.AlignType? _visualOrigin = null;
35         private Visual.AlignType? _visualAnchorPoint = null;
36
37         private PropertyMap _visualTransformMap = null;
38
39         private int? _depthIndex = null;
40
41         /// <summary>
42         /// outputVisualMap.
43         /// </summary>
44         /// <since_tizen> 3 </since_tizen>
45         protected PropertyMap _outputVisualMap = null;
46
47         internal string Name
48         {
49             set;
50             get;
51         }
52
53         internal int VisualIndex
54         {
55             set;
56             get;
57         }
58
59         internal VisualView Parent
60         {
61             set;
62             get;
63         }
64
65         /// <summary>
66         /// Constructor.
67         /// </summary>
68         public VisualMap()
69         {
70         }
71
72         /// <summary>
73         /// Gets or sets the size of the visual.<br />
74         /// It can be either relative (percentage of the parent)
75         /// or absolute (in world units).<br />
76         /// Optional.
77         /// </summary>
78         /// <since_tizen> 3 </since_tizen>
79         public Size2D Size
80         {
81             get
82             {
83                 return _visualSize ?? (new Size2D(1, 1));
84             }
85             set
86             {
87                 _visualSize = value;
88                 if (_visualSizePolicy == null)
89                 {
90                     _visualSizePolicy = new Vector2(1.0f, 1.0f);
91                 }
92                 UpdateVisual();
93             }
94         }
95
96         /// <summary>
97         /// Gets or sets the offset of the visual.<br />
98         /// It can be either relative (percentage of the parent)
99         /// or absolute (in world units).<br />
100         /// Optional.
101         /// </summary>
102         /// <since_tizen> 3 </since_tizen>
103         public Vector2 Position
104         {
105             get
106             {
107                 return _visualOffset ?? (new Vector2(0.0f, 0.0f));
108             }
109             set
110             {
111                 _visualOffset = value;
112                 if (_visualOffsetPolicy == null)
113                 {
114                     _visualOffsetPolicy = new Vector2(1.0f, 1.0f);
115                 }
116                 UpdateVisual();
117             }
118         }
119
120         /// <summary>
121         /// Gets or sets the relative size of the visual<br />
122         /// (percentage [0.0f to 1.0f] of the control).<br />
123         /// Optional.
124         /// </summary>
125         /// <since_tizen> 3 </since_tizen>
126         public RelativeVector2 RelativeSize
127         {
128             get
129             {
130                 return _visualSize ?? (new RelativeVector2(1.0f, 1.0f));
131             }
132             set
133             {
134                 _visualSize = value;
135                 _visualSizePolicy = new Vector2(0.0f, 0.0f);
136                 UpdateVisual();
137             }
138         }
139
140         /// <summary>
141         /// Gets or sets the relative offset of the visual<br />
142         /// (percentage [0.0f to 1.0f] of the control).<br />
143         /// Optional.
144         /// </summary>
145         /// <since_tizen> 3 </since_tizen>
146         public RelativeVector2 RelativePosition
147         {
148             get
149             {
150                 return _visualOffset ?? (new RelativeVector2(0.0f, 0.0f));
151             }
152             set
153             {
154                 _visualOffset = value;
155                 _visualOffsetPolicy = new Vector2(0.0f, 0.0f);
156                 UpdateVisual();
157             }
158         }
159
160         /// <summary>
161         /// Gets or sets whether the x and y offset values are relative<br />
162         /// (percentage [0.0f to 1.0f] of the control) or absolute (in world units).<br />
163         /// By default, both the x and the y offset are relative.<br />
164         /// Optional.
165         /// </summary>
166         /// <since_tizen> 3 </since_tizen>
167         public VisualTransformPolicyType PositionPolicy
168         {
169             get
170             {
171                 if (_visualOffsetPolicy != null && _visualOffsetPolicy.X == 1.0f
172                     && _visualOffsetPolicy.Y == 1.0f)
173                 {
174                     return VisualTransformPolicyType.Absolute;
175                 }
176                 return VisualTransformPolicyType.Relative;
177             }
178             set
179             {
180                 switch (value)
181                 {
182                     case VisualTransformPolicyType.Relative:
183                         _visualOffsetPolicy = new Vector2(0.0f, 0.0f);
184                         break;
185                     case VisualTransformPolicyType.Absolute:
186                         _visualOffsetPolicy = new Vector2(1.0f, 1.0f);
187                         break;
188                     default:
189                         _visualOffsetPolicy = new Vector2(0.0f, 0.0f);
190                         break;
191                 }
192                 UpdateVisual();
193             }
194         }
195
196         /// <summary>
197         /// Gets or sets whether the x offset values are relative<br />
198         /// (percentage [0.0f to 1.0f] of the control) or absolute (in world units).<br />
199         /// By default, the x offset is relative.<br />
200         /// Optional.
201         /// </summary>
202         /// <since_tizen> 3 </since_tizen>
203         public VisualTransformPolicyType PositionPolicyX
204         {
205             get
206             {
207                 if (_visualOffsetPolicy != null && _visualOffsetPolicy.X == 1.0f)
208                 {
209                     return VisualTransformPolicyType.Absolute;
210                 }
211                 return VisualTransformPolicyType.Relative;
212             }
213             set
214             {
215                 if (_visualOffsetPolicy == null)
216                 {
217                     _visualOffsetPolicy = new Vector2(0.0f, 0.0f);
218                 }
219
220                 switch (value)
221                 {
222                     case VisualTransformPolicyType.Relative:
223                         _visualOffsetPolicy.X = 0.0f;
224                         break;
225                     case VisualTransformPolicyType.Absolute:
226                         _visualOffsetPolicy.X = 1.0f;
227                         break;
228                     default:
229                         _visualOffsetPolicy.X = 0.0f;
230                         break;
231                 }
232
233                 UpdateVisual();
234             }
235         }
236
237         /// <summary>
238         /// Gets or sets whether the y offset values are relative<br />
239         /// (percentage [0.0f to 1.0f] of the control) or absolute (in world units).<br />
240         /// By default, the y offset is relative.<br />
241         /// Optional.
242         /// </summary>
243         /// <since_tizen> 3 </since_tizen>
244         public VisualTransformPolicyType PositionPolicyY
245         {
246             get
247             {
248                 if (_visualOffsetPolicy != null && _visualOffsetPolicy.Y == 1.0f)
249                 {
250                     return VisualTransformPolicyType.Absolute;
251                 }
252                 return VisualTransformPolicyType.Relative;
253             }
254             set
255             {
256                 if (_visualOffsetPolicy == null)
257                 {
258                     _visualOffsetPolicy = new Vector2(0.0f, 0.0f);
259                 }
260
261                 switch (value)
262                 {
263                     case VisualTransformPolicyType.Relative:
264                         _visualOffsetPolicy.Y = 0.0f;
265                         break;
266                     case VisualTransformPolicyType.Absolute:
267                         _visualOffsetPolicy.Y = 1.0f;
268                         break;
269                     default:
270                         _visualOffsetPolicy.Y = 0.0f;
271                         break;
272                 }
273                 UpdateVisual();
274             }
275         }
276
277         /// <summary>
278         /// Gets or sets whether the size values of the width or the height are relative<br />
279         /// (percentage [0.0f to 1.0f] of the control) or absolute (in world units).<br />
280         /// By default, offsets of both the width and the height are relative to the control's size.<br />
281         /// Optional.
282         /// </summary>
283         /// <since_tizen> 3 </since_tizen>
284         public VisualTransformPolicyType SizePolicy
285         {
286             get
287             {
288                 if (_visualSizePolicy != null && _visualSizePolicy.X == 1.0f
289                     && _visualSizePolicy.Y == 1.0f)
290                 {
291                     return VisualTransformPolicyType.Absolute;
292                 }
293                 return VisualTransformPolicyType.Relative;
294             }
295             set
296             {
297                 switch (value)
298                 {
299                     case VisualTransformPolicyType.Relative:
300                         _visualSizePolicy = new Vector2(0.0f, 0.0f);
301                         break;
302                     case VisualTransformPolicyType.Absolute:
303                         _visualSizePolicy = new Vector2(1.0f, 1.0f);
304                         break;
305                     default:
306                         _visualSizePolicy = new Vector2(0.0f, 0.0f);
307                         break;
308                 }
309                 UpdateVisual();
310             }
311         }
312
313         /// <summary>
314         /// Gets or sets whether size values of the width are relative.<br />
315         /// (percentage [0.0f to 1.0f] of the control) or absolute (in world units).<br />
316         /// By default, the value of the width is relative to the control's width.<br />
317         /// Optional.
318         /// </summary>
319         /// <since_tizen> 3 </since_tizen>
320         public VisualTransformPolicyType SizePolicyWidth
321         {
322             get
323             {
324                 if (_visualSizePolicy != null && _visualSizePolicy.Width == 1.0f)
325                 {
326                     return VisualTransformPolicyType.Absolute;
327                 }
328                 return VisualTransformPolicyType.Relative;
329             }
330             set
331             {
332                 if (_visualSizePolicy == null)
333                 {
334                     _visualSizePolicy = new Vector2(0.0f, 0.0f);
335                 }
336
337                 switch (value)
338                 {
339                     case VisualTransformPolicyType.Relative:
340                         _visualSizePolicy.Width = 0.0f;
341                         break;
342                     case VisualTransformPolicyType.Absolute:
343                         _visualSizePolicy.Width = 1.0f;
344                         break;
345                     default:
346                         _visualSizePolicy.Width = 0.0f;
347                         break;
348                 }
349                 UpdateVisual();
350             }
351         }
352
353         /// <summary>
354         /// Gets or sets whether size values of the height are relative<br />
355         /// (percentage [0.0f to 1.0f] of the control) or absolute (in world units).<br />
356         /// By default, the height value is relative to the control's height.<br />
357         /// Optional.
358         /// </summary>
359         /// <since_tizen> 3 </since_tizen>
360         public VisualTransformPolicyType SizePolicyHeight
361         {
362             get
363             {
364                 if (_visualSizePolicy != null && _visualSizePolicy.Height == 1.0f)
365                 {
366                     return VisualTransformPolicyType.Absolute;
367                 }
368                 return VisualTransformPolicyType.Relative;
369             }
370             set
371             {
372                 if (_visualSizePolicy == null)
373                 {
374                     _visualSizePolicy = new Vector2(0.0f, 0.0f);
375                 }
376
377                 switch (value)
378                 {
379                     case VisualTransformPolicyType.Relative:
380                         _visualSizePolicy.Height = 0.0f;
381                         break;
382                     case VisualTransformPolicyType.Absolute:
383                         _visualSizePolicy.Height = 1.0f;
384                         break;
385                     default:
386                         _visualSizePolicy.Height = 0.0f;
387                         break;
388                 }
389                 UpdateVisual();
390             }
391         }
392
393         /// <summary>
394         /// Gets or sets the origin of the visual within its control area.<br />
395         /// By default, the origin is center.<br />
396         /// Optional.
397         /// </summary>
398         /// <since_tizen> 3 </since_tizen>
399         public Visual.AlignType Origin
400         {
401             get
402             {
403                 return _visualOrigin ?? (Visual.AlignType.Center);
404             }
405             set
406             {
407                 _visualOrigin = value;
408                 UpdateVisual();
409             }
410         }
411
412         /// <summary>
413         /// Gets or sets the anchor point of the visual.<br />
414         /// By default, the anchor point is center.<br />
415         /// Optional.
416         /// </summary>
417         /// <since_tizen> 3 </since_tizen>
418         public Visual.AlignType AnchorPoint
419         {
420             get
421             {
422                 return _visualAnchorPoint ?? (Visual.AlignType.Center);
423             }
424             set
425             {
426                 _visualAnchorPoint = value;
427                 UpdateVisual();
428             }
429         }
430
431         /// <summary>
432         /// Gets or sets the depth index of the visual.<br />
433         /// By default, the depth index is 0.<br />
434         /// Optional.
435         /// </summary>
436         /// <since_tizen> 3 </since_tizen>
437         public int DepthIndex
438         {
439             get
440             {
441                 return _depthIndex ?? (0);
442             }
443             set
444             {
445                 _depthIndex = value;
446             }
447         }
448
449         private void ComposingTransformMap()
450         {
451             _visualTransformMap = new PropertyMap();
452             if (_visualSize != null) { _visualTransformMap.Add((int)VisualTransformPropertyType.Size, new PropertyValue(_visualSize)); }
453             if (_visualOffset != null) { _visualTransformMap.Add((int)VisualTransformPropertyType.Offset, new PropertyValue(_visualOffset)); }
454             if (_visualOffsetPolicy != null) { _visualTransformMap.Add((int)VisualTransformPropertyType.OffsetPolicy, new PropertyValue(_visualOffsetPolicy)); }
455             if (_visualSizePolicy != null) { _visualTransformMap.Add((int)VisualTransformPropertyType.SizePolicy, new PropertyValue(_visualSizePolicy)); }
456             if (_visualOrigin != null) { _visualTransformMap.Add((int)VisualTransformPropertyType.Origin, new PropertyValue((int)_visualOrigin)); }
457             if (_visualAnchorPoint != null) { _visualTransformMap.Add((int)VisualTransformPropertyType.AnchorPoint, new PropertyValue((int)_visualAnchorPoint)); }
458         }
459
460         /// <summary>
461         /// Gets the transform map used by the visual.
462         /// </summary>
463         /// <since_tizen> 3 </since_tizen>
464         public PropertyMap OutputTransformMap
465         {
466             get
467             {
468                 ComposingTransformMap();
469                 return _visualTransformMap;
470             }
471         }
472
473         /// <summary>
474         /// Compose the out visual map.
475         /// </summary>
476         /// <since_tizen> 3 </since_tizen>
477         protected virtual void ComposingPropertyMap()
478         {
479             _outputVisualMap = new PropertyMap();
480         }
481
482         /// <summary>
483         /// Gets the property map to create the visual.
484         /// </summary>
485         /// <since_tizen> 3 </since_tizen>
486         public PropertyMap OutputVisualMap
487         {
488             get
489             {
490                 ComposingPropertyMap();
491                 return _outputVisualMap;
492             }
493         }
494
495         internal void UpdateVisual()
496         {
497             if (VisualIndex > 0)
498             {
499                 NUILog.Debug("UpdateVisual()! VisualIndex=" + VisualIndex);
500                 Parent.UpdateVisual(VisualIndex, Name, this);
501             }
502             else
503             {
504                 NUILog.Debug("VisualIndex was not set");
505             }
506         }
507
508         /// <summary>
509         /// The shader of the visual.
510         /// </summary>
511         /// <since_tizen> 3 </since_tizen>
512         protected PropertyMap _shader = null;
513         //private PropertyMap _transform = null;
514
515         /// <summary>
516         /// The premultipliedAlpha of the visual.
517         /// </summary>
518         /// <since_tizen> 3 </since_tizen>
519         protected bool? _premultipliedAlpha = null;
520
521         /// <summary>
522         /// The mixColor of the Visual.
523         /// </summary>
524         /// <since_tizen> 3 </since_tizen>
525         protected Color _mixColor = null;
526
527         /// <summary>
528         /// The opacity of the visual.
529         /// </summary>
530         /// <since_tizen> 3 </since_tizen>
531         protected float? _opacity = null;
532
533         /// <summary>
534         /// The map for visual.
535         /// </summary>
536         /// <since_tizen> 3 </since_tizen>
537         protected PropertyMap _commonlyUsedMap = null;
538
539         /// <summary>
540         /// The shader to use in the visual.
541         /// </summary>
542         /// <since_tizen> 3 </since_tizen>
543         public PropertyMap Shader
544         {
545             get
546             {
547                 return _shader;
548             }
549             set
550             {
551                 _shader = value;
552                 UpdateVisual();
553             }
554         }
555
556         /// <summary>
557         /// Enables or disables the premultiplied alpha. <br />
558         /// The premultiplied alpha is false by default unless this behavior is modified by the derived visual type.
559         /// </summary>
560         /// <since_tizen> 3 </since_tizen>
561         public bool PremultipliedAlpha
562         {
563             get
564             {
565                 return _premultipliedAlpha ?? (false);
566             }
567             set
568             {
569                 _premultipliedAlpha = value;
570                 UpdateVisual();
571             }
572         }
573
574         /// <summary>
575         /// Mix color is a blend color for any visual.
576         /// </summary>
577         /// <since_tizen> 3 </since_tizen>
578         public Color MixColor
579         {
580             get
581             {
582                 return _mixColor;
583             }
584             set
585             {
586                 _mixColor = value;
587                 UpdateVisual();
588             }
589         }
590
591         /// <summary>
592         /// Opacity is the alpha component of the mix color discussed above.
593         /// </summary>
594         /// <since_tizen> 3 </since_tizen>
595         public float Opacity
596         {
597             get
598             {
599                 return _opacity ?? (1.0f);
600             }
601             set
602             {
603                 _opacity = value;
604                 UpdateVisual();
605             }
606         }
607
608     }
609
610     /// <summary>
611     /// A class encapsulating the property map of the image visual.
612     /// </summary>
613     public class ImageVisual : VisualMap
614     {
615         /// <summary>
616         /// Constructor.
617         /// </summary>
618         /// <since_tizen> 3 </since_tizen>
619         public ImageVisual() : base()
620         {
621         }
622
623         private string _url = null;
624         private string _alphaMaskUrl = null;
625         private FittingModeType? _fittingMode = null;
626         private SamplingModeType? _samplingMode = null;
627         private int? _desiredWidth = null;
628         private int? _desiredHeight = null;
629         private bool? _synchronousLoading = false;
630         private bool? _borderOnly = null;
631         private Vector4 _pixelArea = null;
632         private WrapModeType? _wrapModeU = null;
633         private WrapModeType? _wrapModeV = null;
634         private float? _maskContentScale = null;
635         private bool? _cropToMask = null;
636
637         /// <summary>
638         /// Gets or sets the URL of the image.<br />
639         /// Mandatory.
640         /// </summary>
641         /// <since_tizen> 3 </since_tizen>
642         public string URL
643         {
644             get
645             {
646                 return _url;
647             }
648             set
649             {
650                 _url = value;
651                 UpdateVisual();
652             }
653         }
654
655
656         /// <summary>
657         /// Gets or sets the URL of the alpha mask.<br />
658         /// Optional.
659         /// </summary>
660         /// <since_tizen> 3 </since_tizen>
661         public string AlphaMaskURL
662         {
663             get
664             {
665                 return _alphaMaskUrl;
666             }
667             set
668             {
669                 _alphaMaskUrl = value;
670                 UpdateVisual();
671             }
672         }
673
674         /// <summary>
675         /// Gets or sets fitting options used when resizing images to fit the desired dimensions.<br />
676         /// If not supplied, the default is FittingModeType.ShrinkToFit.<br />
677         /// For normal quad images only.<br />
678         /// Optional.
679         /// </summary>
680         /// <since_tizen> 3 </since_tizen>
681         public FittingModeType FittingMode
682         {
683             get
684             {
685                 return _fittingMode ?? (FittingModeType.ShrinkToFit);
686             }
687             set
688             {
689                 _fittingMode = value;
690                 UpdateVisual();
691             }
692         }
693
694         /// <summary>
695         /// Gets or sets filtering options used when resizing images to the sample original pixels.<br />
696         /// If not supplied, the default is SamplingModeType.Box.<br />
697         /// For normal quad images only.<br />
698         /// Optional.
699         /// </summary>
700         /// <since_tizen> 3 </since_tizen>
701         public SamplingModeType SamplingMode
702         {
703             get
704             {
705                 return _samplingMode ?? (SamplingModeType.Box);
706             }
707             set
708             {
709                 _samplingMode = value;
710                 UpdateVisual();
711             }
712         }
713
714         /// <summary>
715         /// Gets or sets the desired image width.<br />
716         /// If not specified, the actual image width is used.<br />
717         /// For normal quad images only.<br />
718         /// Optional.
719         /// </summary>
720         /// <since_tizen> 3 </since_tizen>
721         public int DesiredWidth
722         {
723             get
724             {
725                 return _desiredWidth ?? (-1);
726             }
727             set
728             {
729                 _desiredWidth = value;
730                 UpdateVisual();
731             }
732         }
733
734         /// <summary>
735         /// Gets or sets the desired image height.<br />
736         /// If not specified, the actual image height is used.<br />
737         /// For normal quad images only.<br />
738         /// Optional.
739         /// </summary>
740         /// <since_tizen> 3 </since_tizen>
741         public int DesiredHeight
742         {
743             get
744             {
745                 return _desiredHeight ?? (-1);
746             }
747             set
748             {
749                 _desiredHeight = value;
750                 UpdateVisual();
751             }
752         }
753
754         /// <summary>
755         /// Gets or sets whether to load the image synchronously.<br />
756         /// If not specified, the default is false, i.e., the image is loaded asynchronously.<br />
757         /// For normal quad images only.<br />
758         /// Optional.
759         /// </summary>
760         /// <since_tizen> 3 </since_tizen>
761         public bool SynchronousLoading
762         {
763             get
764             {
765                 return _synchronousLoading ?? (false);
766             }
767             set
768             {
769                 _synchronousLoading = value;
770                 UpdateVisual();
771             }
772         }
773
774         /// <summary>
775         /// Gets or sets whether to draw the borders only (If true).<br />
776         /// If not specified, the default is false.<br />
777         /// For n-patch images only.<br />
778         /// Optional.
779         /// </summary>
780         /// <since_tizen> 3 </since_tizen>
781         public bool BorderOnly
782         {
783             get
784             {
785                 return _borderOnly ?? (false);
786             }
787             set
788             {
789                 _borderOnly = value;
790                 UpdateVisual();
791             }
792         }
793
794         /// <summary>
795         /// Gets or sets the image area to be displayed.<br />
796         /// It is a rectangular area.<br />
797         /// The first two elements indicate the top-left position of the area, and the last two elements are the areas of the width and the height respectively.<br />
798         /// If not specified, the default value is Vector4 (0.0, 0.0, 1.0, 1.0), i.e., the entire area of the image.<br />
799         /// For normal quad images only.<br />
800         /// Optional.
801         /// </summary>
802         /// <since_tizen> 3 </since_tizen>
803         public Vector4 PixelArea
804         {
805             get
806             {
807                 return _pixelArea ?? (new Vector4(0.0f, 0.0f, 1.0f, 1.0f));
808             }
809             set
810             {
811                 _pixelArea = value;
812                 UpdateVisual();
813             }
814         }
815
816         /// <summary>
817         /// Gets or sets the wrap mode for the u coordinate.<br />
818         /// It decides how the texture should be sampled when the u coordinate exceeds the range of 0.0 to 1.0.<br />
819         /// If not specified, the default is WrapModeType.Default(CLAMP).<br />
820         /// For normal quad images only.<br />
821         /// Optional.
822         /// </summary>
823         /// <since_tizen> 3 </since_tizen>
824         public WrapModeType WrapModeU
825         {
826             get
827             {
828                 return _wrapModeU ?? (WrapModeType.Default);
829             }
830             set
831             {
832                 _wrapModeU = value;
833                 UpdateVisual();
834             }
835         }
836
837         /// <summary>
838         /// Gets or sets the wrap mode for the v coordinate.<br />
839         /// It decides how the texture should be sampled when the v coordinate exceeds the range of 0.0 to 1.0.<br />
840         /// The first two elements indicate the top-left position of the area, and the last two elements are the areas of the width and the height respectively.<br />
841         /// If not specified, the default is WrapModeType.Default(CLAMP).<br />
842         /// For normal quad images only.
843         /// Optional.
844         /// </summary>
845         /// <since_tizen> 3 </since_tizen>
846         public WrapModeType WrapModeV
847         {
848             get
849             {
850                 return _wrapModeV ?? (WrapModeType.Default);
851             }
852             set
853             {
854                 _wrapModeV = value;
855                 UpdateVisual();
856             }
857         }
858
859         /// <summary>
860         /// Gets or sets scale factor to apply to the content image before masking.
861         /// </summary>
862         /// <since_tizen> 4 </since_tizen>
863         public float MaskContentScale
864         {
865             get
866             {
867                 return _maskContentScale ?? 1.0f;
868             }
869             set
870             {
871                 _maskContentScale = value;
872                 UpdateVisual();
873             }
874         }
875
876         /// <summary>
877         ///  Whether to crop image to mask or scale mask to fit image.
878         /// </summary>
879         /// <since_tizen> 4 </since_tizen>
880         public bool CropToMask
881         {
882             get
883             {
884                 return _cropToMask ?? false;
885             }
886             set
887             {
888                 _cropToMask = value;
889                 UpdateVisual();
890             }
891         }
892
893         /// <summary>
894         /// Compose the out visual map.
895         /// </summary>
896         /// <since_tizen> 3 </since_tizen>
897         protected override void ComposingPropertyMap()
898         {
899             if (_url != null)
900             {
901                 _outputVisualMap = new PropertyMap();
902                 _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Image));
903                 _outputVisualMap.Add(ImageVisualProperty.URL, new PropertyValue(_url));
904                 if (_alphaMaskUrl != null ) { _outputVisualMap.Add(ImageVisualProperty.AlphaMaskURL, new PropertyValue(_alphaMaskUrl)); }
905                 if (_fittingMode != null) { _outputVisualMap.Add(ImageVisualProperty.FittingMode, new PropertyValue((int)_fittingMode)); }
906                 if (_samplingMode != null) { _outputVisualMap.Add(ImageVisualProperty.SamplingMode, new PropertyValue((int)_samplingMode)); }
907                 if (_desiredWidth != null) { _outputVisualMap.Add(ImageVisualProperty.DesiredWidth, new PropertyValue((int)_desiredWidth)); }
908                 if (_desiredHeight != null) { _outputVisualMap.Add(ImageVisualProperty.DesiredHeight, new PropertyValue((int)_desiredHeight)); }
909                 if (_synchronousLoading != null) { _outputVisualMap.Add(ImageVisualProperty.SynchronousLoading, new PropertyValue((bool)_synchronousLoading)); }
910                 if (_borderOnly != null) { _outputVisualMap.Add(ImageVisualProperty.BorderOnly, new PropertyValue((bool)_borderOnly)); }
911                 if (_pixelArea != null) { _outputVisualMap.Add(ImageVisualProperty.PixelArea, new PropertyValue(_pixelArea)); }
912                 if (_wrapModeU != null) { _outputVisualMap.Add(ImageVisualProperty.WrapModeU, new PropertyValue((int)_wrapModeU)); }
913                 if (_wrapModeV != null) { _outputVisualMap.Add(ImageVisualProperty.WrapModeV, new PropertyValue((int)_wrapModeV)); }
914                 if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
915                 if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
916                 if (_mixColor != null) { _outputVisualMap.Add((int)Visual.Property.MixColor, new PropertyValue(_mixColor)); }
917                 if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
918                 if (_maskContentScale != null) { _outputVisualMap.Add((int)ImageVisualProperty.MaskContentScale, new PropertyValue((float)_maskContentScale)); }
919                 if (_cropToMask != null) { _outputVisualMap.Add((int)ImageVisualProperty.CropToMask, new PropertyValue((bool)_cropToMask)); }
920             }
921         }
922     }
923
924     /// <summary>
925     /// A class encapsulating the property map of the text visual.
926     /// </summary>
927     public class TextVisual : VisualMap
928     {
929         /// <summary>
930         /// Constructor.
931         /// </summary>
932         /// <since_tizen> 3 </since_tizen>
933         public TextVisual() : base()
934         {
935         }
936
937         private string _text = null;
938         private string _fontFamily = null;
939         private PropertyMap _fontStyle = null;
940         private float? _pointSize = null;
941         private bool? _multiLine = null;
942         private string _horizontalAlignment = null;
943         private string _verticalAlignment = null;
944         private Color _textColor = null;
945         private bool? _enableMarkup = null;
946
947         /// <summary>
948         /// Gets or sets the text to display in the UTF-8 format.<br />
949         /// Mandatory.
950         /// </summary>
951         /// <since_tizen> 3 </since_tizen>
952         public string Text
953         {
954             get
955             {
956                 return _text;
957             }
958             set
959             {
960                 _text = value;
961                 UpdateVisual();
962             }
963         }
964
965         /// <summary>
966         /// Gets or sets the requested font family to use.<br />
967         /// Optional.
968         /// </summary>
969         /// <since_tizen> 3 </since_tizen>
970         public string FontFamily
971         {
972             get
973             {
974                 return _fontFamily;
975             }
976             set
977             {
978                 _fontFamily = value;
979                 UpdateVisual();
980             }
981         }
982
983         /// <summary>
984         /// Gets or sets the requested font style to use.<br />
985         /// Optional.
986         /// </summary>
987         /// <since_tizen> 3 </since_tizen>
988         public PropertyMap FontStyle
989         {
990             get
991             {
992                 return _fontStyle;
993             }
994             set
995             {
996                 _fontStyle = value;
997                 UpdateVisual();
998             }
999         }
1000
1001         /// <summary>
1002         /// Gets or sets the size of font in points.<br />
1003         /// Mandatory.
1004         /// </summary>
1005         /// <since_tizen> 3 </since_tizen>
1006         public float PointSize
1007         {
1008             get
1009             {
1010                 return _pointSize ?? (0.0f);
1011             }
1012             set
1013             {
1014                 _pointSize = value;
1015                 UpdateVisual();
1016             }
1017         }
1018
1019         /// <summary>
1020         /// Gets or sets the single-line or multi-line layout option.<br />
1021         /// If not specified, the default is false.<br />
1022         /// Optional.
1023         /// </summary>
1024         /// <since_tizen> 3 </since_tizen>
1025         public bool MultiLine
1026         {
1027             get
1028             {
1029                 return _multiLine ?? (false);
1030             }
1031             set
1032             {
1033                 _multiLine = value;
1034                 UpdateVisual();
1035             }
1036         }
1037
1038         /// <summary>
1039         /// Gets or sets the line horizontal alignment.<br />
1040         /// If not specified, the default is begin.<br />
1041         /// Optional.
1042         /// </summary>
1043         /// <since_tizen> 3 </since_tizen>
1044         public HorizontalAlignment HorizontalAlignment
1045         {
1046             get
1047             {
1048                 switch (_horizontalAlignment)
1049                 {
1050                     case "BEGIN":
1051                         return HorizontalAlignment.Begin;
1052                     case "CENTER":
1053                         return HorizontalAlignment.Center;
1054                     case "END":
1055                         return HorizontalAlignment.End;
1056                     default:
1057                         return HorizontalAlignment.Begin;
1058                 }
1059             }
1060             set
1061             {
1062                 switch (value)
1063                 {
1064                     case HorizontalAlignment.Begin:
1065                     {
1066                         _horizontalAlignment = "BEGIN";
1067                         break;
1068                     }
1069                     case HorizontalAlignment.Center:
1070                     {
1071                         _horizontalAlignment = "CENTER";
1072                         break;
1073                     }
1074                     case HorizontalAlignment.End:
1075                     {
1076                         _horizontalAlignment = "END";
1077                         break;
1078                     }
1079                     default:
1080                     {
1081                         _horizontalAlignment = "BEGIN";
1082                         break;
1083                     }
1084                 }
1085                 UpdateVisual();
1086             }
1087         }
1088
1089         /// <summary>
1090         /// Gets or sets the line vertical alignment.<br />
1091         /// If not specified, the default is top.<br />
1092         /// Optional.
1093         /// </summary>
1094         /// <since_tizen> 3 </since_tizen>
1095         public VerticalAlignment VerticalAlignment
1096         {
1097             get
1098             {
1099                 switch (_verticalAlignment)
1100                 {
1101                     case "TOP":
1102                         return VerticalAlignment.Top;
1103                     case "CENTER":
1104                         return VerticalAlignment.Center;
1105                     case "BOTTOM":
1106                         return VerticalAlignment.Bottom;
1107                     default:
1108                         return VerticalAlignment.Top;
1109                 }
1110             }
1111             set
1112             {
1113                 switch (value)
1114                 {
1115                     case VerticalAlignment.Top:
1116                     {
1117                         _verticalAlignment = "TOP";
1118                         break;
1119                     }
1120                     case VerticalAlignment.Center:
1121                     {
1122                         _verticalAlignment = "CENTER";
1123                         break;
1124                     }
1125                     case VerticalAlignment.Bottom:
1126                     {
1127                         _verticalAlignment = "BOTTOM";
1128                         break;
1129                     }
1130                     default:
1131                     {
1132                         _verticalAlignment = "TOP";
1133                         break;
1134                     }
1135                 }
1136                 UpdateVisual();
1137             }
1138         }
1139
1140         /// <summary>
1141         /// Gets or sets the color of the text.<br />
1142         /// Optional.
1143         /// </summary>
1144         /// <since_tizen> 3 </since_tizen>
1145         public Color TextColor
1146         {
1147             get
1148             {
1149                 return _textColor;
1150             }
1151             set
1152             {
1153                 _textColor = value;
1154                 UpdateVisual();
1155             }
1156         }
1157
1158         /// <summary>
1159         /// Gets or sets whether the mark-up processing is enabled.<br />
1160         /// Optional.
1161         /// </summary>
1162         /// <since_tizen> 3 </since_tizen>
1163         public bool EnableMarkup
1164         {
1165             get
1166             {
1167                 return _enableMarkup ?? (false);
1168             }
1169             set
1170             {
1171                 _enableMarkup = value;
1172                 UpdateVisual();
1173             }
1174         }
1175
1176         /// <summary>
1177         /// Compose the out visual map.
1178         /// </summary>
1179         /// <since_tizen> 3 </since_tizen>
1180         protected override void ComposingPropertyMap()
1181         {
1182             if (_text != null && _pointSize != null)
1183             {
1184                 _outputVisualMap = new PropertyMap();
1185                 _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Text));
1186                 _outputVisualMap.Add(TextVisualProperty.Text, new PropertyValue(_text));
1187                 _outputVisualMap.Add(TextVisualProperty.PointSize, new PropertyValue((float)_pointSize));
1188                 if (_fontFamily != null) { _outputVisualMap.Add(TextVisualProperty.FontFamily, new PropertyValue(_fontFamily)); }
1189                 if (_fontStyle != null) { _outputVisualMap.Add(TextVisualProperty.FontStyle, new PropertyValue(_fontStyle)); }
1190                 if (_multiLine != null) { _outputVisualMap.Add(TextVisualProperty.MultiLine, new PropertyValue((bool)_multiLine)); }
1191                 if (_horizontalAlignment != null) { _outputVisualMap.Add(TextVisualProperty.HorizontalAlignment, new PropertyValue(_horizontalAlignment)); }
1192                 if (_verticalAlignment != null) { _outputVisualMap.Add(TextVisualProperty.VerticalAlignment, new PropertyValue(_verticalAlignment)); }
1193                 if (_textColor != null) { _outputVisualMap.Add(TextVisualProperty.TextColor, new PropertyValue(_textColor)); }
1194                 if (_enableMarkup != null) { _outputVisualMap.Add(TextVisualProperty.EnableMarkup, new PropertyValue((bool)_enableMarkup)); }
1195                 if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
1196                 if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
1197                 if (_mixColor != null) { _outputVisualMap.Add((int)Visual.Property.MixColor, new PropertyValue(_mixColor)); }
1198                 if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
1199             }
1200         }
1201     }
1202
1203     /// <summary>
1204     /// A class encapsulating the property map of the border visual.
1205     /// </summary>
1206     public class BorderVisual : VisualMap
1207     {
1208         /// <summary>
1209         /// Constructor.
1210         /// </summary>
1211         /// <since_tizen> 3 </since_tizen>
1212         public BorderVisual() : base()
1213         {
1214         }
1215
1216         private Color _color = null;
1217         private float? _size = null;
1218         private bool? _antiAliasing = null;
1219
1220         /// <summary>
1221         /// Gets or sets the color of the border.<br />
1222         /// Mandatory.
1223         /// </summary>
1224         /// <since_tizen> 3 </since_tizen>
1225         public Color Color
1226         {
1227             get
1228             {
1229                 return _color;
1230             }
1231             set
1232             {
1233                 _color = value;
1234                 UpdateVisual();
1235             }
1236         }
1237
1238         /// <summary>
1239         /// Gets or sets the width of the border (in pixels).<br />
1240         /// Mandatory.
1241         /// </summary>
1242         /// <since_tizen> 3 </since_tizen>
1243         public float BorderSize
1244         {
1245             get
1246             {
1247                 return _size ?? (-1.0f);
1248             }
1249             set
1250             {
1251                 _size = value;
1252                 UpdateVisual();
1253             }
1254         }
1255
1256         /// <summary>
1257         /// Gets or sets whether the anti-aliasing of the border is required.<br />
1258         /// If not supplied, the default is false.<br />
1259         /// Optional.
1260         /// </summary>
1261         /// <since_tizen> 3 </since_tizen>
1262         public bool AntiAliasing
1263         {
1264             get
1265             {
1266                 return _antiAliasing ?? (false);
1267             }
1268             set
1269             {
1270                 _antiAliasing = value;
1271                 UpdateVisual();
1272             }
1273         }
1274
1275         /// <summary>
1276         /// Compose the out visual map.
1277         /// </summary>
1278         /// <since_tizen> 3 </since_tizen>
1279         protected override void ComposingPropertyMap()
1280         {
1281             if (_color != null && _size != null)
1282             {
1283                 _outputVisualMap = new PropertyMap();
1284                 _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Border));
1285                 _outputVisualMap.Add(BorderVisualProperty.Size, new PropertyValue((float)_size));
1286                 _outputVisualMap.Add(BorderVisualProperty.Color, new PropertyValue(_color));
1287                 if (_antiAliasing != null) { _outputVisualMap.Add(BorderVisualProperty.AntiAliasing, new PropertyValue((bool)_antiAliasing)); }
1288                 if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
1289                 if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
1290                 if (_mixColor != null) { _outputVisualMap.Add((int)Visual.Property.MixColor, new PropertyValue(_mixColor)); }
1291                 if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
1292             }
1293         }
1294     }
1295
1296     /// <summary>
1297     /// A class encapsulating the property map of the color visual.
1298     /// </summary>
1299     public class ColorVisual : VisualMap
1300     {
1301         /// <summary>
1302         /// Constructor.
1303         /// </summary>
1304         /// <since_tizen> 3 </since_tizen>
1305         public ColorVisual() : base()
1306         {
1307         }
1308
1309         private Color _mixColorForColorVisual = null;
1310
1311         /// <summary>
1312         /// Gets or sets the solid color required.<br />
1313         /// Mandatory.
1314         /// </summary>
1315         /// <since_tizen> 3 </since_tizen>
1316         public Color Color
1317         {
1318             get
1319             {
1320                 return _mixColorForColorVisual;
1321             }
1322             set
1323             {
1324                 _mixColorForColorVisual = value;
1325                 UpdateVisual();
1326             }
1327         }
1328
1329         /// <summary>
1330         /// Compose the out visual map.
1331         /// </summary>
1332         /// <since_tizen> 3 </since_tizen>
1333         protected override void ComposingPropertyMap()
1334         {
1335             if (_mixColorForColorVisual != null)
1336             {
1337                 _outputVisualMap = new PropertyMap();
1338                 _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Color));
1339                 _outputVisualMap.Add(ColorVisualProperty.MixColor, new PropertyValue(_mixColorForColorVisual));
1340                 if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
1341                 if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
1342                 if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
1343             }
1344         }
1345     }
1346
1347     /// <summary>
1348     /// A class encapsulating the property map of the gradient visual.
1349     /// </summary>
1350     public class GradientVisual : VisualMap
1351     {
1352         /// <summary>
1353         /// Constructor.
1354         /// </summary>
1355         /// <since_tizen> 3 </since_tizen>
1356         public GradientVisual() : base()
1357         {
1358         }
1359
1360         private Vector2 _startPosition = null;
1361         private Vector2 _endPosition = null;
1362         private Vector2 _center = null;
1363         private float? _radius = null;
1364         private PropertyArray _stopOffset = null;
1365         private PropertyArray _stopColor = null;
1366         private GradientVisualUnitsType? _units = null;
1367         private GradientVisualSpreadMethodType? _spreadMethod = null;
1368
1369         /// <summary>
1370         /// Gets or sets the start position of a linear gradient.<br />
1371         /// Mandatory for linear.<br />
1372         /// </summary>
1373         /// <since_tizen> 3 </since_tizen>
1374         public Vector2 StartPosition
1375         {
1376             get
1377             {
1378                 return _startPosition;
1379             }
1380             set
1381             {
1382                 _startPosition = value;
1383                 UpdateVisual();
1384             }
1385         }
1386
1387         /// <summary>
1388         /// Gets or sets the end position of a linear gradient.<br />
1389         /// Mandatory for linear.<br />
1390         /// </summary>
1391         /// <since_tizen> 3 </since_tizen>
1392         public Vector2 EndPosition
1393         {
1394             get
1395             {
1396                 return _endPosition;
1397             }
1398             set
1399             {
1400                 _endPosition = value;
1401                 UpdateVisual();
1402             }
1403         }
1404
1405         /// <summary>
1406         /// Gets or sets the center point of a radial gradient.<br />
1407         /// Mandatory for radial.<br />
1408         /// </summary>
1409         /// <since_tizen> 3 </since_tizen>
1410         public Vector2 Center
1411         {
1412             get
1413             {
1414                 return _center;
1415             }
1416             set
1417             {
1418                 _center = value;
1419                 UpdateVisual();
1420             }
1421         }
1422
1423         /// <summary>
1424         /// Gets or sets the size of the radius of a radial gradient.<br />
1425         /// Mandatory for radial.<br />
1426         /// </summary>
1427         /// <since_tizen> 3 </since_tizen>
1428         public float Radius
1429         {
1430             get
1431             {
1432                 return _radius ?? (-1.0f);
1433             }
1434             set
1435             {
1436                 _radius = value;
1437                 UpdateVisual();
1438             }
1439         }
1440
1441         /// <summary>
1442         /// Gets or sets all the stop offsets.<br />
1443         /// A PropertyArray of float.<br />
1444         /// If not supplied, the default is 0.0f and 1.0f.<br />
1445         /// Optional.
1446         /// </summary>
1447         /// <since_tizen> 3 </since_tizen>
1448         public PropertyArray StopOffset
1449         {
1450             get
1451             {
1452                 return _stopOffset;
1453             }
1454             set
1455             {
1456                 _stopOffset = value;
1457                 UpdateVisual();
1458             }
1459         }
1460
1461         /// <summary>
1462         /// Gets or sets the color at the stop offsets.<br />
1463         /// A PropertyArray of color.<br />
1464         /// At least 2 values are required to show a gradient.<br />
1465         /// Mandatory.
1466         /// </summary>
1467         /// <since_tizen> 3 </since_tizen>
1468         public PropertyArray StopColor
1469         {
1470             get
1471             {
1472                 return _stopColor;
1473             }
1474             set
1475             {
1476                 _stopColor = value;
1477                 UpdateVisual();
1478             }
1479         }
1480
1481         /// <summary>
1482         /// Gets or sets descriptions of the coordinate system for certain attributes of the points in a gradient.<br />
1483         /// If not supplied, the default is GradientVisualUnitsType.ObjectBoundingBox.<br />
1484         /// Optional.
1485         /// </summary>
1486         /// <since_tizen> 3 </since_tizen>
1487         public GradientVisualUnitsType Units
1488         {
1489             get
1490             {
1491                 return _units ?? (GradientVisualUnitsType.ObjectBoundingBox);
1492             }
1493             set
1494             {
1495                 _units = value;
1496                 UpdateVisual();
1497             }
1498         }
1499
1500         /// <summary>
1501         /// Gets or sets indications of what happens if the gradient starts or ends inside the bounds of the target rectangle.<br />
1502         /// If not supplied, the default is GradientVisualSpreadMethodType.Pad.<br />
1503         /// Optional.
1504         /// </summary>
1505         /// <since_tizen> 3 </since_tizen>
1506         public GradientVisualSpreadMethodType SpreadMethod
1507         {
1508             get
1509             {
1510                 return _spreadMethod ?? (GradientVisualSpreadMethodType.Pad);
1511             }
1512             set
1513             {
1514                 _spreadMethod = value;
1515                 UpdateVisual();
1516             }
1517         }
1518
1519         /// <summary>
1520         /// Compose the out visual map.
1521         /// </summary>
1522         /// <since_tizen> 3 </since_tizen>
1523         protected override void ComposingPropertyMap()
1524         {
1525             if (((_startPosition != null && _endPosition != null) || (_center != null && _radius != null)) && _stopColor != null)
1526             {
1527                 _outputVisualMap = new PropertyMap();
1528                 _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Gradient));
1529                 _outputVisualMap.Add(GradientVisualProperty.StopColor, new PropertyValue(_stopColor));
1530                 if (_startPosition != null) { _outputVisualMap.Add(GradientVisualProperty.StartPosition, new PropertyValue(_startPosition)); }
1531                 if (_endPosition != null) { _outputVisualMap.Add(GradientVisualProperty.EndPosition, new PropertyValue(_endPosition)); }
1532                 if (_center != null) { _outputVisualMap.Add(GradientVisualProperty.Center, new PropertyValue(_center)); }
1533                 if (_radius != null) { _outputVisualMap.Add(GradientVisualProperty.Radius, new PropertyValue((float)_radius)); }
1534                 if (_stopOffset != null) { _outputVisualMap.Add(GradientVisualProperty.StopOffset, new PropertyValue(_stopOffset)); }
1535                 if (_units != null) { _outputVisualMap.Add(GradientVisualProperty.Units, new PropertyValue((int)_units)); }
1536                 if (_spreadMethod != null) { _outputVisualMap.Add(GradientVisualProperty.SpreadMethod, new PropertyValue((int)_spreadMethod)); }
1537                 if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
1538                 if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
1539                 if (_mixColor != null) { _outputVisualMap.Add((int)Visual.Property.MixColor, new PropertyValue(_mixColor)); }
1540                 if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
1541             }
1542         }
1543     }
1544
1545     /// <summary>
1546     /// A class encapsulating the property map of the mesh visual.
1547     /// </summary>
1548     public class MeshVisual : VisualMap
1549     {
1550         /// <summary>
1551         /// Constructor.
1552         /// </summary>
1553         /// <since_tizen> 3 </since_tizen>
1554         public MeshVisual() : base()
1555         {
1556         }
1557
1558         private string _objectURL = null;
1559         private string _materialtURL = null;
1560         private string _texturesPath = null;
1561         private MeshVisualShadingModeValue? _shadingMode = null;
1562         private bool? _useMipmapping = null;
1563         private bool? _useSoftNormals = null;
1564         private Vector3 _lightPosition = null;
1565
1566         /// <summary>
1567         /// Gets or sets the location of the ".obj" file.<br />
1568         /// Mandatory.
1569         /// </summary>
1570         /// <since_tizen> 3 </since_tizen>
1571         public string ObjectURL
1572         {
1573             get
1574             {
1575                 return _objectURL;
1576             }
1577             set
1578             {
1579                 _objectURL = value;
1580                 UpdateVisual();
1581             }
1582         }
1583
1584         /// <summary>
1585         /// Gets or sets the location of the ".mtl" file.<br />
1586         /// If not specified, then a textureless object is assumed.<br />
1587         /// Optional.
1588         /// </summary>
1589         /// <since_tizen> 3 </since_tizen>
1590         public string MaterialtURL
1591         {
1592             get
1593             {
1594                 return _materialtURL;
1595             }
1596             set
1597             {
1598                 _materialtURL = value;
1599                 UpdateVisual();
1600             }
1601         }
1602
1603         /// <summary>
1604         /// Gets or sets the path to the directory the textures (including gloss and normal) are stored in.<br />
1605         /// Mandatory if using material.<br />
1606         /// </summary>
1607         /// <since_tizen> 3 </since_tizen>
1608         public string TexturesPath
1609         {
1610             get
1611             {
1612                 return _texturesPath;
1613             }
1614             set
1615             {
1616                 _texturesPath = value;
1617                 UpdateVisual();
1618             }
1619         }
1620
1621         /// <summary>
1622         /// Gets or sets the type of shading mode that the mesh will use.<br />
1623         /// If anything the specified shading mode requires is missing, a simpler mode that can be handled with what has been supplied will be used instead.<br />
1624         /// If not specified, it will use the best it can support (will try MeshVisualShadingModeValue.TexturedWithDetailedSpecularLighting first).<br />
1625         /// Optional.
1626         /// </summary>
1627         /// <since_tizen> 3 </since_tizen>
1628         public MeshVisualShadingModeValue ShadingMode
1629         {
1630             get
1631             {
1632                 return _shadingMode ?? (MeshVisualShadingModeValue.TexturedWithDetailedSpecularLighting);
1633             }
1634             set
1635             {
1636                 _shadingMode = value;
1637                 UpdateVisual();
1638             }
1639         }
1640
1641         /// <summary>
1642         /// Gets or sets whether to use mipmaps for textures or not.<br />
1643         /// If not specified, the default is true.<br />
1644         /// Optional.
1645         /// </summary>
1646         /// <since_tizen> 3 </since_tizen>
1647         public bool UseMipmapping
1648         {
1649             get
1650             {
1651                 return _useMipmapping ?? (true);
1652             }
1653             set
1654             {
1655                 _useMipmapping = value;
1656                 UpdateVisual();
1657             }
1658         }
1659
1660         /// <summary>
1661         /// Gets or sets whether to average normals at each point to smooth textures or not.<br />
1662         /// If not specified, the default is true.<br />
1663         /// Optional.
1664         /// </summary>
1665         /// <since_tizen> 3 </since_tizen>
1666         public bool UseSoftNormals
1667         {
1668             get
1669             {
1670                 return _useSoftNormals ?? (true);
1671             }
1672             set
1673             {
1674                 _useSoftNormals = value;
1675                 UpdateVisual();
1676             }
1677         }
1678
1679         /// <summary>
1680         /// Gets or sets the position, in the stage space, of the point light that applies lighting to the model.<br />
1681         /// This is based off the stage's dimensions, so using the width and the height of the stage halved will correspond to the center,
1682         /// and using all zeroes will place the light at the top-left corner.<br />
1683         /// If not specified, the default is an offset outwards from the center of the screen.<br />
1684         /// Optional.
1685         /// </summary>
1686         /// <since_tizen> 3 </since_tizen>
1687         public Vector3 LightPosition
1688         {
1689             get
1690             {
1691                 return _lightPosition;
1692             }
1693             set
1694             {
1695                 _lightPosition = value;
1696                 UpdateVisual();
1697             }
1698         }
1699
1700         /// <summary>
1701         /// Compose the out visual map.
1702         /// </summary>
1703         /// <since_tizen> 3 </since_tizen>
1704         protected override void ComposingPropertyMap()
1705         {
1706             if (_objectURL != null)
1707             {
1708                 _outputVisualMap = new PropertyMap();
1709                 _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Mesh));
1710                 _outputVisualMap.Add(MeshVisualProperty.ObjectURL, new PropertyValue(_objectURL));
1711                 if (_materialtURL != null) { _outputVisualMap.Add(MeshVisualProperty.MaterialtURL, new PropertyValue(_materialtURL)); }
1712                 if (_texturesPath != null) { _outputVisualMap.Add(MeshVisualProperty.TexturesPath, new PropertyValue(_texturesPath)); }
1713                 if (_shadingMode != null) { _outputVisualMap.Add(MeshVisualProperty.ShadingMode, new PropertyValue((int)_shadingMode)); }
1714                 if (_useMipmapping != null) { _outputVisualMap.Add(MeshVisualProperty.UseMipmapping, new PropertyValue((bool)_useMipmapping)); }
1715                 if (_useSoftNormals != null) { _outputVisualMap.Add(MeshVisualProperty.UseSoftNormals, new PropertyValue((bool)_useSoftNormals)); }
1716                 if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
1717                 if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
1718                 if (_mixColor != null) { _outputVisualMap.Add((int)Visual.Property.MixColor, new PropertyValue(_mixColor)); }
1719                 if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
1720             }
1721         }
1722     }
1723
1724     /// <summary>
1725     /// A class encapsulating the property map of the primetive visual.
1726     /// </summary>
1727     public class PrimitiveVisual : VisualMap
1728     {
1729         /// <summary>
1730         /// Constructor.
1731         /// </summary>
1732         /// <since_tizen> 3 </since_tizen>
1733         public PrimitiveVisual() : base()
1734         {
1735         }
1736
1737         private PrimitiveVisualShapeType? _shape = null;
1738         private Color _mixColorForPrimitiveVisual = null;
1739         private int? _slices = null;
1740         private int? _stacks = null;
1741         private float? _scaleTopRadius = null;
1742         private float? _scaleBottomRadius = null;
1743         private float? _scaleHeight = null;
1744         private float? _scaleRadius = null;
1745         private Vector3 _scaleDimensions = null;
1746         private float? _bevelPercentage = null;
1747         private float? _bevelSmoothness = null;
1748         private Vector3 _lightPosition = null;
1749
1750         /// <summary>
1751         /// Gets or sets the specific shape to render.<br />
1752         /// If not specified, the default is PrimitiveVisualShapeType.Sphere.<br />
1753         /// Optional.
1754         /// </summary>
1755         /// <since_tizen> 3 </since_tizen>
1756         public PrimitiveVisualShapeType Shape
1757         {
1758             get
1759             {
1760                 return _shape ?? (PrimitiveVisualShapeType.Sphere);
1761             }
1762             set
1763             {
1764                 _shape = value;
1765                 UpdateVisual();
1766             }
1767         }
1768
1769         /// <summary>
1770         /// Gets or sets the color of the shape.<br />
1771         /// If not specified, the default is Color (0.5, 0.5, 0.5, 1.0).<br />
1772         /// Applies to all shapes.<br />
1773         /// Optional.
1774         /// </summary>
1775         /// <since_tizen> 3 </since_tizen>
1776         public new Color MixColor
1777         {
1778             get
1779             {
1780                 return _mixColorForPrimitiveVisual ?? (new Color(0.5f, 0.5f, 0.5f, 1.0f));
1781             }
1782             set
1783             {
1784                 _mixColorForPrimitiveVisual = value;
1785                 UpdateVisual();
1786             }
1787         }
1788
1789         /// <summary>
1790         /// Gets or sets the number of slices as you go around the shape.<br />
1791         /// For spheres and conical frustrums, this determines how many divisions there are as you go around the object.<br />
1792         /// If not specified, the default is 128.<br />
1793         /// The range is from 1 to 255.<br />
1794         /// Optional.
1795         /// </summary>
1796         /// <since_tizen> 3 </since_tizen>
1797         public int Slices
1798         {
1799             get
1800             {
1801                 return _slices ?? (128);
1802             }
1803             set
1804             {
1805                 _slices = value;
1806                 UpdateVisual();
1807             }
1808         }
1809
1810         /// <summary>
1811         /// Gets or sets the number of stacks as you go down the shape.<br />
1812         /// For spheres, 'stacks' determines how many layers there are as you go down the object.<br />
1813         /// If not specified, the default is 128.<br />
1814         /// The range is from 1 to 255.<br />
1815         /// Optional.
1816         /// </summary>
1817         /// <since_tizen> 3 </since_tizen>
1818         public int Stacks
1819         {
1820             get
1821             {
1822                 return _stacks ?? (128);
1823             }
1824             set
1825             {
1826                 _stacks = value;
1827                 UpdateVisual();
1828             }
1829         }
1830
1831         /// <summary>
1832         /// Gets or sets the scale of the radius of the top circle of a conical frustrum.<br />
1833         /// If not specified, the default is 1.0f.<br />
1834         /// Applies to: - PrimitiveVisualShapeType.ConicalFrustrum<br />
1835         /// Only values greater than or equal to 0.0f are accepted.<br />
1836         /// Optional.
1837         /// </summary>
1838         /// <since_tizen> 3 </since_tizen>
1839         public float ScaleTopRadius
1840         {
1841             get
1842             {
1843                 return _scaleTopRadius ?? (1.0f);
1844             }
1845             set
1846             {
1847                 _scaleTopRadius = value;
1848                 UpdateVisual();
1849             }
1850         }
1851
1852         /// <summary>
1853         /// Gets or sets the scale of the radius of the bottom circle of a conical frustrum.<br />
1854         /// If not specified, the default is 1.5f.<br />
1855         /// Applies to:  - PrimitiveVisualShapeType.ConicalFrustrum<br />
1856         ///              - PrimitiveVisualShapeType.Cone<br />
1857         /// Only values greater than or equal to 0.0f are accepted.<br />
1858         /// Optional.
1859         /// </summary>
1860         /// <since_tizen> 3 </since_tizen>
1861         public float ScaleBottomRadius
1862         {
1863             get
1864             {
1865                 return _scaleBottomRadius ?? (1.5f);
1866             }
1867             set
1868             {
1869                 _scaleBottomRadius = value;
1870                 UpdateVisual();
1871             }
1872         }
1873
1874         /// <summary>
1875         /// Gets or sets the scale of the height of a conic.<br />
1876         /// If not specified, the default is 3.0f.<br />
1877         /// Applies to:<br />
1878         ///      - PrimitiveVisualShapeType.ConicalFrustrum<br />
1879         ///      - PrimitiveVisualShapeType.Cone<br />
1880         ///      - PrimitiveVisualShapeType.Cylinder<br />
1881         /// Only values greater than or equal to 0.0f are accepted.<br />
1882         /// Optional.
1883         /// </summary>
1884         /// <since_tizen> 3 </since_tizen>
1885         public float ScaleHeight
1886         {
1887             get
1888             {
1889                 return _scaleHeight ?? (3.0f);
1890             }
1891             set
1892             {
1893                 _scaleHeight = value;
1894                 UpdateVisual();
1895             }
1896         }
1897
1898         /// <summary>
1899         /// Gets or sets the scale of the radius of a cylinder.<br />
1900         /// If not specified, the default is 1.0f.<br />
1901         /// Applies to:<br />
1902         ///      - PrimitiveVisualShapeType.Cylinder<br />
1903         /// Only values greater than or equal to 0.0f are accepted.<br />
1904         /// Optional.
1905         /// </summary>
1906         /// <since_tizen> 3 </since_tizen>
1907         public float ScaleRadius
1908         {
1909             get
1910             {
1911                 return _scaleRadius ?? (1.0f);
1912             }
1913             set
1914             {
1915                 _scaleRadius = value;
1916                 UpdateVisual();
1917             }
1918         }
1919
1920         /// <summary>
1921         /// Gets or sets the dimensions of a cuboid. Scales in the same fashion as a 9-patch image.<br />
1922         /// If not specified, the default is Vector3.One.<br />
1923         /// Applies to:<br />
1924         ///      - PrimitiveVisualShapeType.Cube<br />
1925         ///      - PrimitiveVisualShapeType.Octahedron<br />
1926         ///      - PrimitiveVisualShapeType.BevelledCube<br />
1927         /// Each Vector3 parameter should be greater than or equal to 0.0f.<br />
1928         /// Optional.
1929         /// </summary>
1930         /// <since_tizen> 3 </since_tizen>
1931         public Vector3 ScaleDimensions
1932         {
1933             get
1934             {
1935                 return _scaleDimensions ?? (Vector3.One);
1936             }
1937             set
1938             {
1939                 _scaleDimensions = value;
1940                 UpdateVisual();
1941             }
1942         }
1943
1944         /// <summary>
1945         /// Gets or sets determines how bevelled the cuboid should be, based off the smallest dimension.<br />
1946         /// Bevel percentage ranges from 0.0 to 1.0. It affects the ratio of the outer face widths to the width of the overall cube.<br />
1947         /// If not specified, the default is 0.0f (no bevel).<br />
1948         /// Applies to:<br />
1949         ///      - PrimitiveVisualShapeType.BevelledCube<br />
1950         /// The range is from 0.0f to 1.0f.<br />
1951         /// Optional.
1952         /// </summary>
1953         /// <since_tizen> 3 </since_tizen>
1954         public float BevelPercentage
1955         {
1956             get
1957             {
1958                 return _bevelPercentage ?? (0.0f);
1959             }
1960             set
1961             {
1962                 _bevelPercentage = value;
1963                 UpdateVisual();
1964             }
1965         }
1966
1967         /// <summary>
1968         /// Gets or sets descriptions of how smooth the bevelled edges should be.<br />
1969         /// If not specified, the default is 0.0f (sharp edges).<br />
1970         /// Applies to:<br />
1971         ///      - PrimitiveVisualShapeType.BevelledCube<br />
1972         /// The range is from 0.0f to 1.0f.<br />
1973         /// Optional.
1974         /// </summary>
1975         /// <since_tizen> 3 </since_tizen>
1976         public float BevelSmoothness
1977         {
1978             get
1979             {
1980                 return _bevelSmoothness ?? (0.0f);
1981             }
1982             set
1983             {
1984                 _bevelSmoothness = value;
1985                 UpdateVisual();
1986             }
1987         }
1988
1989         /// <summary>
1990         /// Gets or sets the position, in the stage space, of the point light that applies lighting to the model.<br />
1991         /// This is based off the stage's dimensions, so using the width and the height of the stage halved will correspond to the center,
1992         /// and using all zeroes will place the light at the top-left corner.<br />
1993         /// If not specified, the default is an offset outwards from the center of the screen.<br />
1994         /// Applies to all shapes.<br />
1995         /// Optional.
1996         /// </summary>
1997         /// <since_tizen> 3 </since_tizen>
1998         public Vector3 LightPosition
1999         {
2000             get
2001             {
2002                 return _lightPosition;
2003             }
2004             set
2005             {
2006                 _lightPosition = value;
2007                 UpdateVisual();
2008             }
2009         }
2010
2011         /// <summary>
2012         /// Compose the out visual map.
2013         /// </summary>
2014         /// <since_tizen> 3 </since_tizen>
2015         protected override void ComposingPropertyMap()
2016         {
2017             _outputVisualMap = new PropertyMap(); ;
2018             _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Primitive));
2019             if (_shape != null) { _outputVisualMap.Add(PrimitiveVisualProperty.Shape, new PropertyValue((int)_shape)); }
2020             if (_mixColorForPrimitiveVisual != null) { _outputVisualMap.Add(PrimitiveVisualProperty.MixColor, new PropertyValue(_mixColorForPrimitiveVisual)); }
2021             if (_slices != null) { _outputVisualMap.Add(PrimitiveVisualProperty.Slices, new PropertyValue((int)_slices)); }
2022             if (_stacks != null) { _outputVisualMap.Add(PrimitiveVisualProperty.Stacks, new PropertyValue((int)_stacks)); }
2023             if (_scaleTopRadius != null) { _outputVisualMap.Add(PrimitiveVisualProperty.ScaleTopRadius, new PropertyValue((float)_scaleTopRadius)); }
2024             if (_scaleBottomRadius != null) { _outputVisualMap.Add(PrimitiveVisualProperty.ScaleBottomRadius, new PropertyValue((float)_scaleBottomRadius)); }
2025             if (_scaleHeight != null) { _outputVisualMap.Add(PrimitiveVisualProperty.ScaleHeight, new PropertyValue((float)_scaleHeight)); }
2026             if (_scaleRadius != null) { _outputVisualMap.Add(PrimitiveVisualProperty.ScaleRadius, new PropertyValue((float)_scaleRadius)); }
2027             if (_scaleDimensions != null) { _outputVisualMap.Add(PrimitiveVisualProperty.ScaleDimensions, new PropertyValue(_scaleDimensions)); }
2028             if (_bevelPercentage != null) { _outputVisualMap.Add(PrimitiveVisualProperty.BevelPercentage, new PropertyValue((float)_bevelPercentage)); }
2029             if (_bevelSmoothness != null) { _outputVisualMap.Add(PrimitiveVisualProperty.BevelSmoothness, new PropertyValue((float)_bevelSmoothness)); }
2030             if (_lightPosition != null) { _outputVisualMap.Add(PrimitiveVisualProperty.LightPosition, new PropertyValue(_lightPosition)); }
2031             if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
2032             if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
2033             if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
2034         }
2035     }
2036
2037     /// <summary>
2038     /// A class encapsulating the property map of the n-patch image visual.
2039     /// </summary>
2040     public class NPatchVisual : VisualMap
2041     {
2042         /// <summary>
2043         /// Constructor.
2044         /// </summary>
2045         /// <since_tizen> 3 </since_tizen>
2046         public NPatchVisual() : base()
2047         {
2048         }
2049
2050         private string _url = null;
2051         private bool? _borderOnly = null;
2052         private Rectangle _border = null;
2053
2054         /// <summary>
2055         /// Gets or sets the URL of the image.<br />
2056         /// Mandatory.
2057         /// </summary>
2058         /// <since_tizen> 3 </since_tizen>
2059         public string URL
2060         {
2061             get
2062             {
2063                 return _url;
2064             }
2065             set
2066             {
2067                 _url = value;
2068                 UpdateVisual();
2069             }
2070         }
2071
2072         /// <summary>
2073         /// Gets or sets whether to draw the borders only (If true).<br />
2074         /// If not specified, the default is false.<br />
2075         /// For n-patch images only.<br />
2076         /// Optional.
2077         /// </summary>
2078         /// <since_tizen> 3 </since_tizen>
2079         public bool BorderOnly
2080         {
2081             get
2082             {
2083                 return _borderOnly ?? false;
2084             }
2085             set
2086             {
2087                 _borderOnly = value;
2088                 UpdateVisual();
2089             }
2090         }
2091
2092         /// <summary>
2093         /// The border of the image is in the order: left, right, bottom, top.<br />
2094         /// For n-patch images only.<br />
2095         /// Optional.
2096         /// </summary>
2097         /// <since_tizen> 3 </since_tizen>
2098         public Rectangle Border
2099         {
2100             get
2101             {
2102                 return _border;
2103             }
2104             set
2105             {
2106                 _border = value;
2107                 UpdateVisual();
2108             }
2109         }
2110
2111         /// <summary>
2112         /// Compose the out visual map.
2113         /// </summary>
2114         /// <since_tizen> 3 </since_tizen>
2115         protected override void ComposingPropertyMap()
2116         {
2117             if (_url != null)
2118             {
2119                 _outputVisualMap = new PropertyMap();
2120                 _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.NPatch));
2121                 _outputVisualMap.Add(NpatchImageVisualProperty.URL, new PropertyValue(_url));
2122                 if (_borderOnly != null) { _outputVisualMap.Add(NpatchImageVisualProperty.BorderOnly, new PropertyValue((bool)_borderOnly)); }
2123                 if (_border != null) { _outputVisualMap.Add(NpatchImageVisualProperty.Border, new PropertyValue(_border)); }
2124                 if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
2125                 if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
2126                 if (_mixColor != null) { _outputVisualMap.Add((int)Visual.Property.MixColor, new PropertyValue(_mixColor)); }
2127                 if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
2128             }
2129         }
2130     }
2131
2132     /// <summary>
2133     /// A class encapsulating the property map of the SVG visual.
2134     /// </summary>
2135     public class SVGVisual : VisualMap
2136     {
2137         /// <summary>
2138         /// Constructor.
2139         /// </summary>
2140         /// <since_tizen> 3 </since_tizen>
2141         public SVGVisual() : base()
2142         {
2143         }
2144
2145         private string _url = null;
2146
2147         /// <summary>
2148         /// The url of the svg resource.
2149         /// </summary>
2150         /// <since_tizen> 3 </since_tizen>
2151         public string URL
2152         {
2153             get
2154             {
2155                 return _url;
2156             }
2157             set
2158             {
2159                 _url = value;
2160                 UpdateVisual();
2161             }
2162         }
2163
2164         /// <summary>
2165         /// Compose the out visual map.
2166         /// </summary>
2167         /// <since_tizen> 3 </since_tizen>
2168         protected override void ComposingPropertyMap()
2169         {
2170             if (_url != null)
2171             {
2172                 _outputVisualMap = new PropertyMap();
2173                 _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.SVG));
2174                 _outputVisualMap.Add(ImageVisualProperty.URL, new PropertyValue(_url));
2175                 if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
2176                 if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
2177                 if (_mixColor != null) { _outputVisualMap.Add((int)Visual.Property.MixColor, new PropertyValue(_mixColor)); }
2178                 if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
2179             }
2180         }
2181     }
2182
2183     /// <summary>
2184     /// A class encapsulating the property map of the animated image (AGIF) visual.
2185     /// </summary>
2186     public class AnimatedImageVisual : VisualMap
2187     {
2188         /// <summary>
2189         /// Constructor.
2190         /// </summary>
2191         /// <since_tizen> 3 </since_tizen>
2192         public AnimatedImageVisual() : base()
2193         {
2194         }
2195
2196         private List<string> _urls = null;
2197         private int? _batchSize = null;
2198         private int? _cacheSize = null;
2199         private float? _frameDelay = null;
2200
2201         /// <summary>
2202         /// Gets and Sets the url in the AnimatedImageVisual.
2203         /// </summary>
2204         /// <since_tizen> 4 </since_tizen>
2205         public string URL
2206         {
2207             get
2208             {
2209                 if( _urls != null )
2210                 {
2211                     return _urls[0];
2212                 }
2213                 else
2214                 {
2215                     return null;
2216                 }
2217             }
2218             set
2219             {
2220                 if( _urls == null )
2221                 {
2222                     _urls = new List<string>();
2223                     _urls.Add(value);
2224                 }
2225                 else
2226                 {
2227                     _urls[0] = value;
2228                 }
2229                 UpdateVisual();
2230             }
2231         }
2232
2233         /// <summary>
2234         /// Gets and Sets the url list in the AnimatedImageVisual.
2235         /// </summary>
2236         /// <since_tizen> 4 </since_tizen>
2237         public List<string> URLS
2238         {
2239             get
2240             {
2241                 return _urls;
2242             }
2243             set
2244             {
2245                 _urls = value;
2246                 UpdateVisual();
2247             }
2248         }
2249
2250         /// <summary>
2251         /// Gets and Sets the batch size for pre-loading images in the AnimatedImageVisual.
2252         /// </summary>
2253         /// <since_tizen> 4 </since_tizen>
2254         public int BatchSize
2255         {
2256             get
2257             {
2258                 return _batchSize ?? 1;
2259             }
2260             set
2261             {
2262                 _batchSize = value;
2263                 UpdateVisual();
2264             }
2265         }
2266
2267         /// <summary>
2268         /// Gets and Sets the cache size for loading images in the AnimatedImageVisual.
2269         /// </summary>
2270         /// <since_tizen> 4 </since_tizen>
2271         public int CacheSize
2272         {
2273             get
2274             {
2275                 return _cacheSize ?? 1;
2276             }
2277             set
2278             {
2279                 _cacheSize = value;
2280                 UpdateVisual();
2281             }
2282         }
2283
2284         /// <summary>
2285         /// Gets and Sets The number of milliseconds between each frame in the AnimatedImageVisual.
2286         /// </summary>
2287         /// <since_tizen> 4 </since_tizen>
2288         public float FrameDelay
2289         {
2290             get
2291             {
2292                 return _frameDelay ?? 0.1f;
2293             }
2294             set
2295             {
2296                 _frameDelay = value;
2297                 UpdateVisual();
2298             }
2299         }
2300
2301         /// <summary>
2302         /// Compose the out visual map.
2303         /// </summary>
2304         /// <since_tizen> 3 </since_tizen>
2305         protected override void ComposingPropertyMap()
2306         {
2307             if (_urls != null)
2308             {
2309                 _outputVisualMap = new PropertyMap();
2310                 _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.AnimatedImage));
2311                 if( _urls.Count == 1 )
2312                 {
2313                     _outputVisualMap.Add(ImageVisualProperty.URL, new PropertyValue(_urls[0]));
2314                 }
2315                 else
2316                 {
2317                     var urlArray = new PropertyArray();
2318                     foreach( var url in _urls)
2319                     {
2320                         urlArray.Add(new PropertyValue(url));
2321                     }
2322                     _outputVisualMap.Add( ImageVisualProperty.URL, ( new PropertyValue( urlArray ) ) );
2323                 }
2324                 if (_batchSize != null ) {_outputVisualMap.Add((int)ImageVisualProperty.BatchSize, new PropertyValue((int)_batchSize)); }
2325                 if (_cacheSize != null ) {_outputVisualMap.Add((int)ImageVisualProperty.CacheSize, new PropertyValue((int)_cacheSize)); }
2326                 if (_frameDelay != null ) {_outputVisualMap.Add((int)ImageVisualProperty.FrameDelay, new PropertyValue((float)_frameDelay)); }
2327                 if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
2328                 if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
2329                 if (_mixColor != null) { _outputVisualMap.Add((int)Visual.Property.MixColor, new PropertyValue(_mixColor)); }
2330                 if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
2331             }
2332         }
2333     }
2334
2335
2336     //temporary fix for TCT
2337     /// <summary>
2338     /// A class encapsulating the property map of the transition data.
2339     /// </summary>
2340     public class VisualAnimator : VisualMap
2341     {
2342         /// <summary>
2343         /// Create VisualAnimator object.
2344         /// </summary>
2345         /// <since_tizen> 3 </since_tizen>
2346         public VisualAnimator() : base()
2347         {
2348         }
2349
2350         private string _alphaFunction = null;
2351         private int _startTime = 0;
2352         private int _endTime = 0;
2353         private string _target = null;
2354         private string _propertyIndex = null;
2355         private object _destinationValue = null;
2356
2357         /// <summary>
2358         /// Sets and Gets the AlphaFunction of this transition.
2359         /// </summary>
2360         /// <since_tizen> 3 </since_tizen>
2361         public AlphaFunction.BuiltinFunctions AlphaFunction
2362         {
2363             get
2364             {
2365                 switch (_alphaFunction)
2366                 {
2367                     case "LINEAR":
2368                         return Tizen.NUI.AlphaFunction.BuiltinFunctions.Linear;
2369                     case "REVERSE":
2370                         return Tizen.NUI.AlphaFunction.BuiltinFunctions.Reverse;
2371                     case "EASE_IN_SQUARE":
2372                         return Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseInSquare;
2373                     case "EASE_OUT_SQUARE":
2374                         return Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseOutSquare;
2375                     case "EASE_IN":
2376                         return Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseIn;
2377                     case "EASE_OUT":
2378                         return Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseOut;
2379                     case "EASE_IN_OUT":
2380                         return Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseInOut;
2381                     case "EASE_IN_SINE":
2382                         return Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseInSine;
2383                     case "EASE_OUT_SINE":
2384                         return Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseOutSine;
2385                     case "EASE_IN_OUT_SINE":
2386                         return Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseInOutSine;
2387                     case "BOUNCE":
2388                         return Tizen.NUI.AlphaFunction.BuiltinFunctions.Bounce;
2389                     case "SIN":
2390                         return Tizen.NUI.AlphaFunction.BuiltinFunctions.Sin;
2391                     case "EASE_OUT_BACK":
2392                         return Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseOutBack;
2393                     default:
2394                         return Tizen.NUI.AlphaFunction.BuiltinFunctions.Default;
2395                 }
2396             }
2397             set
2398             {
2399                 switch (value)
2400                 {
2401                     case Tizen.NUI.AlphaFunction.BuiltinFunctions.Linear:
2402                         {
2403                             _alphaFunction = "LINEAR";
2404                             break;
2405                         }
2406                     case Tizen.NUI.AlphaFunction.BuiltinFunctions.Reverse:
2407                         {
2408                             _alphaFunction = "REVERSE";
2409                             break;
2410                         }
2411                     case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseInSquare:
2412                         {
2413                             _alphaFunction = "EASE_IN_SQUARE";
2414                             break;
2415                         }
2416                     case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseOutSquare:
2417                         {
2418                             _alphaFunction = "EASE_OUT_SQUARE";
2419                             break;
2420                         }
2421                     case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseIn:
2422                         {
2423                             _alphaFunction = "EASE_IN";
2424                             break;
2425                         }
2426                     case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseOut:
2427                         {
2428                             _alphaFunction = "EASE_OUT";
2429                             break;
2430                         }
2431                     case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseInOut:
2432                         {
2433                             _alphaFunction = "EASE_IN_OUT";
2434                             break;
2435                         }
2436                     case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseInSine:
2437                         {
2438                             _alphaFunction = "EASE_IN_SINE";
2439                             break;
2440                         }
2441                     case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseOutSine:
2442                         {
2443                             _alphaFunction = "EASE_OUT_SINE";
2444                             break;
2445                         }
2446                     case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseInOutSine:
2447                         {
2448                             _alphaFunction = "EASE_IN_OUT_SINE";
2449                             break;
2450                         }
2451                     case Tizen.NUI.AlphaFunction.BuiltinFunctions.Bounce:
2452                         {
2453                             _alphaFunction = "BOUNCE";
2454                             break;
2455                         }
2456                     case Tizen.NUI.AlphaFunction.BuiltinFunctions.Sin:
2457                         {
2458                             _alphaFunction = "SIN";
2459                             break;
2460                         }
2461                     case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseOutBack:
2462                         {
2463                             _alphaFunction = "EASE_OUT_BACK";
2464                             break;
2465                         }
2466                     default:
2467                         {
2468                             _alphaFunction = "DEFAULT";
2469                             break;
2470                         }
2471                 }
2472             }
2473         }
2474
2475         /// <summary>
2476         /// Sets and Gets the StartTime of this transition.
2477         /// </summary>
2478         /// <since_tizen> 3 </since_tizen>
2479         public int StartTime
2480         {
2481             get
2482             {
2483                 return _startTime;
2484             }
2485             set
2486             {
2487                 _startTime = value;
2488             }
2489         }
2490
2491         /// <summary>
2492         /// Sets and Gets the EndTime of this transition.
2493         /// </summary>
2494         /// <since_tizen> 3 </since_tizen>
2495         public int EndTime
2496         {
2497             get
2498             {
2499                 return _endTime;
2500             }
2501             set
2502             {
2503                 _endTime = value;
2504             }
2505         }
2506
2507         /// <summary>
2508         /// Sets and Gets the Target of this transition.
2509         /// </summary>
2510         /// <since_tizen> 3 </since_tizen>
2511         public string Target
2512         {
2513             get
2514             {
2515                 return _target;
2516             }
2517             set
2518             {
2519                 _target = value;
2520             }
2521         }
2522
2523         /// <summary>
2524         /// Sets and Gets the PropertyIndex of this transition.
2525         /// </summary>
2526         /// <since_tizen> 3 </since_tizen>
2527         public string PropertyIndex
2528         {
2529             get
2530             {
2531                 return _propertyIndex;
2532             }
2533             set
2534             {
2535                 _propertyIndex = value;
2536             }
2537         }
2538
2539         /// <summary>
2540         /// Sets and Gets the DestinationValue of this transition.
2541         /// </summary>
2542         /// <since_tizen> 3 </since_tizen>
2543         public object DestinationValue
2544         {
2545             get
2546             {
2547                 return _destinationValue;
2548             }
2549             set
2550             {
2551                 _destinationValue = value;
2552             }
2553         }
2554
2555         /// <summary>
2556         /// Compose the out visual map.
2557         /// </summary>
2558         /// <since_tizen> 3 </since_tizen>
2559         protected override void ComposingPropertyMap()
2560         {
2561             PropertyMap _animator = new PropertyMap();
2562             _animator.Add("alphaFunction", new PropertyValue(_alphaFunction));
2563
2564             PropertyMap _timePeriod = new PropertyMap();
2565             _timePeriod.Add("duration", new PropertyValue((_endTime - _startTime) / 1000.0f));
2566             _timePeriod.Add("delay", new PropertyValue(_startTime / 1000.0f));
2567             _animator.Add("timePeriod", new PropertyValue(_timePeriod));
2568
2569             StringBuilder sb = new StringBuilder(_propertyIndex);
2570             sb[0] = (char)(sb[0] | 0x20);
2571             string _str = sb.ToString();
2572
2573             PropertyValue val = PropertyValue.CreateFromObject(_destinationValue);
2574
2575             PropertyMap _transition = new PropertyMap();
2576             _transition.Add("target", new PropertyValue(_target));
2577             _transition.Add("property", new PropertyValue(_str));
2578             _transition.Add("targetValue", val);
2579             _transition.Add("animator", new PropertyValue(_animator));
2580
2581             _outputVisualMap = _transition;
2582         }
2583     }
2584     //temporary fix for TCT
2585
2586
2587
2588 }