[EflSharp] Update Circle and efl cs files (#945)
[platform/core/csapi/tizenfx.git] / internals / src / EflSharp / EflSharp / efl / efl_ui_selectable.eo.cs
1 #pragma warning disable CS1591
2 using System;
3 using System.Runtime.InteropServices;
4 using System.Collections.Generic;
5 using System.Linq;
6 using System.Threading;
7 using System.ComponentModel;
8 namespace Efl {
9
10 namespace Ui {
11
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
17 {
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;
34 }
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; }
40 }
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; }
46 }
47 /// <summary>Efl UI selectable interface</summary>
48 sealed public class ISelectableConcrete :
49     Efl.Eo.EoWrapper
50     , ISelectable
51     
52 {
53     ///<summary>Pointer to the native class description.</summary>
54     public override System.IntPtr NativeClass
55     {
56         get
57         {
58             if (((object)this).GetType() == typeof(ISelectableConcrete))
59             {
60                 return GetEflClassStatic();
61             }
62             else
63             {
64                 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
65             }
66         }
67     }
68
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)
72     {
73     }
74
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)
81     {
82     }
83
84     /// <summary>Called when selected</summary>
85     public event EventHandler<Efl.Ui.ISelectableItemSelectedEvt_Args> ItemSelectedEvt
86     {
87         add
88         {
89             lock (eflBindingEventLock)
90             {
91                 Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) =>
92                 {
93                     var obj = Efl.Eo.Globals.WrapperSupervisorPtrToManaged(data).Target;
94                     if (obj != null)
95                     {
96                         Efl.Ui.ISelectableItemSelectedEvt_Args args = new Efl.Ui.ISelectableItemSelectedEvt_Args();
97                         args.arg = (Efl.Eo.Globals.CreateWrapperFor(evt.Info) as Efl.Object);
98                         try
99                         {
100                             value?.Invoke(obj, args);
101                         }
102                         catch (Exception e)
103                         {
104                             Eina.Log.Error(e.ToString());
105                             Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
106                         }
107                     }
108                 };
109
110                 string key = "_EFL_UI_EVENT_ITEM_SELECTED";
111                 AddNativeEventHandler(efl.Libs.Efl, key, callerCb, value);
112             }
113         }
114
115         remove
116         {
117             lock (eflBindingEventLock)
118             {
119                 string key = "_EFL_UI_EVENT_ITEM_SELECTED";
120                 RemoveNativeEventHandler(efl.Libs.Efl, key, value);
121             }
122         }
123     }
124     ///<summary>Method to raise event ItemSelectedEvt.</summary>
125     public void OnItemSelectedEvt(Efl.Ui.ISelectableItemSelectedEvt_Args e)
126     {
127         var key = "_EFL_UI_EVENT_ITEM_SELECTED";
128         IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Efl, key);
129         if (desc == IntPtr.Zero)
130         {
131             Eina.Log.Error($"Failed to get native event {key}");
132             return;
133         }
134
135         IntPtr info = e.arg.NativeHandle;
136         Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, info);
137     }
138     /// <summary>Called when no longer selected</summary>
139     public event EventHandler<Efl.Ui.ISelectableItemUnselectedEvt_Args> ItemUnselectedEvt
140     {
141         add
142         {
143             lock (eflBindingEventLock)
144             {
145                 Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) =>
146                 {
147                     var obj = Efl.Eo.Globals.WrapperSupervisorPtrToManaged(data).Target;
148                     if (obj != null)
149                     {
150                         Efl.Ui.ISelectableItemUnselectedEvt_Args args = new Efl.Ui.ISelectableItemUnselectedEvt_Args();
151                         args.arg = (Efl.Eo.Globals.CreateWrapperFor(evt.Info) as Efl.Object);
152                         try
153                         {
154                             value?.Invoke(obj, args);
155                         }
156                         catch (Exception e)
157                         {
158                             Eina.Log.Error(e.ToString());
159                             Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
160                         }
161                     }
162                 };
163
164                 string key = "_EFL_UI_EVENT_ITEM_UNSELECTED";
165                 AddNativeEventHandler(efl.Libs.Efl, key, callerCb, value);
166             }
167         }
168
169         remove
170         {
171             lock (eflBindingEventLock)
172             {
173                 string key = "_EFL_UI_EVENT_ITEM_UNSELECTED";
174                 RemoveNativeEventHandler(efl.Libs.Efl, key, value);
175             }
176         }
177     }
178     ///<summary>Method to raise event ItemUnselectedEvt.</summary>
179     public void OnItemUnselectedEvt(Efl.Ui.ISelectableItemUnselectedEvt_Args e)
180     {
181         var key = "_EFL_UI_EVENT_ITEM_UNSELECTED";
182         IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Efl, key);
183         if (desc == IntPtr.Zero)
184         {
185             Eina.Log.Error($"Failed to get native event {key}");
186             return;
187         }
188
189         IntPtr info = e.arg.NativeHandle;
190         Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, info);
191     }
192     /// <summary>Called when selection is pasted</summary>
193     public event EventHandler SelectionPasteEvt
194     {
195         add
196         {
197             lock (eflBindingEventLock)
198             {
199                 Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) =>
200                 {
201                     var obj = Efl.Eo.Globals.WrapperSupervisorPtrToManaged(data).Target;
202                     if (obj != null)
203                     {
204                         EventArgs args = EventArgs.Empty;
205                         try
206                         {
207                             value?.Invoke(obj, args);
208                         }
209                         catch (Exception e)
210                         {
211                             Eina.Log.Error(e.ToString());
212                             Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
213                         }
214                     }
215                 };
216
217                 string key = "_EFL_UI_EVENT_SELECTION_PASTE";
218                 AddNativeEventHandler(efl.Libs.Efl, key, callerCb, value);
219             }
220         }
221
222         remove
223         {
224             lock (eflBindingEventLock)
225             {
226                 string key = "_EFL_UI_EVENT_SELECTION_PASTE";
227                 RemoveNativeEventHandler(efl.Libs.Efl, key, value);
228             }
229         }
230     }
231     ///<summary>Method to raise event SelectionPasteEvt.</summary>
232     public void OnSelectionPasteEvt(EventArgs e)
233     {
234         var key = "_EFL_UI_EVENT_SELECTION_PASTE";
235         IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Efl, key);
236         if (desc == IntPtr.Zero)
237         {
238             Eina.Log.Error($"Failed to get native event {key}");
239             return;
240         }
241
242         Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, IntPtr.Zero);
243     }
244     /// <summary>Called when selection is copied</summary>
245     public event EventHandler SelectionCopyEvt
246     {
247         add
248         {
249             lock (eflBindingEventLock)
250             {
251                 Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) =>
252                 {
253                     var obj = Efl.Eo.Globals.WrapperSupervisorPtrToManaged(data).Target;
254                     if (obj != null)
255                     {
256                         EventArgs args = EventArgs.Empty;
257                         try
258                         {
259                             value?.Invoke(obj, args);
260                         }
261                         catch (Exception e)
262                         {
263                             Eina.Log.Error(e.ToString());
264                             Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
265                         }
266                     }
267                 };
268
269                 string key = "_EFL_UI_EVENT_SELECTION_COPY";
270                 AddNativeEventHandler(efl.Libs.Efl, key, callerCb, value);
271             }
272         }
273
274         remove
275         {
276             lock (eflBindingEventLock)
277             {
278                 string key = "_EFL_UI_EVENT_SELECTION_COPY";
279                 RemoveNativeEventHandler(efl.Libs.Efl, key, value);
280             }
281         }
282     }
283     ///<summary>Method to raise event SelectionCopyEvt.</summary>
284     public void OnSelectionCopyEvt(EventArgs e)
285     {
286         var key = "_EFL_UI_EVENT_SELECTION_COPY";
287         IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Efl, key);
288         if (desc == IntPtr.Zero)
289         {
290             Eina.Log.Error($"Failed to get native event {key}");
291             return;
292         }
293
294         Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, IntPtr.Zero);
295     }
296     /// <summary>Called when selection is cut</summary>
297     public event EventHandler SelectionCutEvt
298     {
299         add
300         {
301             lock (eflBindingEventLock)
302             {
303                 Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) =>
304                 {
305                     var obj = Efl.Eo.Globals.WrapperSupervisorPtrToManaged(data).Target;
306                     if (obj != null)
307                     {
308                         EventArgs args = EventArgs.Empty;
309                         try
310                         {
311                             value?.Invoke(obj, args);
312                         }
313                         catch (Exception e)
314                         {
315                             Eina.Log.Error(e.ToString());
316                             Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
317                         }
318                     }
319                 };
320
321                 string key = "_EFL_UI_EVENT_SELECTION_CUT";
322                 AddNativeEventHandler(efl.Libs.Efl, key, callerCb, value);
323             }
324         }
325
326         remove
327         {
328             lock (eflBindingEventLock)
329             {
330                 string key = "_EFL_UI_EVENT_SELECTION_CUT";
331                 RemoveNativeEventHandler(efl.Libs.Efl, key, value);
332             }
333         }
334     }
335     ///<summary>Method to raise event SelectionCutEvt.</summary>
336     public void OnSelectionCutEvt(EventArgs e)
337     {
338         var key = "_EFL_UI_EVENT_SELECTION_CUT";
339         IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Efl, key);
340         if (desc == IntPtr.Zero)
341         {
342             Eina.Log.Error($"Failed to get native event {key}");
343             return;
344         }
345
346         Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, IntPtr.Zero);
347     }
348     /// <summary>Called at selection start</summary>
349     public event EventHandler SelectionStartEvt
350     {
351         add
352         {
353             lock (eflBindingEventLock)
354             {
355                 Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) =>
356                 {
357                     var obj = Efl.Eo.Globals.WrapperSupervisorPtrToManaged(data).Target;
358                     if (obj != null)
359                     {
360                         EventArgs args = EventArgs.Empty;
361                         try
362                         {
363                             value?.Invoke(obj, args);
364                         }
365                         catch (Exception e)
366                         {
367                             Eina.Log.Error(e.ToString());
368                             Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
369                         }
370                     }
371                 };
372
373                 string key = "_EFL_UI_EVENT_SELECTION_START";
374                 AddNativeEventHandler(efl.Libs.Efl, key, callerCb, value);
375             }
376         }
377
378         remove
379         {
380             lock (eflBindingEventLock)
381             {
382                 string key = "_EFL_UI_EVENT_SELECTION_START";
383                 RemoveNativeEventHandler(efl.Libs.Efl, key, value);
384             }
385         }
386     }
387     ///<summary>Method to raise event SelectionStartEvt.</summary>
388     public void OnSelectionStartEvt(EventArgs e)
389     {
390         var key = "_EFL_UI_EVENT_SELECTION_START";
391         IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Efl, key);
392         if (desc == IntPtr.Zero)
393         {
394             Eina.Log.Error($"Failed to get native event {key}");
395             return;
396         }
397
398         Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, IntPtr.Zero);
399     }
400     /// <summary>Called when selection is changed</summary>
401     public event EventHandler SelectionChangedEvt
402     {
403         add
404         {
405             lock (eflBindingEventLock)
406             {
407                 Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) =>
408                 {
409                     var obj = Efl.Eo.Globals.WrapperSupervisorPtrToManaged(data).Target;
410                     if (obj != null)
411                     {
412                         EventArgs args = EventArgs.Empty;
413                         try
414                         {
415                             value?.Invoke(obj, args);
416                         }
417                         catch (Exception e)
418                         {
419                             Eina.Log.Error(e.ToString());
420                             Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
421                         }
422                     }
423                 };
424
425                 string key = "_EFL_UI_EVENT_SELECTION_CHANGED";
426                 AddNativeEventHandler(efl.Libs.Efl, key, callerCb, value);
427             }
428         }
429
430         remove
431         {
432             lock (eflBindingEventLock)
433             {
434                 string key = "_EFL_UI_EVENT_SELECTION_CHANGED";
435                 RemoveNativeEventHandler(efl.Libs.Efl, key, value);
436             }
437         }
438     }
439     ///<summary>Method to raise event SelectionChangedEvt.</summary>
440     public void OnSelectionChangedEvt(EventArgs e)
441     {
442         var key = "_EFL_UI_EVENT_SELECTION_CHANGED";
443         IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Efl, key);
444         if (desc == IntPtr.Zero)
445         {
446             Eina.Log.Error($"Failed to get native event {key}");
447             return;
448         }
449
450         Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, IntPtr.Zero);
451     }
452     /// <summary>Called when selection is cleared</summary>
453     public event EventHandler SelectionClearedEvt
454     {
455         add
456         {
457             lock (eflBindingEventLock)
458             {
459                 Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) =>
460                 {
461                     var obj = Efl.Eo.Globals.WrapperSupervisorPtrToManaged(data).Target;
462                     if (obj != null)
463                     {
464                         EventArgs args = EventArgs.Empty;
465                         try
466                         {
467                             value?.Invoke(obj, args);
468                         }
469                         catch (Exception e)
470                         {
471                             Eina.Log.Error(e.ToString());
472                             Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
473                         }
474                     }
475                 };
476
477                 string key = "_EFL_UI_EVENT_SELECTION_CLEARED";
478                 AddNativeEventHandler(efl.Libs.Efl, key, callerCb, value);
479             }
480         }
481
482         remove
483         {
484             lock (eflBindingEventLock)
485             {
486                 string key = "_EFL_UI_EVENT_SELECTION_CLEARED";
487                 RemoveNativeEventHandler(efl.Libs.Efl, key, value);
488             }
489         }
490     }
491     ///<summary>Method to raise event SelectionClearedEvt.</summary>
492     public void OnSelectionClearedEvt(EventArgs e)
493     {
494         var key = "_EFL_UI_EVENT_SELECTION_CLEARED";
495         IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Efl, key);
496         if (desc == IntPtr.Zero)
497         {
498             Eina.Log.Error($"Failed to get native event {key}");
499             return;
500         }
501
502         Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, IntPtr.Zero);
503     }
504     private static IntPtr GetEflClassStatic()
505     {
506         return Efl.Ui.ISelectableConcrete.efl_ui_selectable_interface_get();
507     }
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
511     {
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)
515         {
516             var descs = new System.Collections.Generic.List<Efl_Op_Description>();
517             return descs;
518         }
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()
522         {
523             return Efl.Ui.ISelectableConcrete.efl_ui_selectable_interface_get();
524         }
525
526         #pragma warning disable CA1707, CS1591, SA1300, SA1600
527
528         #pragma warning restore CA1707, CS1591, SA1300, SA1600
529
530 }
531 }
532 }
533
534 }
535