1 #pragma warning disable CS1591
3 using System.Runtime.InteropServices;
4 using System.Collections.Generic;
6 using System.Threading;
7 using System.ComponentModel;
14 /// <summary>Object used by <see cref="Efl.Ui.Spotlight.Container"/> to render an indication of the active widgets's position among the rest of the container's widgets.
15 /// An example would be Android's little dots in the home screen.</summary>
16 [Efl.Ui.Spotlight.Indicator.NativeMethods]
17 [Efl.Eo.BindingEntity]
18 public abstract class Indicator : Efl.Object
20 ///<summary>Pointer to the native class description.</summary>
21 public override System.IntPtr NativeClass
25 if (((object)this).GetType() == typeof(Indicator))
27 return GetEflClassStatic();
31 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
36 [System.Runtime.InteropServices.DllImport(efl.Libs.Elementary)] internal static extern System.IntPtr
37 efl_ui_spotlight_indicator_class_get();
38 /// <summary>Initializes a new instance of the <see cref="Indicator"/> class.</summary>
39 /// <param name="parent">Parent instance.</param>
40 public Indicator(Efl.Object parent= null
41 ) : base(efl_ui_spotlight_indicator_class_get(), parent)
43 FinishInstantiation();
46 /// <summary>Constructor to be used when objects are expected to be constructed from native code.</summary>
47 /// <param name="ch">Tag struct storing the native handle of the object being constructed.</param>
48 protected Indicator(ConstructingHandle ch) : base(ch)
52 /// <summary>Initializes a new instance of the <see cref="Indicator"/> class.
53 /// Internal usage: Constructs an instance from a native pointer. This is used when interacting with C code and should not be used directly.</summary>
54 /// <param name="wh">The native pointer to be wrapped.</param>
55 protected Indicator(Efl.Eo.Globals.WrappingHandle wh) : base(wh)
59 [Efl.Eo.PrivateNativeClass]
60 private class IndicatorRealized : Indicator
62 private IndicatorRealized(Efl.Eo.Globals.WrappingHandle wh) : base(wh)
66 /// <summary>Initializes a new instance of the <see cref="Indicator"/> class.
67 /// Internal usage: Constructor to forward the wrapper initialization to the root class that interfaces with native code. Should not be used directly.</summary>
68 /// <param name="baseKlass">The pointer to the base native Eo class.</param>
69 /// <param name="parent">The Efl.Object parent of this instance.</param>
70 protected Indicator(IntPtr baseKlass, Efl.Object parent) : base(baseKlass, parent)
74 /// <summary>This method is called the first time an <see cref="Efl.Ui.Spotlight.Indicator"/> is assigned to an <see cref="Efl.Ui.Spotlight.Container"/>, binding them together.
75 /// This call can be used to setup the indicator part of the <c>spotlight</c>.
77 /// The Active View of the container (if there is any) will be informed to the indicator by a later call to <see cref="Efl.Ui.Spotlight.Indicator.UpdatePosition"/>.</summary>
78 /// <param name="spotlight">The container to bind this indicator to.</param>
79 virtual public void Bind(Efl.Ui.Spotlight.Container spotlight) {
80 Efl.Ui.Spotlight.Indicator.NativeMethods.efl_ui_spotlight_indicator_bind_ptr.Value.Delegate((IsGeneratedBindingClass ? this.NativeHandle : Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass)),spotlight);
81 Eina.Error.RaiseIfUnhandledException();
83 /// <summary>A <c>subobj</c> has been added at position <c>index</c> in the bound container.
84 /// The manager should check the container's <see cref="Efl.Ui.Spotlight.Container.ActiveIndex"/> since indices might have shifted due to the insertion of the new object.</summary>
85 /// <param name="subobj">The new object that has been added to the container.</param>
86 /// <param name="index">The index of the new object in the container's list.</param>
87 virtual public void AddContent(Efl.Gfx.IEntity subobj, int index) {
88 Efl.Ui.Spotlight.Indicator.NativeMethods.efl_ui_spotlight_indicator_content_add_ptr.Value.Delegate((IsGeneratedBindingClass ? this.NativeHandle : Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass)),subobj, index);
89 Eina.Error.RaiseIfUnhandledException();
91 /// <summary>The <c>subobj</c> at position <c>index</c> in the bound container has been removed.
92 /// The manager should check the container's <see cref="Efl.Ui.Spotlight.Container.ActiveIndex"/> since indices might have shifted due to the removal of the object.</summary>
93 /// <param name="subobj">The object being removed from the container.</param>
94 /// <param name="index">The index this object had in the container's list.</param>
95 virtual public void DelContent(Efl.Gfx.IEntity subobj, int index) {
96 Efl.Ui.Spotlight.Indicator.NativeMethods.efl_ui_spotlight_indicator_content_del_ptr.Value.Delegate((IsGeneratedBindingClass ? this.NativeHandle : Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass)),subobj, index);
97 Eina.Error.RaiseIfUnhandledException();
99 /// <summary>This method tells the indicator that <see cref="Efl.Ui.Spotlight.Container.ActiveIndex"/> has changed in the bound container.
100 /// <c>position</c> ranges from -1 to the number of views in the bound container (<see cref="Efl.IContainer.ContentCount"/>). Notice this allows moving to a position before the first view or past the last view, which might happen if the view is thumb-scrolled out-of-bounds. Indicators can choose to render these out-of-bounds positions or not.
102 /// Fractional values indicate positions in-between two views and should be respected to obtain a smooth transition.</summary>
103 /// <param name="position">The index of the active view, or a value in-between views if a transition is currently playing.</param>
104 virtual public void UpdatePosition(double position) {
105 Efl.Ui.Spotlight.Indicator.NativeMethods.efl_ui_spotlight_indicator_position_update_ptr.Value.Delegate((IsGeneratedBindingClass ? this.NativeHandle : Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass)),position);
106 Eina.Error.RaiseIfUnhandledException();
108 private static IntPtr GetEflClassStatic()
110 return Efl.Ui.Spotlight.Indicator.efl_ui_spotlight_indicator_class_get();
112 /// <summary>Wrapper for native methods and virtual method delegates.
113 /// For internal use by generated code only.</summary>
114 public new class NativeMethods : Efl.Object.NativeMethods
116 private static Efl.Eo.NativeModule Module = new Efl.Eo.NativeModule( efl.Libs.Elementary);
117 /// <summary>Gets the list of Eo operations to override.</summary>
118 /// <returns>The list of Eo operations to be overload.</returns>
119 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
121 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
122 var methods = Efl.Eo.Globals.GetUserMethods(type);
124 if (efl_ui_spotlight_indicator_bind_static_delegate == null)
126 efl_ui_spotlight_indicator_bind_static_delegate = new efl_ui_spotlight_indicator_bind_delegate(bind);
129 if (methods.FirstOrDefault(m => m.Name == "Bind") != null)
131 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_ui_spotlight_indicator_bind"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_spotlight_indicator_bind_static_delegate) });
134 if (efl_ui_spotlight_indicator_content_add_static_delegate == null)
136 efl_ui_spotlight_indicator_content_add_static_delegate = new efl_ui_spotlight_indicator_content_add_delegate(content_add);
139 if (methods.FirstOrDefault(m => m.Name == "AddContent") != null)
141 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_ui_spotlight_indicator_content_add"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_spotlight_indicator_content_add_static_delegate) });
144 if (efl_ui_spotlight_indicator_content_del_static_delegate == null)
146 efl_ui_spotlight_indicator_content_del_static_delegate = new efl_ui_spotlight_indicator_content_del_delegate(content_del);
149 if (methods.FirstOrDefault(m => m.Name == "DelContent") != null)
151 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_ui_spotlight_indicator_content_del"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_spotlight_indicator_content_del_static_delegate) });
154 if (efl_ui_spotlight_indicator_position_update_static_delegate == null)
156 efl_ui_spotlight_indicator_position_update_static_delegate = new efl_ui_spotlight_indicator_position_update_delegate(position_update);
159 if (methods.FirstOrDefault(m => m.Name == "UpdatePosition") != null)
161 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_ui_spotlight_indicator_position_update"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_spotlight_indicator_position_update_static_delegate) });
164 descs.AddRange(base.GetEoOps(type));
167 /// <summary>Returns the Eo class for the native methods of this class.</summary>
168 /// <returns>The native class pointer.</returns>
169 public override IntPtr GetEflClass()
171 return Efl.Ui.Spotlight.Indicator.efl_ui_spotlight_indicator_class_get();
174 #pragma warning disable CA1707, CS1591, SA1300, SA1600
177 private delegate void efl_ui_spotlight_indicator_bind_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))] Efl.Ui.Spotlight.Container spotlight);
180 public delegate void efl_ui_spotlight_indicator_bind_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))] Efl.Ui.Spotlight.Container spotlight);
182 public static Efl.Eo.FunctionWrapper<efl_ui_spotlight_indicator_bind_api_delegate> efl_ui_spotlight_indicator_bind_ptr = new Efl.Eo.FunctionWrapper<efl_ui_spotlight_indicator_bind_api_delegate>(Module, "efl_ui_spotlight_indicator_bind");
184 private static void bind(System.IntPtr obj, System.IntPtr pd, Efl.Ui.Spotlight.Container spotlight)
186 Eina.Log.Debug("function efl_ui_spotlight_indicator_bind was called");
187 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
193 ((Indicator)ws.Target).Bind(spotlight);
197 Eina.Log.Warning($"Callback error: {e.ToString()}");
198 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
205 efl_ui_spotlight_indicator_bind_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), spotlight);
209 private static efl_ui_spotlight_indicator_bind_delegate efl_ui_spotlight_indicator_bind_static_delegate;
212 private delegate void efl_ui_spotlight_indicator_content_add_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))] Efl.Gfx.IEntity subobj, int index);
215 public delegate void efl_ui_spotlight_indicator_content_add_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))] Efl.Gfx.IEntity subobj, int index);
217 public static Efl.Eo.FunctionWrapper<efl_ui_spotlight_indicator_content_add_api_delegate> efl_ui_spotlight_indicator_content_add_ptr = new Efl.Eo.FunctionWrapper<efl_ui_spotlight_indicator_content_add_api_delegate>(Module, "efl_ui_spotlight_indicator_content_add");
219 private static void content_add(System.IntPtr obj, System.IntPtr pd, Efl.Gfx.IEntity subobj, int index)
221 Eina.Log.Debug("function efl_ui_spotlight_indicator_content_add was called");
222 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
228 ((Indicator)ws.Target).AddContent(subobj, index);
232 Eina.Log.Warning($"Callback error: {e.ToString()}");
233 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
240 efl_ui_spotlight_indicator_content_add_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), subobj, index);
244 private static efl_ui_spotlight_indicator_content_add_delegate efl_ui_spotlight_indicator_content_add_static_delegate;
247 private delegate void efl_ui_spotlight_indicator_content_del_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))] Efl.Gfx.IEntity subobj, int index);
250 public delegate void efl_ui_spotlight_indicator_content_del_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))] Efl.Gfx.IEntity subobj, int index);
252 public static Efl.Eo.FunctionWrapper<efl_ui_spotlight_indicator_content_del_api_delegate> efl_ui_spotlight_indicator_content_del_ptr = new Efl.Eo.FunctionWrapper<efl_ui_spotlight_indicator_content_del_api_delegate>(Module, "efl_ui_spotlight_indicator_content_del");
254 private static void content_del(System.IntPtr obj, System.IntPtr pd, Efl.Gfx.IEntity subobj, int index)
256 Eina.Log.Debug("function efl_ui_spotlight_indicator_content_del was called");
257 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
263 ((Indicator)ws.Target).DelContent(subobj, index);
267 Eina.Log.Warning($"Callback error: {e.ToString()}");
268 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
275 efl_ui_spotlight_indicator_content_del_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), subobj, index);
279 private static efl_ui_spotlight_indicator_content_del_delegate efl_ui_spotlight_indicator_content_del_static_delegate;
282 private delegate void efl_ui_spotlight_indicator_position_update_delegate(System.IntPtr obj, System.IntPtr pd, double position);
285 public delegate void efl_ui_spotlight_indicator_position_update_api_delegate(System.IntPtr obj, double position);
287 public static Efl.Eo.FunctionWrapper<efl_ui_spotlight_indicator_position_update_api_delegate> efl_ui_spotlight_indicator_position_update_ptr = new Efl.Eo.FunctionWrapper<efl_ui_spotlight_indicator_position_update_api_delegate>(Module, "efl_ui_spotlight_indicator_position_update");
289 private static void position_update(System.IntPtr obj, System.IntPtr pd, double position)
291 Eina.Log.Debug("function efl_ui_spotlight_indicator_position_update was called");
292 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
298 ((Indicator)ws.Target).UpdatePosition(position);
302 Eina.Log.Warning($"Callback error: {e.ToString()}");
303 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
310 efl_ui_spotlight_indicator_position_update_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), position);
314 private static efl_ui_spotlight_indicator_position_update_delegate efl_ui_spotlight_indicator_position_update_static_delegate;
316 #pragma warning restore CA1707, CS1591, SA1300, SA1600