2 * Copyright(c) 2017 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 map for visual.
537 /// <since_tizen> 3 </since_tizen>
538 protected PropertyMap _commonlyUsedMap = null;
541 /// The shader to use in the visual.
543 /// <since_tizen> 3 </since_tizen>
544 public PropertyMap Shader
558 /// Enables or disables the premultiplied alpha. <br />
559 /// The premultiplied alpha is false by default unless this behavior is modified by the derived visual type.
561 /// <since_tizen> 3 </since_tizen>
562 public bool PremultipliedAlpha
566 return _premultipliedAlpha ?? (false);
570 _premultipliedAlpha = value;
576 /// Mix color is a blend color for any visual.
578 /// <since_tizen> 3 </since_tizen>
579 public Color MixColor
593 /// Opacity is the alpha component of the mix color discussed above.
595 /// <since_tizen> 3 </since_tizen>
600 return _opacity ?? (1.0f);
612 /// A class encapsulating the property map of the image visual.
614 /// <since_tizen> 3 </since_tizen>
615 public class ImageVisual : VisualMap
620 /// <since_tizen> 3 </since_tizen>
621 public ImageVisual() : base()
625 private string _url = null;
626 private string _alphaMaskUrl = null;
627 private string _auxiliaryImageUrl = null;
628 private FittingModeType? _fittingMode = null;
629 private SamplingModeType? _samplingMode = null;
630 private int? _desiredWidth = null;
631 private int? _desiredHeight = null;
632 private bool? _synchronousLoading = false;
633 private bool? _borderOnly = null;
634 private Vector4 _pixelArea = null;
635 private WrapModeType? _wrapModeU = null;
636 private WrapModeType? _wrapModeV = null;
637 private float? _auxiliaryImageAlpha = null;
638 private float? _maskContentScale = null;
639 private bool? _cropToMask = null;
640 private ReleasePolicyType? _releasePolicy = null;
641 private LoadPolicyType? _loadPolicy = null;
642 private bool? _orientationCorrection = true;
645 /// Gets or sets the URL of the image.<br />
648 /// <since_tizen> 3 </since_tizen>
664 /// Gets or sets the URL of the alpha mask.<br />
667 /// <since_tizen> 3 </since_tizen>
668 public string AlphaMaskURL
672 return _alphaMaskUrl;
676 _alphaMaskUrl = value;
682 /// Overlays the auxiliary iamge on top of an NPatch image.
683 /// The resulting visual image will be at least as large as the smallest possible n-patch or the auxiliary image, whichever is larger.
685 /// <since_tizen> 5 </since_tizen>
686 /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
687 [EditorBrowsable(EditorBrowsableState.Never)]
688 public string AuxiliaryImageURL
692 return _auxiliaryImageUrl;
696 _auxiliaryImageUrl = value;
702 /// Gets or sets fitting options used when resizing images to fit the desired dimensions.<br />
703 /// If not supplied, the default is FittingModeType.ShrinkToFit.<br />
704 /// For normal quad images only.<br />
707 /// <since_tizen> 3 </since_tizen>
708 public FittingModeType FittingMode
712 return _fittingMode ?? (FittingModeType.ShrinkToFit);
716 _fittingMode = value;
722 /// Gets or sets filtering options used when resizing images to the sample original pixels.<br />
723 /// If not supplied, the default is SamplingModeType.Box.<br />
724 /// For normal quad images only.<br />
727 /// <since_tizen> 3 </since_tizen>
728 public SamplingModeType SamplingMode
732 return _samplingMode ?? (SamplingModeType.Box);
736 _samplingMode = value;
742 /// Gets or sets the desired image width.<br />
743 /// If not specified, the actual image width is used.<br />
744 /// For normal quad images only.<br />
747 /// <since_tizen> 3 </since_tizen>
748 public int DesiredWidth
752 return _desiredWidth ?? (-1);
756 _desiredWidth = value;
762 /// Gets or sets the desired image height.<br />
763 /// If not specified, the actual image height is used.<br />
764 /// For normal quad images only.<br />
767 /// <since_tizen> 3 </since_tizen>
768 public int DesiredHeight
772 return _desiredHeight ?? (-1);
776 _desiredHeight = value;
782 /// Gets or sets whether to load the image synchronously.<br />
783 /// If not specified, the default is false, i.e., the image is loaded asynchronously.<br />
784 /// For normal quad images only.<br />
787 /// <since_tizen> 3 </since_tizen>
788 public bool SynchronousLoading
792 return _synchronousLoading ?? (false);
796 _synchronousLoading = value;
802 /// Gets or sets whether to draw the borders only (If true).<br />
803 /// If not specified, the default is false.<br />
804 /// For n-patch images only.<br />
807 /// <since_tizen> 3 </since_tizen>
808 public bool BorderOnly
812 return _borderOnly ?? (false);
822 /// Gets or sets the image area to be displayed.<br />
823 /// It is a rectangular area.<br />
824 /// The first two elements indicate the top-left position of the area, and the last two elements are the areas of the width and the height respectively.<br />
825 /// If not specified, the default value is Vector4 (0.0, 0.0, 1.0, 1.0), i.e., the entire area of the image.<br />
826 /// For normal quad images only.<br />
829 /// <since_tizen> 3 </since_tizen>
830 public Vector4 PixelArea
834 return _pixelArea ?? (new Vector4(0.0f, 0.0f, 1.0f, 1.0f));
844 /// Gets or sets the wrap mode for the u coordinate.<br />
845 /// It decides how the texture should be sampled when the u coordinate exceeds the range of 0.0 to 1.0.<br />
846 /// If not specified, the default is WrapModeType.Default(CLAMP).<br />
847 /// For normal quad images only.<br />
850 /// <since_tizen> 3 </since_tizen>
851 public WrapModeType WrapModeU
855 return _wrapModeU ?? (WrapModeType.Default);
865 /// Gets or sets the wrap mode for the v coordinate.<br />
866 /// It decides how the texture should be sampled when the v coordinate exceeds the range of 0.0 to 1.0.<br />
867 /// The first two elements indicate the top-left position of the area, and the last two elements are the areas of the width and the height respectively.<br />
868 /// If not specified, the default is WrapModeType.Default(CLAMP).<br />
869 /// For normal quad images only.
872 /// <since_tizen> 3 </since_tizen>
873 public WrapModeType WrapModeV
877 return _wrapModeV ?? (WrapModeType.Default);
887 /// Gets or sets scale factor to apply to the content image before masking.
889 /// <since_tizen> 4 </since_tizen>
890 public float MaskContentScale
894 return _maskContentScale ?? 1.0f;
898 _maskContentScale = value;
904 /// Whether to crop image to mask or scale mask to fit image.
906 /// <since_tizen> 4 </since_tizen>
907 public bool CropToMask
911 return _cropToMask ?? false;
921 /// An alpha value for mixing between the masked main NPatch image and the auxiliary image.
923 /// <since_tizen> 5 </since_tizen>
924 /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
925 [EditorBrowsable(EditorBrowsableState.Never)]
926 public float AuxiliaryImageAlpha
930 return _auxiliaryImageAlpha ?? 1.0f;
934 _auxiliaryImageAlpha = value;
940 /// Get or set the Image Visual release policy<br />
941 /// It decides if a texture should be released from the cache or kept to reduce loading time <br />
943 /// <since_tizen> 5 </since_tizen>
944 /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
945 [EditorBrowsable(EditorBrowsableState.Never)]
946 public ReleasePolicyType ReleasePolicy
950 return _releasePolicy ?? (ReleasePolicyType.Destroyed );
954 _releasePolicy = value;
961 /// Get or set the Image Visual image loading policy<br />
962 /// It decides if a texture should be loaded immediately after source set or only after visual is added to window <br />
964 /// <since_tizen> 5 </since_tizen>
965 /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
966 [EditorBrowsable(EditorBrowsableState.Never)]
967 public LoadPolicyType LoadPolicy
971 return _loadPolicy ?? (LoadPolicyType.Attached);
981 /// Get or set whether to automatically correct the orientation based on exif data.<br />
982 /// If not specified, the default is true.<br />
983 /// For JPEG images only.<br />
986 /// <since_tizen> 5 </since_tizen>
987 /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API.
988 [EditorBrowsable(EditorBrowsableState.Never)]
989 public bool OrientationCorrection
993 return _orientationCorrection ?? (true);
997 _orientationCorrection = value;
1004 /// Compose the out visual map.
1006 /// <since_tizen> 3 </since_tizen>
1007 protected override void ComposingPropertyMap()
1011 _outputVisualMap = new PropertyMap();
1012 _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Image));
1013 _outputVisualMap.Add(ImageVisualProperty.URL, new PropertyValue(_url));
1014 if (_alphaMaskUrl != null ) { _outputVisualMap.Add(ImageVisualProperty.AlphaMaskURL, new PropertyValue(_alphaMaskUrl)); }
1015 if (_auxiliaryImageUrl != null ) { _outputVisualMap.Add(ImageVisualProperty.AuxiliaryImageURL, new PropertyValue(_auxiliaryImageUrl)); }
1016 if (_fittingMode != null) { _outputVisualMap.Add(ImageVisualProperty.FittingMode, new PropertyValue((int)_fittingMode)); }
1017 if (_samplingMode != null) { _outputVisualMap.Add(ImageVisualProperty.SamplingMode, new PropertyValue((int)_samplingMode)); }
1018 if (_desiredWidth != null) { _outputVisualMap.Add(ImageVisualProperty.DesiredWidth, new PropertyValue((int)_desiredWidth)); }
1019 if (_desiredHeight != null) { _outputVisualMap.Add(ImageVisualProperty.DesiredHeight, new PropertyValue((int)_desiredHeight)); }
1020 if (_synchronousLoading != null) { _outputVisualMap.Add(ImageVisualProperty.SynchronousLoading, new PropertyValue((bool)_synchronousLoading)); }
1021 if (_borderOnly != null) { _outputVisualMap.Add(ImageVisualProperty.BorderOnly, new PropertyValue((bool)_borderOnly)); }
1022 if (_pixelArea != null) { _outputVisualMap.Add(ImageVisualProperty.PixelArea, new PropertyValue(_pixelArea)); }
1023 if (_wrapModeU != null) { _outputVisualMap.Add(ImageVisualProperty.WrapModeU, new PropertyValue((int)_wrapModeU)); }
1024 if (_wrapModeV != null) { _outputVisualMap.Add(ImageVisualProperty.WrapModeV, new PropertyValue((int)_wrapModeV)); }
1025 if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
1026 if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
1027 if (_mixColor != null) { _outputVisualMap.Add((int)Visual.Property.MixColor, new PropertyValue(_mixColor)); }
1028 if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
1029 if (_maskContentScale != null) { _outputVisualMap.Add((int)ImageVisualProperty.MaskContentScale, new PropertyValue((float)_maskContentScale)); }
1030 if (_cropToMask != null) { _outputVisualMap.Add((int)ImageVisualProperty.CropToMask, new PropertyValue((bool)_cropToMask)); }
1031 if (_auxiliaryImageAlpha != null) { _outputVisualMap.Add((int)ImageVisualProperty.AuxiliaryImageAlpha, new PropertyValue((float)_auxiliaryImageAlpha)); }
1032 if (_releasePolicy != null) { _outputVisualMap.Add( ImageVisualProperty.ReleasePolicy , new PropertyValue((int)_releasePolicy)); }
1033 if (_loadPolicy != null) { _outputVisualMap.Add( ImageVisualProperty.LoadPolicy, new PropertyValue((int)_loadPolicy)); }
1034 if (_orientationCorrection != null) { _outputVisualMap.Add( ImageVisualProperty.OrientationCorrection, new PropertyValue((bool)_orientationCorrection)); }
1040 /// A class encapsulating the property map of the text visual.
1042 /// <since_tizen> 3 </since_tizen>
1043 public class TextVisual : VisualMap
1048 /// <since_tizen> 3 </since_tizen>
1049 public TextVisual() : base()
1053 private string _text = null;
1054 private string _fontFamily = null;
1055 private PropertyMap _fontStyle = null;
1056 private float? _pointSize = null;
1057 private bool? _multiLine = null;
1058 private string _horizontalAlignment = null;
1059 private string _verticalAlignment = null;
1060 private Color _textColor = null;
1061 private bool? _enableMarkup = null;
1064 /// Gets or sets the text to display in the UTF-8 format.<br />
1067 /// <since_tizen> 3 </since_tizen>
1082 /// Gets or sets the requested font family to use.<br />
1085 /// <since_tizen> 3 </since_tizen>
1086 public string FontFamily
1094 _fontFamily = value;
1100 /// Gets or sets the requested font style to use.<br />
1103 /// <since_tizen> 3 </since_tizen>
1104 public PropertyMap FontStyle
1118 /// Gets or sets the size of font in points.<br />
1121 /// <since_tizen> 3 </since_tizen>
1122 public float PointSize
1126 return _pointSize ?? (0.0f);
1136 /// Gets or sets the single-line or multi-line layout option.<br />
1137 /// If not specified, the default is false.<br />
1140 /// <since_tizen> 3 </since_tizen>
1141 public bool MultiLine
1145 return _multiLine ?? (false);
1155 /// Gets or sets the line horizontal alignment.<br />
1156 /// If not specified, the default is begin.<br />
1159 /// <since_tizen> 3 </since_tizen>
1160 public HorizontalAlignment HorizontalAlignment
1164 switch (_horizontalAlignment)
1167 return HorizontalAlignment.Begin;
1169 return HorizontalAlignment.Center;
1171 return HorizontalAlignment.End;
1173 return HorizontalAlignment.Begin;
1180 case HorizontalAlignment.Begin:
1182 _horizontalAlignment = "BEGIN";
1185 case HorizontalAlignment.Center:
1187 _horizontalAlignment = "CENTER";
1190 case HorizontalAlignment.End:
1192 _horizontalAlignment = "END";
1197 _horizontalAlignment = "BEGIN";
1206 /// Gets or sets the line vertical alignment.<br />
1207 /// If not specified, the default is top.<br />
1210 /// <since_tizen> 3 </since_tizen>
1211 public VerticalAlignment VerticalAlignment
1215 switch (_verticalAlignment)
1218 return VerticalAlignment.Top;
1220 return VerticalAlignment.Center;
1222 return VerticalAlignment.Bottom;
1224 return VerticalAlignment.Top;
1231 case VerticalAlignment.Top:
1233 _verticalAlignment = "TOP";
1236 case VerticalAlignment.Center:
1238 _verticalAlignment = "CENTER";
1241 case VerticalAlignment.Bottom:
1243 _verticalAlignment = "BOTTOM";
1248 _verticalAlignment = "TOP";
1257 /// Gets or sets the color of the text.<br />
1260 /// <since_tizen> 3 </since_tizen>
1261 public Color TextColor
1275 /// Gets or sets whether the mark-up processing is enabled.<br />
1278 /// <since_tizen> 3 </since_tizen>
1279 public bool EnableMarkup
1283 return _enableMarkup ?? (false);
1287 _enableMarkup = value;
1293 /// Compose the out visual map.
1295 /// <since_tizen> 3 </since_tizen>
1296 protected override void ComposingPropertyMap()
1298 if (_text != null && _pointSize != null)
1300 _outputVisualMap = new PropertyMap();
1301 _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Text));
1302 _outputVisualMap.Add(TextVisualProperty.Text, new PropertyValue(_text));
1303 _outputVisualMap.Add(TextVisualProperty.PointSize, new PropertyValue((float)_pointSize));
1304 if (_fontFamily != null) { _outputVisualMap.Add(TextVisualProperty.FontFamily, new PropertyValue(_fontFamily)); }
1305 if (_fontStyle != null) { _outputVisualMap.Add(TextVisualProperty.FontStyle, new PropertyValue(_fontStyle)); }
1306 if (_multiLine != null) { _outputVisualMap.Add(TextVisualProperty.MultiLine, new PropertyValue((bool)_multiLine)); }
1307 if (_horizontalAlignment != null) { _outputVisualMap.Add(TextVisualProperty.HorizontalAlignment, new PropertyValue(_horizontalAlignment)); }
1308 if (_verticalAlignment != null) { _outputVisualMap.Add(TextVisualProperty.VerticalAlignment, new PropertyValue(_verticalAlignment)); }
1309 if (_textColor != null) { _outputVisualMap.Add(TextVisualProperty.TextColor, new PropertyValue(_textColor)); }
1310 if (_enableMarkup != null) { _outputVisualMap.Add(TextVisualProperty.EnableMarkup, new PropertyValue((bool)_enableMarkup)); }
1311 if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
1312 if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
1313 if (_mixColor != null) { _outputVisualMap.Add((int)Visual.Property.MixColor, new PropertyValue(_mixColor)); }
1314 if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
1320 /// A class encapsulating the property map of the border visual.
1322 /// <since_tizen> 3 </since_tizen>
1323 public class BorderVisual : VisualMap
1328 /// <since_tizen> 3 </since_tizen>
1329 public BorderVisual() : base()
1333 private Color _color = null;
1334 private float? _size = null;
1335 private bool? _antiAliasing = null;
1338 /// Gets or sets the color of the border.<br />
1341 /// <since_tizen> 3 </since_tizen>
1356 /// Gets or sets the width of the border (in pixels).<br />
1359 /// <since_tizen> 3 </since_tizen>
1360 public float BorderSize
1364 return _size ?? (-1.0f);
1374 /// Gets or sets whether the anti-aliasing of the border is required.<br />
1375 /// If not supplied, the default is false.<br />
1378 /// <since_tizen> 3 </since_tizen>
1379 public bool AntiAliasing
1383 return _antiAliasing ?? (false);
1387 _antiAliasing = value;
1393 /// Compose the out visual map.
1395 /// <since_tizen> 3 </since_tizen>
1396 protected override void ComposingPropertyMap()
1398 if (_color != null && _size != null)
1400 _outputVisualMap = new PropertyMap();
1401 _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Border));
1402 _outputVisualMap.Add(BorderVisualProperty.Size, new PropertyValue((float)_size));
1403 _outputVisualMap.Add(BorderVisualProperty.Color, new PropertyValue(_color));
1404 if (_antiAliasing != null) { _outputVisualMap.Add(BorderVisualProperty.AntiAliasing, new PropertyValue((bool)_antiAliasing)); }
1405 if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
1406 if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
1407 if (_mixColor != null) { _outputVisualMap.Add((int)Visual.Property.MixColor, new PropertyValue(_mixColor)); }
1408 if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
1414 /// A class encapsulating the property map of the color visual.
1416 /// <since_tizen> 3 </since_tizen>
1417 public class ColorVisual : VisualMap
1422 /// <since_tizen> 3 </since_tizen>
1423 public ColorVisual() : base()
1427 private Color _mixColorForColorVisual = null;
1430 /// Gets or sets the solid color required.<br />
1433 /// <since_tizen> 3 </since_tizen>
1438 return _mixColorForColorVisual;
1442 _mixColorForColorVisual = value;
1448 /// Compose the out visual map.
1450 /// <since_tizen> 3 </since_tizen>
1451 protected override void ComposingPropertyMap()
1453 if (_mixColorForColorVisual != null)
1455 _outputVisualMap = new PropertyMap();
1456 _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Color));
1457 _outputVisualMap.Add(ColorVisualProperty.MixColor, new PropertyValue(_mixColorForColorVisual));
1458 if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
1459 if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
1460 if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
1466 /// A class encapsulating the property map of the gradient visual.
1468 /// <since_tizen> 3 </since_tizen>
1469 public class GradientVisual : VisualMap
1474 /// <since_tizen> 3 </since_tizen>
1475 public GradientVisual() : base()
1479 private Vector2 _startPosition = null;
1480 private Vector2 _endPosition = null;
1481 private Vector2 _center = null;
1482 private float? _radius = null;
1483 private PropertyArray _stopOffset = null;
1484 private PropertyArray _stopColor = null;
1485 private GradientVisualUnitsType? _units = null;
1486 private GradientVisualSpreadMethodType? _spreadMethod = null;
1489 /// Gets or sets the start position of a linear gradient.<br />
1490 /// Mandatory for linear.<br />
1492 /// <since_tizen> 3 </since_tizen>
1493 public Vector2 StartPosition
1497 return _startPosition;
1501 _startPosition = value;
1507 /// Gets or sets the end position of a linear gradient.<br />
1508 /// Mandatory for linear.<br />
1510 /// <since_tizen> 3 </since_tizen>
1511 public Vector2 EndPosition
1515 return _endPosition;
1519 _endPosition = value;
1525 /// Gets or sets the center point of a radial gradient.<br />
1526 /// Mandatory for radial.<br />
1528 /// <since_tizen> 3 </since_tizen>
1529 public Vector2 Center
1543 /// Gets or sets the size of the radius of a radial gradient.<br />
1544 /// Mandatory for radial.<br />
1546 /// <since_tizen> 3 </since_tizen>
1551 return _radius ?? (-1.0f);
1561 /// Gets or sets all the stop offsets.<br />
1562 /// A PropertyArray of float.<br />
1563 /// If not supplied, the default is 0.0f and 1.0f.<br />
1566 /// <since_tizen> 3 </since_tizen>
1567 public PropertyArray StopOffset
1575 _stopOffset = value;
1581 /// Gets or sets the color at the stop offsets.<br />
1582 /// A PropertyArray of color.<br />
1583 /// At least 2 values are required to show a gradient.<br />
1586 /// <since_tizen> 3 </since_tizen>
1587 public PropertyArray StopColor
1601 /// Gets or sets descriptions of the coordinate system for certain attributes of the points in a gradient.<br />
1602 /// If not supplied, the default is GradientVisualUnitsType.ObjectBoundingBox.<br />
1605 /// <since_tizen> 3 </since_tizen>
1606 public GradientVisualUnitsType Units
1610 return _units ?? (GradientVisualUnitsType.ObjectBoundingBox);
1620 /// Gets or sets indications of what happens if the gradient starts or ends inside the bounds of the target rectangle.<br />
1621 /// If not supplied, the default is GradientVisualSpreadMethodType.Pad.<br />
1624 /// <since_tizen> 3 </since_tizen>
1625 public GradientVisualSpreadMethodType SpreadMethod
1629 return _spreadMethod ?? (GradientVisualSpreadMethodType.Pad);
1633 _spreadMethod = value;
1639 /// Compose the out visual map.
1641 /// <since_tizen> 3 </since_tizen>
1642 protected override void ComposingPropertyMap()
1644 if (((_startPosition != null && _endPosition != null) || (_center != null && _radius != null)) && _stopColor != null)
1646 _outputVisualMap = new PropertyMap();
1647 _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Gradient));
1648 _outputVisualMap.Add(GradientVisualProperty.StopColor, new PropertyValue(_stopColor));
1649 if (_startPosition != null) { _outputVisualMap.Add(GradientVisualProperty.StartPosition, new PropertyValue(_startPosition)); }
1650 if (_endPosition != null) { _outputVisualMap.Add(GradientVisualProperty.EndPosition, new PropertyValue(_endPosition)); }
1651 if (_center != null) { _outputVisualMap.Add(GradientVisualProperty.Center, new PropertyValue(_center)); }
1652 if (_radius != null) { _outputVisualMap.Add(GradientVisualProperty.Radius, new PropertyValue((float)_radius)); }
1653 if (_stopOffset != null) { _outputVisualMap.Add(GradientVisualProperty.StopOffset, new PropertyValue(_stopOffset)); }
1654 if (_units != null) { _outputVisualMap.Add(GradientVisualProperty.Units, new PropertyValue((int)_units)); }
1655 if (_spreadMethod != null) { _outputVisualMap.Add(GradientVisualProperty.SpreadMethod, new PropertyValue((int)_spreadMethod)); }
1656 if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
1657 if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
1658 if (_mixColor != null) { _outputVisualMap.Add((int)Visual.Property.MixColor, new PropertyValue(_mixColor)); }
1659 if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
1665 /// A class encapsulating the property map of the mesh visual.
1667 /// <since_tizen> 3 </since_tizen>
1668 public class MeshVisual : VisualMap
1673 /// <since_tizen> 3 </since_tizen>
1674 public MeshVisual() : base()
1678 private string _objectURL = null;
1679 private string _materialtURL = null;
1680 private string _texturesPath = null;
1681 private MeshVisualShadingModeValue? _shadingMode = null;
1682 private bool? _useMipmapping = null;
1683 private bool? _useSoftNormals = null;
1684 private Vector3 _lightPosition = null;
1687 /// Gets or sets the location of the ".obj" file.<br />
1690 /// <since_tizen> 3 </since_tizen>
1691 public string ObjectURL
1705 /// Gets or sets the location of the ".mtl" file.<br />
1706 /// If not specified, then a textureless object is assumed.<br />
1709 /// <since_tizen> 3 </since_tizen>
1710 public string MaterialtURL
1714 return _materialtURL;
1718 _materialtURL = value;
1724 /// Gets or sets the path to the directory the textures (including gloss and normal) are stored in.<br />
1725 /// Mandatory if using material.<br />
1727 /// <since_tizen> 3 </since_tizen>
1728 public string TexturesPath
1732 return _texturesPath;
1736 _texturesPath = value;
1742 /// Gets or sets the type of shading mode that the mesh will use.<br />
1743 /// If anything the specified shading mode requires is missing, a simpler mode that can be handled with what has been supplied will be used instead.<br />
1744 /// If not specified, it will use the best it can support (will try MeshVisualShadingModeValue.TexturedWithDetailedSpecularLighting first).<br />
1747 /// <since_tizen> 3 </since_tizen>
1748 public MeshVisualShadingModeValue ShadingMode
1752 return _shadingMode ?? (MeshVisualShadingModeValue.TexturedWithDetailedSpecularLighting);
1756 _shadingMode = value;
1762 /// Gets or sets whether to use mipmaps for textures or not.<br />
1763 /// If not specified, the default is true.<br />
1766 /// <since_tizen> 3 </since_tizen>
1767 public bool UseMipmapping
1771 return _useMipmapping ?? (true);
1775 _useMipmapping = value;
1781 /// Gets or sets whether to average normals at each point to smooth textures or not.<br />
1782 /// If not specified, the default is true.<br />
1785 /// <since_tizen> 3 </since_tizen>
1786 public bool UseSoftNormals
1790 return _useSoftNormals ?? (true);
1794 _useSoftNormals = value;
1800 /// Gets or sets the position, in the stage space, of the point light that applies lighting to the model.<br />
1801 /// This is based off the stage's dimensions, so using the width and the height of the stage halved will correspond to the center,
1802 /// and using all zeroes will place the light at the top-left corner.<br />
1803 /// If not specified, the default is an offset outwards from the center of the screen.<br />
1806 /// <since_tizen> 3 </since_tizen>
1807 public Vector3 LightPosition
1811 return _lightPosition;
1815 _lightPosition = value;
1821 /// Compose the out visual map.
1823 /// <since_tizen> 3 </since_tizen>
1824 protected override void ComposingPropertyMap()
1826 if (_objectURL != null)
1828 _outputVisualMap = new PropertyMap();
1829 _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Mesh));
1830 _outputVisualMap.Add(MeshVisualProperty.ObjectURL, new PropertyValue(_objectURL));
1831 if (_materialtURL != null) { _outputVisualMap.Add(MeshVisualProperty.MaterialtURL, new PropertyValue(_materialtURL)); }
1832 if (_texturesPath != null) { _outputVisualMap.Add(MeshVisualProperty.TexturesPath, new PropertyValue(_texturesPath)); }
1833 if (_shadingMode != null) { _outputVisualMap.Add(MeshVisualProperty.ShadingMode, new PropertyValue((int)_shadingMode)); }
1834 if (_useMipmapping != null) { _outputVisualMap.Add(MeshVisualProperty.UseMipmapping, new PropertyValue((bool)_useMipmapping)); }
1835 if (_useSoftNormals != null) { _outputVisualMap.Add(MeshVisualProperty.UseSoftNormals, new PropertyValue((bool)_useSoftNormals)); }
1836 if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
1837 if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
1838 if (_mixColor != null) { _outputVisualMap.Add((int)Visual.Property.MixColor, new PropertyValue(_mixColor)); }
1839 if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
1845 /// A class encapsulating the property map of the primetive visual.
1847 /// <since_tizen> 3 </since_tizen>
1848 public class PrimitiveVisual : VisualMap
1853 /// <since_tizen> 3 </since_tizen>
1854 public PrimitiveVisual() : base()
1858 private PrimitiveVisualShapeType? _shape = null;
1859 private Color _mixColorForPrimitiveVisual = null;
1860 private int? _slices = null;
1861 private int? _stacks = null;
1862 private float? _scaleTopRadius = null;
1863 private float? _scaleBottomRadius = null;
1864 private float? _scaleHeight = null;
1865 private float? _scaleRadius = null;
1866 private Vector3 _scaleDimensions = null;
1867 private float? _bevelPercentage = null;
1868 private float? _bevelSmoothness = null;
1869 private Vector3 _lightPosition = null;
1872 /// Gets or sets the specific shape to render.<br />
1873 /// If not specified, the default is PrimitiveVisualShapeType.Sphere.<br />
1876 /// <since_tizen> 3 </since_tizen>
1877 public PrimitiveVisualShapeType Shape
1881 return _shape ?? (PrimitiveVisualShapeType.Sphere);
1891 /// Gets or sets the color of the shape.<br />
1892 /// If not specified, the default is Color (0.5, 0.5, 0.5, 1.0).<br />
1893 /// Applies to all shapes.<br />
1896 /// <since_tizen> 3 </since_tizen>
1897 public new Color MixColor
1901 return _mixColorForPrimitiveVisual ?? (new Color(0.5f, 0.5f, 0.5f, 1.0f));
1905 _mixColorForPrimitiveVisual = value;
1911 /// Gets or sets the number of slices as you go around the shape.<br />
1912 /// For spheres and conical frustrums, this determines how many divisions there are as you go around the object.<br />
1913 /// If not specified, the default is 128.<br />
1914 /// The range is from 1 to 255.<br />
1917 /// <since_tizen> 3 </since_tizen>
1922 return _slices ?? (128);
1932 /// Gets or sets the number of stacks as you go down the shape.<br />
1933 /// For spheres, 'stacks' determines how many layers there are as you go down the object.<br />
1934 /// If not specified, the default is 128.<br />
1935 /// The range is from 1 to 255.<br />
1938 /// <since_tizen> 3 </since_tizen>
1943 return _stacks ?? (128);
1953 /// Gets or sets the scale of the radius of the top circle of a conical frustrum.<br />
1954 /// If not specified, the default is 1.0f.<br />
1955 /// Applies to: - PrimitiveVisualShapeType.ConicalFrustrum<br />
1956 /// Only values greater than or equal to 0.0f are accepted.<br />
1959 /// <since_tizen> 3 </since_tizen>
1960 public float ScaleTopRadius
1964 return _scaleTopRadius ?? (1.0f);
1968 _scaleTopRadius = value;
1974 /// Gets or sets the scale of the radius of the bottom circle of a conical frustrum.<br />
1975 /// If not specified, the default is 1.5f.<br />
1976 /// Applies to: - PrimitiveVisualShapeType.ConicalFrustrum<br />
1977 /// - PrimitiveVisualShapeType.Cone<br />
1978 /// Only values greater than or equal to 0.0f are accepted.<br />
1981 /// <since_tizen> 3 </since_tizen>
1982 public float ScaleBottomRadius
1986 return _scaleBottomRadius ?? (1.5f);
1990 _scaleBottomRadius = value;
1996 /// Gets or sets the scale of the height of a conic.<br />
1997 /// If not specified, the default is 3.0f.<br />
1998 /// Applies to:<br />
1999 /// - PrimitiveVisualShapeType.ConicalFrustrum<br />
2000 /// - PrimitiveVisualShapeType.Cone<br />
2001 /// - PrimitiveVisualShapeType.Cylinder<br />
2002 /// Only values greater than or equal to 0.0f are accepted.<br />
2005 /// <since_tizen> 3 </since_tizen>
2006 public float ScaleHeight
2010 return _scaleHeight ?? (3.0f);
2014 _scaleHeight = value;
2020 /// Gets or sets the scale of the radius of a cylinder.<br />
2021 /// If not specified, the default is 1.0f.<br />
2022 /// Applies to:<br />
2023 /// - PrimitiveVisualShapeType.Cylinder<br />
2024 /// Only values greater than or equal to 0.0f are accepted.<br />
2027 /// <since_tizen> 3 </since_tizen>
2028 public float ScaleRadius
2032 return _scaleRadius ?? (1.0f);
2036 _scaleRadius = value;
2042 /// Gets or sets the dimensions of a cuboid. Scales in the same fashion as a 9-patch image.<br />
2043 /// If not specified, the default is Vector3.One.<br />
2044 /// Applies to:<br />
2045 /// - PrimitiveVisualShapeType.Cube<br />
2046 /// - PrimitiveVisualShapeType.Octahedron<br />
2047 /// - PrimitiveVisualShapeType.BevelledCube<br />
2048 /// Each Vector3 parameter should be greater than or equal to 0.0f.<br />
2051 /// <since_tizen> 3 </since_tizen>
2052 public Vector3 ScaleDimensions
2056 return _scaleDimensions ?? (Vector3.One);
2060 _scaleDimensions = value;
2066 /// Gets or sets determines how bevelled the cuboid should be, based off the smallest dimension.<br />
2067 /// Bevel percentage ranges from 0.0 to 1.0. It affects the ratio of the outer face widths to the width of the overall cube.<br />
2068 /// If not specified, the default is 0.0f (no bevel).<br />
2069 /// Applies to:<br />
2070 /// - PrimitiveVisualShapeType.BevelledCube<br />
2071 /// The range is from 0.0f to 1.0f.<br />
2074 /// <since_tizen> 3 </since_tizen>
2075 public float BevelPercentage
2079 return _bevelPercentage ?? (0.0f);
2083 _bevelPercentage = value;
2089 /// Gets or sets descriptions of how smooth the bevelled edges should be.<br />
2090 /// If not specified, the default is 0.0f (sharp edges).<br />
2091 /// Applies to:<br />
2092 /// - PrimitiveVisualShapeType.BevelledCube<br />
2093 /// The range is from 0.0f to 1.0f.<br />
2096 /// <since_tizen> 3 </since_tizen>
2097 public float BevelSmoothness
2101 return _bevelSmoothness ?? (0.0f);
2105 _bevelSmoothness = value;
2111 /// Gets or sets the position, in the stage space, of the point light that applies lighting to the model.<br />
2112 /// This is based off the stage's dimensions, so using the width and the height of the stage halved will correspond to the center,
2113 /// and using all zeroes will place the light at the top-left corner.<br />
2114 /// If not specified, the default is an offset outwards from the center of the screen.<br />
2115 /// Applies to all shapes.<br />
2118 /// <since_tizen> 3 </since_tizen>
2119 public Vector3 LightPosition
2123 return _lightPosition;
2127 _lightPosition = value;
2133 /// Compose the out visual map.
2135 /// <since_tizen> 3 </since_tizen>
2136 protected override void ComposingPropertyMap()
2138 _outputVisualMap = new PropertyMap(); ;
2139 _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Primitive));
2140 if (_shape != null) { _outputVisualMap.Add(PrimitiveVisualProperty.Shape, new PropertyValue((int)_shape)); }
2141 if (_mixColorForPrimitiveVisual != null) { _outputVisualMap.Add(PrimitiveVisualProperty.MixColor, new PropertyValue(_mixColorForPrimitiveVisual)); }
2142 if (_slices != null) { _outputVisualMap.Add(PrimitiveVisualProperty.Slices, new PropertyValue((int)_slices)); }
2143 if (_stacks != null) { _outputVisualMap.Add(PrimitiveVisualProperty.Stacks, new PropertyValue((int)_stacks)); }
2144 if (_scaleTopRadius != null) { _outputVisualMap.Add(PrimitiveVisualProperty.ScaleTopRadius, new PropertyValue((float)_scaleTopRadius)); }
2145 if (_scaleBottomRadius != null) { _outputVisualMap.Add(PrimitiveVisualProperty.ScaleBottomRadius, new PropertyValue((float)_scaleBottomRadius)); }
2146 if (_scaleHeight != null) { _outputVisualMap.Add(PrimitiveVisualProperty.ScaleHeight, new PropertyValue((float)_scaleHeight)); }
2147 if (_scaleRadius != null) { _outputVisualMap.Add(PrimitiveVisualProperty.ScaleRadius, new PropertyValue((float)_scaleRadius)); }
2148 if (_scaleDimensions != null) { _outputVisualMap.Add(PrimitiveVisualProperty.ScaleDimensions, new PropertyValue(_scaleDimensions)); }
2149 if (_bevelPercentage != null) { _outputVisualMap.Add(PrimitiveVisualProperty.BevelPercentage, new PropertyValue((float)_bevelPercentage)); }
2150 if (_bevelSmoothness != null) { _outputVisualMap.Add(PrimitiveVisualProperty.BevelSmoothness, new PropertyValue((float)_bevelSmoothness)); }
2151 if (_lightPosition != null) { _outputVisualMap.Add(PrimitiveVisualProperty.LightPosition, new PropertyValue(_lightPosition)); }
2152 if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
2153 if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
2154 if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
2159 /// A class encapsulating the property map of the n-patch image visual.
2161 /// <since_tizen> 3 </since_tizen>
2162 public class NPatchVisual : VisualMap
2167 /// <since_tizen> 3 </since_tizen>
2168 public NPatchVisual() : base()
2172 private string _url = null;
2173 private bool? _borderOnly = null;
2174 private Rectangle _border = null;
2177 /// Gets or sets the URL of the image.<br />
2180 /// <since_tizen> 3 </since_tizen>
2195 /// Gets or sets whether to draw the borders only (If true).<br />
2196 /// If not specified, the default is false.<br />
2197 /// For n-patch images only.<br />
2200 /// <since_tizen> 3 </since_tizen>
2201 public bool BorderOnly
2205 return _borderOnly ?? false;
2209 _borderOnly = value;
2215 /// The border of the image is in the order: left, right, bottom, top.<br />
2216 /// For n-patch images only.<br />
2219 /// <since_tizen> 3 </since_tizen>
2220 public Rectangle Border
2234 /// Compose the out visual map.
2236 /// <since_tizen> 3 </since_tizen>
2237 protected override void ComposingPropertyMap()
2241 _outputVisualMap = new PropertyMap();
2242 _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.NPatch));
2243 _outputVisualMap.Add(NpatchImageVisualProperty.URL, new PropertyValue(_url));
2244 if (_borderOnly != null) { _outputVisualMap.Add(NpatchImageVisualProperty.BorderOnly, new PropertyValue((bool)_borderOnly)); }
2245 if (_border != null) { _outputVisualMap.Add(NpatchImageVisualProperty.Border, new PropertyValue(_border)); }
2246 if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
2247 if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
2248 if (_mixColor != null) { _outputVisualMap.Add((int)Visual.Property.MixColor, new PropertyValue(_mixColor)); }
2249 if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
2255 /// A class encapsulating the property map of the SVG visual.
2257 /// <since_tizen> 3 </since_tizen>
2258 public class SVGVisual : VisualMap
2263 /// <since_tizen> 3 </since_tizen>
2264 public SVGVisual() : base()
2268 private string _url = null;
2271 /// The url of the svg resource.
2273 /// <since_tizen> 3 </since_tizen>
2288 /// Compose the out visual map.
2290 /// <since_tizen> 3 </since_tizen>
2291 protected override void ComposingPropertyMap()
2295 _outputVisualMap = new PropertyMap();
2296 _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.SVG));
2297 _outputVisualMap.Add(ImageVisualProperty.URL, new PropertyValue(_url));
2298 if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
2299 if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
2300 if (_mixColor != null) { _outputVisualMap.Add((int)Visual.Property.MixColor, new PropertyValue(_mixColor)); }
2301 if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
2307 /// A class encapsulating the property map of the animated image (AGIF) visual.
2309 /// <since_tizen> 3 </since_tizen>
2310 public class AnimatedImageVisual : VisualMap
2315 /// <since_tizen> 3 </since_tizen>
2316 public AnimatedImageVisual() : base()
2320 private List<string> _urls = null;
2321 private int? _batchSize = null;
2322 private int? _cacheSize = null;
2323 private float? _frameDelay = null;
2326 /// Gets and Sets the url in the AnimatedImageVisual.
2328 /// <since_tizen> 3 </since_tizen>
2346 _urls = new List<string>();
2358 /// Gets and Sets the url list in the AnimatedImageVisual.
2360 /// <since_tizen> 4 </since_tizen>
2361 public List<string> URLS
2375 /// Gets and Sets the batch size for pre-loading images in the AnimatedImageVisual.
2377 /// <since_tizen> 4 </since_tizen>
2378 public int BatchSize
2382 return _batchSize ?? 1;
2392 /// Gets and Sets the cache size for loading images in the AnimatedImageVisual.
2394 /// <since_tizen> 4 </since_tizen>
2395 public int CacheSize
2399 return _cacheSize ?? 1;
2409 /// Gets and Sets The number of milliseconds between each frame in the AnimatedImageVisual.
2411 /// <since_tizen> 4 </since_tizen>
2412 public float FrameDelay
2416 return _frameDelay ?? 0.1f;
2420 _frameDelay = value;
2426 /// Compose the out visual map.
2428 /// <since_tizen> 3 </since_tizen>
2429 protected override void ComposingPropertyMap()
2433 _outputVisualMap = new PropertyMap();
2434 _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.AnimatedImage));
2435 if( _urls.Count == 1 )
2437 _outputVisualMap.Add(ImageVisualProperty.URL, new PropertyValue(_urls[0]));
2441 var urlArray = new PropertyArray();
2442 foreach( var url in _urls)
2444 urlArray.Add(new PropertyValue(url));
2446 _outputVisualMap.Add( ImageVisualProperty.URL, ( new PropertyValue( urlArray ) ) );
2448 if (_batchSize != null ) {_outputVisualMap.Add((int)ImageVisualProperty.BatchSize, new PropertyValue((int)_batchSize)); }
2449 if (_cacheSize != null ) {_outputVisualMap.Add((int)ImageVisualProperty.CacheSize, new PropertyValue((int)_cacheSize)); }
2450 if (_frameDelay != null ) {_outputVisualMap.Add((int)ImageVisualProperty.FrameDelay, new PropertyValue((float)_frameDelay)); }
2451 if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
2452 if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
2453 if (_mixColor != null) { _outputVisualMap.Add((int)Visual.Property.MixColor, new PropertyValue(_mixColor)); }
2454 if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
2460 //temporary fix for TCT
2462 /// A class encapsulating the property map of the transition data.
2464 /// <since_tizen> 3 </since_tizen>
2465 public class VisualAnimator : VisualMap
2468 /// Create VisualAnimator object.
2470 /// <since_tizen> 3 </since_tizen>
2471 public VisualAnimator() : base()
2475 private string _alphaFunction = null;
2476 private int _startTime = 0;
2477 private int _endTime = 0;
2478 private string _target = null;
2479 private string _propertyIndex = null;
2480 private object _destinationValue = null;
2483 /// Sets and Gets the AlphaFunction of this transition.
2485 /// <since_tizen> 3 </since_tizen>
2486 public AlphaFunction.BuiltinFunctions AlphaFunction
2490 switch (_alphaFunction)
2493 return Tizen.NUI.AlphaFunction.BuiltinFunctions.Linear;
2495 return Tizen.NUI.AlphaFunction.BuiltinFunctions.Reverse;
2496 case "EASE_IN_SQUARE":
2497 return Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseInSquare;
2498 case "EASE_OUT_SQUARE":
2499 return Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseOutSquare;
2501 return Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseIn;
2503 return Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseOut;
2505 return Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseInOut;
2506 case "EASE_IN_SINE":
2507 return Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseInSine;
2508 case "EASE_OUT_SINE":
2509 return Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseOutSine;
2510 case "EASE_IN_OUT_SINE":
2511 return Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseInOutSine;
2513 return Tizen.NUI.AlphaFunction.BuiltinFunctions.Bounce;
2515 return Tizen.NUI.AlphaFunction.BuiltinFunctions.Sin;
2516 case "EASE_OUT_BACK":
2517 return Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseOutBack;
2519 return Tizen.NUI.AlphaFunction.BuiltinFunctions.Default;
2526 case Tizen.NUI.AlphaFunction.BuiltinFunctions.Linear:
2528 _alphaFunction = "LINEAR";
2531 case Tizen.NUI.AlphaFunction.BuiltinFunctions.Reverse:
2533 _alphaFunction = "REVERSE";
2536 case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseInSquare:
2538 _alphaFunction = "EASE_IN_SQUARE";
2541 case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseOutSquare:
2543 _alphaFunction = "EASE_OUT_SQUARE";
2546 case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseIn:
2548 _alphaFunction = "EASE_IN";
2551 case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseOut:
2553 _alphaFunction = "EASE_OUT";
2556 case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseInOut:
2558 _alphaFunction = "EASE_IN_OUT";
2561 case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseInSine:
2563 _alphaFunction = "EASE_IN_SINE";
2566 case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseOutSine:
2568 _alphaFunction = "EASE_OUT_SINE";
2571 case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseInOutSine:
2573 _alphaFunction = "EASE_IN_OUT_SINE";
2576 case Tizen.NUI.AlphaFunction.BuiltinFunctions.Bounce:
2578 _alphaFunction = "BOUNCE";
2581 case Tizen.NUI.AlphaFunction.BuiltinFunctions.Sin:
2583 _alphaFunction = "SIN";
2586 case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseOutBack:
2588 _alphaFunction = "EASE_OUT_BACK";
2593 _alphaFunction = "DEFAULT";
2601 /// Sets and Gets the StartTime of this transition.
2603 /// <since_tizen> 3 </since_tizen>
2604 public int StartTime
2617 /// Sets and Gets the EndTime of this transition.
2619 /// <since_tizen> 3 </since_tizen>
2633 /// Sets and Gets the Target of this transition.
2635 /// <since_tizen> 3 </since_tizen>
2636 public string Target
2649 /// Sets and Gets the PropertyIndex of this transition.
2651 /// <since_tizen> 3 </since_tizen>
2652 public string PropertyIndex
2656 return _propertyIndex;
2660 _propertyIndex = value;
2665 /// Sets and Gets the DestinationValue of this transition.
2667 /// <since_tizen> 3 </since_tizen>
2668 public object DestinationValue
2672 return _destinationValue;
2676 _destinationValue = value;
2681 /// Compose the out visual map.
2683 /// <since_tizen> 3 </since_tizen>
2684 protected override void ComposingPropertyMap()
2686 PropertyMap _animator = new PropertyMap();
2687 _animator.Add("alphaFunction", new PropertyValue(_alphaFunction));
2689 PropertyMap _timePeriod = new PropertyMap();
2690 _timePeriod.Add("duration", new PropertyValue((_endTime - _startTime) / 1000.0f));
2691 _timePeriod.Add("delay", new PropertyValue(_startTime / 1000.0f));
2692 _animator.Add("timePeriod", new PropertyValue(_timePeriod));
2694 StringBuilder sb = new StringBuilder(_propertyIndex);
2695 sb[0] = (char)(sb[0] | 0x20);
2696 string _str = sb.ToString();
2698 PropertyValue val = PropertyValue.CreateFromObject(_destinationValue);
2700 PropertyMap _transition = new PropertyMap();
2701 _transition.Add("target", new PropertyValue(_target));
2702 _transition.Add("property", new PropertyValue(_str));
2703 _transition.Add("targetValue", val);
2704 _transition.Add("animator", new PropertyValue(_animator));
2706 _outputVisualMap = _transition;
2709 //temporary fix for TCT