-// Copyright (c) 2017 Samsung Electronics Co., Ltd.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
+/*
+ * Copyright(c) 2018 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+using System.Text;
+using System.Collections.Generic;
+using Tizen.NUI.BaseComponents;
+using System.ComponentModel;
namespace Tizen.NUI
{
- using System.Collections.Generic;
- using Tizen.NUI.BaseComponents;
-
/// <summary>
- /// A class encapsulating the transform map of visual.
+ /// A class encapsulating the transform map of the visual.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public class VisualMap
{
+ /// <summary>
+ /// outputVisualMap.
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
+ protected PropertyMap _outputVisualMap = null;
+
+ /// <summary>
+ /// The shader of the visual.
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
+ protected PropertyMap _shader = null;
+ //private PropertyMap _transform = null;
+
+ /// <summary>
+ /// The premultipliedAlpha of the visual.
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
+ protected bool? _premultipliedAlpha = null;
+
+ /// <summary>
+ /// The mixColor of the Visual.
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
+ protected Color _mixColor = null;
+
+ /// <summary>
+ /// The opacity of the visual.
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
+ protected float? _opacity = null;
+
+ /// <summary>
+ /// The FittingMode of the visual.
+ /// </summary>
+ /// <since_tizen> 5 </since_tizen>
+ protected VisualFittingModeType? _visualFittingMode = null;
+
+ /// <summary>
+ /// The map for visual.
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
+ protected PropertyMap _commonlyUsedMap = null;
+
private Vector2 _visualSize = null;
private Vector2 _visualOffset = null;
private Vector2 _visualOffsetPolicy = null;
private PropertyMap _visualTransformMap = null;
private int? _depthIndex = null;
- protected PropertyMap _outputVisualMap = null;
-
- internal string Name
- {
- set;
- get;
- }
-
- internal int VisualIndex
- {
- set;
- get;
- }
-
- internal VisualView Parent
- {
- set;
- get;
- }
+ /// <summary>
+ /// Constructor.
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
public VisualMap()
{
}
/// <summary>
- /// Get or set size of the visual.<br>
+ /// Gets or sets the size of the visual.<br />
/// It can be either relative (percentage of the parent)
- /// or absolute (in world units).<br>
+ /// or absolute (in world units).<br />
/// Optional.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public Size2D Size
{
get
_visualSize = value;
if (_visualSizePolicy == null)
{
- _visualSizePolicy = new Vector2(0.0f, 0.0f);
+ _visualSizePolicy = new Vector2(1.0f, 1.0f);
}
UpdateVisual();
}
}
/// <summary>
- /// Get or set offset of the visual.<br>
+ /// Gets or sets the offset of the visual.<br />
/// It can be either relative (percentage of the parent)
- /// or absolute (in world units).<br>
+ /// or absolute (in world units).<br />
/// Optional.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public Vector2 Position
{
get
_visualOffset = value;
if (_visualOffsetPolicy == null)
{
- _visualOffsetPolicy = new Vector2(0.0f, 0.0f);
+ _visualOffsetPolicy = new Vector2(1.0f, 1.0f);
}
UpdateVisual();
}
}
/// <summary>
- /// Get or set relative size of the visual<br>
- /// (percentage [0.0f to 1.0f] of the control).<br>
+ /// Gets or sets the relative size of the visual<br />
+ /// (percentage [0.0f to 1.0f] of the control).<br />
/// Optional.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public RelativeVector2 RelativeSize
{
get
}
/// <summary>
- /// Get or set relative offset of the visual<br>
- /// (percentage [0.0f to 1.0f] of the control).<br>
+ /// Gets or sets the relative offset of the visual<br />
+ /// (percentage [0.0f to 1.0f] of the control).<br />
/// Optional.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public RelativeVector2 RelativePosition
{
get
}
/// <summary>
- /// Get or set whether the x and y offset values are relative<br>
- /// (percentage [0.0f to 1.0f] of the control) or absolute (in world units).<br>
- /// Be default, both the x and the y offset is relative.<br>
+ /// Gets or sets whether the x and y offset values are relative<br />
+ /// (percentage [0.0f to 1.0f] of the control) or absolute (in world units).<br />
+ /// By default, both the x and the y offset are relative.<br />
/// Optional.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public VisualTransformPolicyType PositionPolicy
{
get
}
/// <summary>
- /// Get or set whether the x offset values are relative<br>
- /// (percentage [0.0f to 1.0f] of the control) or absolute (in world units).<br>
- /// Be default, the x offset is relative.<br>
+ /// Gets or sets whether the x offset values are relative<br />
+ /// (percentage [0.0f to 1.0f] of the control) or absolute (in world units).<br />
+ /// By default, the x offset is relative.<br />
/// Optional.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public VisualTransformPolicyType PositionPolicyX
{
get
}
/// <summary>
- /// Get or set whether the y offset values are relative<br>
- /// (percentage [0.0f to 1.0f] of the control) or absolute (in world units).<br>
- /// Be default, the y offset is relative.<br>
+ /// Gets or sets whether the y offset values are relative<br />
+ /// (percentage [0.0f to 1.0f] of the control) or absolute (in world units).<br />
+ /// By default, the y offset is relative.<br />
/// Optional.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public VisualTransformPolicyType PositionPolicyY
{
get
}
/// <summary>
- /// Get or set whether the width or height size values are relative<br>
- /// (percentage [0.0f to 1.0f] of the control) or absolute (in world units).<br>
- /// Be default, both the width and the height offset is relative to the control's size.<br>
+ /// Gets or sets whether the size values of the width or the height are relative<br />
+ /// (percentage [0.0f to 1.0f] of the control) or absolute (in world units).<br />
+ /// By default, offsets of both the width and the height are relative to the control's size.<br />
/// Optional.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public VisualTransformPolicyType SizePolicy
{
get
}
/// <summary>
- /// Get or set whether the width size values are relative<br>
- /// (percentage [0.0f to 1.0f] of the control) or absolute (in world units).<br>
- /// Be default, the width value is relative to the control's width.<br>
+ /// Gets or sets whether size values of the width are relative.<br />
+ /// (percentage [0.0f to 1.0f] of the control) or absolute (in world units).<br />
+ /// By default, the value of the width is relative to the control's width.<br />
/// Optional.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public VisualTransformPolicyType SizePolicyWidth
{
get
}
/// <summary>
- /// Get or set whether the height size values are relative<br>
- /// (percentage [0.0f to 1.0f] of the control) or absolute (in world units).<br>
- /// Be default, both the height value is relative to the control's height.<br>
+ /// Gets or sets whether size values of the height are relative<br />
+ /// (percentage [0.0f to 1.0f] of the control) or absolute (in world units).<br />
+ /// By default, the height value is relative to the control's height.<br />
/// Optional.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public VisualTransformPolicyType SizePolicyHeight
{
get
}
/// <summary>
- /// Get or set the origin of the visual within its control area.<br>
- /// By default, the origin is Center.<br>
+ /// Gets or sets the origin of the visual within its control area.<br />
+ /// By default, the origin is center.<br />
/// Optional.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public Visual.AlignType Origin
{
get
}
/// <summary>
- /// Get or set the anchor-point of the visual.<br>
- /// By default, the anchor point is Center.<br>
+ /// Gets or sets the anchor point of the visual.<br />
+ /// By default, the anchor point is center.<br />
/// Optional.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public Visual.AlignType AnchorPoint
{
get
}
/// <summary>
- /// Get or set the depth index of the visual.<br>
- /// By default, the depth index is 0.<br>
+ /// Gets or sets the depth index of the visual.<br />
+ /// By default, the depth index is 0.<br />
/// Optional.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public int DepthIndex
{
get
}
}
- private void ComposingTransformMap()
- {
- _visualTransformMap = new PropertyMap();
- if (_visualSize != null) { _visualTransformMap.Add((int)VisualTransformPropertyType.Size, new PropertyValue(_visualSize)); }
- if (_visualOffset != null) { _visualTransformMap.Add((int)VisualTransformPropertyType.Offset, new PropertyValue(_visualOffset)); }
- if (_visualOffsetPolicy != null) { _visualTransformMap.Add((int)VisualTransformPropertyType.OffsetPolicy, new PropertyValue(_visualOffsetPolicy)); }
- if (_visualSizePolicy != null) { _visualTransformMap.Add((int)VisualTransformPropertyType.SizePolicy, new PropertyValue(_visualSizePolicy)); }
- if (_visualOrigin != null) { _visualTransformMap.Add((int)VisualTransformPropertyType.Origin, new PropertyValue((int)_visualOrigin)); }
- if (_visualAnchorPoint != null) { _visualTransformMap.Add((int)VisualTransformPropertyType.AnchorPoint, new PropertyValue((int)_visualAnchorPoint)); }
- }
-
/// <summary>
- /// Get the transform map used by the visual.
+ /// Gets the transform map used by the visual.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public PropertyMap OutputTransformMap
{
get
}
}
- protected virtual void ComposingPropertyMap()
- {
- _outputVisualMap = new PropertyMap();
- }
-
/// <summary>
- /// Get the property map to create the visual.
+ /// Gets the property map to create the visual.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public PropertyMap OutputVisualMap
{
get
}
}
- internal void UpdateVisual()
- {
- if (VisualIndex > 0)
- {
- NUILog.Debug("UpdateVisual()! VisualIndex=" + VisualIndex);
- Parent.UpdateVisual(VisualIndex, Name, this);
- }
- else
- {
- NUILog.Debug("VisualIndex was not set");
- }
- }
-
- protected PropertyMap _shader = null;
- //private PropertyMap _transform = null;
- protected bool? _premultipliedAlpha = null;
- protected Color _mixColor = null;
- protected float? _opacity = null;
- protected PropertyMap _commonlyUsedMap = null;
/// <summary>
/// The shader to use in the visual.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public PropertyMap Shader
{
get
}
/// <summary>
- /// Enables/disables premultiplied alpha. <br>
- /// The premultiplied alpha is false by default unless this behaviour is modified by the derived Visual type.
+ /// Enables or disables the premultiplied alpha. <br />
+ /// The premultiplied alpha is false by default unless this behavior is modified by the derived visual type.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public bool PremultipliedAlpha
{
get
/// <summary>
/// Mix color is a blend color for any visual.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public Color MixColor
{
get
}
/// <summary>
- /// Opacity is the alpha component of the mixColor, above.
+ /// Opacity is the alpha component of the mix color discussed above.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public float Opacity
{
get
}
}
+ /// <summary>
+ /// The fitting mode of the visual.
+ /// The default is defined by the type of visual (if it is suitable to be stretched or not).
+ /// </summary>
+ /// <since_tizen> 5 </since_tizen>
+ public VisualFittingModeType VisualFittingMode
+ {
+ get
+ {
+ if (_visualFittingMode == null)
+ {
+ if (this is AnimatedImageVisual ||
+ this is MeshVisual ||
+ this is PrimitiveVisual ||
+ this is TextVisual)
+ {
+ return VisualFittingModeType.FitKeepAspectRatio;
+ }
+ else
+ {
+ return VisualFittingModeType.Fill;
+ }
+ }
+ else
+ {
+ return (VisualFittingModeType)_visualFittingMode;
+ }
+ }
+ set
+ {
+ _visualFittingMode = value;
+ UpdateVisual();
+ }
+ }
+
+ internal string Name
+ {
+ set;
+ get;
+ }
+
+ internal int VisualIndex
+ {
+ set;
+ get;
+ }
+
+ internal VisualView Parent
+ {
+ set;
+ get;
+ }
+
+ internal void UpdateVisual()
+ {
+ if (VisualIndex > 0)
+ {
+ NUILog.Debug("UpdateVisual()! VisualIndex=" + VisualIndex);
+ Parent.UpdateVisual(VisualIndex, Name, this);
+ }
+ else
+ {
+ NUILog.Debug("VisualIndex was not set");
+ }
+ }
+
+ /// <summary>
+ /// Compose the out visual map.
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
+ protected virtual void ComposingPropertyMap()
+ {
+ _outputVisualMap = new PropertyMap();
+ }
+
+ private void ComposingTransformMap()
+ {
+ _visualTransformMap = new PropertyMap();
+ if (_visualSize != null) { _visualTransformMap.Add((int)VisualTransformPropertyType.Size, new PropertyValue(_visualSize)); }
+ if (_visualOffset != null) { _visualTransformMap.Add((int)VisualTransformPropertyType.Offset, new PropertyValue(_visualOffset)); }
+ if (_visualOffsetPolicy != null) { _visualTransformMap.Add((int)VisualTransformPropertyType.OffsetPolicy, new PropertyValue(_visualOffsetPolicy)); }
+ if (_visualSizePolicy != null) { _visualTransformMap.Add((int)VisualTransformPropertyType.SizePolicy, new PropertyValue(_visualSizePolicy)); }
+ if (_visualOrigin != null) { _visualTransformMap.Add((int)VisualTransformPropertyType.Origin, new PropertyValue((int)_visualOrigin)); }
+ if (_visualAnchorPoint != null) { _visualTransformMap.Add((int)VisualTransformPropertyType.AnchorPoint, new PropertyValue((int)_visualAnchorPoint)); }
+ }
+
}
/// <summary>
- /// A class encapsulating the property map of a image visual.
+ /// A class encapsulating the property map of the image visual.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public class ImageVisual : VisualMap
{
- public ImageVisual() : base()
- {
- }
-
private string _url = null;
private string _alphaMaskUrl = null;
+ private string _auxiliaryImageUrl = null;
private FittingModeType? _fittingMode = null;
private SamplingModeType? _samplingMode = null;
private int? _desiredWidth = null;
private Vector4 _pixelArea = null;
private WrapModeType? _wrapModeU = null;
private WrapModeType? _wrapModeV = null;
+ private float? _auxiliaryImageAlpha = null;
private float? _maskContentScale = null;
private bool? _cropToMask = null;
+ private ReleasePolicyType? _releasePolicy = null;
+ private LoadPolicyType? _loadPolicy = null;
+ private bool? _orientationCorrection = true;
+ private bool? _atlasing = false;
/// <summary>
- /// Get or set the URL of the image.<br>
- /// Mandatory.
+ /// Constructor.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
+ public ImageVisual() : base()
+ {
+ }
+ /// <summary>
+ /// Gets or sets the URL of the image.<br />
+ /// Mandatory.
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
public string URL
{
get
/// <summary>
- /// Get or set the URL of the alpha mask.<br>
+ /// Gets or sets the URL of the alpha mask.<br />
/// Optional.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public string AlphaMaskURL
{
get
}
/// <summary>
- /// Get or set fitting options, used when resizing images to fit desired dimensions.<br>
- /// If not supplied, default is FittingModeType.ShrinkToFit.<br>
- /// For Normal Quad images only.<br>
+ /// Overlays the auxiliary image on top of an NPatch image.
+ /// The resulting visual image will be at least as large as the smallest possible n-patch or the auxiliary image, whichever is larger.
+ /// </summary>
+ /// <since_tizen> 5 </since_tizen>
+ public string AuxiliaryImageURL
+ {
+ get
+ {
+ return _auxiliaryImageUrl;
+ }
+ set
+ {
+ _auxiliaryImageUrl = value;
+ UpdateVisual();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets fitting options used when resizing images to fit the desired dimensions.<br />
+ /// If not supplied, the default is FittingModeType.ShrinkToFit.<br />
+ /// For normal quad images only.<br />
/// Optional.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public FittingModeType FittingMode
{
get
}
/// <summary>
- /// Get or set filtering options, used when resizing images to sample original pixels.<br>
- /// If not supplied, default is SamplingModeType.Box.<br>
- /// For Normal Quad images only.<br>
+ /// Gets or sets filtering options used when resizing images to the sample original pixels.<br />
+ /// If not supplied, the default is SamplingModeType.Box.<br />
+ /// For normal quad images only.<br />
/// Optional.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public SamplingModeType SamplingMode
{
get
}
/// <summary>
- /// Get or set the desired image width.<br>
- /// If not specified, the actual image width is used.<br>
- /// For Normal Quad images only.<br>
+ /// Gets or sets the desired image width.<br />
+ /// If not specified, the actual image width is used.<br />
+ /// For normal quad images only.<br />
/// Optional.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public int DesiredWidth
{
get
}
/// <summary>
- /// Get or set the desired image height.<br>
- /// If not specified, the actual image height is used.<br>
- /// For Normal Quad images only.<br>
+ /// Gets or sets the desired image height.<br />
+ /// If not specified, the actual image height is used.<br />
+ /// For normal quad images only.<br />
/// Optional.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public int DesiredHeight
{
get
}
/// <summary>
- /// Get or set whether to load the image synchronously.<br>
- /// If not specified, the default is false, i.e. the image is loaded asynchronously.<br>
- /// For Normal Quad images only.<br>
+ /// Gets or sets whether to load the image synchronously.<br />
+ /// If not specified, the default is false, i.e., the image is loaded asynchronously.<br />
+ /// For normal quad images only.<br />
/// Optional.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public bool SynchronousLoading
{
get
}
/// <summary>
- /// Get or set whether to draws the borders only(If true).<br>
- /// If not specified, the default is false.<br>
- /// For N-Patch images only.<br>
+ /// Gets or sets whether to draw the borders only (If true).<br />
+ /// If not specified, the default is false.<br />
+ /// For n-patch images only.<br />
/// Optional.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public bool BorderOnly
{
get
}
/// <summary>
- /// Get or set the image area to be displayed.<br>
- /// It is a rectangular area.<br>
- /// The first two elements indicate the top-left position of the area, and the last two elements are the area width and height respectively.<br>
- /// 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>
- /// For For Normal QUAD image only.<br>
+ /// Gets or sets the image area to be displayed.<br />
+ /// It is a rectangular area.<br />
+ /// 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 />
+ /// 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 />
+ /// For normal quad images only.<br />
/// Optional.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public Vector4 PixelArea
{
get
}
/// <summary>
- /// Get or set the wrap mode for u coordinate.<br>
- /// It decides how the texture should be sampled when the u coordinate exceeds the range of 0.0 to 1.0.<br>
- /// If not specified, the default is WrapModeType.Default(CLAMP).<br>
- /// For Normal QUAD image only.<br>
+ /// Gets or sets the wrap mode for the u coordinate.<br />
+ /// It decides how the texture should be sampled when the u coordinate exceeds the range of 0.0 to 1.0.<br />
+ /// If not specified, the default is WrapModeType.Default(CLAMP).<br />
+ /// For normal quad images only.<br />
/// Optional.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public WrapModeType WrapModeU
{
get
}
/// <summary>
- /// Get or set the wrap mode for v coordinate.<br>
- /// It decides how the texture should be sampled when the v coordinate exceeds the range of 0.0 to 1.0.<br>
- /// The first two elements indicate the top-left position of the area, and the last two elements are the area width and height respectively.<br>
- /// If not specified, the default is WrapModeType.Default(CLAMP).<br>
- /// For Normal QUAD image only.
+ /// Gets or sets the wrap mode for the v coordinate.<br />
+ /// It decides how the texture should be sampled when the v coordinate exceeds the range of 0.0 to 1.0.<br />
+ /// 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 />
+ /// If not specified, the default is WrapModeType.Default(CLAMP).<br />
+ /// For normal quad images only.
/// Optional.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public WrapModeType WrapModeV
{
get
}
}
+ /// <summary>
+ /// Gets or sets scale factor to apply to the content image before masking.
+ /// </summary>
+ /// <since_tizen> 4 </since_tizen>
public float MaskContentScale
{
get
}
}
+ /// <summary>
+ /// Whether to crop image to mask or scale mask to fit image.
+ /// </summary>
+ /// <since_tizen> 4 </since_tizen>
public bool CropToMask
{
get
}
}
+ /// <summary>
+ /// An alpha value for mixing between the masked main NPatch image and the auxiliary image.
+ /// </summary>
+ /// <since_tizen> 5 </since_tizen>
+ public float AuxiliaryImageAlpha
+ {
+ get
+ {
+ return _auxiliaryImageAlpha ?? 1.0f;
+ }
+ set
+ {
+ _auxiliaryImageAlpha = value;
+ UpdateVisual();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the Image Visual release policy.<br/>
+ /// It decides if a texture should be released from the cache or kept to reduce the loading time.<br/>
+ /// </summary>
+ /// <since_tizen> 5 </since_tizen>
+ public ReleasePolicyType ReleasePolicy
+ {
+ get
+ {
+ return _releasePolicy ?? (ReleasePolicyType.Destroyed );
+ }
+ set
+ {
+ _releasePolicy = value;
+ UpdateVisual();
+ }
+ }
+
+
+ /// <summary>
+ /// Gets or sets the Image Visual image loading policy.<br />
+ /// It decides if a texture should be loaded immediately after source set or only after the visual is added to the window.<br />
+ /// </summary>
+ /// <since_tizen> 5 </since_tizen>
+ public LoadPolicyType LoadPolicy
+ {
+ get
+ {
+ return _loadPolicy ?? (LoadPolicyType.Attached);
+ }
+ set
+ {
+ _loadPolicy = value;
+ UpdateVisual();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets whether to automatically correct the orientation based on the Exchangeable Image File (EXIF) data.<br />
+ /// If not specified, the default is true.<br />
+ /// For JPEG images only.<br />
+ /// Optional.
+ /// </summary>
+ /// <since_tizen> 5 </since_tizen>
+ public bool OrientationCorrection
+ {
+ get
+ {
+ return _orientationCorrection ?? (true);
+ }
+ set
+ {
+ _orientationCorrection = value;
+ UpdateVisual();
+ }
+ }
+
+ /// <summary>
+ /// Whether to use the texture atlas or not.
+ /// Optional. By default atlasing is off.
+ /// </summary>
+ /// <since_tizen> 5 </since_tizen>
+ public bool Atlasing
+ {
+ get
+ {
+ return _atlasing ?? (false);
+ }
+ set
+ {
+ _atlasing = value;
+ UpdateVisual();
+ }
+ }
+
+ /// <summary>
+ /// Compose the out visual map.
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
protected override void ComposingPropertyMap()
{
if (_url != null)
_outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Image));
_outputVisualMap.Add(ImageVisualProperty.URL, new PropertyValue(_url));
if (_alphaMaskUrl != null ) { _outputVisualMap.Add(ImageVisualProperty.AlphaMaskURL, new PropertyValue(_alphaMaskUrl)); }
+ if (_auxiliaryImageUrl != null ) { _outputVisualMap.Add(ImageVisualProperty.AuxiliaryImageURL, new PropertyValue(_auxiliaryImageUrl)); }
if (_fittingMode != null) { _outputVisualMap.Add(ImageVisualProperty.FittingMode, new PropertyValue((int)_fittingMode)); }
if (_samplingMode != null) { _outputVisualMap.Add(ImageVisualProperty.SamplingMode, new PropertyValue((int)_samplingMode)); }
if (_desiredWidth != null) { _outputVisualMap.Add(ImageVisualProperty.DesiredWidth, new PropertyValue((int)_desiredWidth)); }
if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
if (_maskContentScale != null) { _outputVisualMap.Add((int)ImageVisualProperty.MaskContentScale, new PropertyValue((float)_maskContentScale)); }
if (_cropToMask != null) { _outputVisualMap.Add((int)ImageVisualProperty.CropToMask, new PropertyValue((bool)_cropToMask)); }
+ if (_auxiliaryImageAlpha != null) { _outputVisualMap.Add((int)ImageVisualProperty.AuxiliaryImageAlpha, new PropertyValue((float)_auxiliaryImageAlpha)); }
+ if (_releasePolicy != null) { _outputVisualMap.Add( ImageVisualProperty.ReleasePolicy , new PropertyValue((int)_releasePolicy)); }
+ if (_loadPolicy != null) { _outputVisualMap.Add( ImageVisualProperty.LoadPolicy, new PropertyValue((int)_loadPolicy)); }
+ if (_orientationCorrection != null) { _outputVisualMap.Add( ImageVisualProperty.OrientationCorrection, new PropertyValue((bool)_orientationCorrection)); }
+ if (_atlasing != null) { _outputVisualMap.Add( ImageVisualProperty.Atlasing, new PropertyValue((bool)_atlasing)); }
+ if (_visualFittingMode != null) { _outputVisualMap.Add((int)Visual.Property.VisualFittingMode, new PropertyValue((int)_visualFittingMode)); }
}
}
}
/// <summary>
- /// A class encapsulating the property map of a text visual.
+ /// A class encapsulating the property map of the text visual.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public class TextVisual : VisualMap
{
- public TextVisual() : base()
- {
- }
-
private string _text = null;
private string _fontFamily = null;
private PropertyMap _fontStyle = null;
private string _verticalAlignment = null;
private Color _textColor = null;
private bool? _enableMarkup = null;
+ private PropertyMap _shadow = null;
+ private PropertyMap _underline = null;
+ private PropertyMap _outline = null;
+ private PropertyMap _background = null;
+
+ /// <summary>
+ /// Constructor.
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
+ public TextVisual() : base()
+ {
+ }
/// <summary>
- /// Get or set the text to display in UTF-8 format.<br>
+ /// Gets or sets the text to display in the UTF-8 format.<br />
/// Mandatory.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public string Text
{
get
}
/// <summary>
- /// Get or set the requested font family to use.<br>
+ /// Gets or sets the requested font family to use.<br />
/// Optional.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public string FontFamily
{
get
}
/// <summary>
- /// Get or set the requested font style to use.<br>
+ /// Gets or sets the requested font style to use.<br />
/// Optional.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public PropertyMap FontStyle
{
get
}
/// <summary>
- /// Get or set the size of font in points.<br>
+ /// Gets or sets the size of font in points.<br />
/// Mandatory.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public float PointSize
{
get
}
/// <summary>
- /// Get or set the single-line or multi-line layout option.<br>
- /// If not specified, the default is false.<br>
+ /// Gets or sets the single-line or multi-line layout option.<br />
+ /// If not specified, the default is false.<br />
/// Optional.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public bool MultiLine
{
get
}
/// <summary>
- /// Get or set the line horizontal alignment.<br>
- /// If not specified, the default is Begin.<br>
+ /// Gets or sets the line horizontal alignment.<br />
+ /// If not specified, the default is begin.<br />
/// Optional.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public HorizontalAlignment HorizontalAlignment
{
get
}
/// <summary>
- /// Get or set the line vertical alignment.<br>
- /// If not specified, the default is Top.<br>
+ /// Gets or sets the line vertical alignment.<br />
+ /// If not specified, the default is top.<br />
/// Optional.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public VerticalAlignment VerticalAlignment
{
get
}
/// <summary>
- /// Get or set the color of the text.<br>
+ /// Gets or sets the color of the text.<br />
/// Optional.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public Color TextColor
{
get
}
/// <summary>
- /// Get or set whether the mark-up processing is enabled.<br>
+ /// Gets or sets whether the mark-up processing is enabled.<br />
/// Optional.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public bool EnableMarkup
{
get
}
}
+ /// <summary>
+ /// Gets or sets the shadow parameters.
+ /// </summary>
+ /// <since_tizen> 5 </since_tizen>
+ public PropertyMap Shadow
+ {
+ get
+ {
+ return _shadow;
+ }
+ set
+ {
+ _shadow = value;
+ UpdateVisual();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the underline parameters.
+ /// </summary>
+ /// <since_tizen> 5 </since_tizen>
+ public PropertyMap Underline
+ {
+ get
+ {
+ return _underline;
+ }
+ set
+ {
+ _underline = value;
+ UpdateVisual();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the outline parameters.
+ /// </summary>
+ /// <since_tizen> 5 </since_tizen>
+ public PropertyMap Outline
+ {
+ get
+ {
+ return _outline;
+ }
+ set
+ {
+ _outline = value;
+ UpdateVisual();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the background parameters.
+ /// </summary>
+ /// <since_tizen> 5 </since_tizen>
+ public PropertyMap Background
+ {
+ get
+ {
+ return _background;
+ }
+ set
+ {
+ _background = value;
+ UpdateVisual();
+ }
+ }
+
+ /// <summary>
+ /// Compose the out visual map.
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
protected override void ComposingPropertyMap()
{
if (_text != null && _pointSize != null)
if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
if (_mixColor != null) { _outputVisualMap.Add((int)Visual.Property.MixColor, new PropertyValue(_mixColor)); }
if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
+ if (_shadow != null) { _outputVisualMap.Add(TextVisualProperty.Shadow, new PropertyValue(_shadow)); }
+ if (_underline != null) { _outputVisualMap.Add(TextVisualProperty.Underline, new PropertyValue(_underline)); }
+ if (_outline != null) { _outputVisualMap.Add(TextVisualProperty.Outline, new PropertyValue(_outline)); }
+ if (_background != null) { _outputVisualMap.Add(TextVisualProperty.Background, new PropertyValue(_background)); }
+ if (_visualFittingMode != null) { _outputVisualMap.Add((int)Visual.Property.VisualFittingMode, new PropertyValue((int)_visualFittingMode)); }
}
}
}
/// <summary>
- /// A class encapsulating the property map of a border visual.
+ /// A class encapsulating the property map of the border visual.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public class BorderVisual : VisualMap
{
- public BorderVisual() : base()
- {
- }
-
private Color _color = null;
private float? _size = null;
private bool? _antiAliasing = null;
/// <summary>
- /// Get or set the color of the border.<br>
+ /// Constructor.
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
+ public BorderVisual() : base()
+ {
+ }
+
+ /// <summary>
+ /// Gets or sets the color of the border.<br />
/// Mandatory.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public Color Color
{
get
}
/// <summary>
- /// Get or set the width of the border (in pixels).<br>
+ /// Gets or sets the width of the border (in pixels).<br />
/// Mandatory.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public float BorderSize
{
get
}
/// <summary>
- /// Get or set whether anti-aliasing of the border is required.<br>
- /// If not supplied, default is false.<br>
+ /// Gets or sets whether the anti-aliasing of the border is required.<br />
+ /// If not supplied, the default is false.<br />
/// Optional.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public bool AntiAliasing
{
get
}
}
+ /// <summary>
+ /// Compose the out visual map.
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
protected override void ComposingPropertyMap()
{
if (_color != null && _size != null)
if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
if (_mixColor != null) { _outputVisualMap.Add((int)Visual.Property.MixColor, new PropertyValue(_mixColor)); }
if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
+ if (_visualFittingMode != null) { _outputVisualMap.Add((int)Visual.Property.VisualFittingMode, new PropertyValue((int)_visualFittingMode)); }
}
}
}
/// <summary>
- /// A class encapsulating the property map of a color visual.
+ /// A class encapsulating the property map of the color visual.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public class ColorVisual : VisualMap
{
+ private Color _mixColorForColorVisual = null;
+ private bool? _renderIfTransparent = false;
+
+ /// <summary>
+ /// Constructor.
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
public ColorVisual() : base()
{
}
- private Color _mixColorForColorVisual = null;
-
/// <summary>
- /// Get or set the solid color required.<br>
+ /// Gets or sets the solid color required.<br />
/// Mandatory.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public Color Color
{
get
}
}
+ /// <summary>
+ /// Gets or sets whether to render if the MixColor is transparent.
+ /// By default it is false, which means that the ColorVisual will not render if the MIX_COLOR is transparent.
+ /// </summary>
+ /// <since_tizen> 5 </since_tizen>
+ public bool RenderIfTransparent
+ {
+ get
+ {
+ return _renderIfTransparent ?? (false);
+ }
+ set
+ {
+ _renderIfTransparent = value;
+ UpdateVisual();
+ }
+ }
+
+ /// <summary>
+ /// Compose the out visual map.
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
protected override void ComposingPropertyMap()
{
if (_mixColorForColorVisual != null)
if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
+ if (_renderIfTransparent != null) { _outputVisualMap.Add(ColorVisualProperty.RenderIfTransparent, new PropertyValue((bool)_renderIfTransparent)); }
+ if (_visualFittingMode != null) { _outputVisualMap.Add((int)Visual.Property.VisualFittingMode, new PropertyValue((int)_visualFittingMode)); }
}
}
}
/// <summary>
- /// A class encapsulating the property map of a gradient visual.
+ /// A class encapsulating the property map of the gradient visual.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public class GradientVisual : VisualMap
{
- public GradientVisual() : base()
- {
- }
-
private Vector2 _startPosition = null;
private Vector2 _endPosition = null;
private Vector2 _center = null;
private GradientVisualSpreadMethodType? _spreadMethod = null;
/// <summary>
- /// Get or set the start position of a linear gradient.<br>
- /// Mandatory for Linear.<br>
+ /// Constructor.
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
+ public GradientVisual() : base()
+ {
+ }
+
+ /// <summary>
+ /// Gets or sets the start position of a linear gradient.<br />
+ /// Mandatory for linear.<br />
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public Vector2 StartPosition
{
get
}
/// <summary>
- /// Get or set the end position of a linear gradient.<br>
- /// Mandatory for Linear.<br>
+ /// Gets or sets the end position of a linear gradient.<br />
+ /// Mandatory for linear.<br />
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public Vector2 EndPosition
{
get
}
/// <summary>
- /// Get or set the center point of a radial gradient.<br>
- /// Mandatory for Radial.<br>
+ /// Gets or sets the center point of a radial gradient.<br />
+ /// Mandatory for radial.<br />
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public Vector2 Center
{
get
}
/// <summary>
- /// Get or set the size of the radius of a radial gradient.<br>
- /// Mandatory for Radial.<br>
+ /// Gets or sets the size of the radius of a radial gradient.<br />
+ /// Mandatory for radial.<br />
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public float Radius
{
get
}
/// <summary>
- /// Get or set all the stop offsets.<br>
- /// A PropertyArray of float.<br>
- /// If not supplied, default is 0.0f and 1.0f.<br>
+ /// Gets or sets all the stop offsets.<br />
+ /// A PropertyArray of float.<br />
+ /// If not supplied, the default is 0.0f and 1.0f.<br />
/// Optional.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public PropertyArray StopOffset
{
get
}
/// <summary>
- /// Get or set the color at the stop offsets.<br>
- /// A PropertyArray of Color.<br>
- /// At least 2 values required to show a gradient.<br>
+ /// Gets or sets the color at the stop offsets.<br />
+ /// A PropertyArray of color.<br />
+ /// At least 2 values are required to show a gradient.<br />
/// Mandatory.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public PropertyArray StopColor
{
get
}
/// <summary>
- /// Get or set defines the coordinate system for certain attributes of the points in a gradient.<br>
- /// If not supplied, default is GradientVisualUnitsType.ObjectBoundingBox.<br>
+ /// Gets or sets descriptions of the coordinate system for certain attributes of the points in a gradient.<br />
+ /// If not supplied, the default is GradientVisualUnitsType.ObjectBoundingBox.<br />
/// Optional.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public GradientVisualUnitsType Units
{
get
}
/// <summary>
- /// Get or set indicates what happens if the gradient starts or ends inside the bounds of the target rectangle.<br>
- /// If not supplied, default is GradientVisualSpreadMethodType.Pad.<br>
+ /// Gets or sets indications of what happens if the gradient starts or ends inside the bounds of the target rectangle.<br />
+ /// If not supplied, the default is GradientVisualSpreadMethodType.Pad.<br />
/// Optional.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public GradientVisualSpreadMethodType SpreadMethod
{
get
}
}
+ /// <summary>
+ /// Compose the out visual map.
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
protected override void ComposingPropertyMap()
{
if (((_startPosition != null && _endPosition != null) || (_center != null && _radius != null)) && _stopColor != null)
if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
if (_mixColor != null) { _outputVisualMap.Add((int)Visual.Property.MixColor, new PropertyValue(_mixColor)); }
if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
+ if (_visualFittingMode != null) { _outputVisualMap.Add((int)Visual.Property.VisualFittingMode, new PropertyValue((int)_visualFittingMode)); }
}
}
}
/// <summary>
- /// A class encapsulating the property map of a mesh visual.
+ /// A class encapsulating the property map of the mesh visual.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public class MeshVisual : VisualMap
{
- public MeshVisual() : base()
- {
- }
-
private string _objectURL = null;
private string _materialtURL = null;
private string _texturesPath = null;
private Vector3 _lightPosition = null;
/// <summary>
- /// Get or set the location of the ".obj" file.<br>
+ /// Constructor.
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
+ public MeshVisual() : base()
+ {
+ }
+
+ /// <summary>
+ /// Gets or sets the location of the ".obj" file.<br />
/// Mandatory.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public string ObjectURL
{
get
}
/// <summary>
- /// Get or set the location of the ".mtl" file.<br>
- /// If not specified, then a textureless object is assumed.<br>
+ /// Gets or sets the location of the ".mtl" file.<br />
+ /// If not specified, then a textureless object is assumed.<br />
/// Optional.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public string MaterialtURL
{
get
}
/// <summary>
- /// Get or set path to the directory the textures (including gloss and normal) are stored in.<br>
- /// Mandatory if using material.<br>
+ /// Gets or sets the path to the directory the textures (including gloss and normal) are stored in.<br />
+ /// Mandatory if using material.<br />
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public string TexturesPath
{
get
}
/// <summary>
- /// Get or set the type of shading mode that the mesh will use.<br>
- /// 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>
- /// If not specified, it will use the best it can support (will try MeshVisualShadingModeValue.TexturedWithDetailedSpecularLighting first).<br>
+ /// Gets or sets the type of shading mode that the mesh will use.<br />
+ /// 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 />
+ /// If not specified, it will use the best it can support (will try MeshVisualShadingModeValue.TexturedWithDetailedSpecularLighting first).<br />
/// Optional.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public MeshVisualShadingModeValue ShadingMode
{
get
}
/// <summary>
- /// Get or set whether to use mipmaps for textures or not.<br>
- /// If not specified, the default is true.<br>
+ /// Gets or sets whether to use mipmaps for textures or not.<br />
+ /// If not specified, the default is true.<br />
/// Optional.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public bool UseMipmapping
{
get
}
/// <summary>
- /// Get or set whether to average normals at each point to smooth textures or not.<br>
- /// If not specified, the default is true.<br>
+ /// Gets or sets whether to average normals at each point to smooth textures or not.<br />
+ /// If not specified, the default is true.<br />
/// Optional.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public bool UseSoftNormals
{
get
}
/// <summary>
- /// Get or set the position, in stage space, of the point light that applies lighting to the model.<br>
- /// This is based off the stage's dimensions, so using the width and height of the stage halved will correspond to the center,
- /// and using all zeroes will place the light at the top left corner.<br>
- /// If not specified, the default is an offset outwards from the center of the screen.<br>
+ /// Gets or sets the position, in the stage space, of the point light that applies lighting to the model.<br />
+ /// This is based off the stage's dimensions, so using the width and the height of the stage halved will correspond to the center,
+ /// and using all zeroes will place the light at the top-left corner.<br />
+ /// If not specified, the default is an offset outwards from the center of the screen.<br />
/// Optional.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public Vector3 LightPosition
{
get
}
}
+ /// <summary>
+ /// Compose the out visual map.
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
protected override void ComposingPropertyMap()
{
if (_objectURL != null)
if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
if (_mixColor != null) { _outputVisualMap.Add((int)Visual.Property.MixColor, new PropertyValue(_mixColor)); }
if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
+ if (_visualFittingMode != null) { _outputVisualMap.Add((int)Visual.Property.VisualFittingMode, new PropertyValue((int)_visualFittingMode)); }
}
}
}
/// <summary>
- /// A class encapsulating the property map of a primetive visual.
+ /// A class encapsulating the property map of the primetive visual.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public class PrimitiveVisual : VisualMap
{
- public PrimitiveVisual() : base()
- {
- }
-
private PrimitiveVisualShapeType? _shape = null;
private Color _mixColorForPrimitiveVisual = null;
private int? _slices = null;
private Vector3 _lightPosition = null;
/// <summary>
- /// Get or set the specific shape to render.<br>
- /// If not specified, the default is PrimitiveVisualShapeType.Sphere.<br>
+ /// Constructor.
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
+ public PrimitiveVisual() : base()
+ {
+ }
+
+ /// <summary>
+ /// Gets or sets the specific shape to render.<br />
+ /// If not specified, the default is PrimitiveVisualShapeType.Sphere.<br />
/// Optional.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public PrimitiveVisualShapeType Shape
{
get
}
/// <summary>
- /// Get or set the color of the shape.<br>
- /// If not specified, the default is Color(0.5, 0.5, 0.5, 1.0).<br>
- /// Applies to ALL shapes.<br>
+ /// Gets or sets the color of the shape.<br />
+ /// If not specified, the default is Color (0.5, 0.5, 0.5, 1.0).<br />
+ /// Applies to all shapes.<br />
/// Optional.
/// </summary>
- public Color MixColor
+ /// <since_tizen> 3 </since_tizen>
+ public new Color MixColor
{
get
{
}
/// <summary>
- /// Get or set the number of slices as you go around the shape.<br>
- /// For spheres and conical frustrums, this determines how many divisions there are as you go around the object.<br>
- /// If not specified, the default is 128.<br>
- /// The range is from 1 to 255.<br>
+ /// Gets or sets the number of slices as you go around the shape.<br />
+ /// For spheres and conical frustrums, this determines how many divisions there are as you go around the object.<br />
+ /// If not specified, the default is 128.<br />
+ /// The range is from 1 to 255.<br />
/// Optional.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public int Slices
{
get
}
/// <summary>
- /// Get or set the number of stacks as you go down the shape.<br>
- /// For spheres, 'stacks' determines how many layers there are as you go down the object.<br>
- /// If not specified, the default is 128.<br>
- /// The range is from 1 to 255.<br>
+ /// Gets or sets the number of stacks as you go down the shape.<br />
+ /// For spheres, 'stacks' determines how many layers there are as you go down the object.<br />
+ /// If not specified, the default is 128.<br />
+ /// The range is from 1 to 255.<br />
/// Optional.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public int Stacks
{
get
}
/// <summary>
- /// Get or set the scale of the radius of the top circle of a conical frustrum.<br>
- /// If not specified, the default is 1.0f.<br>
- /// Applies to: - PrimitiveVisualShapeType.ConicalFrustrum<br>
- /// Only values greater than or equal to 0.0f are accepted.<br>
+ /// Gets or sets the scale of the radius of the top circle of a conical frustrum.<br />
+ /// If not specified, the default is 1.0f.<br />
+ /// Applies to: - PrimitiveVisualShapeType.ConicalFrustrum<br />
+ /// Only values greater than or equal to 0.0f are accepted.<br />
/// Optional.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public float ScaleTopRadius
{
get
}
/// <summary>
- /// Get or set the scale of the radius of the bottom circle of a conical frustrum.<br>
- /// If not specified, the default is 1.5f.<br>
- /// Applies to: - PrimitiveVisualShapeType.ConicalFrustrum<br>
- /// - PrimitiveVisualShapeType.Cone<br>
- /// Only values greater than or equal to 0.0f are accepted.<br>
+ /// Gets or sets the scale of the radius of the bottom circle of a conical frustrum.<br />
+ /// If not specified, the default is 1.5f.<br />
+ /// Applies to: - PrimitiveVisualShapeType.ConicalFrustrum<br />
+ /// - PrimitiveVisualShapeType.Cone<br />
+ /// Only values greater than or equal to 0.0f are accepted.<br />
/// Optional.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public float ScaleBottomRadius
{
get
}
/// <summary>
- /// Get or set the scale of the height of a conic.<br>
- /// If not specified, the default is 3.0f.<br>
- /// Applies to:<br>
- /// - PrimitiveVisualShapeType.ConicalFrustrum<br>
- /// - PrimitiveVisualShapeType.Cone<br>
- /// - PrimitiveVisualShapeType.Cylinder<br>
- /// Only values greater than or equal to 0.0f are accepted.<br>
+ /// Gets or sets the scale of the height of a conic.<br />
+ /// If not specified, the default is 3.0f.<br />
+ /// Applies to:<br />
+ /// - PrimitiveVisualShapeType.ConicalFrustrum<br />
+ /// - PrimitiveVisualShapeType.Cone<br />
+ /// - PrimitiveVisualShapeType.Cylinder<br />
+ /// Only values greater than or equal to 0.0f are accepted.<br />
/// Optional.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public float ScaleHeight
{
get
}
/// <summary>
- /// Get or set the scale of the radius of a cylinder.<br>
- /// If not specified, the default is 1.0f.<br>
- /// Applies to:<br>
- /// - PrimitiveVisualShapeType.Cylinder<br>
- /// Only values greater than or equal to 0.0f are accepted.<br>
+ /// Gets or sets the scale of the radius of a cylinder.<br />
+ /// If not specified, the default is 1.0f.<br />
+ /// Applies to:<br />
+ /// - PrimitiveVisualShapeType.Cylinder<br />
+ /// Only values greater than or equal to 0.0f are accepted.<br />
/// Optional.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public float ScaleRadius
{
get
}
/// <summary>
- /// Get or set the dimensions of a cuboid. Scales in the same fashion as a 9-patch image.<br>
- /// If not specified, the default is Vector3.One.<br>
- /// Applies to:<br>
- /// - PrimitiveVisualShapeType.Cube<br>
- /// - PrimitiveVisualShapeType.Octahedron<br>
- /// - PrimitiveVisualShapeType.BevelledCube<br>
- /// Each vector3 parameter should be greater than or equal to 0.0f.<br>
+ /// Gets or sets the dimensions of a cuboid. Scales in the same fashion as a 9-patch image.<br />
+ /// If not specified, the default is Vector3.One.<br />
+ /// Applies to:<br />
+ /// - PrimitiveVisualShapeType.Cube<br />
+ /// - PrimitiveVisualShapeType.Octahedron<br />
+ /// - PrimitiveVisualShapeType.BevelledCube<br />
+ /// Each Vector3 parameter should be greater than or equal to 0.0f.<br />
/// Optional.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public Vector3 ScaleDimensions
{
get
}
/// <summary>
- /// Get or set determines how bevelled the cuboid should be, based off the smallest dimension.<br>
- /// 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>
- /// If not specified, the default is 0.0f (no bevel).<br>
- /// Applies to:<br>
- /// - PrimitiveVisualShapeType.BevelledCube<br>
- /// The range is from 0.0f to 1.0f.<br>
+ /// Gets or sets determines how bevelled the cuboid should be, based off the smallest dimension.<br />
+ /// 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 />
+ /// If not specified, the default is 0.0f (no bevel).<br />
+ /// Applies to:<br />
+ /// - PrimitiveVisualShapeType.BevelledCube<br />
+ /// The range is from 0.0f to 1.0f.<br />
/// Optional.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public float BevelPercentage
{
get
}
/// <summary>
- /// Get or set defines how smooth the bevelled edges should be.<br>
- /// If not specified, the default is 0.0f (sharp edges).<br>
- /// Applies to:<br>
- /// - PrimitiveVisualShapeType.BevelledCube<br>
- /// The range is from 0.0f to 1.0f.<br>
+ /// Gets or sets descriptions of how smooth the bevelled edges should be.<br />
+ /// If not specified, the default is 0.0f (sharp edges).<br />
+ /// Applies to:<br />
+ /// - PrimitiveVisualShapeType.BevelledCube<br />
+ /// The range is from 0.0f to 1.0f.<br />
/// Optional.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public float BevelSmoothness
{
get
}
/// <summary>
- /// Get or set the position, in stage space, of the point light that applies lighting to the model.<br>
- /// This is based off the stage's dimensions, so using the width and height of the stage halved will correspond to the center,
- /// and using all zeroes will place the light at the top left corner.<br>
- /// If not specified, the default is an offset outwards from the center of the screen.<br>
- /// Applies to ALL shapes.<br>
+ /// Gets or sets the position, in the stage space, of the point light that applies lighting to the model.<br />
+ /// This is based off the stage's dimensions, so using the width and the height of the stage halved will correspond to the center,
+ /// and using all zeroes will place the light at the top-left corner.<br />
+ /// If not specified, the default is an offset outwards from the center of the screen.<br />
+ /// Applies to all shapes.<br />
/// Optional.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public Vector3 LightPosition
{
get
}
}
+ /// <summary>
+ /// Compose the out visual map.
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
protected override void ComposingPropertyMap()
{
_outputVisualMap = new PropertyMap(); ;
if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
+ if (_visualFittingMode != null) { _outputVisualMap.Add((int)Visual.Property.VisualFittingMode, new PropertyValue((int)_visualFittingMode)); }
}
}
/// <summary>
- /// A class encapsulating the property map of a n-patch image visual.
+ /// A class encapsulating the property map of the n-patch image visual.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public class NPatchVisual : VisualMap
{
- public NPatchVisual() : base()
- {
- }
-
private string _url = null;
private bool? _borderOnly = null;
private Rectangle _border = null;
/// <summary>
- /// Get or set the URL of the image.<br>
+ /// Constructor.
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
+ public NPatchVisual() : base()
+ {
+ }
+
+ /// <summary>
+ /// Gets or sets the URL of the image.<br />
/// Mandatory.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public string URL
{
get
}
/// <summary>
- /// Get or set whether to draws the borders only(If true).<br>
- /// If not specified, the default is false.<br>
- /// For N-Patch images only.<br>
+ /// Gets or sets whether to draw the borders only (If true).<br />
+ /// If not specified, the default is false.<br />
+ /// For n-patch images only.<br />
/// Optional.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public bool BorderOnly
{
get
}
/// <summary>
- /// The border of the image in the order: left, right, bottom, top.<br>
- /// For N-Patch images only.<br>
+ /// The border of the image is in the order: left, right, bottom, top.<br />
+ /// For n-patch images only.<br />
/// Optional.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public Rectangle Border
{
get
}
}
+ /// <summary>
+ /// Compose the out visual map.
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
protected override void ComposingPropertyMap()
{
if (_url != null)
if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
if (_mixColor != null) { _outputVisualMap.Add((int)Visual.Property.MixColor, new PropertyValue(_mixColor)); }
if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
+ if (_visualFittingMode != null) { _outputVisualMap.Add((int)Visual.Property.VisualFittingMode, new PropertyValue((int)_visualFittingMode)); }
}
}
}
/// <summary>
- /// A class encapsulating the property map of a SVG visual.
+ /// A class encapsulating the property map of the SVG visual.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public class SVGVisual : VisualMap
{
+ private string _url = null;
+
+ /// <summary>
+ /// Constructor.
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
public SVGVisual() : base()
{
}
- private string _url = null;
-
+ /// <summary>
+ /// The url of the svg resource.
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
public string URL
{
get
}
}
+ /// <summary>
+ /// Compose the out visual map.
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
protected override void ComposingPropertyMap()
{
if (_url != null)
if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
if (_mixColor != null) { _outputVisualMap.Add((int)Visual.Property.MixColor, new PropertyValue(_mixColor)); }
if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
+ if (_visualFittingMode != null) { _outputVisualMap.Add((int)Visual.Property.VisualFittingMode, new PropertyValue((int)_visualFittingMode)); }
}
}
}
/// <summary>
- /// A class encapsulating the property map of a Animated Image(AGIF) visual.
+ /// A class encapsulating the property map of the animated image (AGIF) visual.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public class AnimatedImageVisual : VisualMap
{
- public AnimatedImageVisual() : base()
- {
- }
-
private List<string> _urls = null;
private int? _batchSize = null;
private int? _cacheSize = null;
private float? _frameDelay = null;
+ private float? _loopCount = null;
+ /// <summary>
+ /// Constructor.
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
+ public AnimatedImageVisual() : base()
+ {
+ }
+
+ /// <summary>
+ /// Gets and Sets the url in the AnimatedImageVisual.
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
public string URL
{
get
}
}
+ /// <summary>
+ /// Gets and Sets the url list in the AnimatedImageVisual.
+ /// </summary>
+ /// <since_tizen> 4 </since_tizen>
public List<string> URLS
{
get
}
}
+ /// <summary>
+ /// Gets and Sets the batch size for pre-loading images in the AnimatedImageVisual.
+ /// </summary>
+ /// <since_tizen> 4 </since_tizen>
public int BatchSize
{
get
}
}
+ /// <summary>
+ /// Gets and Sets the cache size for loading images in the AnimatedImageVisual.
+ /// </summary>
+ /// <since_tizen> 4 </since_tizen>
public int CacheSize
{
get
UpdateVisual();
}
}
+
+ /// <summary>
+ /// Gets and Sets The number of milliseconds between each frame in the AnimatedImageVisual.
+ /// </summary>
+ /// <since_tizen> 4 </since_tizen>
public float FrameDelay
{
get
}
}
+ /// <summary>
+ /// Gets and sets the number of times the AnimatedImageVisual will be looped.
+ /// The default is -1. If the number is less than 0 then it loops unlimited,otherwise loop loopCount times.
+ /// </summary>
+ /// <since_tizen> 5 </since_tizen>
+ public float LoopCount
+ {
+ get
+ {
+ return _loopCount ?? -1;
+ }
+ set
+ {
+ _loopCount = value;
+ UpdateVisual();
+ }
+ }
+
+ /// <summary>
+ /// Compose the out visual map.
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
protected override void ComposingPropertyMap()
{
if (_urls != null)
if (_batchSize != null ) {_outputVisualMap.Add((int)ImageVisualProperty.BatchSize, new PropertyValue((int)_batchSize)); }
if (_cacheSize != null ) {_outputVisualMap.Add((int)ImageVisualProperty.CacheSize, new PropertyValue((int)_cacheSize)); }
if (_frameDelay != null ) {_outputVisualMap.Add((int)ImageVisualProperty.FrameDelay, new PropertyValue((float)_frameDelay)); }
+ if (_loopCount != null ) {_outputVisualMap.Add((int)ImageVisualProperty.LoopCount, new PropertyValue((int)_loopCount)); }
if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
if (_mixColor != null) { _outputVisualMap.Add((int)Visual.Property.MixColor, new PropertyValue(_mixColor)); }
if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
+ if (_visualFittingMode != null) { _outputVisualMap.Add((int)Visual.Property.VisualFittingMode, new PropertyValue((int)_visualFittingMode)); }
}
}
}
-
//temporary fix for TCT
+ /// <summary>
+ /// A class encapsulating the property map of the transition data.
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
public class VisualAnimator : VisualMap
{
- public VisualAnimator() : base()
- {
- }
-
private string _alphaFunction = null;
private int _startTime = 0;
private int _endTime = 0;
private string _propertyIndex = null;
private object _destinationValue = null;
+ /// <summary>
+ /// Create VisualAnimator object.
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
+ public VisualAnimator() : base()
+ {
+ }
+
+ /// <summary>
+ /// Sets and Gets the AlphaFunction of this transition.
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
public AlphaFunction.BuiltinFunctions AlphaFunction
{
get
}
}
+ /// <summary>
+ /// Sets and Gets the StartTime of this transition.
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
public int StartTime
{
get
}
}
+ /// <summary>
+ /// Sets and Gets the EndTime of this transition.
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
public int EndTime
{
get
}
}
+ /// <summary>
+ /// Sets and Gets the Target of this transition.
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
public string Target
{
get
}
}
+ /// <summary>
+ /// Sets and Gets the PropertyIndex of this transition.
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
public string PropertyIndex
{
get
}
}
+ /// <summary>
+ /// Sets and Gets the DestinationValue of this transition.
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
public object DestinationValue
{
get
}
}
+ /// <summary>
+ /// Compose the out visual map.
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
protected override void ComposingPropertyMap()
{
PropertyMap _animator = new PropertyMap();
_timePeriod.Add("delay", new PropertyValue(_startTime / 1000.0f));
_animator.Add("timePeriod", new PropertyValue(_timePeriod));
- string _str1 = _propertyIndex.Substring(0, 1);
- string _str2 = _propertyIndex.Substring(1);
- string _str = _str1.ToLower() + _str2;
+ StringBuilder sb = new StringBuilder(_propertyIndex);
+ sb[0] = (char)(sb[0] | 0x20);
+ string _str = sb.ToString();
PropertyValue val = PropertyValue.CreateFromObject(_destinationValue);