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>Efl UI text selectable interface</summary>
14 /// <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>
15 [Efl.Ui.ITextSelectableConcrete.NativeMethods]
16 [Efl.Eo.BindingEntity]
17 public interface ITextSelectable :
18 Efl.Eo.IWrapper, IDisposable
20 /// <summary>Called when selection is pasted</summary>
21 event EventHandler SelectionPasteEvt;
22 /// <summary>Called when selection is copied</summary>
23 event EventHandler SelectionCopyEvt;
24 /// <summary>Called when selection is cut</summary>
25 event EventHandler SelectionCutEvt;
26 /// <summary>Called at selection start</summary>
27 event EventHandler SelectionStartEvt;
28 /// <summary>Called when selection is changed</summary>
29 event EventHandler SelectionChangedEvt;
30 /// <summary>Called when selection is cleared</summary>
31 event EventHandler SelectionClearedEvt;
33 /// <summary>Efl UI text selectable interface</summary>
34 /// <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>
35 sealed public class ITextSelectableConcrete :
40 /// <summary>Pointer to the native class description.</summary>
41 public override System.IntPtr NativeClass
45 if (((object)this).GetType() == typeof(ITextSelectableConcrete))
47 return GetEflClassStatic();
51 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
56 /// <summary>Subclasses should override this constructor if they are expected to be instantiated from native code.
57 /// Do not call this constructor directly.</summary>
58 /// <param name="ch">Tag struct storing the native handle of the object being constructed.</param>
59 private ITextSelectableConcrete(ConstructingHandle ch) : base(ch)
63 [System.Runtime.InteropServices.DllImport("libefl.so.1")] internal static extern System.IntPtr
64 efl_ui_text_selectable_interface_get();
65 /// <summary>Initializes a new instance of the <see cref="ITextSelectable"/> class.
66 /// Internal usage: This is used when interacting with C code and should not be used directly.</summary>
67 /// <param name="wh">The native pointer to be wrapped.</param>
68 private ITextSelectableConcrete(Efl.Eo.Globals.WrappingHandle wh) : base(wh)
72 /// <summary>Called when selection is pasted</summary>
73 public event EventHandler SelectionPasteEvt
77 lock (eflBindingEventLock)
79 Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) =>
81 var obj = Efl.Eo.Globals.WrapperSupervisorPtrToManaged(data).Target;
84 EventArgs args = EventArgs.Empty;
87 value?.Invoke(obj, args);
91 Eina.Log.Error(e.ToString());
92 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
97 string key = "_EFL_UI_EVENT_SELECTION_PASTE";
98 AddNativeEventHandler(efl.Libs.Efl, key, callerCb, value);
104 lock (eflBindingEventLock)
106 string key = "_EFL_UI_EVENT_SELECTION_PASTE";
107 RemoveNativeEventHandler(efl.Libs.Efl, key, value);
111 /// <summary>Method to raise event SelectionPasteEvt.</summary>
112 public void OnSelectionPasteEvt(EventArgs e)
114 var key = "_EFL_UI_EVENT_SELECTION_PASTE";
115 IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Efl, key);
116 if (desc == IntPtr.Zero)
118 Eina.Log.Error($"Failed to get native event {key}");
122 Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, IntPtr.Zero);
124 /// <summary>Called when selection is copied</summary>
125 public event EventHandler SelectionCopyEvt
129 lock (eflBindingEventLock)
131 Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) =>
133 var obj = Efl.Eo.Globals.WrapperSupervisorPtrToManaged(data).Target;
136 EventArgs args = EventArgs.Empty;
139 value?.Invoke(obj, args);
143 Eina.Log.Error(e.ToString());
144 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
149 string key = "_EFL_UI_EVENT_SELECTION_COPY";
150 AddNativeEventHandler(efl.Libs.Efl, key, callerCb, value);
156 lock (eflBindingEventLock)
158 string key = "_EFL_UI_EVENT_SELECTION_COPY";
159 RemoveNativeEventHandler(efl.Libs.Efl, key, value);
163 /// <summary>Method to raise event SelectionCopyEvt.</summary>
164 public void OnSelectionCopyEvt(EventArgs e)
166 var key = "_EFL_UI_EVENT_SELECTION_COPY";
167 IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Efl, key);
168 if (desc == IntPtr.Zero)
170 Eina.Log.Error($"Failed to get native event {key}");
174 Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, IntPtr.Zero);
176 /// <summary>Called when selection is cut</summary>
177 public event EventHandler SelectionCutEvt
181 lock (eflBindingEventLock)
183 Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) =>
185 var obj = Efl.Eo.Globals.WrapperSupervisorPtrToManaged(data).Target;
188 EventArgs args = EventArgs.Empty;
191 value?.Invoke(obj, args);
195 Eina.Log.Error(e.ToString());
196 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
201 string key = "_EFL_UI_EVENT_SELECTION_CUT";
202 AddNativeEventHandler(efl.Libs.Efl, key, callerCb, value);
208 lock (eflBindingEventLock)
210 string key = "_EFL_UI_EVENT_SELECTION_CUT";
211 RemoveNativeEventHandler(efl.Libs.Efl, key, value);
215 /// <summary>Method to raise event SelectionCutEvt.</summary>
216 public void OnSelectionCutEvt(EventArgs e)
218 var key = "_EFL_UI_EVENT_SELECTION_CUT";
219 IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Efl, key);
220 if (desc == IntPtr.Zero)
222 Eina.Log.Error($"Failed to get native event {key}");
226 Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, IntPtr.Zero);
228 /// <summary>Called at selection start</summary>
229 public event EventHandler SelectionStartEvt
233 lock (eflBindingEventLock)
235 Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) =>
237 var obj = Efl.Eo.Globals.WrapperSupervisorPtrToManaged(data).Target;
240 EventArgs args = EventArgs.Empty;
243 value?.Invoke(obj, args);
247 Eina.Log.Error(e.ToString());
248 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
253 string key = "_EFL_UI_EVENT_SELECTION_START";
254 AddNativeEventHandler(efl.Libs.Efl, key, callerCb, value);
260 lock (eflBindingEventLock)
262 string key = "_EFL_UI_EVENT_SELECTION_START";
263 RemoveNativeEventHandler(efl.Libs.Efl, key, value);
267 /// <summary>Method to raise event SelectionStartEvt.</summary>
268 public void OnSelectionStartEvt(EventArgs e)
270 var key = "_EFL_UI_EVENT_SELECTION_START";
271 IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Efl, key);
272 if (desc == IntPtr.Zero)
274 Eina.Log.Error($"Failed to get native event {key}");
278 Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, IntPtr.Zero);
280 /// <summary>Called when selection is changed</summary>
281 public event EventHandler SelectionChangedEvt
285 lock (eflBindingEventLock)
287 Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) =>
289 var obj = Efl.Eo.Globals.WrapperSupervisorPtrToManaged(data).Target;
292 EventArgs args = EventArgs.Empty;
295 value?.Invoke(obj, args);
299 Eina.Log.Error(e.ToString());
300 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
305 string key = "_EFL_UI_EVENT_SELECTION_CHANGED";
306 AddNativeEventHandler(efl.Libs.Efl, key, callerCb, value);
312 lock (eflBindingEventLock)
314 string key = "_EFL_UI_EVENT_SELECTION_CHANGED";
315 RemoveNativeEventHandler(efl.Libs.Efl, key, value);
319 /// <summary>Method to raise event SelectionChangedEvt.</summary>
320 public void OnSelectionChangedEvt(EventArgs e)
322 var key = "_EFL_UI_EVENT_SELECTION_CHANGED";
323 IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Efl, key);
324 if (desc == IntPtr.Zero)
326 Eina.Log.Error($"Failed to get native event {key}");
330 Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, IntPtr.Zero);
332 /// <summary>Called when selection is cleared</summary>
333 public event EventHandler SelectionClearedEvt
337 lock (eflBindingEventLock)
339 Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) =>
341 var obj = Efl.Eo.Globals.WrapperSupervisorPtrToManaged(data).Target;
344 EventArgs args = EventArgs.Empty;
347 value?.Invoke(obj, args);
351 Eina.Log.Error(e.ToString());
352 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
357 string key = "_EFL_UI_EVENT_SELECTION_CLEARED";
358 AddNativeEventHandler(efl.Libs.Efl, key, callerCb, value);
364 lock (eflBindingEventLock)
366 string key = "_EFL_UI_EVENT_SELECTION_CLEARED";
367 RemoveNativeEventHandler(efl.Libs.Efl, key, value);
371 /// <summary>Method to raise event SelectionClearedEvt.</summary>
372 public void OnSelectionClearedEvt(EventArgs e)
374 var key = "_EFL_UI_EVENT_SELECTION_CLEARED";
375 IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Efl, key);
376 if (desc == IntPtr.Zero)
378 Eina.Log.Error($"Failed to get native event {key}");
382 Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, IntPtr.Zero);
384 private static IntPtr GetEflClassStatic()
386 return Efl.Ui.ITextSelectableConcrete.efl_ui_text_selectable_interface_get();
388 /// <summary>Wrapper for native methods and virtual method delegates.
389 /// For internal use by generated code only.</summary>
390 public new class NativeMethods : Efl.Eo.EoWrapper.NativeMethods
392 /// <summary>Gets the list of Eo operations to override.</summary>
393 /// <returns>The list of Eo operations to be overload.</returns>
394 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
396 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
399 /// <summary>Returns the Eo class for the native methods of this class.</summary>
400 /// <returns>The native class pointer.</returns>
401 public override IntPtr GetEflClass()
403 return Efl.Ui.ITextSelectableConcrete.efl_ui_text_selectable_interface_get();
406 #pragma warning disable CA1707, CS1591, SA1300, SA1600
408 #pragma warning restore CA1707, CS1591, SA1300, SA1600
417 #pragma warning disable CS1591
418 public static class Efl_UiITextSelectableConcrete_ExtensionMethods {
420 #pragma warning restore CS1591