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