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