[NUI] Add getter property for VisualFittingMode (#460)
[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             get
625             {
626                 if (_visualFittingMode == null)
627                 {
628                     if (this is AnimatedImageVisual ||
629                         this is MeshVisual ||
630                         this is PrimitiveVisual ||
631                         this is TextVisual)
632                     {
633                         return VisualFittingModeType.FitKeepAspectRatio;
634                     }
635                     else
636                     {
637                         return VisualFittingModeType.Fill;
638                     }
639                 }
640                 else
641                 {
642                     return (VisualFittingModeType)_visualFittingMode;
643                 }
644             }
645             set
646             {
647                 _visualFittingMode = value;
648                 UpdateVisual();
649             }
650         }
651     }
652
653     /// <summary>
654     /// A class encapsulating the property map of the image visual.
655     /// </summary>
656     /// <since_tizen> 3 </since_tizen>
657     public class ImageVisual : VisualMap
658     {
659         /// <summary>
660         /// Constructor.
661         /// </summary>
662         /// <since_tizen> 3 </since_tizen>
663         public ImageVisual() : base()
664         {
665         }
666
667         private string _url = null;
668         private string _alphaMaskUrl = null;
669         private string _auxiliaryImageUrl = null;
670         private FittingModeType? _fittingMode = null;
671         private SamplingModeType? _samplingMode = null;
672         private int? _desiredWidth = null;
673         private int? _desiredHeight = null;
674         private bool? _synchronousLoading = false;
675         private bool? _borderOnly = null;
676         private Vector4 _pixelArea = null;
677         private WrapModeType? _wrapModeU = null;
678         private WrapModeType? _wrapModeV = null;
679         private float? _auxiliaryImageAlpha = null;
680         private float? _maskContentScale = null;
681         private bool? _cropToMask = null;
682         private ReleasePolicyType? _releasePolicy = null;
683         private LoadPolicyType? _loadPolicy = null;
684         private bool? _orientationCorrection = true;
685         private bool? _atlasing = false;
686
687         /// <summary>
688         /// Gets or sets the URL of the image.<br />
689         /// Mandatory.
690         /// </summary>
691         /// <since_tizen> 3 </since_tizen>
692         public string URL
693         {
694             get
695             {
696                 return _url;
697             }
698             set
699             {
700                 _url = value;
701                 UpdateVisual();
702             }
703         }
704
705
706         /// <summary>
707         /// Gets or sets the URL of the alpha mask.<br />
708         /// Optional.
709         /// </summary>
710         /// <since_tizen> 3 </since_tizen>
711         public string AlphaMaskURL
712         {
713             get
714             {
715                 return _alphaMaskUrl;
716             }
717             set
718             {
719                 _alphaMaskUrl = value;
720                 UpdateVisual();
721             }
722         }
723
724         /// <summary>
725         /// Overlays the auxiliary image on top of an NPatch image.
726         /// The resulting visual image will be at least as large as the smallest possible n-patch or the auxiliary image, whichever is larger.
727         /// </summary>
728         /// <since_tizen> 5 </since_tizen>
729         public string AuxiliaryImageURL
730         {
731             get
732             {
733                 return _auxiliaryImageUrl;
734             }
735             set
736             {
737                 _auxiliaryImageUrl = value;
738                 UpdateVisual();
739             }
740         }
741
742         /// <summary>
743         /// Gets or sets fitting options used when resizing images to fit the desired dimensions.<br />
744         /// If not supplied, the default is FittingModeType.ShrinkToFit.<br />
745         /// For normal quad images only.<br />
746         /// Optional.
747         /// </summary>
748         /// <since_tizen> 3 </since_tizen>
749         public FittingModeType FittingMode
750         {
751             get
752             {
753                 return _fittingMode ?? (FittingModeType.ShrinkToFit);
754             }
755             set
756             {
757                 _fittingMode = value;
758                 UpdateVisual();
759             }
760         }
761
762         /// <summary>
763         /// Gets or sets filtering options used when resizing images to the sample original pixels.<br />
764         /// If not supplied, the default is SamplingModeType.Box.<br />
765         /// For normal quad images only.<br />
766         /// Optional.
767         /// </summary>
768         /// <since_tizen> 3 </since_tizen>
769         public SamplingModeType SamplingMode
770         {
771             get
772             {
773                 return _samplingMode ?? (SamplingModeType.Box);
774             }
775             set
776             {
777                 _samplingMode = value;
778                 UpdateVisual();
779             }
780         }
781
782         /// <summary>
783         /// Gets or sets the desired image width.<br />
784         /// If not specified, the actual image width is used.<br />
785         /// For normal quad images only.<br />
786         /// Optional.
787         /// </summary>
788         /// <since_tizen> 3 </since_tizen>
789         public int DesiredWidth
790         {
791             get
792             {
793                 return _desiredWidth ?? (-1);
794             }
795             set
796             {
797                 _desiredWidth = value;
798                 UpdateVisual();
799             }
800         }
801
802         /// <summary>
803         /// Gets or sets the desired image height.<br />
804         /// If not specified, the actual image height is used.<br />
805         /// For normal quad images only.<br />
806         /// Optional.
807         /// </summary>
808         /// <since_tizen> 3 </since_tizen>
809         public int DesiredHeight
810         {
811             get
812             {
813                 return _desiredHeight ?? (-1);
814             }
815             set
816             {
817                 _desiredHeight = value;
818                 UpdateVisual();
819             }
820         }
821
822         /// <summary>
823         /// Gets or sets whether to load the image synchronously.<br />
824         /// If not specified, the default is false, i.e., the image is loaded asynchronously.<br />
825         /// For normal quad images only.<br />
826         /// Optional.
827         /// </summary>
828         /// <since_tizen> 3 </since_tizen>
829         public bool SynchronousLoading
830         {
831             get
832             {
833                 return _synchronousLoading ?? (false);
834             }
835             set
836             {
837                 _synchronousLoading = value;
838                 UpdateVisual();
839             }
840         }
841
842         /// <summary>
843         /// Gets or sets whether to draw the borders only (If true).<br />
844         /// If not specified, the default is false.<br />
845         /// For n-patch images only.<br />
846         /// Optional.
847         /// </summary>
848         /// <since_tizen> 3 </since_tizen>
849         public bool BorderOnly
850         {
851             get
852             {
853                 return _borderOnly ?? (false);
854             }
855             set
856             {
857                 _borderOnly = value;
858                 UpdateVisual();
859             }
860         }
861
862         /// <summary>
863         /// Gets or sets the image area to be displayed.<br />
864         /// It is a rectangular area.<br />
865         /// The first two elements indicate the top-left position of the area, and the last two elements are the areas of the width and the height respectively.<br />
866         /// If not specified, the default value is Vector4 (0.0, 0.0, 1.0, 1.0), i.e., the entire area of the image.<br />
867         /// For normal quad images only.<br />
868         /// Optional.
869         /// </summary>
870         /// <since_tizen> 3 </since_tizen>
871         public Vector4 PixelArea
872         {
873             get
874             {
875                 return _pixelArea ?? (new Vector4(0.0f, 0.0f, 1.0f, 1.0f));
876             }
877             set
878             {
879                 _pixelArea = value;
880                 UpdateVisual();
881             }
882         }
883
884         /// <summary>
885         /// Gets or sets the wrap mode for the u coordinate.<br />
886         /// It decides how the texture should be sampled when the u coordinate exceeds the range of 0.0 to 1.0.<br />
887         /// If not specified, the default is WrapModeType.Default(CLAMP).<br />
888         /// For normal quad images only.<br />
889         /// Optional.
890         /// </summary>
891         /// <since_tizen> 3 </since_tizen>
892         public WrapModeType WrapModeU
893         {
894             get
895             {
896                 return _wrapModeU ?? (WrapModeType.Default);
897             }
898             set
899             {
900                 _wrapModeU = value;
901                 UpdateVisual();
902             }
903         }
904
905         /// <summary>
906         /// Gets or sets the wrap mode for the v coordinate.<br />
907         /// It decides how the texture should be sampled when the v coordinate exceeds the range of 0.0 to 1.0.<br />
908         /// 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 />
909         /// If not specified, the default is WrapModeType.Default(CLAMP).<br />
910         /// For normal quad images only.
911         /// Optional.
912         /// </summary>
913         /// <since_tizen> 3 </since_tizen>
914         public WrapModeType WrapModeV
915         {
916             get
917             {
918                 return _wrapModeV ?? (WrapModeType.Default);
919             }
920             set
921             {
922                 _wrapModeV = value;
923                 UpdateVisual();
924             }
925         }
926
927         /// <summary>
928         /// Gets or sets scale factor to apply to the content image before masking.
929         /// </summary>
930         /// <since_tizen> 4 </since_tizen>
931         public float MaskContentScale
932         {
933             get
934             {
935                 return _maskContentScale ?? 1.0f;
936             }
937             set
938             {
939                 _maskContentScale = value;
940                 UpdateVisual();
941             }
942         }
943
944         /// <summary>
945         ///  Whether to crop image to mask or scale mask to fit image.
946         /// </summary>
947         /// <since_tizen> 4 </since_tizen>
948         public bool CropToMask
949         {
950             get
951             {
952                 return _cropToMask ?? false;
953             }
954             set
955             {
956                 _cropToMask = value;
957                 UpdateVisual();
958             }
959         }
960
961         /// <summary>
962         ///  An alpha value for mixing between the masked main NPatch image and the auxiliary image.
963         /// </summary>
964         /// <since_tizen> 5 </since_tizen>
965         public float AuxiliaryImageAlpha
966         {
967             get
968             {
969                 return _auxiliaryImageAlpha ?? 1.0f;
970             }
971             set
972             {
973                 _auxiliaryImageAlpha = value;
974                 UpdateVisual();
975             }
976         }
977
978         /// <summary>
979         /// Gets or sets the Image Visual release policy.<br/>
980         /// It decides if a texture should be released from the cache or kept to reduce the loading time.<br/>
981         /// </summary>
982         /// <since_tizen> 5 </since_tizen>
983         public ReleasePolicyType ReleasePolicy
984         {
985             get
986             {
987                 return _releasePolicy ?? (ReleasePolicyType.Destroyed );
988             }
989             set
990             {
991                 _releasePolicy = value;
992                 UpdateVisual();
993             }
994         }
995
996
997         /// <summary>
998         /// Gets or sets the Image Visual image loading policy.<br />
999         /// It decides if a texture should be loaded immediately after source set or only after the visual is added to the window.<br />
1000         /// </summary>
1001         /// <since_tizen> 5 </since_tizen>
1002         public LoadPolicyType LoadPolicy
1003         {
1004             get
1005             {
1006                 return _loadPolicy ?? (LoadPolicyType.Attached);
1007             }
1008             set
1009             {
1010                 _loadPolicy = value;
1011                 UpdateVisual();
1012             }
1013         }
1014
1015         /// <summary>
1016         /// Gets or sets whether to automatically correct the orientation based on the Exchangeable Image File (EXIF) data.<br />
1017         /// If not specified, the default is true.<br />
1018         /// For JPEG images only.<br />
1019         /// Optional.
1020         /// </summary>
1021         /// <since_tizen> 5 </since_tizen>
1022         public bool OrientationCorrection
1023         {
1024             get
1025             {
1026                 return _orientationCorrection ?? (true);
1027             }
1028             set
1029             {
1030                 _orientationCorrection = value;
1031                 UpdateVisual();
1032             }
1033         }
1034
1035         /// <summary>
1036         /// Whether to use the texture atlas or not.
1037         /// Optional. By default atlasing is off.
1038         /// </summary>
1039         /// <since_tizen> 5 </since_tizen>
1040         /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
1041         [EditorBrowsable(EditorBrowsableState.Never)]
1042         public bool Atlasing
1043         {
1044             get
1045             {
1046                 return _atlasing ?? (false);
1047             }
1048             set
1049             {
1050                 _atlasing = value;
1051                 UpdateVisual();
1052             }
1053         }
1054
1055         /// <summary>
1056         /// Compose the out visual map.
1057         /// </summary>
1058         /// <since_tizen> 3 </since_tizen>
1059         protected override void ComposingPropertyMap()
1060         {
1061             if (_url != null)
1062             {
1063                 _outputVisualMap = new PropertyMap();
1064                 _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Image));
1065                 _outputVisualMap.Add(ImageVisualProperty.URL, new PropertyValue(_url));
1066                 if (_alphaMaskUrl != null ) { _outputVisualMap.Add(ImageVisualProperty.AlphaMaskURL, new PropertyValue(_alphaMaskUrl)); }
1067                 if (_auxiliaryImageUrl != null ) { _outputVisualMap.Add(ImageVisualProperty.AuxiliaryImageURL, new PropertyValue(_auxiliaryImageUrl)); }
1068                 if (_fittingMode != null) { _outputVisualMap.Add(ImageVisualProperty.FittingMode, new PropertyValue((int)_fittingMode)); }
1069                 if (_samplingMode != null) { _outputVisualMap.Add(ImageVisualProperty.SamplingMode, new PropertyValue((int)_samplingMode)); }
1070                 if (_desiredWidth != null) { _outputVisualMap.Add(ImageVisualProperty.DesiredWidth, new PropertyValue((int)_desiredWidth)); }
1071                 if (_desiredHeight != null) { _outputVisualMap.Add(ImageVisualProperty.DesiredHeight, new PropertyValue((int)_desiredHeight)); }
1072                 if (_synchronousLoading != null) { _outputVisualMap.Add(ImageVisualProperty.SynchronousLoading, new PropertyValue((bool)_synchronousLoading)); }
1073                 if (_borderOnly != null) { _outputVisualMap.Add(ImageVisualProperty.BorderOnly, new PropertyValue((bool)_borderOnly)); }
1074                 if (_pixelArea != null) { _outputVisualMap.Add(ImageVisualProperty.PixelArea, new PropertyValue(_pixelArea)); }
1075                 if (_wrapModeU != null) { _outputVisualMap.Add(ImageVisualProperty.WrapModeU, new PropertyValue((int)_wrapModeU)); }
1076                 if (_wrapModeV != null) { _outputVisualMap.Add(ImageVisualProperty.WrapModeV, new PropertyValue((int)_wrapModeV)); }
1077                 if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
1078                 if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
1079                 if (_mixColor != null) { _outputVisualMap.Add((int)Visual.Property.MixColor, new PropertyValue(_mixColor)); }
1080                 if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
1081                 if (_maskContentScale != null) { _outputVisualMap.Add((int)ImageVisualProperty.MaskContentScale, new PropertyValue((float)_maskContentScale)); }
1082                 if (_cropToMask != null) { _outputVisualMap.Add((int)ImageVisualProperty.CropToMask, new PropertyValue((bool)_cropToMask)); }
1083                 if (_auxiliaryImageAlpha != null) { _outputVisualMap.Add((int)ImageVisualProperty.AuxiliaryImageAlpha, new PropertyValue((float)_auxiliaryImageAlpha)); }
1084                 if (_releasePolicy != null) { _outputVisualMap.Add( ImageVisualProperty.ReleasePolicy , new PropertyValue((int)_releasePolicy)); }
1085                 if (_loadPolicy != null) { _outputVisualMap.Add( ImageVisualProperty.LoadPolicy, new PropertyValue((int)_loadPolicy)); }
1086                 if (_orientationCorrection != null) { _outputVisualMap.Add( ImageVisualProperty.OrientationCorrection, new PropertyValue((bool)_orientationCorrection)); }
1087                 if (_atlasing != null) { _outputVisualMap.Add( ImageVisualProperty.Atlasing, new PropertyValue((bool)_atlasing)); }
1088                 if (_visualFittingMode != null) { _outputVisualMap.Add((int)Visual.Property.VisualFittingMode, new PropertyValue((int)_visualFittingMode)); }
1089             }
1090         }
1091     }
1092
1093     /// <summary>
1094     /// A class encapsulating the property map of the text visual.
1095     /// </summary>
1096     /// <since_tizen> 3 </since_tizen>
1097     public class TextVisual : VisualMap
1098     {
1099         /// <summary>
1100         /// Constructor.
1101         /// </summary>
1102         /// <since_tizen> 3 </since_tizen>
1103         public TextVisual() : base()
1104         {
1105         }
1106
1107         private string _text = null;
1108         private string _fontFamily = null;
1109         private PropertyMap _fontStyle = null;
1110         private float? _pointSize = null;
1111         private bool? _multiLine = null;
1112         private string _horizontalAlignment = null;
1113         private string _verticalAlignment = null;
1114         private Color _textColor = null;
1115         private bool? _enableMarkup = null;
1116         private PropertyMap _shadow = null;
1117         private PropertyMap _underline = null;
1118         private PropertyMap _outline = null;
1119         private PropertyMap _background = null;
1120
1121         /// <summary>
1122         /// Gets or sets the text to display in the UTF-8 format.<br />
1123         /// Mandatory.
1124         /// </summary>
1125         /// <since_tizen> 3 </since_tizen>
1126         public string Text
1127         {
1128             get
1129             {
1130                 return _text;
1131             }
1132             set
1133             {
1134                 _text = value;
1135                 UpdateVisual();
1136             }
1137         }
1138
1139         /// <summary>
1140         /// Gets or sets the requested font family to use.<br />
1141         /// Optional.
1142         /// </summary>
1143         /// <since_tizen> 3 </since_tizen>
1144         public string FontFamily
1145         {
1146             get
1147             {
1148                 return _fontFamily;
1149             }
1150             set
1151             {
1152                 _fontFamily = value;
1153                 UpdateVisual();
1154             }
1155         }
1156
1157         /// <summary>
1158         /// Gets or sets the requested font style to use.<br />
1159         /// Optional.
1160         /// </summary>
1161         /// <since_tizen> 3 </since_tizen>
1162         public PropertyMap FontStyle
1163         {
1164             get
1165             {
1166                 return _fontStyle;
1167             }
1168             set
1169             {
1170                 _fontStyle = value;
1171                 UpdateVisual();
1172             }
1173         }
1174
1175         /// <summary>
1176         /// Gets or sets the size of font in points.<br />
1177         /// Mandatory.
1178         /// </summary>
1179         /// <since_tizen> 3 </since_tizen>
1180         public float PointSize
1181         {
1182             get
1183             {
1184                 return _pointSize ?? (0.0f);
1185             }
1186             set
1187             {
1188                 _pointSize = value;
1189                 UpdateVisual();
1190             }
1191         }
1192
1193         /// <summary>
1194         /// Gets or sets the single-line or multi-line layout option.<br />
1195         /// If not specified, the default is false.<br />
1196         /// Optional.
1197         /// </summary>
1198         /// <since_tizen> 3 </since_tizen>
1199         public bool MultiLine
1200         {
1201             get
1202             {
1203                 return _multiLine ?? (false);
1204             }
1205             set
1206             {
1207                 _multiLine = value;
1208                 UpdateVisual();
1209             }
1210         }
1211
1212         /// <summary>
1213         /// Gets or sets the line horizontal alignment.<br />
1214         /// If not specified, the default is begin.<br />
1215         /// Optional.
1216         /// </summary>
1217         /// <since_tizen> 3 </since_tizen>
1218         public HorizontalAlignment HorizontalAlignment
1219         {
1220             get
1221             {
1222                 switch (_horizontalAlignment)
1223                 {
1224                     case "BEGIN":
1225                         return HorizontalAlignment.Begin;
1226                     case "CENTER":
1227                         return HorizontalAlignment.Center;
1228                     case "END":
1229                         return HorizontalAlignment.End;
1230                     default:
1231                         return HorizontalAlignment.Begin;
1232                 }
1233             }
1234             set
1235             {
1236                 switch (value)
1237                 {
1238                     case HorizontalAlignment.Begin:
1239                     {
1240                         _horizontalAlignment = "BEGIN";
1241                         break;
1242                     }
1243                     case HorizontalAlignment.Center:
1244                     {
1245                         _horizontalAlignment = "CENTER";
1246                         break;
1247                     }
1248                     case HorizontalAlignment.End:
1249                     {
1250                         _horizontalAlignment = "END";
1251                         break;
1252                     }
1253                     default:
1254                     {
1255                         _horizontalAlignment = "BEGIN";
1256                         break;
1257                     }
1258                 }
1259                 UpdateVisual();
1260             }
1261         }
1262
1263         /// <summary>
1264         /// Gets or sets the line vertical alignment.<br />
1265         /// If not specified, the default is top.<br />
1266         /// Optional.
1267         /// </summary>
1268         /// <since_tizen> 3 </since_tizen>
1269         public VerticalAlignment VerticalAlignment
1270         {
1271             get
1272             {
1273                 switch (_verticalAlignment)
1274                 {
1275                     case "TOP":
1276                         return VerticalAlignment.Top;
1277                     case "CENTER":
1278                         return VerticalAlignment.Center;
1279                     case "BOTTOM":
1280                         return VerticalAlignment.Bottom;
1281                     default:
1282                         return VerticalAlignment.Top;
1283                 }
1284             }
1285             set
1286             {
1287                 switch (value)
1288                 {
1289                     case VerticalAlignment.Top:
1290                     {
1291                         _verticalAlignment = "TOP";
1292                         break;
1293                     }
1294                     case VerticalAlignment.Center:
1295                     {
1296                         _verticalAlignment = "CENTER";
1297                         break;
1298                     }
1299                     case VerticalAlignment.Bottom:
1300                     {
1301                         _verticalAlignment = "BOTTOM";
1302                         break;
1303                     }
1304                     default:
1305                     {
1306                         _verticalAlignment = "TOP";
1307                         break;
1308                     }
1309                 }
1310                 UpdateVisual();
1311             }
1312         }
1313
1314         /// <summary>
1315         /// Gets or sets the color of the text.<br />
1316         /// Optional.
1317         /// </summary>
1318         /// <since_tizen> 3 </since_tizen>
1319         public Color TextColor
1320         {
1321             get
1322             {
1323                 return _textColor;
1324             }
1325             set
1326             {
1327                 _textColor = value;
1328                 UpdateVisual();
1329             }
1330         }
1331
1332         /// <summary>
1333         /// Gets or sets whether the mark-up processing is enabled.<br />
1334         /// Optional.
1335         /// </summary>
1336         /// <since_tizen> 3 </since_tizen>
1337         public bool EnableMarkup
1338         {
1339             get
1340             {
1341                 return _enableMarkup ?? (false);
1342             }
1343             set
1344             {
1345                 _enableMarkup = value;
1346                 UpdateVisual();
1347             }
1348         }
1349
1350         /// <summary>
1351         /// Gets or sets the shadow parameters.
1352         /// </summary>
1353         /// <since_tizen> 5 </since_tizen>
1354         /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
1355         [EditorBrowsable(EditorBrowsableState.Never)]
1356         public PropertyMap Shadow
1357         {
1358             get
1359             {
1360                 return _shadow;
1361             }
1362             set
1363             {
1364                 _shadow = value;
1365                 UpdateVisual();
1366             }
1367         }
1368
1369         /// <summary>
1370         /// Gets or sets the underline parameters.
1371         /// </summary>
1372         /// <since_tizen> 5 </since_tizen>
1373         /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
1374         [EditorBrowsable(EditorBrowsableState.Never)]
1375         public PropertyMap Underline
1376         {
1377             get
1378             {
1379                 return _underline;
1380             }
1381             set
1382             {
1383                 _underline = value;
1384                 UpdateVisual();
1385             }
1386         }
1387
1388         /// <summary>
1389         /// Gets or sets the outline parameters.
1390         /// </summary>
1391         /// <since_tizen> 5 </since_tizen>
1392         /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
1393         [EditorBrowsable(EditorBrowsableState.Never)]
1394         public PropertyMap Outline
1395         {
1396             get
1397             {
1398                 return _outline;
1399             }
1400             set
1401             {
1402                 _outline = value;
1403                 UpdateVisual();
1404             }
1405         }
1406
1407         /// <summary>
1408         /// Gets or sets the background parameters.
1409         /// </summary>
1410         /// <since_tizen> 5 </since_tizen>
1411         /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
1412         [EditorBrowsable(EditorBrowsableState.Never)]
1413         public PropertyMap Background
1414         {
1415             get
1416             {
1417                 return _background;
1418             }
1419             set
1420             {
1421                 _background = value;
1422                 UpdateVisual();
1423             }
1424         }
1425
1426         /// <summary>
1427         /// Compose the out visual map.
1428         /// </summary>
1429         /// <since_tizen> 3 </since_tizen>
1430         protected override void ComposingPropertyMap()
1431         {
1432             if (_text != null && _pointSize != null)
1433             {
1434                 _outputVisualMap = new PropertyMap();
1435                 _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Text));
1436                 _outputVisualMap.Add(TextVisualProperty.Text, new PropertyValue(_text));
1437                 _outputVisualMap.Add(TextVisualProperty.PointSize, new PropertyValue((float)_pointSize));
1438                 if (_fontFamily != null) { _outputVisualMap.Add(TextVisualProperty.FontFamily, new PropertyValue(_fontFamily)); }
1439                 if (_fontStyle != null) { _outputVisualMap.Add(TextVisualProperty.FontStyle, new PropertyValue(_fontStyle)); }
1440                 if (_multiLine != null) { _outputVisualMap.Add(TextVisualProperty.MultiLine, new PropertyValue((bool)_multiLine)); }
1441                 if (_horizontalAlignment != null) { _outputVisualMap.Add(TextVisualProperty.HorizontalAlignment, new PropertyValue(_horizontalAlignment)); }
1442                 if (_verticalAlignment != null) { _outputVisualMap.Add(TextVisualProperty.VerticalAlignment, new PropertyValue(_verticalAlignment)); }
1443                 if (_textColor != null) { _outputVisualMap.Add(TextVisualProperty.TextColor, new PropertyValue(_textColor)); }
1444                 if (_enableMarkup != null) { _outputVisualMap.Add(TextVisualProperty.EnableMarkup, new PropertyValue((bool)_enableMarkup)); }
1445                 if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
1446                 if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
1447                 if (_mixColor != null) { _outputVisualMap.Add((int)Visual.Property.MixColor, new PropertyValue(_mixColor)); }
1448                 if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
1449                 if (_shadow != null) { _outputVisualMap.Add(TextVisualProperty.Shadow, new PropertyValue(_shadow)); }
1450                 if (_underline != null) { _outputVisualMap.Add(TextVisualProperty.Underline, new PropertyValue(_underline)); }
1451                 if (_outline != null) { _outputVisualMap.Add(TextVisualProperty.Outline, new PropertyValue(_outline)); }
1452                 if (_background != null) { _outputVisualMap.Add(TextVisualProperty.Background, new PropertyValue(_background)); }
1453             }
1454         }
1455     }
1456
1457     /// <summary>
1458     /// A class encapsulating the property map of the border visual.
1459     /// </summary>
1460     /// <since_tizen> 3 </since_tizen>
1461     public class BorderVisual : VisualMap
1462     {
1463         /// <summary>
1464         /// Constructor.
1465         /// </summary>
1466         /// <since_tizen> 3 </since_tizen>
1467         public BorderVisual() : base()
1468         {
1469         }
1470
1471         private Color _color = null;
1472         private float? _size = null;
1473         private bool? _antiAliasing = null;
1474
1475         /// <summary>
1476         /// Gets or sets the color of the border.<br />
1477         /// Mandatory.
1478         /// </summary>
1479         /// <since_tizen> 3 </since_tizen>
1480         public Color Color
1481         {
1482             get
1483             {
1484                 return _color;
1485             }
1486             set
1487             {
1488                 _color = value;
1489                 UpdateVisual();
1490             }
1491         }
1492
1493         /// <summary>
1494         /// Gets or sets the width of the border (in pixels).<br />
1495         /// Mandatory.
1496         /// </summary>
1497         /// <since_tizen> 3 </since_tizen>
1498         public float BorderSize
1499         {
1500             get
1501             {
1502                 return _size ?? (-1.0f);
1503             }
1504             set
1505             {
1506                 _size = value;
1507                 UpdateVisual();
1508             }
1509         }
1510
1511         /// <summary>
1512         /// Gets or sets whether the anti-aliasing of the border is required.<br />
1513         /// If not supplied, the default is false.<br />
1514         /// Optional.
1515         /// </summary>
1516         /// <since_tizen> 3 </since_tizen>
1517         public bool AntiAliasing
1518         {
1519             get
1520             {
1521                 return _antiAliasing ?? (false);
1522             }
1523             set
1524             {
1525                 _antiAliasing = value;
1526                 UpdateVisual();
1527             }
1528         }
1529
1530         /// <summary>
1531         /// Compose the out visual map.
1532         /// </summary>
1533         /// <since_tizen> 3 </since_tizen>
1534         protected override void ComposingPropertyMap()
1535         {
1536             if (_color != null && _size != null)
1537             {
1538                 _outputVisualMap = new PropertyMap();
1539                 _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Border));
1540                 _outputVisualMap.Add(BorderVisualProperty.Size, new PropertyValue((float)_size));
1541                 _outputVisualMap.Add(BorderVisualProperty.Color, new PropertyValue(_color));
1542                 if (_antiAliasing != null) { _outputVisualMap.Add(BorderVisualProperty.AntiAliasing, new PropertyValue((bool)_antiAliasing)); }
1543                 if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
1544                 if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
1545                 if (_mixColor != null) { _outputVisualMap.Add((int)Visual.Property.MixColor, new PropertyValue(_mixColor)); }
1546                 if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
1547             }
1548         }
1549     }
1550
1551     /// <summary>
1552     /// A class encapsulating the property map of the color visual.
1553     /// </summary>
1554     /// <since_tizen> 3 </since_tizen>
1555     public class ColorVisual : VisualMap
1556     {
1557         /// <summary>
1558         /// Constructor.
1559         /// </summary>
1560         /// <since_tizen> 3 </since_tizen>
1561         public ColorVisual() : base()
1562         {
1563         }
1564
1565         private Color _mixColorForColorVisual = null;
1566         private bool? _renderIfTransparent = false;
1567
1568         /// <summary>
1569         /// Gets or sets the solid color required.<br />
1570         /// Mandatory.
1571         /// </summary>
1572         /// <since_tizen> 3 </since_tizen>
1573         public Color Color
1574         {
1575             get
1576             {
1577                 return _mixColorForColorVisual;
1578             }
1579             set
1580             {
1581                 _mixColorForColorVisual = value;
1582                 UpdateVisual();
1583             }
1584         }
1585
1586         /// <summary>
1587         /// Gets or sets whether to render if the MixColor is transparent.
1588         /// By default it is false, which means that the ColorVisual will not render if the MIX_COLOR is transparent.
1589         /// </summary>
1590         /// <since_tizen> 5 </since_tizen>
1591         /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
1592         [EditorBrowsable(EditorBrowsableState.Never)]
1593         public bool RenderIfTransparent
1594         {
1595             get
1596             {
1597                 return _renderIfTransparent ?? (false);
1598             }
1599             set
1600             {
1601                 _renderIfTransparent = value;
1602                 UpdateVisual();
1603             }
1604         }
1605
1606         /// <summary>
1607         /// Compose the out visual map.
1608         /// </summary>
1609         /// <since_tizen> 3 </since_tizen>
1610         protected override void ComposingPropertyMap()
1611         {
1612             if (_mixColorForColorVisual != null)
1613             {
1614                 _outputVisualMap = new PropertyMap();
1615                 _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Color));
1616                 _outputVisualMap.Add(ColorVisualProperty.MixColor, new PropertyValue(_mixColorForColorVisual));
1617                 if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
1618                 if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
1619                 if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
1620                 if (_renderIfTransparent != null) { _outputVisualMap.Add(ColorVisualProperty.RenderIfTransparent, new PropertyValue((bool)_renderIfTransparent)); }
1621             }
1622         }
1623     }
1624
1625     /// <summary>
1626     /// A class encapsulating the property map of the gradient visual.
1627     /// </summary>
1628     /// <since_tizen> 3 </since_tizen>
1629     public class GradientVisual : VisualMap
1630     {
1631         /// <summary>
1632         /// Constructor.
1633         /// </summary>
1634         /// <since_tizen> 3 </since_tizen>
1635         public GradientVisual() : base()
1636         {
1637         }
1638
1639         private Vector2 _startPosition = null;
1640         private Vector2 _endPosition = null;
1641         private Vector2 _center = null;
1642         private float? _radius = null;
1643         private PropertyArray _stopOffset = null;
1644         private PropertyArray _stopColor = null;
1645         private GradientVisualUnitsType? _units = null;
1646         private GradientVisualSpreadMethodType? _spreadMethod = null;
1647
1648         /// <summary>
1649         /// Gets or sets the start position of a linear gradient.<br />
1650         /// Mandatory for linear.<br />
1651         /// </summary>
1652         /// <since_tizen> 3 </since_tizen>
1653         public Vector2 StartPosition
1654         {
1655             get
1656             {
1657                 return _startPosition;
1658             }
1659             set
1660             {
1661                 _startPosition = value;
1662                 UpdateVisual();
1663             }
1664         }
1665
1666         /// <summary>
1667         /// Gets or sets the end position of a linear gradient.<br />
1668         /// Mandatory for linear.<br />
1669         /// </summary>
1670         /// <since_tizen> 3 </since_tizen>
1671         public Vector2 EndPosition
1672         {
1673             get
1674             {
1675                 return _endPosition;
1676             }
1677             set
1678             {
1679                 _endPosition = value;
1680                 UpdateVisual();
1681             }
1682         }
1683
1684         /// <summary>
1685         /// Gets or sets the center point of a radial gradient.<br />
1686         /// Mandatory for radial.<br />
1687         /// </summary>
1688         /// <since_tizen> 3 </since_tizen>
1689         public Vector2 Center
1690         {
1691             get
1692             {
1693                 return _center;
1694             }
1695             set
1696             {
1697                 _center = value;
1698                 UpdateVisual();
1699             }
1700         }
1701
1702         /// <summary>
1703         /// Gets or sets the size of the radius of a radial gradient.<br />
1704         /// Mandatory for radial.<br />
1705         /// </summary>
1706         /// <since_tizen> 3 </since_tizen>
1707         public float Radius
1708         {
1709             get
1710             {
1711                 return _radius ?? (-1.0f);
1712             }
1713             set
1714             {
1715                 _radius = value;
1716                 UpdateVisual();
1717             }
1718         }
1719
1720         /// <summary>
1721         /// Gets or sets all the stop offsets.<br />
1722         /// A PropertyArray of float.<br />
1723         /// If not supplied, the default is 0.0f and 1.0f.<br />
1724         /// Optional.
1725         /// </summary>
1726         /// <since_tizen> 3 </since_tizen>
1727         public PropertyArray StopOffset
1728         {
1729             get
1730             {
1731                 return _stopOffset;
1732             }
1733             set
1734             {
1735                 _stopOffset = value;
1736                 UpdateVisual();
1737             }
1738         }
1739
1740         /// <summary>
1741         /// Gets or sets the color at the stop offsets.<br />
1742         /// A PropertyArray of color.<br />
1743         /// At least 2 values are required to show a gradient.<br />
1744         /// Mandatory.
1745         /// </summary>
1746         /// <since_tizen> 3 </since_tizen>
1747         public PropertyArray StopColor
1748         {
1749             get
1750             {
1751                 return _stopColor;
1752             }
1753             set
1754             {
1755                 _stopColor = value;
1756                 UpdateVisual();
1757             }
1758         }
1759
1760         /// <summary>
1761         /// Gets or sets descriptions of the coordinate system for certain attributes of the points in a gradient.<br />
1762         /// If not supplied, the default is GradientVisualUnitsType.ObjectBoundingBox.<br />
1763         /// Optional.
1764         /// </summary>
1765         /// <since_tizen> 3 </since_tizen>
1766         public GradientVisualUnitsType Units
1767         {
1768             get
1769             {
1770                 return _units ?? (GradientVisualUnitsType.ObjectBoundingBox);
1771             }
1772             set
1773             {
1774                 _units = value;
1775                 UpdateVisual();
1776             }
1777         }
1778
1779         /// <summary>
1780         /// Gets or sets indications of what happens if the gradient starts or ends inside the bounds of the target rectangle.<br />
1781         /// If not supplied, the default is GradientVisualSpreadMethodType.Pad.<br />
1782         /// Optional.
1783         /// </summary>
1784         /// <since_tizen> 3 </since_tizen>
1785         public GradientVisualSpreadMethodType SpreadMethod
1786         {
1787             get
1788             {
1789                 return _spreadMethod ?? (GradientVisualSpreadMethodType.Pad);
1790             }
1791             set
1792             {
1793                 _spreadMethod = value;
1794                 UpdateVisual();
1795             }
1796         }
1797
1798         /// <summary>
1799         /// Compose the out visual map.
1800         /// </summary>
1801         /// <since_tizen> 3 </since_tizen>
1802         protected override void ComposingPropertyMap()
1803         {
1804             if (((_startPosition != null && _endPosition != null) || (_center != null && _radius != null)) && _stopColor != null)
1805             {
1806                 _outputVisualMap = new PropertyMap();
1807                 _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Gradient));
1808                 _outputVisualMap.Add(GradientVisualProperty.StopColor, new PropertyValue(_stopColor));
1809                 if (_startPosition != null) { _outputVisualMap.Add(GradientVisualProperty.StartPosition, new PropertyValue(_startPosition)); }
1810                 if (_endPosition != null) { _outputVisualMap.Add(GradientVisualProperty.EndPosition, new PropertyValue(_endPosition)); }
1811                 if (_center != null) { _outputVisualMap.Add(GradientVisualProperty.Center, new PropertyValue(_center)); }
1812                 if (_radius != null) { _outputVisualMap.Add(GradientVisualProperty.Radius, new PropertyValue((float)_radius)); }
1813                 if (_stopOffset != null) { _outputVisualMap.Add(GradientVisualProperty.StopOffset, new PropertyValue(_stopOffset)); }
1814                 if (_units != null) { _outputVisualMap.Add(GradientVisualProperty.Units, new PropertyValue((int)_units)); }
1815                 if (_spreadMethod != null) { _outputVisualMap.Add(GradientVisualProperty.SpreadMethod, new PropertyValue((int)_spreadMethod)); }
1816                 if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
1817                 if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
1818                 if (_mixColor != null) { _outputVisualMap.Add((int)Visual.Property.MixColor, new PropertyValue(_mixColor)); }
1819                 if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
1820             }
1821         }
1822     }
1823
1824     /// <summary>
1825     /// A class encapsulating the property map of the mesh visual.
1826     /// </summary>
1827     /// <since_tizen> 3 </since_tizen>
1828     public class MeshVisual : VisualMap
1829     {
1830         /// <summary>
1831         /// Constructor.
1832         /// </summary>
1833         /// <since_tizen> 3 </since_tizen>
1834         public MeshVisual() : base()
1835         {
1836         }
1837
1838         private string _objectURL = null;
1839         private string _materialtURL = null;
1840         private string _texturesPath = null;
1841         private MeshVisualShadingModeValue? _shadingMode = null;
1842         private bool? _useMipmapping = null;
1843         private bool? _useSoftNormals = null;
1844         private Vector3 _lightPosition = null;
1845
1846         /// <summary>
1847         /// Gets or sets the location of the ".obj" file.<br />
1848         /// Mandatory.
1849         /// </summary>
1850         /// <since_tizen> 3 </since_tizen>
1851         public string ObjectURL
1852         {
1853             get
1854             {
1855                 return _objectURL;
1856             }
1857             set
1858             {
1859                 _objectURL = value;
1860                 UpdateVisual();
1861             }
1862         }
1863
1864         /// <summary>
1865         /// Gets or sets the location of the ".mtl" file.<br />
1866         /// If not specified, then a textureless object is assumed.<br />
1867         /// Optional.
1868         /// </summary>
1869         /// <since_tizen> 3 </since_tizen>
1870         public string MaterialtURL
1871         {
1872             get
1873             {
1874                 return _materialtURL;
1875             }
1876             set
1877             {
1878                 _materialtURL = value;
1879                 UpdateVisual();
1880             }
1881         }
1882
1883         /// <summary>
1884         /// Gets or sets the path to the directory the textures (including gloss and normal) are stored in.<br />
1885         /// Mandatory if using material.<br />
1886         /// </summary>
1887         /// <since_tizen> 3 </since_tizen>
1888         public string TexturesPath
1889         {
1890             get
1891             {
1892                 return _texturesPath;
1893             }
1894             set
1895             {
1896                 _texturesPath = value;
1897                 UpdateVisual();
1898             }
1899         }
1900
1901         /// <summary>
1902         /// Gets or sets the type of shading mode that the mesh will use.<br />
1903         /// 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 />
1904         /// If not specified, it will use the best it can support (will try MeshVisualShadingModeValue.TexturedWithDetailedSpecularLighting first).<br />
1905         /// Optional.
1906         /// </summary>
1907         /// <since_tizen> 3 </since_tizen>
1908         public MeshVisualShadingModeValue ShadingMode
1909         {
1910             get
1911             {
1912                 return _shadingMode ?? (MeshVisualShadingModeValue.TexturedWithDetailedSpecularLighting);
1913             }
1914             set
1915             {
1916                 _shadingMode = value;
1917                 UpdateVisual();
1918             }
1919         }
1920
1921         /// <summary>
1922         /// Gets or sets whether to use mipmaps for textures or not.<br />
1923         /// If not specified, the default is true.<br />
1924         /// Optional.
1925         /// </summary>
1926         /// <since_tizen> 3 </since_tizen>
1927         public bool UseMipmapping
1928         {
1929             get
1930             {
1931                 return _useMipmapping ?? (true);
1932             }
1933             set
1934             {
1935                 _useMipmapping = value;
1936                 UpdateVisual();
1937             }
1938         }
1939
1940         /// <summary>
1941         /// Gets or sets whether to average normals at each point to smooth textures or not.<br />
1942         /// If not specified, the default is true.<br />
1943         /// Optional.
1944         /// </summary>
1945         /// <since_tizen> 3 </since_tizen>
1946         public bool UseSoftNormals
1947         {
1948             get
1949             {
1950                 return _useSoftNormals ?? (true);
1951             }
1952             set
1953             {
1954                 _useSoftNormals = value;
1955                 UpdateVisual();
1956             }
1957         }
1958
1959         /// <summary>
1960         /// Gets or sets the position, in the stage space, of the point light that applies lighting to the model.<br />
1961         /// This is based off the stage's dimensions, so using the width and the height of the stage halved will correspond to the center,
1962         /// and using all zeroes will place the light at the top-left corner.<br />
1963         /// If not specified, the default is an offset outwards from the center of the screen.<br />
1964         /// Optional.
1965         /// </summary>
1966         /// <since_tizen> 3 </since_tizen>
1967         public Vector3 LightPosition
1968         {
1969             get
1970             {
1971                 return _lightPosition;
1972             }
1973             set
1974             {
1975                 _lightPosition = value;
1976                 UpdateVisual();
1977             }
1978         }
1979
1980         /// <summary>
1981         /// Compose the out visual map.
1982         /// </summary>
1983         /// <since_tizen> 3 </since_tizen>
1984         protected override void ComposingPropertyMap()
1985         {
1986             if (_objectURL != null)
1987             {
1988                 _outputVisualMap = new PropertyMap();
1989                 _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Mesh));
1990                 _outputVisualMap.Add(MeshVisualProperty.ObjectURL, new PropertyValue(_objectURL));
1991                 if (_materialtURL != null) { _outputVisualMap.Add(MeshVisualProperty.MaterialtURL, new PropertyValue(_materialtURL)); }
1992                 if (_texturesPath != null) { _outputVisualMap.Add(MeshVisualProperty.TexturesPath, new PropertyValue(_texturesPath)); }
1993                 if (_shadingMode != null) { _outputVisualMap.Add(MeshVisualProperty.ShadingMode, new PropertyValue((int)_shadingMode)); }
1994                 if (_useMipmapping != null) { _outputVisualMap.Add(MeshVisualProperty.UseMipmapping, new PropertyValue((bool)_useMipmapping)); }
1995                 if (_useSoftNormals != null) { _outputVisualMap.Add(MeshVisualProperty.UseSoftNormals, new PropertyValue((bool)_useSoftNormals)); }
1996                 if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
1997                 if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
1998                 if (_mixColor != null) { _outputVisualMap.Add((int)Visual.Property.MixColor, new PropertyValue(_mixColor)); }
1999                 if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
2000             }
2001         }
2002     }
2003
2004     /// <summary>
2005     /// A class encapsulating the property map of the primetive visual.
2006     /// </summary>
2007     /// <since_tizen> 3 </since_tizen>
2008     public class PrimitiveVisual : VisualMap
2009     {
2010         /// <summary>
2011         /// Constructor.
2012         /// </summary>
2013         /// <since_tizen> 3 </since_tizen>
2014         public PrimitiveVisual() : base()
2015         {
2016         }
2017
2018         private PrimitiveVisualShapeType? _shape = null;
2019         private Color _mixColorForPrimitiveVisual = null;
2020         private int? _slices = null;
2021         private int? _stacks = null;
2022         private float? _scaleTopRadius = null;
2023         private float? _scaleBottomRadius = null;
2024         private float? _scaleHeight = null;
2025         private float? _scaleRadius = null;
2026         private Vector3 _scaleDimensions = null;
2027         private float? _bevelPercentage = null;
2028         private float? _bevelSmoothness = null;
2029         private Vector3 _lightPosition = null;
2030
2031         /// <summary>
2032         /// Gets or sets the specific shape to render.<br />
2033         /// If not specified, the default is PrimitiveVisualShapeType.Sphere.<br />
2034         /// Optional.
2035         /// </summary>
2036         /// <since_tizen> 3 </since_tizen>
2037         public PrimitiveVisualShapeType Shape
2038         {
2039             get
2040             {
2041                 return _shape ?? (PrimitiveVisualShapeType.Sphere);
2042             }
2043             set
2044             {
2045                 _shape = value;
2046                 UpdateVisual();
2047             }
2048         }
2049
2050         /// <summary>
2051         /// Gets or sets the color of the shape.<br />
2052         /// If not specified, the default is Color (0.5, 0.5, 0.5, 1.0).<br />
2053         /// Applies to all shapes.<br />
2054         /// Optional.
2055         /// </summary>
2056         /// <since_tizen> 3 </since_tizen>
2057         public new Color MixColor
2058         {
2059             get
2060             {
2061                 return _mixColorForPrimitiveVisual ?? (new Color(0.5f, 0.5f, 0.5f, 1.0f));
2062             }
2063             set
2064             {
2065                 _mixColorForPrimitiveVisual = value;
2066                 UpdateVisual();
2067             }
2068         }
2069
2070         /// <summary>
2071         /// Gets or sets the number of slices as you go around the shape.<br />
2072         /// For spheres and conical frustrums, this determines how many divisions there are as you go around 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 Slices
2079         {
2080             get
2081             {
2082                 return _slices ?? (128);
2083             }
2084             set
2085             {
2086                 _slices = value;
2087                 UpdateVisual();
2088             }
2089         }
2090
2091         /// <summary>
2092         /// Gets or sets the number of stacks as you go down the shape.<br />
2093         /// For spheres, 'stacks' determines how many layers there are as you go down the object.<br />
2094         /// If not specified, the default is 128.<br />
2095         /// The range is from 1 to 255.<br />
2096         /// Optional.
2097         /// </summary>
2098         /// <since_tizen> 3 </since_tizen>
2099         public int Stacks
2100         {
2101             get
2102             {
2103                 return _stacks ?? (128);
2104             }
2105             set
2106             {
2107                 _stacks = value;
2108                 UpdateVisual();
2109             }
2110         }
2111
2112         /// <summary>
2113         /// Gets or sets the scale of the radius of the top circle of a conical frustrum.<br />
2114         /// If not specified, the default is 1.0f.<br />
2115         /// Applies to: - PrimitiveVisualShapeType.ConicalFrustrum<br />
2116         /// Only values greater than or equal to 0.0f are accepted.<br />
2117         /// Optional.
2118         /// </summary>
2119         /// <since_tizen> 3 </since_tizen>
2120         public float ScaleTopRadius
2121         {
2122             get
2123             {
2124                 return _scaleTopRadius ?? (1.0f);
2125             }
2126             set
2127             {
2128                 _scaleTopRadius = value;
2129                 UpdateVisual();
2130             }
2131         }
2132
2133         /// <summary>
2134         /// Gets or sets the scale of the radius of the bottom circle of a conical frustrum.<br />
2135         /// If not specified, the default is 1.5f.<br />
2136         /// Applies to:  - PrimitiveVisualShapeType.ConicalFrustrum<br />
2137         ///              - PrimitiveVisualShapeType.Cone<br />
2138         /// Only values greater than or equal to 0.0f are accepted.<br />
2139         /// Optional.
2140         /// </summary>
2141         /// <since_tizen> 3 </since_tizen>
2142         public float ScaleBottomRadius
2143         {
2144             get
2145             {
2146                 return _scaleBottomRadius ?? (1.5f);
2147             }
2148             set
2149             {
2150                 _scaleBottomRadius = value;
2151                 UpdateVisual();
2152             }
2153         }
2154
2155         /// <summary>
2156         /// Gets or sets the scale of the height of a conic.<br />
2157         /// If not specified, the default is 3.0f.<br />
2158         /// Applies to:<br />
2159         ///      - PrimitiveVisualShapeType.ConicalFrustrum<br />
2160         ///      - PrimitiveVisualShapeType.Cone<br />
2161         ///      - PrimitiveVisualShapeType.Cylinder<br />
2162         /// Only values greater than or equal to 0.0f are accepted.<br />
2163         /// Optional.
2164         /// </summary>
2165         /// <since_tizen> 3 </since_tizen>
2166         public float ScaleHeight
2167         {
2168             get
2169             {
2170                 return _scaleHeight ?? (3.0f);
2171             }
2172             set
2173             {
2174                 _scaleHeight = value;
2175                 UpdateVisual();
2176             }
2177         }
2178
2179         /// <summary>
2180         /// Gets or sets the scale of the radius of a cylinder.<br />
2181         /// If not specified, the default is 1.0f.<br />
2182         /// Applies to:<br />
2183         ///      - PrimitiveVisualShapeType.Cylinder<br />
2184         /// Only values greater than or equal to 0.0f are accepted.<br />
2185         /// Optional.
2186         /// </summary>
2187         /// <since_tizen> 3 </since_tizen>
2188         public float ScaleRadius
2189         {
2190             get
2191             {
2192                 return _scaleRadius ?? (1.0f);
2193             }
2194             set
2195             {
2196                 _scaleRadius = value;
2197                 UpdateVisual();
2198             }
2199         }
2200
2201         /// <summary>
2202         /// Gets or sets the dimensions of a cuboid. Scales in the same fashion as a 9-patch image.<br />
2203         /// If not specified, the default is Vector3.One.<br />
2204         /// Applies to:<br />
2205         ///      - PrimitiveVisualShapeType.Cube<br />
2206         ///      - PrimitiveVisualShapeType.Octahedron<br />
2207         ///      - PrimitiveVisualShapeType.BevelledCube<br />
2208         /// Each Vector3 parameter should be greater than or equal to 0.0f.<br />
2209         /// Optional.
2210         /// </summary>
2211         /// <since_tizen> 3 </since_tizen>
2212         public Vector3 ScaleDimensions
2213         {
2214             get
2215             {
2216                 return _scaleDimensions ?? (Vector3.One);
2217             }
2218             set
2219             {
2220                 _scaleDimensions = value;
2221                 UpdateVisual();
2222             }
2223         }
2224
2225         /// <summary>
2226         /// Gets or sets determines how bevelled the cuboid should be, based off the smallest dimension.<br />
2227         /// 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 />
2228         /// If not specified, the default is 0.0f (no bevel).<br />
2229         /// Applies to:<br />
2230         ///      - PrimitiveVisualShapeType.BevelledCube<br />
2231         /// The range is from 0.0f to 1.0f.<br />
2232         /// Optional.
2233         /// </summary>
2234         /// <since_tizen> 3 </since_tizen>
2235         public float BevelPercentage
2236         {
2237             get
2238             {
2239                 return _bevelPercentage ?? (0.0f);
2240             }
2241             set
2242             {
2243                 _bevelPercentage = value;
2244                 UpdateVisual();
2245             }
2246         }
2247
2248         /// <summary>
2249         /// Gets or sets descriptions of how smooth the bevelled edges should be.<br />
2250         /// If not specified, the default is 0.0f (sharp edges).<br />
2251         /// Applies to:<br />
2252         ///      - PrimitiveVisualShapeType.BevelledCube<br />
2253         /// The range is from 0.0f to 1.0f.<br />
2254         /// Optional.
2255         /// </summary>
2256         /// <since_tizen> 3 </since_tizen>
2257         public float BevelSmoothness
2258         {
2259             get
2260             {
2261                 return _bevelSmoothness ?? (0.0f);
2262             }
2263             set
2264             {
2265                 _bevelSmoothness = value;
2266                 UpdateVisual();
2267             }
2268         }
2269
2270         /// <summary>
2271         /// Gets or sets the position, in the stage space, of the point light that applies lighting to the model.<br />
2272         /// This is based off the stage's dimensions, so using the width and the height of the stage halved will correspond to the center,
2273         /// and using all zeroes will place the light at the top-left corner.<br />
2274         /// If not specified, the default is an offset outwards from the center of the screen.<br />
2275         /// Applies to all shapes.<br />
2276         /// Optional.
2277         /// </summary>
2278         /// <since_tizen> 3 </since_tizen>
2279         public Vector3 LightPosition
2280         {
2281             get
2282             {
2283                 return _lightPosition;
2284             }
2285             set
2286             {
2287                 _lightPosition = value;
2288                 UpdateVisual();
2289             }
2290         }
2291
2292         /// <summary>
2293         /// Compose the out visual map.
2294         /// </summary>
2295         /// <since_tizen> 3 </since_tizen>
2296         protected override void ComposingPropertyMap()
2297         {
2298             _outputVisualMap = new PropertyMap(); ;
2299             _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Primitive));
2300             if (_shape != null) { _outputVisualMap.Add(PrimitiveVisualProperty.Shape, new PropertyValue((int)_shape)); }
2301             if (_mixColorForPrimitiveVisual != null) { _outputVisualMap.Add(PrimitiveVisualProperty.MixColor, new PropertyValue(_mixColorForPrimitiveVisual)); }
2302             if (_slices != null) { _outputVisualMap.Add(PrimitiveVisualProperty.Slices, new PropertyValue((int)_slices)); }
2303             if (_stacks != null) { _outputVisualMap.Add(PrimitiveVisualProperty.Stacks, new PropertyValue((int)_stacks)); }
2304             if (_scaleTopRadius != null) { _outputVisualMap.Add(PrimitiveVisualProperty.ScaleTopRadius, new PropertyValue((float)_scaleTopRadius)); }
2305             if (_scaleBottomRadius != null) { _outputVisualMap.Add(PrimitiveVisualProperty.ScaleBottomRadius, new PropertyValue((float)_scaleBottomRadius)); }
2306             if (_scaleHeight != null) { _outputVisualMap.Add(PrimitiveVisualProperty.ScaleHeight, new PropertyValue((float)_scaleHeight)); }
2307             if (_scaleRadius != null) { _outputVisualMap.Add(PrimitiveVisualProperty.ScaleRadius, new PropertyValue((float)_scaleRadius)); }
2308             if (_scaleDimensions != null) { _outputVisualMap.Add(PrimitiveVisualProperty.ScaleDimensions, new PropertyValue(_scaleDimensions)); }
2309             if (_bevelPercentage != null) { _outputVisualMap.Add(PrimitiveVisualProperty.BevelPercentage, new PropertyValue((float)_bevelPercentage)); }
2310             if (_bevelSmoothness != null) { _outputVisualMap.Add(PrimitiveVisualProperty.BevelSmoothness, new PropertyValue((float)_bevelSmoothness)); }
2311             if (_lightPosition != null) { _outputVisualMap.Add(PrimitiveVisualProperty.LightPosition, new PropertyValue(_lightPosition)); }
2312             if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
2313             if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
2314             if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
2315         }
2316     }
2317
2318     /// <summary>
2319     /// A class encapsulating the property map of the n-patch image visual.
2320     /// </summary>
2321     /// <since_tizen> 3 </since_tizen>
2322     public class NPatchVisual : VisualMap
2323     {
2324         /// <summary>
2325         /// Constructor.
2326         /// </summary>
2327         /// <since_tizen> 3 </since_tizen>
2328         public NPatchVisual() : base()
2329         {
2330         }
2331
2332         private string _url = null;
2333         private bool? _borderOnly = null;
2334         private Rectangle _border = null;
2335
2336         /// <summary>
2337         /// Gets or sets the URL of the image.<br />
2338         /// Mandatory.
2339         /// </summary>
2340         /// <since_tizen> 3 </since_tizen>
2341         public string URL
2342         {
2343             get
2344             {
2345                 return _url;
2346             }
2347             set
2348             {
2349                 _url = value;
2350                 UpdateVisual();
2351             }
2352         }
2353
2354         /// <summary>
2355         /// Gets or sets whether to draw the borders only (If true).<br />
2356         /// If not specified, the default is false.<br />
2357         /// For n-patch images only.<br />
2358         /// Optional.
2359         /// </summary>
2360         /// <since_tizen> 3 </since_tizen>
2361         public bool BorderOnly
2362         {
2363             get
2364             {
2365                 return _borderOnly ?? false;
2366             }
2367             set
2368             {
2369                 _borderOnly = value;
2370                 UpdateVisual();
2371             }
2372         }
2373
2374         /// <summary>
2375         /// The border of the image is in the order: left, right, bottom, top.<br />
2376         /// For n-patch images only.<br />
2377         /// Optional.
2378         /// </summary>
2379         /// <since_tizen> 3 </since_tizen>
2380         public Rectangle Border
2381         {
2382             get
2383             {
2384                 return _border;
2385             }
2386             set
2387             {
2388                 _border = value;
2389                 UpdateVisual();
2390             }
2391         }
2392
2393         /// <summary>
2394         /// Compose the out visual map.
2395         /// </summary>
2396         /// <since_tizen> 3 </since_tizen>
2397         protected override void ComposingPropertyMap()
2398         {
2399             if (_url != null)
2400             {
2401                 _outputVisualMap = new PropertyMap();
2402                 _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.NPatch));
2403                 _outputVisualMap.Add(NpatchImageVisualProperty.URL, new PropertyValue(_url));
2404                 if (_borderOnly != null) { _outputVisualMap.Add(NpatchImageVisualProperty.BorderOnly, new PropertyValue((bool)_borderOnly)); }
2405                 if (_border != null) { _outputVisualMap.Add(NpatchImageVisualProperty.Border, new PropertyValue(_border)); }
2406                 if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
2407                 if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
2408                 if (_mixColor != null) { _outputVisualMap.Add((int)Visual.Property.MixColor, new PropertyValue(_mixColor)); }
2409                 if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
2410             }
2411         }
2412     }
2413
2414     /// <summary>
2415     /// A class encapsulating the property map of the SVG visual.
2416     /// </summary>
2417     /// <since_tizen> 3 </since_tizen>
2418     public class SVGVisual : VisualMap
2419     {
2420         /// <summary>
2421         /// Constructor.
2422         /// </summary>
2423         /// <since_tizen> 3 </since_tizen>
2424         public SVGVisual() : base()
2425         {
2426         }
2427
2428         private string _url = null;
2429
2430         /// <summary>
2431         /// The url of the svg resource.
2432         /// </summary>
2433         /// <since_tizen> 3 </since_tizen>
2434         public string URL
2435         {
2436             get
2437             {
2438                 return _url;
2439             }
2440             set
2441             {
2442                 _url = value;
2443                 UpdateVisual();
2444             }
2445         }
2446
2447         /// <summary>
2448         /// Compose the out visual map.
2449         /// </summary>
2450         /// <since_tizen> 3 </since_tizen>
2451         protected override void ComposingPropertyMap()
2452         {
2453             if (_url != null)
2454             {
2455                 _outputVisualMap = new PropertyMap();
2456                 _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.SVG));
2457                 _outputVisualMap.Add(ImageVisualProperty.URL, new PropertyValue(_url));
2458                 if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
2459                 if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
2460                 if (_mixColor != null) { _outputVisualMap.Add((int)Visual.Property.MixColor, new PropertyValue(_mixColor)); }
2461                 if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
2462             }
2463         }
2464     }
2465
2466     /// <summary>
2467     /// A class encapsulating the property map of the animated image (AGIF) visual.
2468     /// </summary>
2469     /// <since_tizen> 3 </since_tizen>
2470     public class AnimatedImageVisual : VisualMap
2471     {
2472         /// <summary>
2473         /// Constructor.
2474         /// </summary>
2475         /// <since_tizen> 3 </since_tizen>
2476         public AnimatedImageVisual() : base()
2477         {
2478         }
2479
2480         private List<string> _urls = null;
2481         private int? _batchSize = null;
2482         private int? _cacheSize = null;
2483         private float? _frameDelay = null;
2484         private float? _loopCount = null;
2485
2486         /// <summary>
2487         /// Gets and Sets the url in the AnimatedImageVisual.
2488         /// </summary>
2489         /// <since_tizen> 3 </since_tizen>
2490         public string URL
2491         {
2492             get
2493             {
2494                 if( _urls != null )
2495                 {
2496                     return _urls[0];
2497                 }
2498                 else
2499                 {
2500                     return null;
2501                 }
2502             }
2503             set
2504             {
2505                 if( _urls == null )
2506                 {
2507                     _urls = new List<string>();
2508                     _urls.Add(value);
2509                 }
2510                 else
2511                 {
2512                     _urls[0] = value;
2513                 }
2514                 UpdateVisual();
2515             }
2516         }
2517
2518         /// <summary>
2519         /// Gets and Sets the url list in the AnimatedImageVisual.
2520         /// </summary>
2521         /// <since_tizen> 4 </since_tizen>
2522         public List<string> URLS
2523         {
2524             get
2525             {
2526                 return _urls;
2527             }
2528             set
2529             {
2530                 _urls = value;
2531                 UpdateVisual();
2532             }
2533         }
2534
2535         /// <summary>
2536         /// Gets and Sets the batch size for pre-loading images in the AnimatedImageVisual.
2537         /// </summary>
2538         /// <since_tizen> 4 </since_tizen>
2539         public int BatchSize
2540         {
2541             get
2542             {
2543                 return _batchSize ?? 1;
2544             }
2545             set
2546             {
2547                 _batchSize = value;
2548                 UpdateVisual();
2549             }
2550         }
2551
2552         /// <summary>
2553         /// Gets and Sets the cache size for loading images in the AnimatedImageVisual.
2554         /// </summary>
2555         /// <since_tizen> 4 </since_tizen>
2556         public int CacheSize
2557         {
2558             get
2559             {
2560                 return _cacheSize ?? 1;
2561             }
2562             set
2563             {
2564                 _cacheSize = value;
2565                 UpdateVisual();
2566             }
2567         }
2568
2569         /// <summary>
2570         /// Gets and Sets The number of milliseconds between each frame in the AnimatedImageVisual.
2571         /// </summary>
2572         /// <since_tizen> 4 </since_tizen>
2573         public float FrameDelay
2574         {
2575             get
2576             {
2577                 return _frameDelay ?? 0.1f;
2578             }
2579             set
2580             {
2581                 _frameDelay = value;
2582                 UpdateVisual();
2583             }
2584         }
2585
2586         /// <summary>
2587         /// Gets and sets the number of times the AnimatedImageVisual will be looped.
2588         /// The default is -1. If the number is less than 0 then it loops unlimited,otherwise loop loopCount times.
2589         /// </summary>
2590         /// <since_tizen> 5 </since_tizen>
2591         public float LoopCount
2592         {
2593             get
2594             {
2595                 return _loopCount ?? -1;
2596             }
2597             set
2598             {
2599                 _loopCount = value;
2600                 UpdateVisual();
2601             }
2602         }
2603
2604         /// <summary>
2605         /// Compose the out visual map.
2606         /// </summary>
2607         /// <since_tizen> 3 </since_tizen>
2608         protected override void ComposingPropertyMap()
2609         {
2610             if (_urls != null)
2611             {
2612                 _outputVisualMap = new PropertyMap();
2613                 _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.AnimatedImage));
2614                 if( _urls.Count == 1 )
2615                 {
2616                     _outputVisualMap.Add(ImageVisualProperty.URL, new PropertyValue(_urls[0]));
2617                 }
2618                 else
2619                 {
2620                     var urlArray = new PropertyArray();
2621                     foreach( var url in _urls)
2622                     {
2623                         urlArray.Add(new PropertyValue(url));
2624                     }
2625                     _outputVisualMap.Add( ImageVisualProperty.URL, ( new PropertyValue( urlArray ) ) );
2626                 }
2627                 if (_batchSize != null ) {_outputVisualMap.Add((int)ImageVisualProperty.BatchSize, new PropertyValue((int)_batchSize)); }
2628                 if (_cacheSize != null ) {_outputVisualMap.Add((int)ImageVisualProperty.CacheSize, new PropertyValue((int)_cacheSize)); }
2629                 if (_frameDelay != null ) {_outputVisualMap.Add((int)ImageVisualProperty.FrameDelay, new PropertyValue((float)_frameDelay)); }
2630                 if (_loopCount != null ) {_outputVisualMap.Add((int)ImageVisualProperty.LoopCount, new PropertyValue((int)_loopCount)); }
2631                 if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
2632                 if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
2633                 if (_mixColor != null) { _outputVisualMap.Add((int)Visual.Property.MixColor, new PropertyValue(_mixColor)); }
2634                 if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
2635             }
2636         }
2637     }
2638
2639
2640     //temporary fix for TCT
2641     /// <summary>
2642     /// A class encapsulating the property map of the transition data.
2643     /// </summary>
2644     /// <since_tizen> 3 </since_tizen>
2645     public class VisualAnimator : VisualMap
2646     {
2647         /// <summary>
2648         /// Create VisualAnimator object.
2649         /// </summary>
2650         /// <since_tizen> 3 </since_tizen>
2651         public VisualAnimator() : base()
2652         {
2653         }
2654
2655         private string _alphaFunction = null;
2656         private int _startTime = 0;
2657         private int _endTime = 0;
2658         private string _target = null;
2659         private string _propertyIndex = null;
2660         private object _destinationValue = null;
2661
2662         /// <summary>
2663         /// Sets and Gets the AlphaFunction of this transition.
2664         /// </summary>
2665         /// <since_tizen> 3 </since_tizen>
2666         public AlphaFunction.BuiltinFunctions AlphaFunction
2667         {
2668             get
2669             {
2670                 switch (_alphaFunction)
2671                 {
2672                     case "LINEAR":
2673                         return Tizen.NUI.AlphaFunction.BuiltinFunctions.Linear;
2674                     case "REVERSE":
2675                         return Tizen.NUI.AlphaFunction.BuiltinFunctions.Reverse;
2676                     case "EASE_IN_SQUARE":
2677                         return Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseInSquare;
2678                     case "EASE_OUT_SQUARE":
2679                         return Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseOutSquare;
2680                     case "EASE_IN":
2681                         return Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseIn;
2682                     case "EASE_OUT":
2683                         return Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseOut;
2684                     case "EASE_IN_OUT":
2685                         return Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseInOut;
2686                     case "EASE_IN_SINE":
2687                         return Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseInSine;
2688                     case "EASE_OUT_SINE":
2689                         return Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseOutSine;
2690                     case "EASE_IN_OUT_SINE":
2691                         return Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseInOutSine;
2692                     case "BOUNCE":
2693                         return Tizen.NUI.AlphaFunction.BuiltinFunctions.Bounce;
2694                     case "SIN":
2695                         return Tizen.NUI.AlphaFunction.BuiltinFunctions.Sin;
2696                     case "EASE_OUT_BACK":
2697                         return Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseOutBack;
2698                     default:
2699                         return Tizen.NUI.AlphaFunction.BuiltinFunctions.Default;
2700                 }
2701             }
2702             set
2703             {
2704                 switch (value)
2705                 {
2706                     case Tizen.NUI.AlphaFunction.BuiltinFunctions.Linear:
2707                         {
2708                             _alphaFunction = "LINEAR";
2709                             break;
2710                         }
2711                     case Tizen.NUI.AlphaFunction.BuiltinFunctions.Reverse:
2712                         {
2713                             _alphaFunction = "REVERSE";
2714                             break;
2715                         }
2716                     case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseInSquare:
2717                         {
2718                             _alphaFunction = "EASE_IN_SQUARE";
2719                             break;
2720                         }
2721                     case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseOutSquare:
2722                         {
2723                             _alphaFunction = "EASE_OUT_SQUARE";
2724                             break;
2725                         }
2726                     case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseIn:
2727                         {
2728                             _alphaFunction = "EASE_IN";
2729                             break;
2730                         }
2731                     case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseOut:
2732                         {
2733                             _alphaFunction = "EASE_OUT";
2734                             break;
2735                         }
2736                     case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseInOut:
2737                         {
2738                             _alphaFunction = "EASE_IN_OUT";
2739                             break;
2740                         }
2741                     case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseInSine:
2742                         {
2743                             _alphaFunction = "EASE_IN_SINE";
2744                             break;
2745                         }
2746                     case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseOutSine:
2747                         {
2748                             _alphaFunction = "EASE_OUT_SINE";
2749                             break;
2750                         }
2751                     case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseInOutSine:
2752                         {
2753                             _alphaFunction = "EASE_IN_OUT_SINE";
2754                             break;
2755                         }
2756                     case Tizen.NUI.AlphaFunction.BuiltinFunctions.Bounce:
2757                         {
2758                             _alphaFunction = "BOUNCE";
2759                             break;
2760                         }
2761                     case Tizen.NUI.AlphaFunction.BuiltinFunctions.Sin:
2762                         {
2763                             _alphaFunction = "SIN";
2764                             break;
2765                         }
2766                     case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseOutBack:
2767                         {
2768                             _alphaFunction = "EASE_OUT_BACK";
2769                             break;
2770                         }
2771                     default:
2772                         {
2773                             _alphaFunction = "DEFAULT";
2774                             break;
2775                         }
2776                 }
2777             }
2778         }
2779
2780         /// <summary>
2781         /// Sets and Gets the StartTime of this transition.
2782         /// </summary>
2783         /// <since_tizen> 3 </since_tizen>
2784         public int StartTime
2785         {
2786             get
2787             {
2788                 return _startTime;
2789             }
2790             set
2791             {
2792                 _startTime = value;
2793             }
2794         }
2795
2796         /// <summary>
2797         /// Sets and Gets the EndTime of this transition.
2798         /// </summary>
2799         /// <since_tizen> 3 </since_tizen>
2800         public int EndTime
2801         {
2802             get
2803             {
2804                 return _endTime;
2805             }
2806             set
2807             {
2808                 _endTime = value;
2809             }
2810         }
2811
2812         /// <summary>
2813         /// Sets and Gets the Target of this transition.
2814         /// </summary>
2815         /// <since_tizen> 3 </since_tizen>
2816         public string Target
2817         {
2818             get
2819             {
2820                 return _target;
2821             }
2822             set
2823             {
2824                 _target = value;
2825             }
2826         }
2827
2828         /// <summary>
2829         /// Sets and Gets the PropertyIndex of this transition.
2830         /// </summary>
2831         /// <since_tizen> 3 </since_tizen>
2832         public string PropertyIndex
2833         {
2834             get
2835             {
2836                 return _propertyIndex;
2837             }
2838             set
2839             {
2840                 _propertyIndex = value;
2841             }
2842         }
2843
2844         /// <summary>
2845         /// Sets and Gets the DestinationValue of this transition.
2846         /// </summary>
2847         /// <since_tizen> 3 </since_tizen>
2848         public object DestinationValue
2849         {
2850             get
2851             {
2852                 return _destinationValue;
2853             }
2854             set
2855             {
2856                 _destinationValue = value;
2857             }
2858         }
2859
2860         /// <summary>
2861         /// Compose the out visual map.
2862         /// </summary>
2863         /// <since_tizen> 3 </since_tizen>
2864         protected override void ComposingPropertyMap()
2865         {
2866             PropertyMap _animator = new PropertyMap();
2867             _animator.Add("alphaFunction", new PropertyValue(_alphaFunction));
2868
2869             PropertyMap _timePeriod = new PropertyMap();
2870             _timePeriod.Add("duration", new PropertyValue((_endTime - _startTime) / 1000.0f));
2871             _timePeriod.Add("delay", new PropertyValue(_startTime / 1000.0f));
2872             _animator.Add("timePeriod", new PropertyValue(_timePeriod));
2873
2874             StringBuilder sb = new StringBuilder(_propertyIndex);
2875             sb[0] = (char)(sb[0] | 0x20);
2876             string _str = sb.ToString();
2877
2878             PropertyValue val = PropertyValue.CreateFromObject(_destinationValue);
2879
2880             PropertyMap _transition = new PropertyMap();
2881             _transition.Add("target", new PropertyValue(_target));
2882             _transition.Add("property", new PropertyValue(_str));
2883             _transition.Add("targetValue", val);
2884             _transition.Add("animator", new PropertyValue(_animator));
2885
2886             _outputVisualMap = _transition;
2887         }
2888     }
2889     //temporary fix for TCT
2890
2891
2892
2893 }