[EflSharp] Update Circle and efl cs files (#995)
[platform/core/csapi/tizenfx.git] / internals / src / EflSharp / EflSharp / efl / efl_ui_progressbar_part.eo.cs
old mode 100644 (file)
new mode 100755 (executable)
index b415e44..ef20167
@@ -1,3 +1,4 @@
+#define EFL_BETA
 #pragma warning disable CS1591
 using System;
 using System.Runtime.InteropServices;
@@ -10,11 +11,12 @@ namespace Efl {
 namespace Ui {
 
 /// <summary>Elementary progressbar internal part class</summary>
+/// <remarks>This is a <b>BETA</b> class. It can be modified or removed in the future. Do not use it for product development.</remarks>
 [Efl.Ui.ProgressbarPart.NativeMethods]
 [Efl.Eo.BindingEntity]
 public class ProgressbarPart : Efl.Ui.LayoutPart, Efl.Ui.IRangeDisplay
 {
-    ///<summary>Pointer to the native class description.</summary>
+    /// <summary>Pointer to the native class description.</summary>
     public override System.IntPtr NativeClass
     {
         get
@@ -40,7 +42,8 @@ public class ProgressbarPart : Efl.Ui.LayoutPart, Efl.Ui.IRangeDisplay
         FinishInstantiation();
     }
 
-    /// <summary>Constructor to be used when objects are expected to be constructed from native code.</summary>
+    /// <summary>Subclasses should override this constructor if they are expected to be instantiated from native code.
+    /// Do not call this constructor directly.</summary>
     /// <param name="ch">Tag struct storing the native handle of the object being constructed.</param>
     protected ProgressbarPart(ConstructingHandle ch) : base(ch)
     {
@@ -61,27 +64,183 @@ public class ProgressbarPart : Efl.Ui.LayoutPart, Efl.Ui.IRangeDisplay
     {
     }
 
-    /// <summary>Control the range value (in percentage) on a given range widget
-    /// Use this call to set range levels.
-    /// 
-    /// Note: If you pass a value out of the specified interval for <c>val</c>, it will be interpreted as the closest of the boundary values in the interval.</summary>
-    /// <returns>The range value (must be between $0.0 and 1.0)</returns>
+    /// <summary>Emitted when the <see cref="Efl.Ui.IRangeDisplay.RangeValue"/> is getting changed.</summary>
+    public event EventHandler ChangedEvt
+    {
+        add
+        {
+            lock (eflBindingEventLock)
+            {
+                Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) =>
+                {
+                    var obj = Efl.Eo.Globals.WrapperSupervisorPtrToManaged(data).Target;
+                    if (obj != null)
+                    {
+                        EventArgs args = EventArgs.Empty;
+                        try
+                        {
+                            value?.Invoke(obj, args);
+                        }
+                        catch (Exception e)
+                        {
+                            Eina.Log.Error(e.ToString());
+                            Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
+                        }
+                    }
+                };
+
+                string key = "_EFL_UI_RANGE_EVENT_CHANGED";
+                AddNativeEventHandler(efl.Libs.Elementary, key, callerCb, value);
+            }
+        }
+
+        remove
+        {
+            lock (eflBindingEventLock)
+            {
+                string key = "_EFL_UI_RANGE_EVENT_CHANGED";
+                RemoveNativeEventHandler(efl.Libs.Elementary, key, value);
+            }
+        }
+    }
+    /// <summary>Method to raise event ChangedEvt.</summary>
+    public void OnChangedEvt(EventArgs e)
+    {
+        var key = "_EFL_UI_RANGE_EVENT_CHANGED";
+        IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Elementary, key);
+        if (desc == IntPtr.Zero)
+        {
+            Eina.Log.Error($"Failed to get native event {key}");
+            return;
+        }
+
+        Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, IntPtr.Zero);
+    }
+    /// <summary>Emitted when the <see cref="Efl.Ui.IRangeDisplay.RangeValue"/> has reached the minimum of <see cref="Efl.Ui.IRangeDisplay.GetRangeLimits"/>.</summary>
+    public event EventHandler MinReachedEvt
+    {
+        add
+        {
+            lock (eflBindingEventLock)
+            {
+                Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) =>
+                {
+                    var obj = Efl.Eo.Globals.WrapperSupervisorPtrToManaged(data).Target;
+                    if (obj != null)
+                    {
+                        EventArgs args = EventArgs.Empty;
+                        try
+                        {
+                            value?.Invoke(obj, args);
+                        }
+                        catch (Exception e)
+                        {
+                            Eina.Log.Error(e.ToString());
+                            Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
+                        }
+                    }
+                };
+
+                string key = "_EFL_UI_RANGE_EVENT_MIN_REACHED";
+                AddNativeEventHandler(efl.Libs.Elementary, key, callerCb, value);
+            }
+        }
+
+        remove
+        {
+            lock (eflBindingEventLock)
+            {
+                string key = "_EFL_UI_RANGE_EVENT_MIN_REACHED";
+                RemoveNativeEventHandler(efl.Libs.Elementary, key, value);
+            }
+        }
+    }
+    /// <summary>Method to raise event MinReachedEvt.</summary>
+    public void OnMinReachedEvt(EventArgs e)
+    {
+        var key = "_EFL_UI_RANGE_EVENT_MIN_REACHED";
+        IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Elementary, key);
+        if (desc == IntPtr.Zero)
+        {
+            Eina.Log.Error($"Failed to get native event {key}");
+            return;
+        }
+
+        Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, IntPtr.Zero);
+    }
+    /// <summary>Emitted when the <c>range_value</c> has reached the maximum of <see cref="Efl.Ui.IRangeDisplay.GetRangeLimits"/>.</summary>
+    public event EventHandler MaxReachedEvt
+    {
+        add
+        {
+            lock (eflBindingEventLock)
+            {
+                Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) =>
+                {
+                    var obj = Efl.Eo.Globals.WrapperSupervisorPtrToManaged(data).Target;
+                    if (obj != null)
+                    {
+                        EventArgs args = EventArgs.Empty;
+                        try
+                        {
+                            value?.Invoke(obj, args);
+                        }
+                        catch (Exception e)
+                        {
+                            Eina.Log.Error(e.ToString());
+                            Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
+                        }
+                    }
+                };
+
+                string key = "_EFL_UI_RANGE_EVENT_MAX_REACHED";
+                AddNativeEventHandler(efl.Libs.Elementary, key, callerCb, value);
+            }
+        }
+
+        remove
+        {
+            lock (eflBindingEventLock)
+            {
+                string key = "_EFL_UI_RANGE_EVENT_MAX_REACHED";
+                RemoveNativeEventHandler(efl.Libs.Elementary, key, value);
+            }
+        }
+    }
+    /// <summary>Method to raise event MaxReachedEvt.</summary>
+    public void OnMaxReachedEvt(EventArgs e)
+    {
+        var key = "_EFL_UI_RANGE_EVENT_MAX_REACHED";
+        IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Elementary, key);
+        if (desc == IntPtr.Zero)
+        {
+            Eina.Log.Error($"Failed to get native event {key}");
+            return;
+        }
+
+        Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, IntPtr.Zero);
+    }
+    /// <summary>Control the value (position) of the widget within its valid range.
+    /// Values outside the limits defined in <see cref="Efl.Ui.IRangeDisplay.GetRangeLimits"/> are ignored and an error is printed.</summary>
+    /// <returns>The range value (must be within the bounds of <see cref="Efl.Ui.IRangeDisplay.GetRangeLimits"/>).</returns>
     virtual public double GetRangeValue() {
          var _ret_var = Efl.Ui.IRangeDisplayConcrete.NativeMethods.efl_ui_range_value_get_ptr.Value.Delegate((IsGeneratedBindingClass ? this.NativeHandle : Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass)));
         Eina.Error.RaiseIfUnhandledException();
         return _ret_var;
  }
-    /// <summary>Control the range value (in percentage) on a given range widget
-    /// Use this call to set range levels.
-    /// 
-    /// Note: If you pass a value out of the specified interval for <c>val</c>, it will be interpreted as the closest of the boundary values in the interval.</summary>
-    /// <param name="val">The range value (must be between $0.0 and 1.0)</param>
+    /// <summary>Control the value (position) of the widget within its valid range.
+    /// Values outside the limits defined in <see cref="Efl.Ui.IRangeDisplay.GetRangeLimits"/> are ignored and an error is printed.</summary>
+    /// <param name="val">The range value (must be within the bounds of <see cref="Efl.Ui.IRangeDisplay.GetRangeLimits"/>).</param>
     virtual public void SetRangeValue(double val) {
                                  Efl.Ui.IRangeDisplayConcrete.NativeMethods.efl_ui_range_value_set_ptr.Value.Delegate((IsGeneratedBindingClass ? this.NativeHandle : Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass)),val);
         Eina.Error.RaiseIfUnhandledException();
                          }
-    /// <summary>Get the minimum and maximum values of the given range widget.
-    /// Note: If only one value is needed, the other pointer can be passed as <c>null</c>.</summary>
+    /// <summary>Set the minimum and maximum values for given range widget.
+    /// If the current value is less than <c>min</c>, it will be updated to <c>min</c>. If it is bigger then <c>max</c>, will be updated to <c>max</c>. The resulting value can be obtained with <see cref="Efl.Ui.IRangeDisplay.GetRangeValue"/>.
+    /// 
+    /// The default minimum and maximum values may be different for each class.
+    /// 
+    /// Note: maximum must be greater than minimum, otherwise behavior is undefined.</summary>
     /// <param name="min">The minimum value.</param>
     /// <param name="max">The maximum value.</param>
     virtual public void GetRangeLimits(out double min, out double max) {
@@ -89,28 +248,40 @@ public class ProgressbarPart : Efl.Ui.LayoutPart, Efl.Ui.IRangeDisplay
         Eina.Error.RaiseIfUnhandledException();
                                          }
     /// <summary>Set the minimum and maximum values for given range widget.
-    /// Define the allowed range of values to be selected by the user.
+    /// If the current value is less than <c>min</c>, it will be updated to <c>min</c>. If it is bigger then <c>max</c>, will be updated to <c>max</c>. The resulting value can be obtained with <see cref="Efl.Ui.IRangeDisplay.GetRangeValue"/>.
     /// 
-    /// If actual value is less than <c>min</c>, it will be updated to <c>min</c>. If it is bigger then <c>max</c>, will be updated to <c>max</c>. The actual value can be obtained with <see cref="Efl.Ui.IRangeDisplay.GetRangeValue"/>
+    /// The default minimum and maximum values may be different for each class.
     /// 
-    /// The minimum and maximum values may be different for each class.
-    /// 
-    /// Warning: maximum must be greater than minimum, otherwise behavior is undefined.</summary>
+    /// Note: maximum must be greater than minimum, otherwise behavior is undefined.</summary>
     /// <param name="min">The minimum value.</param>
     /// <param name="max">The maximum value.</param>
     virtual public void SetRangeLimits(double min, double max) {
                                                          Efl.Ui.IRangeDisplayConcrete.NativeMethods.efl_ui_range_limits_set_ptr.Value.Delegate((IsGeneratedBindingClass ? this.NativeHandle : Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass)),min, max);
         Eina.Error.RaiseIfUnhandledException();
                                          }
-    /// <summary>Control the range value (in percentage) on a given range widget
-    /// Use this call to set range levels.
-    /// 
-    /// Note: If you pass a value out of the specified interval for <c>val</c>, it will be interpreted as the closest of the boundary values in the interval.</summary>
-    /// <value>The range value (must be between $0.0 and 1.0)</value>
+    /// <summary>Control the value (position) of the widget within its valid range.
+    /// Values outside the limits defined in <see cref="Efl.Ui.IRangeDisplay.GetRangeLimits"/> are ignored and an error is printed.</summary>
+    /// <value>The range value (must be within the bounds of <see cref="Efl.Ui.IRangeDisplay.GetRangeLimits"/>).</value>
     public double RangeValue {
         get { return GetRangeValue(); }
         set { SetRangeValue(value); }
     }
+    /// <summary>Set the minimum and maximum values for given range widget.
+    /// If the current value is less than <c>min</c>, it will be updated to <c>min</c>. If it is bigger then <c>max</c>, will be updated to <c>max</c>. The resulting value can be obtained with <see cref="Efl.Ui.IRangeDisplay.GetRangeValue"/>.
+    /// 
+    /// The default minimum and maximum values may be different for each class.
+    /// 
+    /// Note: maximum must be greater than minimum, otherwise behavior is undefined.</summary>
+    /// <value>The minimum value.</value>
+    public (double, double) RangeLimits {
+        get {
+            double _out_min = default(double);
+            double _out_max = default(double);
+            GetRangeLimits(out _out_min,out _out_max);
+            return (_out_min,_out_max);
+        }
+        set { SetRangeLimits( value.Item1,  value.Item2); }
+    }
     private static IntPtr GetEflClassStatic()
     {
         return Efl.Ui.ProgressbarPart.efl_ui_progressbar_part_class_get();
@@ -328,3 +499,17 @@ public class ProgressbarPart : Efl.Ui.LayoutPart, Efl.Ui.IRangeDisplay
 
 }
 
+#if EFL_BETA
+#pragma warning disable CS1591
+public static class Efl_UiProgressbarPart_ExtensionMethods {
+    public static Efl.BindableProperty<double> RangeValue<T>(this Efl.Ui.ItemFactory<T> fac, Efl.Csharp.ExtensionTag<Efl.Ui.ProgressbarPart, T>magic = null) where T : Efl.Ui.ProgressbarPart {
+        return new Efl.BindableProperty<double>("range_value", fac);
+    }
+public static Efl.BindableProperty<double> RangeValue<T>(this Efl.BindablePart<T> part, Efl.Csharp.ExtensionTag<Efl.Ui.ProgressbarPart, T>magic = null) where T : Efl.Ui.ProgressbarPart {
+        return new Efl.BindableProperty<double>(part.PartName, "range_value", part.Binder);
+    }
+
+    
+}
+#pragma warning restore CS1591
+#endif