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