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