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