Add a Outline struct to pass data of DALi Outline PropertyMap.
The Outline struct can be used as an argument to
SetOutline and GetOutline methods.
// example
var outline = new Tizen.NUI.Text.Outline();
outline.Width = 2.0f;
outline.Color = new Color("#45B39D");
label.SetOutline(outline);
Signed-off-by: Bowon Ryu <bowon.ryu@samsung.com>
}
}
+ /// <summary>
+ /// Set Outline to TextEditor. <br />
+ /// </summary>
+ /// <param name="outline">The Outline</param>
+ /// <remarks>
+ /// SetOutline specifies the outline of the text through <see cref="Tizen.NUI.Text.Outline"/>. <br />
+ /// </remarks>
+ /// <example>
+ /// The following example demonstrates how to use the SetOutline method.
+ /// <code>
+ /// var outline = new Tizen.NUI.Text.Outline();
+ /// outline.Width = 2.0f;
+ /// outline.Color = new Color("#45B39D");
+ /// editor.SetOutline(outline);
+ /// </code>
+ /// </example>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public void SetOutline(Outline outline)
+ {
+ SetProperty(TextEditor.Property.OUTLINE, new PropertyValue(TextUtils.GetOutlineMap(outline)));
+ }
+
+ /// <summary>
+ /// Get Outline from TextEditor. <br />
+ /// </summary>
+ /// <returns>The Outline</returns>
+ /// <remarks>
+ /// <see cref="Tizen.NUI.Text.Outline"/>
+ /// </remarks>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Outline GetOutline()
+ {
+ var map = new PropertyMap();
+ GetProperty(TextEditor.Property.OUTLINE).Get(map);
+ return TextUtils.GetOutlineStruct(map);
+ }
+
/// <summary>
/// The InputOutline property.
/// </summary>
}
}
+ /// <summary>
+ /// Set Outline to TextField. <br />
+ /// </summary>
+ /// <param name="outline">The Outline</param>
+ /// <remarks>
+ /// SetOutline specifies the outline of the text through <see cref="Tizen.NUI.Text.Outline"/>. <br />
+ /// </remarks>
+ /// <example>
+ /// The following example demonstrates how to use the SetOutline method.
+ /// <code>
+ /// var outline = new Tizen.NUI.Text.Outline();
+ /// outline.Width = 2.0f;
+ /// outline.Color = new Color("#45B39D");
+ /// field.SetOutline(outline);
+ /// </code>
+ /// </example>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public void SetOutline(Outline outline)
+ {
+ SetProperty(TextField.Property.OUTLINE, new PropertyValue(TextUtils.GetOutlineMap(outline)));
+ }
+
+ /// <summary>
+ /// Get Outline from TextField. <br />
+ /// </summary>
+ /// <returns>The Outline</returns>
+ /// <remarks>
+ /// <see cref="Tizen.NUI.Text.Outline"/>
+ /// </remarks>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Outline GetOutline()
+ {
+ var map = new PropertyMap();
+ GetProperty(TextField.Property.OUTLINE).Get(map);
+ return TextUtils.GetOutlineStruct(map);
+ }
+
/// <summary>
/// The InputOutline property.
/// </summary>
}
}
+ /// <summary>
+ /// Set Outline to TextLabel. <br />
+ /// </summary>
+ /// <param name="outline">The Outline</param>
+ /// <remarks>
+ /// SetOutline specifies the outline of the text through <see cref="Tizen.NUI.Text.Outline"/>. <br />
+ /// </remarks>
+ /// <example>
+ /// The following example demonstrates how to use the SetOutline method.
+ /// <code>
+ /// var outline = new Tizen.NUI.Text.Outline();
+ /// outline.Width = 2.0f;
+ /// outline.Color = new Color("#45B39D");
+ /// label.SetOutline(outline);
+ /// </code>
+ /// </example>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public void SetOutline(Outline outline)
+ {
+ SetProperty(TextLabel.Property.OUTLINE, new PropertyValue(TextUtils.GetOutlineMap(outline)));
+ }
+
+ /// <summary>
+ /// Get Outline from TextLabel. <br />
+ /// </summary>
+ /// <returns>The Outline</returns>
+ /// <remarks>
+ /// <see cref="Tizen.NUI.Text.Outline"/>
+ /// </remarks>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Outline GetOutline()
+ {
+ var map = new PropertyMap();
+ GetProperty(TextLabel.Property.OUTLINE).Get(map);
+ return TextUtils.GetOutlineStruct(map);
+ }
+
/// <summary>
/// The PixelSize property.<br />
/// The size of font in pixels.<br />
return shadow;
}
+
+ /// <summary>
+ /// This method converts a Outline struct to a PropertyMap and returns it.
+ /// The returned map can be used for set Outline PropertyMap in the SetOutline method.
+ /// <param name="outline">The Outline struct value.</param>
+ /// <returns> A PropertyMap for Outline property. </returns>
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static PropertyMap GetOutlineMap(Outline outline)
+ {
+ var map = new PropertyMap();
+
+ if (outline.Color != null)
+ map.Add("color", new PropertyValue(outline.Color));
+
+ map.Add("width", new PropertyValue(outline.Width));
+
+ return map;
+ }
+
+ /// <summary>
+ /// This method converts a Outline map to a struct and returns it.
+ /// The returned struct can be returned to the user as a Outline in the GetOutline method.
+ /// <param name="map">The Outline PropertyMap.</param>
+ /// <returns> A Outline struct. </returns>
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static Outline GetOutlineStruct(PropertyMap map)
+ {
+ Color color = new Color();
+ map.Find(0, "color").Get(color);
+ map.Find(0, "width").Get(out float width);
+
+ var outline = new Outline();
+ outline.Color = color;
+ outline.Width = width;
+
+ return outline;
+ }
}
}
[EditorBrowsable(EditorBrowsableState.Never)]
public float BlurRadius { get; set; }
}
+
+ /// <summary>
+ /// A struct to pass data of Outline PropertyMap. <br />
+ /// </summary>
+ /// <remarks>
+ /// The Outline struct is used as an argument to SetOutline and GetOutline methods. <br />
+ /// See <see cref="Tizen.NUI.BaseComponents.TextLabel.SetOutline"/>, <see cref="Tizen.NUI.BaseComponents.TextLabel.GetOutline"/>, <see cref="Tizen.NUI.BaseComponents.TextField.SetOutline"/>, <see cref="Tizen.NUI.BaseComponents.TextField.GetOutline"/>, <see cref="Tizen.NUI.BaseComponents.TextEditor.SetOutline"/> and <see cref="Tizen.NUI.BaseComponents.TextEditor.GetOutline"/>. <br />
+ /// </remarks>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public struct Outline
+ {
+ /// <summary>
+ /// The color of the outline (the default color is Color.White).
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Color Color { get; set; }
+
+ /// <summary>
+ /// The width in pixels of the outline (If not provided then the outline is not enabled).
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public float Width { get; set; }
+ }
}
}