2 #pragma warning disable CS1591
4 using System.Runtime.InteropServices;
5 using System.Collections.Generic;
7 using System.Threading;
8 using System.ComponentModel;
13 /// <summary>Helper class that connects theme signals or object events to the interfaces which are for actions.
14 /// For example, this simplifies creating widgets that implement the <see cref="Efl.Input.IClickable"/> interface.</summary>
15 /// <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>
16 [Efl.Ui.ActionConnector.NativeMethods]
17 [Efl.Eo.BindingEntity]
18 public class ActionConnector : Efl.Eo.EoWrapper
20 /// <summary>Pointer to the native class description.</summary>
21 public override System.IntPtr NativeClass
25 if (((object)this).GetType() == typeof(ActionConnector))
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_action_connector_class_get();
38 /// <summary>Initializes a new instance of the <see cref="ActionConnector"/> class.</summary>
39 /// <param name="parent">Parent instance.</param>
40 public ActionConnector(Efl.Object parent= null
41 ) : base(efl_ui_action_connector_class_get(), parent)
43 FinishInstantiation();
46 /// <summary>Subclasses should override this constructor if they are expected to be instantiated from native code.
47 /// Do not call this constructor directly.</summary>
48 /// <param name="ch">Tag struct storing the native handle of the object being constructed.</param>
49 protected ActionConnector(ConstructingHandle ch) : base(ch)
53 /// <summary>Initializes a new instance of the <see cref="ActionConnector"/> class.
54 /// Internal usage: Constructs an instance from a native pointer. This is used when interacting with C code and should not be used directly.</summary>
55 /// <param name="wh">The native pointer to be wrapped.</param>
56 protected ActionConnector(Efl.Eo.Globals.WrappingHandle wh) : base(wh)
60 /// <summary>Initializes a new instance of the <see cref="ActionConnector"/> class.
61 /// Internal usage: Constructor to forward the wrapper initialization to the root class that interfaces with native code. Should not be used directly.</summary>
62 /// <param name="baseKlass">The pointer to the base native Eo class.</param>
63 /// <param name="parent">The Efl.Object parent of this instance.</param>
64 protected ActionConnector(IntPtr baseKlass, Efl.Object parent) : base(baseKlass, parent)
68 /// <summary>This will listen to the standard "click" events on a theme and emit the appropriate events through the <see cref="Efl.Input.IClickable"/> interface.
69 /// Using these methods widgets do not need to listen to the theme signals. This class does it and calls the correct clickable functions.
71 /// This handles theme signals "efl,action,press", "efl,action,unpress" and "efl,action,mouse_out", and the <see cref="Efl.Input.IInterface.PointerMoveEvt"/> event.</summary>
72 /// <param name="kw_object">The object to listen on.</param>
73 /// <param name="clickable">The object to call the clickable methods on.</param>
74 public static void BindClickableToTheme(Efl.Canvas.Layout kw_object, Efl.Input.IClickable clickable) {
75 Efl.Ui.ActionConnector.NativeMethods.efl_ui_action_connector_bind_clickable_to_theme_ptr.Value.Delegate(kw_object, clickable);
76 Eina.Error.RaiseIfUnhandledException();
78 /// <summary>This will listen to the standard "click" events on an object, and emit the appropriate events through the <see cref="Efl.Input.IClickable"/> interface.
79 /// Using these methods widgets do not need to listen to the object events. This class does it and calls the correct clickable functions.
81 /// The handled events are <see cref="Efl.Input.IInterface.PointerUpEvt"/> and <see cref="Efl.Input.IInterface.PointerDownEvt"/>.</summary>
82 /// <param name="kw_object">The object to listen on.</param>
83 /// <param name="clickable">The object to call the clickable methods on.</param>
84 public static void BindClickableToObject(Efl.Input.IInterface kw_object, Efl.Input.IClickable clickable) {
85 Efl.Ui.ActionConnector.NativeMethods.efl_ui_action_connector_bind_clickable_to_object_ptr.Value.Delegate(kw_object, clickable);
86 Eina.Error.RaiseIfUnhandledException();
88 private static IntPtr GetEflClassStatic()
90 return Efl.Ui.ActionConnector.efl_ui_action_connector_class_get();
92 /// <summary>Wrapper for native methods and virtual method delegates.
93 /// For internal use by generated code only.</summary>
94 public new class NativeMethods : Efl.Eo.EoWrapper.NativeMethods
96 private static Efl.Eo.NativeModule Module = new Efl.Eo.NativeModule( efl.Libs.Elementary);
97 /// <summary>Gets the list of Eo operations to override.</summary>
98 /// <returns>The list of Eo operations to be overload.</returns>
99 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
101 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
102 descs.AddRange(base.GetEoOps(type));
105 /// <summary>Returns the Eo class for the native methods of this class.</summary>
106 /// <returns>The native class pointer.</returns>
107 public override IntPtr GetEflClass()
109 return Efl.Ui.ActionConnector.efl_ui_action_connector_class_get();
112 #pragma warning disable CA1707, CS1591, SA1300, SA1600
115 private delegate void efl_ui_action_connector_bind_clickable_to_theme_delegate([MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))] Efl.Canvas.Layout kw_object, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))] Efl.Input.IClickable clickable);
118 public delegate void efl_ui_action_connector_bind_clickable_to_theme_api_delegate([MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))] Efl.Canvas.Layout kw_object, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))] Efl.Input.IClickable clickable);
120 public static Efl.Eo.FunctionWrapper<efl_ui_action_connector_bind_clickable_to_theme_api_delegate> efl_ui_action_connector_bind_clickable_to_theme_ptr = new Efl.Eo.FunctionWrapper<efl_ui_action_connector_bind_clickable_to_theme_api_delegate>(Module, "efl_ui_action_connector_bind_clickable_to_theme");
122 private static void bind_clickable_to_theme(System.IntPtr obj, System.IntPtr pd, Efl.Canvas.Layout kw_object, Efl.Input.IClickable clickable)
124 Eina.Log.Debug("function efl_ui_action_connector_bind_clickable_to_theme was called");
125 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
131 ActionConnector.BindClickableToTheme(kw_object, clickable);
135 Eina.Log.Warning($"Callback error: {e.ToString()}");
136 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
143 efl_ui_action_connector_bind_clickable_to_theme_ptr.Value.Delegate(kw_object, clickable);
148 private delegate void efl_ui_action_connector_bind_clickable_to_object_delegate([MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))] Efl.Input.IInterface kw_object, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))] Efl.Input.IClickable clickable);
151 public delegate void efl_ui_action_connector_bind_clickable_to_object_api_delegate([MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))] Efl.Input.IInterface kw_object, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))] Efl.Input.IClickable clickable);
153 public static Efl.Eo.FunctionWrapper<efl_ui_action_connector_bind_clickable_to_object_api_delegate> efl_ui_action_connector_bind_clickable_to_object_ptr = new Efl.Eo.FunctionWrapper<efl_ui_action_connector_bind_clickable_to_object_api_delegate>(Module, "efl_ui_action_connector_bind_clickable_to_object");
155 private static void bind_clickable_to_object(System.IntPtr obj, System.IntPtr pd, Efl.Input.IInterface kw_object, Efl.Input.IClickable clickable)
157 Eina.Log.Debug("function efl_ui_action_connector_bind_clickable_to_object was called");
158 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
164 ActionConnector.BindClickableToObject(kw_object, clickable);
168 Eina.Log.Warning($"Callback error: {e.ToString()}");
169 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
176 efl_ui_action_connector_bind_clickable_to_object_ptr.Value.Delegate(kw_object, clickable);
180 #pragma warning restore CA1707, CS1591, SA1300, SA1600
189 #pragma warning disable CS1591
190 public static class Efl_UiActionConnector_ExtensionMethods {
192 #pragma warning restore CS1591