*/
using System;
+using System.ComponentModel;
+using System.Diagnostics;
namespace ElmSharp.Wearable
{
/// <summary>
- /// The Circle GenList Selector is a widget to display and handle genlist items by rotary event
- /// Inherits <see cref="GenList"/>
+ /// The Circle GenList Selector is a widget to display and handle the genlist items by the Rotary event.
+ /// Inherits <see cref="GenList"/>.
/// </summary>
- public class CircleGenList : GenList
+ /// <since_tizen> preview </since_tizen>
+ [Obsolete("This has been deprecated in API12")]
+ public class CircleGenList : GenList, IRotaryActionWidget
{
- IntPtr circleHandle;
+ IntPtr _circleHandle;
+ CircleSurface _surface;
/// <summary>
- /// Creates and initializes a new instance of the Circle GenList class
+ /// Creates and initializes a new instance of the Circle GenList class.
/// </summary>
- /// <param name="parent">The parent of new Circle GenList instance</param>
- public CircleGenList(EvasObject parent) : base(parent) { }
+ /// <param name="parent">The parent of the new Circle GenList instance.</param>
+ /// <param name="surface">The surface for drawing the circle features for this widget.</param>
+ /// <since_tizen> preview </since_tizen>
+ [Obsolete("This has been deprecated in API12")]
+ public CircleGenList(EvasObject parent, CircleSurface surface) : base()
+ {
+ Debug.Assert(parent == null || surface == null || parent.IsRealized);
+ _surface = surface;
+ Realize(parent);
+ }
+
+ /// <summary>
+ /// Creates and initializes a new instance of the Circle GenList class.
+ /// </summary>
+ /// <param name="parent">The parent of the new Circle CircleGenList instance.</param>
+ /// <since_tizen> preview </since_tizen>
+ [Obsolete("It is not safe for guess circle surface from parent and create new surface by every new widget")]
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public CircleGenList(EvasObject parent) : this(parent, CircleSurface.CreateCircleSurface(parent))
+ {
+ ((IRotaryActionWidget)this).Activate();
+ }
+
+ /// <summary>
+ /// Gets the handle for the Circle widget.
+ /// </summary>
+ /// <since_tizen> preview </since_tizen>
+ [Obsolete("This has been deprecated in API12")]
+ public virtual IntPtr CircleHandle => _circleHandle;
+
+ /// <summary>
+ /// Gets the handle for the circle surface used in this widget.
+ /// </summary>
+ /// <since_tizen> preview </since_tizen>
+ [Obsolete("This has been deprecated in API12")]
+ public virtual CircleSurface CircleSurface => _surface;
/// <summary>
- /// Sets or gets the disabled state of the Circle GenList Selector
+ /// Sets or gets the disabled state of this widget.
/// </summary>
+ /// <since_tizen> preview </since_tizen>
+ [Obsolete("Use IsEnabled")]
+ [EditorBrowsable(EditorBrowsableState.Never)]
public bool Disabled
{
+ get => !IsEnabled;
+ set => IsEnabled = !value;
+ }
+
+ /// <summary>
+ /// Sets or gets the state of the widget, which might be enabled or disabled.
+ /// </summary>
+ /// <since_tizen> preview </since_tizen>
+ [Obsolete("This has been deprecated in API12")]
+ public override bool IsEnabled
+ {
get
{
- return Interop.Eext.eext_circle_object_disabled_get(circleHandle);
+ return !Interop.Eext.eext_circle_object_disabled_get(CircleHandle);
}
set
{
- Interop.Eext.eext_circle_object_disabled_set(circleHandle, value);
+ Interop.Eext.eext_circle_object_disabled_set(CircleHandle, !value);
}
}
/// <summary>
- /// Sets or gets the color of the scroll background
+ /// Sets or gets the color of the scroll background.
/// </summary>
+ /// <since_tizen> preview </since_tizen>
+ [Obsolete("This has been deprecated in API12")]
public Color VerticalScrollBackgroundColor
{
get
{
int r, g, b, a;
- Interop.Eext.eext_circle_object_item_color_get(circleHandle, "vertical,scroll,bg", out r, out g, out b, out a);
+ Interop.Eext.eext_circle_object_item_color_get(CircleHandle, "vertical,scroll,bg", out r, out g, out b, out a);
return new Color(r, g, b, a);
}
set
{
- Interop.Eext.eext_circle_object_item_color_set(circleHandle, "vertical,scroll,bg", value.R, value.G, value.B, value.A);
+ Interop.Eext.eext_circle_object_item_color_set(CircleHandle, "vertical,scroll,bg", value.R, value.G, value.B, value.A);
}
}
/// <summary>
- /// Sets or gets the line width of the scroll background
+ /// Sets or gets the line width of the scroll background.
/// </summary>
+ /// <since_tizen> preview </since_tizen>
+ [Obsolete("This has been deprecated in API12")]
public int VerticalScrollBackgroundLineWidth
{
get
{
- return Interop.Eext.eext_circle_object_item_line_width_get(circleHandle, "vertical,scroll,bg");
+ return Interop.Eext.eext_circle_object_item_line_width_get(CircleHandle, "vertical,scroll,bg");
}
set
{
- Interop.Eext.eext_circle_object_item_line_width_set(circleHandle, "vertical,scroll,bg", value);
+ Interop.Eext.eext_circle_object_item_line_width_set(CircleHandle, "vertical,scroll,bg", value);
}
}
/// <summary>
- /// Sets or gets the redius of the scroll background
+ /// Sets or gets the radius of the scroll background.
/// </summary>
+ /// <since_tizen> preview </since_tizen>
+ [Obsolete("This has been deprecated in API12")]
public double VerticalScrollBackgroundRadius
{
get
{
- return Interop.Eext.eext_circle_object_item_radius_get(circleHandle, "vertical,scroll,bg");
+ return Interop.Eext.eext_circle_object_item_radius_get(CircleHandle, "vertical,scroll,bg");
}
set
{
- Interop.Eext.eext_circle_object_item_radius_set(circleHandle, "vertical,scroll,bg", value);
+ Interop.Eext.eext_circle_object_item_radius_set(CircleHandle, "vertical,scroll,bg", value);
}
}
/// <summary>
- /// Sets or gets the color of the scroll bar
+ /// Sets or gets the color of the scrollbar.
/// </summary>
+ /// <since_tizen> preview </since_tizen>
+ [Obsolete("This has been deprecated in API12")]
public Color VerticalScrollBarColor
{
get
{
int r, g, b, a;
- Interop.Eext.eext_circle_object_item_color_get(circleHandle, "default", out r, out g, out b, out a);
+ Interop.Eext.eext_circle_object_item_color_get(CircleHandle, "default", out r, out g, out b, out a);
return new Color(r, g, b, a);
}
set
{
- Interop.Eext.eext_circle_object_item_color_set(circleHandle, "default", value.R, value.G, value.B, value.A);
+ Interop.Eext.eext_circle_object_item_color_set(CircleHandle, "default", value.R, value.G, value.B, value.A);
}
}
/// <summary>
- /// Sets or gets the line width of the scroll bar
+ /// Sets or gets the line width of the scrollbar.
/// </summary>
+ /// <since_tizen> preview </since_tizen>
+ [Obsolete("This has been deprecated in API12")]
public int VerticalScrollBarLineWidth
{
get
{
- return Interop.Eext.eext_circle_object_item_line_width_get(circleHandle, "default");
+ return Interop.Eext.eext_circle_object_item_line_width_get(CircleHandle, "default");
}
set
{
- Interop.Eext.eext_circle_object_item_line_width_set(circleHandle, "default", value);
+ Interop.Eext.eext_circle_object_item_line_width_set(CircleHandle, "default", value);
}
}
/// <summary>
- /// Sets or gets the redius of the scroll bar
+ /// Sets or gets the radius of the scrollbar.
/// </summary>
+ /// <since_tizen> preview </since_tizen>
+ [Obsolete("This has been deprecated in API12")]
public double VerticalScrollBarRadius
{
get
{
- return Interop.Eext.eext_circle_object_item_radius_get(circleHandle, "default");
+ return Interop.Eext.eext_circle_object_item_radius_get(CircleHandle, "default");
}
set
{
- Interop.Eext.eext_circle_object_item_radius_set(circleHandle, "default", value);
+ Interop.Eext.eext_circle_object_item_radius_set(CircleHandle, "default", value);
}
}
/// <summary>
- /// Sets or gets the policy if the scroll bar is visible
+ /// Sets or gets the policy if the scrollbar is visible.
/// </summary>
/// <remarks>
- /// ScrollBarVisiblePolicy.Auto means the vertical scrollbar is made visible if it is needed, and otherwise kept hidden.
+ /// ScrollBarVisiblePolicy.Auto means the vertical scrollbar is made visible if it is needed, or otherwise kept hidden.
/// ScrollBarVisiblePolicy.Visible turns it on all the time, and ScrollBarVisiblePolicy.Invisible always keeps it off.
/// </remarks>
- public ScrollBarVisiblePolicy VerticalScrollBarVisiblePolicy
+ /// <since_tizen> preview </since_tizen>
+ [Obsolete("This has been deprecated in API12")]
+ public new ScrollBarVisiblePolicy VerticalScrollBarVisiblePolicy
{
get
{
int policy;
- Interop.Eext.eext_circle_object_genlist_scroller_policy_get(circleHandle, IntPtr.Zero, out policy);
+ Interop.Eext.eext_circle_object_genlist_scroller_policy_get(CircleHandle, IntPtr.Zero, out policy);
return (ScrollBarVisiblePolicy)policy;
}
set
{
int h;
- Interop.Eext.eext_circle_object_genlist_scroller_policy_get(circleHandle, out h, IntPtr.Zero);
- Interop.Eext.eext_circle_object_genlist_scroller_policy_set(circleHandle, (int)h, (int)value);
+ Interop.Eext.eext_circle_object_genlist_scroller_policy_get(CircleHandle, out h, IntPtr.Zero);
+ Interop.Eext.eext_circle_object_genlist_scroller_policy_set(CircleHandle, (int)h, (int)value);
}
}
+ /// <summary>
+ /// Creates a widget handle.
+ /// </summary>
+ /// <param name="parent">Parent EvasObject.</param>
+ /// <returns>Handle IntPtr.</returns>
+ /// <since_tizen> preview </since_tizen>
+ [Obsolete("This has been deprecated in API12")]
protected override IntPtr CreateHandle(EvasObject parent)
{
var handle = base.CreateHandle(parent);
-
- IntPtr surface = IntPtr.Zero;
-
- if (parent is Conformant)
- {
- surface = Interop.Eext.eext_circle_surface_conformant_add(parent);
- }
- else if (parent is Naviframe)
- {
- surface = Interop.Eext.eext_circle_surface_naviframe_add(parent.RealHandle);
- }
- else if (parent is Layout)
- {
- surface = Interop.Eext.eext_circle_surface_layout_add(parent);
- }
-
- circleHandle = Interop.Eext.eext_circle_object_genlist_add(RealHandle, surface);
- if (surface == IntPtr.Zero)
- {
- EvasObject p = parent;
- while(!(p is Window))
- {
- p = p.Parent;
- }
- var w = (p as Window).ScreenSize.Width;
- var h = (p as Window).ScreenSize.Height;
- Interop.Evas.evas_object_resize(circleHandle, w, h);
- }
-
- Interop.Eext.eext_rotary_object_event_activated_set(circleHandle, true);
+ _circleHandle = Interop.Eext.eext_circle_object_genlist_add(RealHandle == IntPtr.Zero ? handle : RealHandle, CircleSurface.Handle);
return handle;
}