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