1 #pragma warning disable CS1591
3 using System.Runtime.InteropServices;
4 using System.Collections.Generic;
6 using System.Threading;
7 using System.ComponentModel;
12 /// <summary>Efl UI selectable interface</summary>
13 [Efl.Ui.ISelectableConcrete.NativeMethods]
14 [Efl.Eo.BindingEntity]
15 public interface ISelectable :
16 Efl.Eo.IWrapper, IDisposable
18 /// <summary>Called when selected</summary>
19 event EventHandler<Efl.Ui.ISelectableItemSelectedEvt_Args> ItemSelectedEvt;
20 /// <summary>Called when no longer selected</summary>
21 event EventHandler<Efl.Ui.ISelectableItemUnselectedEvt_Args> ItemUnselectedEvt;
22 /// <summary>Called when selection is pasted</summary>
23 event EventHandler SelectionPasteEvt;
24 /// <summary>Called when selection is copied</summary>
25 event EventHandler SelectionCopyEvt;
26 /// <summary>Called when selection is cut</summary>
27 event EventHandler SelectionCutEvt;
28 /// <summary>Called at selection start</summary>
29 event EventHandler SelectionStartEvt;
30 /// <summary>Called when selection is changed</summary>
31 event EventHandler SelectionChangedEvt;
32 /// <summary>Called when selection is cleared</summary>
33 event EventHandler SelectionClearedEvt;
35 ///<summary>Event argument wrapper for event <see cref="Efl.Ui.ISelectable.ItemSelectedEvt"/>.</summary>
36 [Efl.Eo.BindingEntity]
37 public class ISelectableItemSelectedEvt_Args : EventArgs {
38 ///<summary>Actual event payload.</summary>
39 public Efl.Object arg { get; set; }
41 ///<summary>Event argument wrapper for event <see cref="Efl.Ui.ISelectable.ItemUnselectedEvt"/>.</summary>
42 [Efl.Eo.BindingEntity]
43 public class ISelectableItemUnselectedEvt_Args : EventArgs {
44 ///<summary>Actual event payload.</summary>
45 public Efl.Object arg { get; set; }
47 /// <summary>Efl UI selectable interface</summary>
48 sealed public class ISelectableConcrete :
53 ///<summary>Pointer to the native class description.</summary>
54 public override System.IntPtr NativeClass
58 if (((object)this).GetType() == typeof(ISelectableConcrete))
60 return GetEflClassStatic();
64 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
69 /// <summary>Constructor to be used when objects are expected to be constructed from native code.</summary>
70 /// <param name="ch">Tag struct storing the native handle of the object being constructed.</param>
71 private ISelectableConcrete(ConstructingHandle ch) : base(ch)
75 [System.Runtime.InteropServices.DllImport("libefl.so.1")] internal static extern System.IntPtr
76 efl_ui_selectable_interface_get();
77 /// <summary>Initializes a new instance of the <see cref="ISelectable"/> class.
78 /// Internal usage: This is used when interacting with C code and should not be used directly.</summary>
79 /// <param name="wh">The native pointer to be wrapped.</param>
80 private ISelectableConcrete(Efl.Eo.Globals.WrappingHandle wh) : base(wh)
84 /// <summary>Called when selected</summary>
85 public event EventHandler<Efl.Ui.ISelectableItemSelectedEvt_Args> ItemSelectedEvt
89 lock (eflBindingEventLock)
91 Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) =>
93 var obj = Efl.Eo.Globals.WrapperSupervisorPtrToManaged(data).Target;
96 Efl.Ui.ISelectableItemSelectedEvt_Args args = new Efl.Ui.ISelectableItemSelectedEvt_Args();
97 args.arg = (Efl.Eo.Globals.CreateWrapperFor(evt.Info) as Efl.Object);
100 value?.Invoke(obj, args);
104 Eina.Log.Error(e.ToString());
105 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
110 string key = "_EFL_UI_EVENT_ITEM_SELECTED";
111 AddNativeEventHandler(efl.Libs.Efl, key, callerCb, value);
117 lock (eflBindingEventLock)
119 string key = "_EFL_UI_EVENT_ITEM_SELECTED";
120 RemoveNativeEventHandler(efl.Libs.Efl, key, value);
124 ///<summary>Method to raise event ItemSelectedEvt.</summary>
125 public void OnItemSelectedEvt(Efl.Ui.ISelectableItemSelectedEvt_Args e)
127 var key = "_EFL_UI_EVENT_ITEM_SELECTED";
128 IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Efl, key);
129 if (desc == IntPtr.Zero)
131 Eina.Log.Error($"Failed to get native event {key}");
135 IntPtr info = e.arg.NativeHandle;
136 Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, info);
138 /// <summary>Called when no longer selected</summary>
139 public event EventHandler<Efl.Ui.ISelectableItemUnselectedEvt_Args> ItemUnselectedEvt
143 lock (eflBindingEventLock)
145 Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) =>
147 var obj = Efl.Eo.Globals.WrapperSupervisorPtrToManaged(data).Target;
150 Efl.Ui.ISelectableItemUnselectedEvt_Args args = new Efl.Ui.ISelectableItemUnselectedEvt_Args();
151 args.arg = (Efl.Eo.Globals.CreateWrapperFor(evt.Info) as Efl.Object);
154 value?.Invoke(obj, args);
158 Eina.Log.Error(e.ToString());
159 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
164 string key = "_EFL_UI_EVENT_ITEM_UNSELECTED";
165 AddNativeEventHandler(efl.Libs.Efl, key, callerCb, value);
171 lock (eflBindingEventLock)
173 string key = "_EFL_UI_EVENT_ITEM_UNSELECTED";
174 RemoveNativeEventHandler(efl.Libs.Efl, key, value);
178 ///<summary>Method to raise event ItemUnselectedEvt.</summary>
179 public void OnItemUnselectedEvt(Efl.Ui.ISelectableItemUnselectedEvt_Args e)
181 var key = "_EFL_UI_EVENT_ITEM_UNSELECTED";
182 IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Efl, key);
183 if (desc == IntPtr.Zero)
185 Eina.Log.Error($"Failed to get native event {key}");
189 IntPtr info = e.arg.NativeHandle;
190 Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, info);
192 /// <summary>Called when selection is pasted</summary>
193 public event EventHandler SelectionPasteEvt
197 lock (eflBindingEventLock)
199 Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) =>
201 var obj = Efl.Eo.Globals.WrapperSupervisorPtrToManaged(data).Target;
204 EventArgs args = EventArgs.Empty;
207 value?.Invoke(obj, args);
211 Eina.Log.Error(e.ToString());
212 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
217 string key = "_EFL_UI_EVENT_SELECTION_PASTE";
218 AddNativeEventHandler(efl.Libs.Efl, key, callerCb, value);
224 lock (eflBindingEventLock)
226 string key = "_EFL_UI_EVENT_SELECTION_PASTE";
227 RemoveNativeEventHandler(efl.Libs.Efl, key, value);
231 ///<summary>Method to raise event SelectionPasteEvt.</summary>
232 public void OnSelectionPasteEvt(EventArgs e)
234 var key = "_EFL_UI_EVENT_SELECTION_PASTE";
235 IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Efl, key);
236 if (desc == IntPtr.Zero)
238 Eina.Log.Error($"Failed to get native event {key}");
242 Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, IntPtr.Zero);
244 /// <summary>Called when selection is copied</summary>
245 public event EventHandler SelectionCopyEvt
249 lock (eflBindingEventLock)
251 Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) =>
253 var obj = Efl.Eo.Globals.WrapperSupervisorPtrToManaged(data).Target;
256 EventArgs args = EventArgs.Empty;
259 value?.Invoke(obj, args);
263 Eina.Log.Error(e.ToString());
264 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
269 string key = "_EFL_UI_EVENT_SELECTION_COPY";
270 AddNativeEventHandler(efl.Libs.Efl, key, callerCb, value);
276 lock (eflBindingEventLock)
278 string key = "_EFL_UI_EVENT_SELECTION_COPY";
279 RemoveNativeEventHandler(efl.Libs.Efl, key, value);
283 ///<summary>Method to raise event SelectionCopyEvt.</summary>
284 public void OnSelectionCopyEvt(EventArgs e)
286 var key = "_EFL_UI_EVENT_SELECTION_COPY";
287 IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Efl, key);
288 if (desc == IntPtr.Zero)
290 Eina.Log.Error($"Failed to get native event {key}");
294 Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, IntPtr.Zero);
296 /// <summary>Called when selection is cut</summary>
297 public event EventHandler SelectionCutEvt
301 lock (eflBindingEventLock)
303 Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) =>
305 var obj = Efl.Eo.Globals.WrapperSupervisorPtrToManaged(data).Target;
308 EventArgs args = EventArgs.Empty;
311 value?.Invoke(obj, args);
315 Eina.Log.Error(e.ToString());
316 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
321 string key = "_EFL_UI_EVENT_SELECTION_CUT";
322 AddNativeEventHandler(efl.Libs.Efl, key, callerCb, value);
328 lock (eflBindingEventLock)
330 string key = "_EFL_UI_EVENT_SELECTION_CUT";
331 RemoveNativeEventHandler(efl.Libs.Efl, key, value);
335 ///<summary>Method to raise event SelectionCutEvt.</summary>
336 public void OnSelectionCutEvt(EventArgs e)
338 var key = "_EFL_UI_EVENT_SELECTION_CUT";
339 IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Efl, key);
340 if (desc == IntPtr.Zero)
342 Eina.Log.Error($"Failed to get native event {key}");
346 Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, IntPtr.Zero);
348 /// <summary>Called at selection start</summary>
349 public event EventHandler SelectionStartEvt
353 lock (eflBindingEventLock)
355 Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) =>
357 var obj = Efl.Eo.Globals.WrapperSupervisorPtrToManaged(data).Target;
360 EventArgs args = EventArgs.Empty;
363 value?.Invoke(obj, args);
367 Eina.Log.Error(e.ToString());
368 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
373 string key = "_EFL_UI_EVENT_SELECTION_START";
374 AddNativeEventHandler(efl.Libs.Efl, key, callerCb, value);
380 lock (eflBindingEventLock)
382 string key = "_EFL_UI_EVENT_SELECTION_START";
383 RemoveNativeEventHandler(efl.Libs.Efl, key, value);
387 ///<summary>Method to raise event SelectionStartEvt.</summary>
388 public void OnSelectionStartEvt(EventArgs e)
390 var key = "_EFL_UI_EVENT_SELECTION_START";
391 IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Efl, key);
392 if (desc == IntPtr.Zero)
394 Eina.Log.Error($"Failed to get native event {key}");
398 Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, IntPtr.Zero);
400 /// <summary>Called when selection is changed</summary>
401 public event EventHandler SelectionChangedEvt
405 lock (eflBindingEventLock)
407 Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) =>
409 var obj = Efl.Eo.Globals.WrapperSupervisorPtrToManaged(data).Target;
412 EventArgs args = EventArgs.Empty;
415 value?.Invoke(obj, args);
419 Eina.Log.Error(e.ToString());
420 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
425 string key = "_EFL_UI_EVENT_SELECTION_CHANGED";
426 AddNativeEventHandler(efl.Libs.Efl, key, callerCb, value);
432 lock (eflBindingEventLock)
434 string key = "_EFL_UI_EVENT_SELECTION_CHANGED";
435 RemoveNativeEventHandler(efl.Libs.Efl, key, value);
439 ///<summary>Method to raise event SelectionChangedEvt.</summary>
440 public void OnSelectionChangedEvt(EventArgs e)
442 var key = "_EFL_UI_EVENT_SELECTION_CHANGED";
443 IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Efl, key);
444 if (desc == IntPtr.Zero)
446 Eina.Log.Error($"Failed to get native event {key}");
450 Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, IntPtr.Zero);
452 /// <summary>Called when selection is cleared</summary>
453 public event EventHandler SelectionClearedEvt
457 lock (eflBindingEventLock)
459 Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) =>
461 var obj = Efl.Eo.Globals.WrapperSupervisorPtrToManaged(data).Target;
464 EventArgs args = EventArgs.Empty;
467 value?.Invoke(obj, args);
471 Eina.Log.Error(e.ToString());
472 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
477 string key = "_EFL_UI_EVENT_SELECTION_CLEARED";
478 AddNativeEventHandler(efl.Libs.Efl, key, callerCb, value);
484 lock (eflBindingEventLock)
486 string key = "_EFL_UI_EVENT_SELECTION_CLEARED";
487 RemoveNativeEventHandler(efl.Libs.Efl, key, value);
491 ///<summary>Method to raise event SelectionClearedEvt.</summary>
492 public void OnSelectionClearedEvt(EventArgs e)
494 var key = "_EFL_UI_EVENT_SELECTION_CLEARED";
495 IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Efl, key);
496 if (desc == IntPtr.Zero)
498 Eina.Log.Error($"Failed to get native event {key}");
502 Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, IntPtr.Zero);
504 private static IntPtr GetEflClassStatic()
506 return Efl.Ui.ISelectableConcrete.efl_ui_selectable_interface_get();
508 /// <summary>Wrapper for native methods and virtual method delegates.
509 /// For internal use by generated code only.</summary>
510 public new class NativeMethods : Efl.Eo.EoWrapper.NativeMethods
512 /// <summary>Gets the list of Eo operations to override.</summary>
513 /// <returns>The list of Eo operations to be overload.</returns>
514 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
516 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
519 /// <summary>Returns the Eo class for the native methods of this class.</summary>
520 /// <returns>The native class pointer.</returns>
521 public override IntPtr GetEflClass()
523 return Efl.Ui.ISelectableConcrete.efl_ui_selectable_interface_get();
526 #pragma warning disable CA1707, CS1591, SA1300, SA1600
528 #pragma warning restore CA1707, CS1591, SA1300, SA1600