[NUI] TCSACR-226 code change (#1032)
[platform/core/csapi/tizenfx.git] / internals / src / EflSharp / EflSharp / efl / efl_ui_selection.eo.cs
1 #define EFL_BETA
2 #pragma warning disable CS1591
3 using System;
4 using System.Runtime.InteropServices;
5 using System.Collections.Generic;
6 using System.Linq;
7 using System.Threading;
8 using System.ComponentModel;
9 namespace Efl {
10
11 namespace Ui {
12
13 /// <summary>Efl Ui Selection class</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.ISelectionConcrete.NativeMethods]
16 [Efl.Eo.BindingEntity]
17 public interface ISelection : 
18     Efl.Eo.IWrapper, IDisposable
19 {
20     /// <summary>Set the selection data to the object</summary>
21 /// <param name="type">Selection Type</param>
22 /// <param name="format">Selection Format</param>
23 /// <param name="data">Selection data</param>
24 /// <param name="seat">Specified seat for multiple seats case.</param>
25 /// <returns>Future for tracking when the selection is lost</returns>
26  Eina.Future SetSelection(Efl.Ui.SelectionType type, Efl.Ui.SelectionFormat format, Eina.Slice data, uint seat);
27     /// <summary>Get the data from the object that has selection</summary>
28 /// <param name="type">Selection Type</param>
29 /// <param name="format">Selection Format</param>
30 /// <param name="data_func">Data ready function pointer</param>
31 /// <param name="seat">Specified seat for multiple seats case.</param>
32 void GetSelection(Efl.Ui.SelectionType type, Efl.Ui.SelectionFormat format, Efl.Ui.SelectionDataReady data_func, uint seat);
33     /// <summary>Clear the selection data from the object</summary>
34 /// <param name="type">Selection Type</param>
35 /// <param name="seat">Specified seat for multiple seats case.</param>
36 void ClearSelection(Efl.Ui.SelectionType type, uint seat);
37     /// <summary>Determine whether the selection data has owner</summary>
38 /// <param name="type">Selection type</param>
39 /// <param name="seat">Specified seat for multiple seats case.</param>
40 /// <returns>EINA_TRUE if there is object owns selection, otherwise EINA_FALSE</returns>
41 bool HasOwner(Efl.Ui.SelectionType type, uint seat);
42         /// <summary>Async wrapper for <see cref="SetSelection" />.</summary>
43     /// <param name="type">Selection Type</param>
44     /// <param name="format">Selection Format</param>
45     /// <param name="data">Selection data</param>
46     /// <param name="seat">Specified seat for multiple seats case.</param>
47     /// <param name="token">Token to notify the async operation of external request to cancel.</param>
48     /// <returns>An async task wrapping the result of the operation.</returns>
49     System.Threading.Tasks.Task<Eina.Value> SetSelectionAsync(Efl.Ui.SelectionType type,Efl.Ui.SelectionFormat format,Eina.Slice data,uint seat, System.Threading.CancellationToken token = default(System.Threading.CancellationToken));
50
51                 /// <summary>Called when display server&apos;s selection has changed</summary>
52     /// <value><see cref="Efl.Ui.ISelectionWmSelectionChangedEvt_Args"/></value>
53     event EventHandler<Efl.Ui.ISelectionWmSelectionChangedEvt_Args> WmSelectionChangedEvt;
54 }
55 /// <summary>Event argument wrapper for event <see cref="Efl.Ui.ISelection.WmSelectionChangedEvt"/>.</summary>
56 [Efl.Eo.BindingEntity]
57 public class ISelectionWmSelectionChangedEvt_Args : EventArgs {
58     /// <summary>Actual event payload.</summary>
59     /// <value>Called when display server&apos;s selection has changed</value>
60     public Efl.Ui.SelectionChanged arg { get; set; }
61 }
62 /// <summary>Efl Ui Selection class</summary>
63 /// <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>
64 sealed public  class ISelectionConcrete :
65     Efl.Eo.EoWrapper
66     , ISelection
67     
68 {
69     /// <summary>Pointer to the native class description.</summary>
70     public override System.IntPtr NativeClass
71     {
72         get
73         {
74             if (((object)this).GetType() == typeof(ISelectionConcrete))
75             {
76                 return GetEflClassStatic();
77             }
78             else
79             {
80                 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
81             }
82         }
83     }
84
85     /// <summary>Subclasses should override this constructor if they are expected to be instantiated from native code.
86     /// Do not call this constructor directly.</summary>
87     /// <param name="ch">Tag struct storing the native handle of the object being constructed.</param>
88     private ISelectionConcrete(ConstructingHandle ch) : base(ch)
89     {
90     }
91
92     [System.Runtime.InteropServices.DllImport(efl.Libs.Elementary)] internal static extern System.IntPtr
93         efl_ui_selection_mixin_get();
94     /// <summary>Initializes a new instance of the <see cref="ISelection"/> class.
95     /// Internal usage: This is used when interacting with C code and should not be used directly.</summary>
96     /// <param name="wh">The native pointer to be wrapped.</param>
97     private ISelectionConcrete(Efl.Eo.Globals.WrappingHandle wh) : base(wh)
98     {
99     }
100
101     /// <summary>Called when display server&apos;s selection has changed</summary>
102     /// <value><see cref="Efl.Ui.ISelectionWmSelectionChangedEvt_Args"/></value>
103     public event EventHandler<Efl.Ui.ISelectionWmSelectionChangedEvt_Args> WmSelectionChangedEvt
104     {
105         add
106         {
107             lock (eflBindingEventLock)
108             {
109                 Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) =>
110                 {
111                     var obj = Efl.Eo.Globals.WrapperSupervisorPtrToManaged(data).Target;
112                     if (obj != null)
113                     {
114                         Efl.Ui.ISelectionWmSelectionChangedEvt_Args args = new Efl.Ui.ISelectionWmSelectionChangedEvt_Args();
115                         args.arg =  evt.Info;
116                         try
117                         {
118                             value?.Invoke(obj, args);
119                         }
120                         catch (Exception e)
121                         {
122                             Eina.Log.Error(e.ToString());
123                             Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
124                         }
125                     }
126                 };
127
128                 string key = "_EFL_UI_SELECTION_EVENT_WM_SELECTION_CHANGED";
129                 AddNativeEventHandler(efl.Libs.Elementary, key, callerCb, value);
130             }
131         }
132
133         remove
134         {
135             lock (eflBindingEventLock)
136             {
137                 string key = "_EFL_UI_SELECTION_EVENT_WM_SELECTION_CHANGED";
138                 RemoveNativeEventHandler(efl.Libs.Elementary, key, value);
139             }
140         }
141     }
142     /// <summary>Method to raise event WmSelectionChangedEvt.</summary>
143     public void OnWmSelectionChangedEvt(Efl.Ui.ISelectionWmSelectionChangedEvt_Args e)
144     {
145         var key = "_EFL_UI_SELECTION_EVENT_WM_SELECTION_CHANGED";
146         IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Elementary, key);
147         if (desc == IntPtr.Zero)
148         {
149             Eina.Log.Error($"Failed to get native event {key}");
150             return;
151         }
152
153         IntPtr info = Marshal.AllocHGlobal(Marshal.SizeOf(e.arg));
154         try
155         {
156             Marshal.StructureToPtr(e.arg, info, false);
157             Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, info);
158         }
159         finally
160         {
161             Marshal.FreeHGlobal(info);
162         }
163     }
164     /// <summary>Set the selection data to the object</summary>
165     /// <param name="type">Selection Type</param>
166     /// <param name="format">Selection Format</param>
167     /// <param name="data">Selection data</param>
168     /// <param name="seat">Specified seat for multiple seats case.</param>
169     /// <returns>Future for tracking when the selection is lost</returns>
170     public  Eina.Future SetSelection(Efl.Ui.SelectionType type, Efl.Ui.SelectionFormat format, Eina.Slice data, uint seat) {
171                                                                                                          var _ret_var = Efl.Ui.ISelectionConcrete.NativeMethods.efl_ui_selection_set_ptr.Value.Delegate(this.NativeHandle,type, format, data, seat);
172         Eina.Error.RaiseIfUnhandledException();
173                                                                         return _ret_var;
174  }
175     /// <summary>Get the data from the object that has selection</summary>
176     /// <param name="type">Selection Type</param>
177     /// <param name="format">Selection Format</param>
178     /// <param name="data_func">Data ready function pointer</param>
179     /// <param name="seat">Specified seat for multiple seats case.</param>
180     public void GetSelection(Efl.Ui.SelectionType type, Efl.Ui.SelectionFormat format, Efl.Ui.SelectionDataReady data_func, uint seat) {
181                                                                                          GCHandle data_func_handle = GCHandle.Alloc(data_func);
182                 Efl.Ui.ISelectionConcrete.NativeMethods.efl_ui_selection_get_ptr.Value.Delegate(this.NativeHandle,type, format, GCHandle.ToIntPtr(data_func_handle), Efl.Ui.SelectionDataReadyWrapper.Cb, Efl.Eo.Globals.free_gchandle, seat);
183         Eina.Error.RaiseIfUnhandledException();
184                                                                          }
185     /// <summary>Clear the selection data from the object</summary>
186     /// <param name="type">Selection Type</param>
187     /// <param name="seat">Specified seat for multiple seats case.</param>
188     public void ClearSelection(Efl.Ui.SelectionType type, uint seat) {
189                                                          Efl.Ui.ISelectionConcrete.NativeMethods.efl_ui_selection_clear_ptr.Value.Delegate(this.NativeHandle,type, seat);
190         Eina.Error.RaiseIfUnhandledException();
191                                          }
192     /// <summary>Determine whether the selection data has owner</summary>
193     /// <param name="type">Selection type</param>
194     /// <param name="seat">Specified seat for multiple seats case.</param>
195     /// <returns>EINA_TRUE if there is object owns selection, otherwise EINA_FALSE</returns>
196     public bool HasOwner(Efl.Ui.SelectionType type, uint seat) {
197                                                          var _ret_var = Efl.Ui.ISelectionConcrete.NativeMethods.efl_ui_selection_has_owner_ptr.Value.Delegate(this.NativeHandle,type, seat);
198         Eina.Error.RaiseIfUnhandledException();
199                                         return _ret_var;
200  }
201     /// <summary>Async wrapper for <see cref="SetSelection" />.</summary>
202     /// <param name="type">Selection Type</param>
203     /// <param name="format">Selection Format</param>
204     /// <param name="data">Selection data</param>
205     /// <param name="seat">Specified seat for multiple seats case.</param>
206     /// <param name="token">Token to notify the async operation of external request to cancel.</param>
207     /// <returns>An async task wrapping the result of the operation.</returns>
208     public System.Threading.Tasks.Task<Eina.Value> SetSelectionAsync(Efl.Ui.SelectionType type,Efl.Ui.SelectionFormat format,Eina.Slice data,uint seat, System.Threading.CancellationToken token = default(System.Threading.CancellationToken))
209     {
210         Eina.Future future = SetSelection( type, format, data, seat);
211         return Efl.Eo.Globals.WrapAsync(future, token);
212     }
213
214     private static IntPtr GetEflClassStatic()
215     {
216         return Efl.Ui.ISelectionConcrete.efl_ui_selection_mixin_get();
217     }
218     /// <summary>Wrapper for native methods and virtual method delegates.
219     /// For internal use by generated code only.</summary>
220     public new class NativeMethods : Efl.Eo.EoWrapper.NativeMethods
221     {
222         private static Efl.Eo.NativeModule Module = new Efl.Eo.NativeModule(    efl.Libs.Elementary);
223         /// <summary>Gets the list of Eo operations to override.</summary>
224         /// <returns>The list of Eo operations to be overload.</returns>
225         public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
226         {
227             var descs = new System.Collections.Generic.List<Efl_Op_Description>();
228             var methods = Efl.Eo.Globals.GetUserMethods(type);
229
230             if (efl_ui_selection_set_static_delegate == null)
231             {
232                 efl_ui_selection_set_static_delegate = new efl_ui_selection_set_delegate(selection_set);
233             }
234
235             if (methods.FirstOrDefault(m => m.Name == "SetSelection") != null)
236             {
237                 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_ui_selection_set"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_selection_set_static_delegate) });
238             }
239
240             if (efl_ui_selection_get_static_delegate == null)
241             {
242                 efl_ui_selection_get_static_delegate = new efl_ui_selection_get_delegate(selection_get);
243             }
244
245             if (methods.FirstOrDefault(m => m.Name == "GetSelection") != null)
246             {
247                 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_ui_selection_get"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_selection_get_static_delegate) });
248             }
249
250             if (efl_ui_selection_clear_static_delegate == null)
251             {
252                 efl_ui_selection_clear_static_delegate = new efl_ui_selection_clear_delegate(selection_clear);
253             }
254
255             if (methods.FirstOrDefault(m => m.Name == "ClearSelection") != null)
256             {
257                 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_ui_selection_clear"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_selection_clear_static_delegate) });
258             }
259
260             if (efl_ui_selection_has_owner_static_delegate == null)
261             {
262                 efl_ui_selection_has_owner_static_delegate = new efl_ui_selection_has_owner_delegate(has_owner);
263             }
264
265             if (methods.FirstOrDefault(m => m.Name == "HasOwner") != null)
266             {
267                 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_ui_selection_has_owner"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_selection_has_owner_static_delegate) });
268             }
269
270             return descs;
271         }
272         /// <summary>Returns the Eo class for the native methods of this class.</summary>
273         /// <returns>The native class pointer.</returns>
274         public override IntPtr GetEflClass()
275         {
276             return Efl.Ui.ISelectionConcrete.efl_ui_selection_mixin_get();
277         }
278
279         #pragma warning disable CA1707, CS1591, SA1300, SA1600
280
281         [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Eina.FutureMarshaler))]
282         private delegate  Eina.Future efl_ui_selection_set_delegate(System.IntPtr obj, System.IntPtr pd,  Efl.Ui.SelectionType type,  Efl.Ui.SelectionFormat format,  Eina.Slice data,  uint seat);
283
284         [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Eina.FutureMarshaler))]
285         public delegate  Eina.Future efl_ui_selection_set_api_delegate(System.IntPtr obj,  Efl.Ui.SelectionType type,  Efl.Ui.SelectionFormat format,  Eina.Slice data,  uint seat);
286
287         public static Efl.Eo.FunctionWrapper<efl_ui_selection_set_api_delegate> efl_ui_selection_set_ptr = new Efl.Eo.FunctionWrapper<efl_ui_selection_set_api_delegate>(Module, "efl_ui_selection_set");
288
289         private static  Eina.Future selection_set(System.IntPtr obj, System.IntPtr pd, Efl.Ui.SelectionType type, Efl.Ui.SelectionFormat format, Eina.Slice data, uint seat)
290         {
291             Eina.Log.Debug("function efl_ui_selection_set was called");
292             var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
293             if (ws != null)
294             {
295                                                                                                              Eina.Future _ret_var = default( Eina.Future);
296                 try
297                 {
298                     _ret_var = ((ISelection)ws.Target).SetSelection(type, format, data, seat);
299                 }
300                 catch (Exception e)
301                 {
302                     Eina.Log.Warning($"Callback error: {e.ToString()}");
303                     Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
304                 }
305
306                                                                         return _ret_var;
307
308             }
309             else
310             {
311                 return efl_ui_selection_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), type, format, data, seat);
312             }
313         }
314
315         private static efl_ui_selection_set_delegate efl_ui_selection_set_static_delegate;
316
317         
318         private delegate void efl_ui_selection_get_delegate(System.IntPtr obj, System.IntPtr pd,  Efl.Ui.SelectionType type,  Efl.Ui.SelectionFormat format,  IntPtr data_func_data, Efl.Ui.SelectionDataReadyInternal data_func, EinaFreeCb data_func_free_cb,  uint seat);
319
320         
321         public delegate void efl_ui_selection_get_api_delegate(System.IntPtr obj,  Efl.Ui.SelectionType type,  Efl.Ui.SelectionFormat format,  IntPtr data_func_data, Efl.Ui.SelectionDataReadyInternal data_func, EinaFreeCb data_func_free_cb,  uint seat);
322
323         public static Efl.Eo.FunctionWrapper<efl_ui_selection_get_api_delegate> efl_ui_selection_get_ptr = new Efl.Eo.FunctionWrapper<efl_ui_selection_get_api_delegate>(Module, "efl_ui_selection_get");
324
325         private static void selection_get(System.IntPtr obj, System.IntPtr pd, Efl.Ui.SelectionType type, Efl.Ui.SelectionFormat format, IntPtr data_func_data, Efl.Ui.SelectionDataReadyInternal data_func, EinaFreeCb data_func_free_cb, uint seat)
326         {
327             Eina.Log.Debug("function efl_ui_selection_get was called");
328             var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
329             if (ws != null)
330             {
331                                                                                             Efl.Ui.SelectionDataReadyWrapper data_func_wrapper = new Efl.Ui.SelectionDataReadyWrapper(data_func, data_func_data, data_func_free_cb);
332                     
333                 try
334                 {
335                     ((ISelection)ws.Target).GetSelection(type, format, data_func_wrapper.ManagedCb, seat);
336                 }
337                 catch (Exception e)
338                 {
339                     Eina.Log.Warning($"Callback error: {e.ToString()}");
340                     Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
341                 }
342
343                                                                         
344             }
345             else
346             {
347                 efl_ui_selection_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), type, format, data_func_data, data_func, data_func_free_cb, seat);
348             }
349         }
350
351         private static efl_ui_selection_get_delegate efl_ui_selection_get_static_delegate;
352
353         
354         private delegate void efl_ui_selection_clear_delegate(System.IntPtr obj, System.IntPtr pd,  Efl.Ui.SelectionType type,  uint seat);
355
356         
357         public delegate void efl_ui_selection_clear_api_delegate(System.IntPtr obj,  Efl.Ui.SelectionType type,  uint seat);
358
359         public static Efl.Eo.FunctionWrapper<efl_ui_selection_clear_api_delegate> efl_ui_selection_clear_ptr = new Efl.Eo.FunctionWrapper<efl_ui_selection_clear_api_delegate>(Module, "efl_ui_selection_clear");
360
361         private static void selection_clear(System.IntPtr obj, System.IntPtr pd, Efl.Ui.SelectionType type, uint seat)
362         {
363             Eina.Log.Debug("function efl_ui_selection_clear was called");
364             var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
365             if (ws != null)
366             {
367                                                             
368                 try
369                 {
370                     ((ISelection)ws.Target).ClearSelection(type, seat);
371                 }
372                 catch (Exception e)
373                 {
374                     Eina.Log.Warning($"Callback error: {e.ToString()}");
375                     Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
376                 }
377
378                                         
379             }
380             else
381             {
382                 efl_ui_selection_clear_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), type, seat);
383             }
384         }
385
386         private static efl_ui_selection_clear_delegate efl_ui_selection_clear_static_delegate;
387
388         [return: MarshalAs(UnmanagedType.U1)]
389         private delegate bool efl_ui_selection_has_owner_delegate(System.IntPtr obj, System.IntPtr pd,  Efl.Ui.SelectionType type,  uint seat);
390
391         [return: MarshalAs(UnmanagedType.U1)]
392         public delegate bool efl_ui_selection_has_owner_api_delegate(System.IntPtr obj,  Efl.Ui.SelectionType type,  uint seat);
393
394         public static Efl.Eo.FunctionWrapper<efl_ui_selection_has_owner_api_delegate> efl_ui_selection_has_owner_ptr = new Efl.Eo.FunctionWrapper<efl_ui_selection_has_owner_api_delegate>(Module, "efl_ui_selection_has_owner");
395
396         private static bool has_owner(System.IntPtr obj, System.IntPtr pd, Efl.Ui.SelectionType type, uint seat)
397         {
398             Eina.Log.Debug("function efl_ui_selection_has_owner was called");
399             var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
400             if (ws != null)
401             {
402                                                             bool _ret_var = default(bool);
403                 try
404                 {
405                     _ret_var = ((ISelection)ws.Target).HasOwner(type, seat);
406                 }
407                 catch (Exception e)
408                 {
409                     Eina.Log.Warning($"Callback error: {e.ToString()}");
410                     Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
411                 }
412
413                                         return _ret_var;
414
415             }
416             else
417             {
418                 return efl_ui_selection_has_owner_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), type, seat);
419             }
420         }
421
422         private static efl_ui_selection_has_owner_delegate efl_ui_selection_has_owner_static_delegate;
423
424         #pragma warning restore CA1707, CS1591, SA1300, SA1600
425
426 }
427 }
428 }
429
430 }
431
432 #if EFL_BETA
433 #pragma warning disable CS1591
434 public static class Efl_UiISelectionConcrete_ExtensionMethods {
435 }
436 #pragma warning restore CS1591
437 #endif