2 * Copyright(c) 2018 Samsung Electronics Co., Ltd.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 using System.Collections.Generic;
19 using Tizen.NUI.BaseComponents;
20 using System.ComponentModel;
25 /// A class encapsulating the transform map of the visual.
27 /// <since_tizen> 3 </since_tizen>
28 public class VisualMap
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;
37 private PropertyMap _visualTransformMap = null;
39 private int? _depthIndex = null;
44 /// <since_tizen> 3 </since_tizen>
45 protected PropertyMap _outputVisualMap = null;
53 internal int VisualIndex
59 internal VisualView Parent
68 /// <since_tizen> 3 </since_tizen>
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 />
79 /// <since_tizen> 3 </since_tizen>
84 return _visualSize ?? (new Size2D(1, 1));
89 if (_visualSizePolicy == null)
91 _visualSizePolicy = new Vector2(1.0f, 1.0f);
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 />
103 /// <since_tizen> 3 </since_tizen>
104 public Vector2 Position
108 return _visualOffset ?? (new Vector2(0.0f, 0.0f));
112 _visualOffset = value;
113 if (_visualOffsetPolicy == null)
115 _visualOffsetPolicy = new Vector2(1.0f, 1.0f);
122 /// Gets or sets the relative size of the visual<br />
123 /// (percentage [0.0f to 1.0f] of the control).<br />
126 /// <since_tizen> 3 </since_tizen>
127 public RelativeVector2 RelativeSize
131 return _visualSize ?? (new RelativeVector2(1.0f, 1.0f));
136 _visualSizePolicy = new Vector2(0.0f, 0.0f);
142 /// Gets or sets the relative offset of the visual<br />
143 /// (percentage [0.0f to 1.0f] of the control).<br />
146 /// <since_tizen> 3 </since_tizen>
147 public RelativeVector2 RelativePosition
151 return _visualOffset ?? (new RelativeVector2(0.0f, 0.0f));
155 _visualOffset = value;
156 _visualOffsetPolicy = new Vector2(0.0f, 0.0f);
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 />
167 /// <since_tizen> 3 </since_tizen>
168 public VisualTransformPolicyType PositionPolicy
172 if (_visualOffsetPolicy != null && _visualOffsetPolicy.X == 1.0f
173 && _visualOffsetPolicy.Y == 1.0f)
175 return VisualTransformPolicyType.Absolute;
177 return VisualTransformPolicyType.Relative;
183 case VisualTransformPolicyType.Relative:
184 _visualOffsetPolicy = new Vector2(0.0f, 0.0f);
186 case VisualTransformPolicyType.Absolute:
187 _visualOffsetPolicy = new Vector2(1.0f, 1.0f);
190 _visualOffsetPolicy = new Vector2(0.0f, 0.0f);
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 />
203 /// <since_tizen> 3 </since_tizen>
204 public VisualTransformPolicyType PositionPolicyX
208 if (_visualOffsetPolicy != null && _visualOffsetPolicy.X == 1.0f)
210 return VisualTransformPolicyType.Absolute;
212 return VisualTransformPolicyType.Relative;
216 if (_visualOffsetPolicy == null)
218 _visualOffsetPolicy = new Vector2(0.0f, 0.0f);
223 case VisualTransformPolicyType.Relative:
224 _visualOffsetPolicy.X = 0.0f;
226 case VisualTransformPolicyType.Absolute:
227 _visualOffsetPolicy.X = 1.0f;
230 _visualOffsetPolicy.X = 0.0f;
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 />
244 /// <since_tizen> 3 </since_tizen>
245 public VisualTransformPolicyType PositionPolicyY
249 if (_visualOffsetPolicy != null && _visualOffsetPolicy.Y == 1.0f)
251 return VisualTransformPolicyType.Absolute;
253 return VisualTransformPolicyType.Relative;
257 if (_visualOffsetPolicy == null)
259 _visualOffsetPolicy = new Vector2(0.0f, 0.0f);
264 case VisualTransformPolicyType.Relative:
265 _visualOffsetPolicy.Y = 0.0f;
267 case VisualTransformPolicyType.Absolute:
268 _visualOffsetPolicy.Y = 1.0f;
271 _visualOffsetPolicy.Y = 0.0f;
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 />
284 /// <since_tizen> 3 </since_tizen>
285 public VisualTransformPolicyType SizePolicy
289 if (_visualSizePolicy != null && _visualSizePolicy.X == 1.0f
290 && _visualSizePolicy.Y == 1.0f)
292 return VisualTransformPolicyType.Absolute;
294 return VisualTransformPolicyType.Relative;
300 case VisualTransformPolicyType.Relative:
301 _visualSizePolicy = new Vector2(0.0f, 0.0f);
303 case VisualTransformPolicyType.Absolute:
304 _visualSizePolicy = new Vector2(1.0f, 1.0f);
307 _visualSizePolicy = new Vector2(0.0f, 0.0f);
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 />
320 /// <since_tizen> 3 </since_tizen>
321 public VisualTransformPolicyType SizePolicyWidth
325 if (_visualSizePolicy != null && _visualSizePolicy.Width == 1.0f)
327 return VisualTransformPolicyType.Absolute;
329 return VisualTransformPolicyType.Relative;
333 if (_visualSizePolicy == null)
335 _visualSizePolicy = new Vector2(0.0f, 0.0f);
340 case VisualTransformPolicyType.Relative:
341 _visualSizePolicy.Width = 0.0f;
343 case VisualTransformPolicyType.Absolute:
344 _visualSizePolicy.Width = 1.0f;
347 _visualSizePolicy.Width = 0.0f;
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 />
360 /// <since_tizen> 3 </since_tizen>
361 public VisualTransformPolicyType SizePolicyHeight
365 if (_visualSizePolicy != null && _visualSizePolicy.Height == 1.0f)
367 return VisualTransformPolicyType.Absolute;
369 return VisualTransformPolicyType.Relative;
373 if (_visualSizePolicy == null)
375 _visualSizePolicy = new Vector2(0.0f, 0.0f);
380 case VisualTransformPolicyType.Relative:
381 _visualSizePolicy.Height = 0.0f;
383 case VisualTransformPolicyType.Absolute:
384 _visualSizePolicy.Height = 1.0f;
387 _visualSizePolicy.Height = 0.0f;
395 /// Gets or sets the origin of the visual within its control area.<br />
396 /// By default, the origin is center.<br />
399 /// <since_tizen> 3 </since_tizen>
400 public Visual.AlignType Origin
404 return _visualOrigin ?? (Visual.AlignType.Center);
408 _visualOrigin = value;
414 /// Gets or sets the anchor point of the visual.<br />
415 /// By default, the anchor point is center.<br />
418 /// <since_tizen> 3 </since_tizen>
419 public Visual.AlignType AnchorPoint
423 return _visualAnchorPoint ?? (Visual.AlignType.Center);
427 _visualAnchorPoint = value;
433 /// Gets or sets the depth index of the visual.<br />
434 /// By default, the depth index is 0.<br />
437 /// <since_tizen> 3 </since_tizen>
438 public int DepthIndex
442 return _depthIndex ?? (0);
450 private void ComposingTransformMap()
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)); }
462 /// Gets the transform map used by the visual.
464 /// <since_tizen> 3 </since_tizen>
465 public PropertyMap OutputTransformMap
469 ComposingTransformMap();
470 return _visualTransformMap;
475 /// Compose the out visual map.
477 /// <since_tizen> 3 </since_tizen>
478 protected virtual void ComposingPropertyMap()
480 _outputVisualMap = new PropertyMap();
484 /// Gets the property map to create the visual.
486 /// <since_tizen> 3 </since_tizen>
487 public PropertyMap OutputVisualMap
491 ComposingPropertyMap();
492 return _outputVisualMap;
496 internal void UpdateVisual()
500 NUILog.Debug("UpdateVisual()! VisualIndex=" + VisualIndex);
501 Parent.UpdateVisual(VisualIndex, Name, this);
505 NUILog.Debug("VisualIndex was not set");
510 /// The shader of the visual.
512 /// <since_tizen> 3 </since_tizen>
513 protected PropertyMap _shader = null;
514 //private PropertyMap _transform = null;
517 /// The premultipliedAlpha of the visual.
519 /// <since_tizen> 3 </since_tizen>
520 protected bool? _premultipliedAlpha = null;
523 /// The mixColor of the Visual.
525 /// <since_tizen> 3 </since_tizen>
526 protected Color _mixColor = null;
529 /// The opacity of the visual.
531 /// <since_tizen> 3 </since_tizen>
532 protected float? _opacity = null;
535 /// The FittingMode of the visual.
537 /// <since_tizen> 5 </since_tizen>
538 protected VisualFittingModeType? _visualFittingMode = null;
541 /// The map for visual.
543 /// <since_tizen> 3 </since_tizen>
544 protected PropertyMap _commonlyUsedMap = null;
547 /// The shader to use in the visual.
549 /// <since_tizen> 3 </since_tizen>
550 public PropertyMap Shader
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.
567 /// <since_tizen> 3 </since_tizen>
568 public bool PremultipliedAlpha
572 return _premultipliedAlpha ?? (false);
576 _premultipliedAlpha = value;
582 /// Mix color is a blend color for any visual.
584 /// <since_tizen> 3 </since_tizen>
585 public Color MixColor
599 /// Opacity is the alpha component of the mix color discussed above.
601 /// <since_tizen> 3 </since_tizen>
606 return _opacity ?? (1.0f);
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).
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
626 if (_visualFittingMode == null)
628 if (this is AnimatedImageVisual ||
629 this is MeshVisual ||
630 this is PrimitiveVisual ||
633 return VisualFittingModeType.FitKeepAspectRatio;
637 return VisualFittingModeType.Fill;
642 return (VisualFittingModeType)_visualFittingMode;
647 _visualFittingMode = value;
654 /// A class encapsulating the property map of the image visual.
656 /// <since_tizen> 3 </since_tizen>
657 public class ImageVisual : VisualMap
662 /// <since_tizen> 3 </since_tizen>
663 public ImageVisual() : base()
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;
688 /// Gets or sets the URL of the image.<br />
691 /// <since_tizen> 3 </since_tizen>
707 /// Gets or sets the URL of the alpha mask.<br />
710 /// <since_tizen> 3 </since_tizen>
711 public string AlphaMaskURL
715 return _alphaMaskUrl;
719 _alphaMaskUrl = value;
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.
728 /// <since_tizen> 5 </since_tizen>
729 public string AuxiliaryImageURL
733 return _auxiliaryImageUrl;
737 _auxiliaryImageUrl = value;
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 />
748 /// <since_tizen> 3 </since_tizen>
749 public FittingModeType FittingMode
753 return _fittingMode ?? (FittingModeType.ShrinkToFit);
757 _fittingMode = value;
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 />
768 /// <since_tizen> 3 </since_tizen>
769 public SamplingModeType SamplingMode
773 return _samplingMode ?? (SamplingModeType.Box);
777 _samplingMode = value;
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 />
788 /// <since_tizen> 3 </since_tizen>
789 public int DesiredWidth
793 return _desiredWidth ?? (-1);
797 _desiredWidth = value;
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 />
808 /// <since_tizen> 3 </since_tizen>
809 public int DesiredHeight
813 return _desiredHeight ?? (-1);
817 _desiredHeight = value;
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 />
828 /// <since_tizen> 3 </since_tizen>
829 public bool SynchronousLoading
833 return _synchronousLoading ?? (false);
837 _synchronousLoading = value;
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 />
848 /// <since_tizen> 3 </since_tizen>
849 public bool BorderOnly
853 return _borderOnly ?? (false);
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 />
870 /// <since_tizen> 3 </since_tizen>
871 public Vector4 PixelArea
875 return _pixelArea ?? (new Vector4(0.0f, 0.0f, 1.0f, 1.0f));
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 />
891 /// <since_tizen> 3 </since_tizen>
892 public WrapModeType WrapModeU
896 return _wrapModeU ?? (WrapModeType.Default);
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.
913 /// <since_tizen> 3 </since_tizen>
914 public WrapModeType WrapModeV
918 return _wrapModeV ?? (WrapModeType.Default);
928 /// Gets or sets scale factor to apply to the content image before masking.
930 /// <since_tizen> 4 </since_tizen>
931 public float MaskContentScale
935 return _maskContentScale ?? 1.0f;
939 _maskContentScale = value;
945 /// Whether to crop image to mask or scale mask to fit image.
947 /// <since_tizen> 4 </since_tizen>
948 public bool CropToMask
952 return _cropToMask ?? false;
962 /// An alpha value for mixing between the masked main NPatch image and the auxiliary image.
964 /// <since_tizen> 5 </since_tizen>
965 public float AuxiliaryImageAlpha
969 return _auxiliaryImageAlpha ?? 1.0f;
973 _auxiliaryImageAlpha = value;
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/>
982 /// <since_tizen> 5 </since_tizen>
983 public ReleasePolicyType ReleasePolicy
987 return _releasePolicy ?? (ReleasePolicyType.Destroyed );
991 _releasePolicy = value;
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 />
1001 /// <since_tizen> 5 </since_tizen>
1002 public LoadPolicyType LoadPolicy
1006 return _loadPolicy ?? (LoadPolicyType.Attached);
1010 _loadPolicy = value;
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 />
1021 /// <since_tizen> 5 </since_tizen>
1022 public bool OrientationCorrection
1026 return _orientationCorrection ?? (true);
1030 _orientationCorrection = value;
1036 /// Whether to use the texture atlas or not.
1037 /// Optional. By default atlasing is off.
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
1046 return _atlasing ?? (false);
1056 /// Compose the out visual map.
1058 /// <since_tizen> 3 </since_tizen>
1059 protected override void ComposingPropertyMap()
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)); }
1094 /// A class encapsulating the property map of the text visual.
1096 /// <since_tizen> 3 </since_tizen>
1097 public class TextVisual : VisualMap
1102 /// <since_tizen> 3 </since_tizen>
1103 public TextVisual() : base()
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;
1122 /// Gets or sets the text to display in the UTF-8 format.<br />
1125 /// <since_tizen> 3 </since_tizen>
1140 /// Gets or sets the requested font family to use.<br />
1143 /// <since_tizen> 3 </since_tizen>
1144 public string FontFamily
1152 _fontFamily = value;
1158 /// Gets or sets the requested font style to use.<br />
1161 /// <since_tizen> 3 </since_tizen>
1162 public PropertyMap FontStyle
1176 /// Gets or sets the size of font in points.<br />
1179 /// <since_tizen> 3 </since_tizen>
1180 public float PointSize
1184 return _pointSize ?? (0.0f);
1194 /// Gets or sets the single-line or multi-line layout option.<br />
1195 /// If not specified, the default is false.<br />
1198 /// <since_tizen> 3 </since_tizen>
1199 public bool MultiLine
1203 return _multiLine ?? (false);
1213 /// Gets or sets the line horizontal alignment.<br />
1214 /// If not specified, the default is begin.<br />
1217 /// <since_tizen> 3 </since_tizen>
1218 public HorizontalAlignment HorizontalAlignment
1222 switch (_horizontalAlignment)
1225 return HorizontalAlignment.Begin;
1227 return HorizontalAlignment.Center;
1229 return HorizontalAlignment.End;
1231 return HorizontalAlignment.Begin;
1238 case HorizontalAlignment.Begin:
1240 _horizontalAlignment = "BEGIN";
1243 case HorizontalAlignment.Center:
1245 _horizontalAlignment = "CENTER";
1248 case HorizontalAlignment.End:
1250 _horizontalAlignment = "END";
1255 _horizontalAlignment = "BEGIN";
1264 /// Gets or sets the line vertical alignment.<br />
1265 /// If not specified, the default is top.<br />
1268 /// <since_tizen> 3 </since_tizen>
1269 public VerticalAlignment VerticalAlignment
1273 switch (_verticalAlignment)
1276 return VerticalAlignment.Top;
1278 return VerticalAlignment.Center;
1280 return VerticalAlignment.Bottom;
1282 return VerticalAlignment.Top;
1289 case VerticalAlignment.Top:
1291 _verticalAlignment = "TOP";
1294 case VerticalAlignment.Center:
1296 _verticalAlignment = "CENTER";
1299 case VerticalAlignment.Bottom:
1301 _verticalAlignment = "BOTTOM";
1306 _verticalAlignment = "TOP";
1315 /// Gets or sets the color of the text.<br />
1318 /// <since_tizen> 3 </since_tizen>
1319 public Color TextColor
1333 /// Gets or sets whether the mark-up processing is enabled.<br />
1336 /// <since_tizen> 3 </since_tizen>
1337 public bool EnableMarkup
1341 return _enableMarkup ?? (false);
1345 _enableMarkup = value;
1351 /// Gets or sets the shadow parameters.
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
1370 /// Gets or sets the underline parameters.
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
1389 /// Gets or sets the outline parameters.
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
1408 /// Gets or sets the background parameters.
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
1421 _background = value;
1427 /// Compose the out visual map.
1429 /// <since_tizen> 3 </since_tizen>
1430 protected override void ComposingPropertyMap()
1432 if (_text != null && _pointSize != null)
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)); }
1458 /// A class encapsulating the property map of the border visual.
1460 /// <since_tizen> 3 </since_tizen>
1461 public class BorderVisual : VisualMap
1466 /// <since_tizen> 3 </since_tizen>
1467 public BorderVisual() : base()
1471 private Color _color = null;
1472 private float? _size = null;
1473 private bool? _antiAliasing = null;
1476 /// Gets or sets the color of the border.<br />
1479 /// <since_tizen> 3 </since_tizen>
1494 /// Gets or sets the width of the border (in pixels).<br />
1497 /// <since_tizen> 3 </since_tizen>
1498 public float BorderSize
1502 return _size ?? (-1.0f);
1512 /// Gets or sets whether the anti-aliasing of the border is required.<br />
1513 /// If not supplied, the default is false.<br />
1516 /// <since_tizen> 3 </since_tizen>
1517 public bool AntiAliasing
1521 return _antiAliasing ?? (false);
1525 _antiAliasing = value;
1531 /// Compose the out visual map.
1533 /// <since_tizen> 3 </since_tizen>
1534 protected override void ComposingPropertyMap()
1536 if (_color != null && _size != null)
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)); }
1552 /// A class encapsulating the property map of the color visual.
1554 /// <since_tizen> 3 </since_tizen>
1555 public class ColorVisual : VisualMap
1560 /// <since_tizen> 3 </since_tizen>
1561 public ColorVisual() : base()
1565 private Color _mixColorForColorVisual = null;
1566 private bool? _renderIfTransparent = false;
1569 /// Gets or sets the solid color required.<br />
1572 /// <since_tizen> 3 </since_tizen>
1577 return _mixColorForColorVisual;
1581 _mixColorForColorVisual = value;
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.
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
1597 return _renderIfTransparent ?? (false);
1601 _renderIfTransparent = value;
1607 /// Compose the out visual map.
1609 /// <since_tizen> 3 </since_tizen>
1610 protected override void ComposingPropertyMap()
1612 if (_mixColorForColorVisual != null)
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)); }
1626 /// A class encapsulating the property map of the gradient visual.
1628 /// <since_tizen> 3 </since_tizen>
1629 public class GradientVisual : VisualMap
1634 /// <since_tizen> 3 </since_tizen>
1635 public GradientVisual() : base()
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;
1649 /// Gets or sets the start position of a linear gradient.<br />
1650 /// Mandatory for linear.<br />
1652 /// <since_tizen> 3 </since_tizen>
1653 public Vector2 StartPosition
1657 return _startPosition;
1661 _startPosition = value;
1667 /// Gets or sets the end position of a linear gradient.<br />
1668 /// Mandatory for linear.<br />
1670 /// <since_tizen> 3 </since_tizen>
1671 public Vector2 EndPosition
1675 return _endPosition;
1679 _endPosition = value;
1685 /// Gets or sets the center point of a radial gradient.<br />
1686 /// Mandatory for radial.<br />
1688 /// <since_tizen> 3 </since_tizen>
1689 public Vector2 Center
1703 /// Gets or sets the size of the radius of a radial gradient.<br />
1704 /// Mandatory for radial.<br />
1706 /// <since_tizen> 3 </since_tizen>
1711 return _radius ?? (-1.0f);
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 />
1726 /// <since_tizen> 3 </since_tizen>
1727 public PropertyArray StopOffset
1735 _stopOffset = value;
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 />
1746 /// <since_tizen> 3 </since_tizen>
1747 public PropertyArray StopColor
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 />
1765 /// <since_tizen> 3 </since_tizen>
1766 public GradientVisualUnitsType Units
1770 return _units ?? (GradientVisualUnitsType.ObjectBoundingBox);
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 />
1784 /// <since_tizen> 3 </since_tizen>
1785 public GradientVisualSpreadMethodType SpreadMethod
1789 return _spreadMethod ?? (GradientVisualSpreadMethodType.Pad);
1793 _spreadMethod = value;
1799 /// Compose the out visual map.
1801 /// <since_tizen> 3 </since_tizen>
1802 protected override void ComposingPropertyMap()
1804 if (((_startPosition != null && _endPosition != null) || (_center != null && _radius != null)) && _stopColor != null)
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)); }
1825 /// A class encapsulating the property map of the mesh visual.
1827 /// <since_tizen> 3 </since_tizen>
1828 public class MeshVisual : VisualMap
1833 /// <since_tizen> 3 </since_tizen>
1834 public MeshVisual() : base()
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;
1847 /// Gets or sets the location of the ".obj" file.<br />
1850 /// <since_tizen> 3 </since_tizen>
1851 public string ObjectURL
1865 /// Gets or sets the location of the ".mtl" file.<br />
1866 /// If not specified, then a textureless object is assumed.<br />
1869 /// <since_tizen> 3 </since_tizen>
1870 public string MaterialtURL
1874 return _materialtURL;
1878 _materialtURL = value;
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 />
1887 /// <since_tizen> 3 </since_tizen>
1888 public string TexturesPath
1892 return _texturesPath;
1896 _texturesPath = value;
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 />
1907 /// <since_tizen> 3 </since_tizen>
1908 public MeshVisualShadingModeValue ShadingMode
1912 return _shadingMode ?? (MeshVisualShadingModeValue.TexturedWithDetailedSpecularLighting);
1916 _shadingMode = value;
1922 /// Gets or sets whether to use mipmaps for textures or not.<br />
1923 /// If not specified, the default is true.<br />
1926 /// <since_tizen> 3 </since_tizen>
1927 public bool UseMipmapping
1931 return _useMipmapping ?? (true);
1935 _useMipmapping = value;
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 />
1945 /// <since_tizen> 3 </since_tizen>
1946 public bool UseSoftNormals
1950 return _useSoftNormals ?? (true);
1954 _useSoftNormals = value;
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 />
1966 /// <since_tizen> 3 </since_tizen>
1967 public Vector3 LightPosition
1971 return _lightPosition;
1975 _lightPosition = value;
1981 /// Compose the out visual map.
1983 /// <since_tizen> 3 </since_tizen>
1984 protected override void ComposingPropertyMap()
1986 if (_objectURL != null)
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)); }
2005 /// A class encapsulating the property map of the primetive visual.
2007 /// <since_tizen> 3 </since_tizen>
2008 public class PrimitiveVisual : VisualMap
2013 /// <since_tizen> 3 </since_tizen>
2014 public PrimitiveVisual() : base()
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;
2032 /// Gets or sets the specific shape to render.<br />
2033 /// If not specified, the default is PrimitiveVisualShapeType.Sphere.<br />
2036 /// <since_tizen> 3 </since_tizen>
2037 public PrimitiveVisualShapeType Shape
2041 return _shape ?? (PrimitiveVisualShapeType.Sphere);
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 />
2056 /// <since_tizen> 3 </since_tizen>
2057 public new Color MixColor
2061 return _mixColorForPrimitiveVisual ?? (new Color(0.5f, 0.5f, 0.5f, 1.0f));
2065 _mixColorForPrimitiveVisual = value;
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 />
2077 /// <since_tizen> 3 </since_tizen>
2082 return _slices ?? (128);
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 />
2098 /// <since_tizen> 3 </since_tizen>
2103 return _stacks ?? (128);
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 />
2119 /// <since_tizen> 3 </since_tizen>
2120 public float ScaleTopRadius
2124 return _scaleTopRadius ?? (1.0f);
2128 _scaleTopRadius = value;
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 />
2141 /// <since_tizen> 3 </since_tizen>
2142 public float ScaleBottomRadius
2146 return _scaleBottomRadius ?? (1.5f);
2150 _scaleBottomRadius = value;
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 />
2165 /// <since_tizen> 3 </since_tizen>
2166 public float ScaleHeight
2170 return _scaleHeight ?? (3.0f);
2174 _scaleHeight = value;
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 />
2187 /// <since_tizen> 3 </since_tizen>
2188 public float ScaleRadius
2192 return _scaleRadius ?? (1.0f);
2196 _scaleRadius = value;
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 />
2211 /// <since_tizen> 3 </since_tizen>
2212 public Vector3 ScaleDimensions
2216 return _scaleDimensions ?? (Vector3.One);
2220 _scaleDimensions = value;
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 />
2234 /// <since_tizen> 3 </since_tizen>
2235 public float BevelPercentage
2239 return _bevelPercentage ?? (0.0f);
2243 _bevelPercentage = value;
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 />
2256 /// <since_tizen> 3 </since_tizen>
2257 public float BevelSmoothness
2261 return _bevelSmoothness ?? (0.0f);
2265 _bevelSmoothness = value;
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 />
2278 /// <since_tizen> 3 </since_tizen>
2279 public Vector3 LightPosition
2283 return _lightPosition;
2287 _lightPosition = value;
2293 /// Compose the out visual map.
2295 /// <since_tizen> 3 </since_tizen>
2296 protected override void ComposingPropertyMap()
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)); }
2319 /// A class encapsulating the property map of the n-patch image visual.
2321 /// <since_tizen> 3 </since_tizen>
2322 public class NPatchVisual : VisualMap
2327 /// <since_tizen> 3 </since_tizen>
2328 public NPatchVisual() : base()
2332 private string _url = null;
2333 private bool? _borderOnly = null;
2334 private Rectangle _border = null;
2337 /// Gets or sets the URL of the image.<br />
2340 /// <since_tizen> 3 </since_tizen>
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 />
2360 /// <since_tizen> 3 </since_tizen>
2361 public bool BorderOnly
2365 return _borderOnly ?? false;
2369 _borderOnly = value;
2375 /// The border of the image is in the order: left, right, bottom, top.<br />
2376 /// For n-patch images only.<br />
2379 /// <since_tizen> 3 </since_tizen>
2380 public Rectangle Border
2394 /// Compose the out visual map.
2396 /// <since_tizen> 3 </since_tizen>
2397 protected override void ComposingPropertyMap()
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)); }
2415 /// A class encapsulating the property map of the SVG visual.
2417 /// <since_tizen> 3 </since_tizen>
2418 public class SVGVisual : VisualMap
2423 /// <since_tizen> 3 </since_tizen>
2424 public SVGVisual() : base()
2428 private string _url = null;
2431 /// The url of the svg resource.
2433 /// <since_tizen> 3 </since_tizen>
2448 /// Compose the out visual map.
2450 /// <since_tizen> 3 </since_tizen>
2451 protected override void ComposingPropertyMap()
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)); }
2467 /// A class encapsulating the property map of the animated image (AGIF) visual.
2469 /// <since_tizen> 3 </since_tizen>
2470 public class AnimatedImageVisual : VisualMap
2475 /// <since_tizen> 3 </since_tizen>
2476 public AnimatedImageVisual() : base()
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;
2487 /// Gets and Sets the url in the AnimatedImageVisual.
2489 /// <since_tizen> 3 </since_tizen>
2507 _urls = new List<string>();
2519 /// Gets and Sets the url list in the AnimatedImageVisual.
2521 /// <since_tizen> 4 </since_tizen>
2522 public List<string> URLS
2536 /// Gets and Sets the batch size for pre-loading images in the AnimatedImageVisual.
2538 /// <since_tizen> 4 </since_tizen>
2539 public int BatchSize
2543 return _batchSize ?? 1;
2553 /// Gets and Sets the cache size for loading images in the AnimatedImageVisual.
2555 /// <since_tizen> 4 </since_tizen>
2556 public int CacheSize
2560 return _cacheSize ?? 1;
2570 /// Gets and Sets The number of milliseconds between each frame in the AnimatedImageVisual.
2572 /// <since_tizen> 4 </since_tizen>
2573 public float FrameDelay
2577 return _frameDelay ?? 0.1f;
2581 _frameDelay = value;
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.
2590 /// <since_tizen> 5 </since_tizen>
2591 public float LoopCount
2595 return _loopCount ?? -1;
2605 /// Compose the out visual map.
2607 /// <since_tizen> 3 </since_tizen>
2608 protected override void ComposingPropertyMap()
2612 _outputVisualMap = new PropertyMap();
2613 _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.AnimatedImage));
2614 if( _urls.Count == 1 )
2616 _outputVisualMap.Add(ImageVisualProperty.URL, new PropertyValue(_urls[0]));
2620 var urlArray = new PropertyArray();
2621 foreach( var url in _urls)
2623 urlArray.Add(new PropertyValue(url));
2625 _outputVisualMap.Add( ImageVisualProperty.URL, ( new PropertyValue( urlArray ) ) );
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)); }
2640 //temporary fix for TCT
2642 /// A class encapsulating the property map of the transition data.
2644 /// <since_tizen> 3 </since_tizen>
2645 public class VisualAnimator : VisualMap
2648 /// Create VisualAnimator object.
2650 /// <since_tizen> 3 </since_tizen>
2651 public VisualAnimator() : base()
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;
2663 /// Sets and Gets the AlphaFunction of this transition.
2665 /// <since_tizen> 3 </since_tizen>
2666 public AlphaFunction.BuiltinFunctions AlphaFunction
2670 switch (_alphaFunction)
2673 return Tizen.NUI.AlphaFunction.BuiltinFunctions.Linear;
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;
2681 return Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseIn;
2683 return Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseOut;
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;
2693 return Tizen.NUI.AlphaFunction.BuiltinFunctions.Bounce;
2695 return Tizen.NUI.AlphaFunction.BuiltinFunctions.Sin;
2696 case "EASE_OUT_BACK":
2697 return Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseOutBack;
2699 return Tizen.NUI.AlphaFunction.BuiltinFunctions.Default;
2706 case Tizen.NUI.AlphaFunction.BuiltinFunctions.Linear:
2708 _alphaFunction = "LINEAR";
2711 case Tizen.NUI.AlphaFunction.BuiltinFunctions.Reverse:
2713 _alphaFunction = "REVERSE";
2716 case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseInSquare:
2718 _alphaFunction = "EASE_IN_SQUARE";
2721 case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseOutSquare:
2723 _alphaFunction = "EASE_OUT_SQUARE";
2726 case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseIn:
2728 _alphaFunction = "EASE_IN";
2731 case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseOut:
2733 _alphaFunction = "EASE_OUT";
2736 case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseInOut:
2738 _alphaFunction = "EASE_IN_OUT";
2741 case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseInSine:
2743 _alphaFunction = "EASE_IN_SINE";
2746 case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseOutSine:
2748 _alphaFunction = "EASE_OUT_SINE";
2751 case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseInOutSine:
2753 _alphaFunction = "EASE_IN_OUT_SINE";
2756 case Tizen.NUI.AlphaFunction.BuiltinFunctions.Bounce:
2758 _alphaFunction = "BOUNCE";
2761 case Tizen.NUI.AlphaFunction.BuiltinFunctions.Sin:
2763 _alphaFunction = "SIN";
2766 case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseOutBack:
2768 _alphaFunction = "EASE_OUT_BACK";
2773 _alphaFunction = "DEFAULT";
2781 /// Sets and Gets the StartTime of this transition.
2783 /// <since_tizen> 3 </since_tizen>
2784 public int StartTime
2797 /// Sets and Gets the EndTime of this transition.
2799 /// <since_tizen> 3 </since_tizen>
2813 /// Sets and Gets the Target of this transition.
2815 /// <since_tizen> 3 </since_tizen>
2816 public string Target
2829 /// Sets and Gets the PropertyIndex of this transition.
2831 /// <since_tizen> 3 </since_tizen>
2832 public string PropertyIndex
2836 return _propertyIndex;
2840 _propertyIndex = value;
2845 /// Sets and Gets the DestinationValue of this transition.
2847 /// <since_tizen> 3 </since_tizen>
2848 public object DestinationValue
2852 return _destinationValue;
2856 _destinationValue = value;
2861 /// Compose the out visual map.
2863 /// <since_tizen> 3 </since_tizen>
2864 protected override void ComposingPropertyMap()
2866 PropertyMap _animator = new PropertyMap();
2867 _animator.Add("alphaFunction", new PropertyValue(_alphaFunction));
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));
2874 StringBuilder sb = new StringBuilder(_propertyIndex);
2875 sb[0] = (char)(sb[0] | 0x20);
2876 string _str = sb.ToString();
2878 PropertyValue val = PropertyValue.CreateFromObject(_destinationValue);
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));
2886 _outputVisualMap = _transition;
2889 //temporary fix for TCT