[NUI] TCSACR-226 code change (#1032)
[platform/core/csapi/tizenfx.git] / internals / src / EflSharp / EflSharp / efl / efl_ui_tab_page.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>Event argument wrapper for event <see cref="Efl.Ui.TabPage.TabChangedEvt"/>.</summary>
14 [Efl.Eo.BindingEntity]
15 public class TabPageTabChangedEvt_Args : EventArgs {
16     /// <summary>Actual event payload.</summary>
17     /// <value>Called when tab changed</value>
18     public Efl.Ui.TabPageTabChangedEvent arg { get; set; }
19 }
20 /// <summary>Tab Page class</summary>
21 /// <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>
22 [Efl.Ui.TabPage.NativeMethods]
23 [Efl.Eo.BindingEntity]
24 public class TabPage : Efl.Ui.LayoutBase, Efl.IContent
25 {
26     /// <summary>Pointer to the native class description.</summary>
27     public override System.IntPtr NativeClass
28     {
29         get
30         {
31             if (((object)this).GetType() == typeof(TabPage))
32             {
33                 return GetEflClassStatic();
34             }
35             else
36             {
37                 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
38             }
39         }
40     }
41
42     [System.Runtime.InteropServices.DllImport(efl.Libs.Elementary)] internal static extern System.IntPtr
43         efl_ui_tab_page_class_get();
44     /// <summary>Initializes a new instance of the <see cref="TabPage"/> class.</summary>
45     /// <param name="parent">Parent instance.</param>
46     /// <param name="style">The widget style to use. See <see cref="Efl.Ui.Widget.SetStyle" /></param>
47     public TabPage(Efl.Object parent
48             , System.String style = null) : base(efl_ui_tab_page_class_get(), parent)
49     {
50         if (Efl.Eo.Globals.ParamHelperCheck(style))
51         {
52             SetStyle(Efl.Eo.Globals.GetParamHelper(style));
53         }
54
55         FinishInstantiation();
56     }
57
58     /// <summary>Subclasses should override this constructor if they are expected to be instantiated from native code.
59     /// Do not call this constructor directly.</summary>
60     /// <param name="ch">Tag struct storing the native handle of the object being constructed.</param>
61     protected TabPage(ConstructingHandle ch) : base(ch)
62     {
63     }
64
65     /// <summary>Initializes a new instance of the <see cref="TabPage"/> class.
66     /// Internal usage: Constructs an instance from a native pointer. 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     protected TabPage(Efl.Eo.Globals.WrappingHandle wh) : base(wh)
69     {
70     }
71
72     /// <summary>Initializes a new instance of the <see cref="TabPage"/> class.
73     /// Internal usage: Constructor to forward the wrapper initialization to the root class that interfaces with native code. Should not be used directly.</summary>
74     /// <param name="baseKlass">The pointer to the base native Eo class.</param>
75     /// <param name="parent">The Efl.Object parent of this instance.</param>
76     protected TabPage(IntPtr baseKlass, Efl.Object parent) : base(baseKlass, parent)
77     {
78     }
79
80     /// <summary>Called when tab changed</summary>
81     /// <value><see cref="Efl.Ui.TabPageTabChangedEvt_Args"/></value>
82     public event EventHandler<Efl.Ui.TabPageTabChangedEvt_Args> TabChangedEvt
83     {
84         add
85         {
86             lock (eflBindingEventLock)
87             {
88                 Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) =>
89                 {
90                     var obj = Efl.Eo.Globals.WrapperSupervisorPtrToManaged(data).Target;
91                     if (obj != null)
92                     {
93                         Efl.Ui.TabPageTabChangedEvt_Args args = new Efl.Ui.TabPageTabChangedEvt_Args();
94                         args.arg =  evt.Info;
95                         try
96                         {
97                             value?.Invoke(obj, args);
98                         }
99                         catch (Exception e)
100                         {
101                             Eina.Log.Error(e.ToString());
102                             Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
103                         }
104                     }
105                 };
106
107                 string key = "_EFL_UI_TAB_PAGE_EVENT_TAB_CHANGED";
108                 AddNativeEventHandler(efl.Libs.Elementary, key, callerCb, value);
109             }
110         }
111
112         remove
113         {
114             lock (eflBindingEventLock)
115             {
116                 string key = "_EFL_UI_TAB_PAGE_EVENT_TAB_CHANGED";
117                 RemoveNativeEventHandler(efl.Libs.Elementary, key, value);
118             }
119         }
120     }
121     /// <summary>Method to raise event TabChangedEvt.</summary>
122     public void OnTabChangedEvt(Efl.Ui.TabPageTabChangedEvt_Args e)
123     {
124         var key = "_EFL_UI_TAB_PAGE_EVENT_TAB_CHANGED";
125         IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Elementary, key);
126         if (desc == IntPtr.Zero)
127         {
128             Eina.Log.Error($"Failed to get native event {key}");
129             return;
130         }
131
132         IntPtr info = Marshal.AllocHGlobal(Marshal.SizeOf(e.arg));
133         try
134         {
135             Marshal.StructureToPtr(e.arg, info, false);
136             Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, info);
137         }
138         finally
139         {
140             Marshal.FreeHGlobal(info);
141         }
142     }
143     /// <summary>Sent after the content is set or unset using the current content object.
144     /// (Since EFL 1.22)</summary>
145     /// <value><see cref="Efl.IContentContentChangedEvt_Args"/></value>
146     public event EventHandler<Efl.IContentContentChangedEvt_Args> ContentChangedEvt
147     {
148         add
149         {
150             lock (eflBindingEventLock)
151             {
152                 Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) =>
153                 {
154                     var obj = Efl.Eo.Globals.WrapperSupervisorPtrToManaged(data).Target;
155                     if (obj != null)
156                     {
157                         Efl.IContentContentChangedEvt_Args args = new Efl.IContentContentChangedEvt_Args();
158                         args.arg = (Efl.Eo.Globals.CreateWrapperFor(evt.Info) as Efl.Gfx.IEntityConcrete);
159                         try
160                         {
161                             value?.Invoke(obj, args);
162                         }
163                         catch (Exception e)
164                         {
165                             Eina.Log.Error(e.ToString());
166                             Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
167                         }
168                     }
169                 };
170
171                 string key = "_EFL_CONTENT_EVENT_CONTENT_CHANGED";
172                 AddNativeEventHandler(efl.Libs.Elementary, key, callerCb, value);
173             }
174         }
175
176         remove
177         {
178             lock (eflBindingEventLock)
179             {
180                 string key = "_EFL_CONTENT_EVENT_CONTENT_CHANGED";
181                 RemoveNativeEventHandler(efl.Libs.Elementary, key, value);
182             }
183         }
184     }
185     /// <summary>Method to raise event ContentChangedEvt.</summary>
186     public void OnContentChangedEvt(Efl.IContentContentChangedEvt_Args e)
187     {
188         var key = "_EFL_CONTENT_EVENT_CONTENT_CHANGED";
189         IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Elementary, key);
190         if (desc == IntPtr.Zero)
191         {
192             Eina.Log.Error($"Failed to get native event {key}");
193             return;
194         }
195
196         IntPtr info = e.arg.NativeHandle;
197         Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, info);
198     }
199     public Efl.Ui.TabPagePartTab TabPart
200     {
201         get
202         {
203             return GetPart("tab") as Efl.Ui.TabPagePartTab;
204         }
205     }
206     /// <summary>Sub-object currently set as this object&apos;s single content.
207     /// If it is set multiple times, previous sub-objects are removed first. Therefore, if an invalid <c>content</c> is set the object will become empty (it will have no sub-object).
208     /// (Since EFL 1.22)</summary>
209     /// <returns>The sub-object.</returns>
210     virtual public Efl.Gfx.IEntity GetContent() {
211          var _ret_var = Efl.IContentConcrete.NativeMethods.efl_content_get_ptr.Value.Delegate((IsGeneratedBindingClass ? this.NativeHandle : Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass)));
212         Eina.Error.RaiseIfUnhandledException();
213         return _ret_var;
214  }
215     /// <summary>Sub-object currently set as this object&apos;s single content.
216     /// If it is set multiple times, previous sub-objects are removed first. Therefore, if an invalid <c>content</c> is set the object will become empty (it will have no sub-object).
217     /// (Since EFL 1.22)</summary>
218     /// <param name="content">The sub-object.</param>
219     /// <returns><c>true</c> if <c>content</c> was successfully swallowed.</returns>
220     virtual public bool SetContent(Efl.Gfx.IEntity content) {
221                                  var _ret_var = Efl.IContentConcrete.NativeMethods.efl_content_set_ptr.Value.Delegate((IsGeneratedBindingClass ? this.NativeHandle : Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass)),content);
222         Eina.Error.RaiseIfUnhandledException();
223                         return _ret_var;
224  }
225     /// <summary>Remove the sub-object currently set as content of this object and return it. This object becomes empty.
226     /// (Since EFL 1.22)</summary>
227     /// <returns>Unswallowed object</returns>
228     virtual public Efl.Gfx.IEntity UnsetContent() {
229          var _ret_var = Efl.IContentConcrete.NativeMethods.efl_content_unset_ptr.Value.Delegate((IsGeneratedBindingClass ? this.NativeHandle : Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass)));
230         Eina.Error.RaiseIfUnhandledException();
231         return _ret_var;
232  }
233     /// <summary>Sub-object currently set as this object&apos;s single content.
234     /// If it is set multiple times, previous sub-objects are removed first. Therefore, if an invalid <c>content</c> is set the object will become empty (it will have no sub-object).
235     /// (Since EFL 1.22)</summary>
236     /// <value>The sub-object.</value>
237     public Efl.Gfx.IEntity Content {
238         get { return GetContent(); }
239         set { SetContent(value); }
240     }
241     private static IntPtr GetEflClassStatic()
242     {
243         return Efl.Ui.TabPage.efl_ui_tab_page_class_get();
244     }
245     /// <summary>Wrapper for native methods and virtual method delegates.
246     /// For internal use by generated code only.</summary>
247     public new class NativeMethods : Efl.Ui.LayoutBase.NativeMethods
248     {
249         private static Efl.Eo.NativeModule Module = new Efl.Eo.NativeModule(    efl.Libs.Elementary);
250         /// <summary>Gets the list of Eo operations to override.</summary>
251         /// <returns>The list of Eo operations to be overload.</returns>
252         public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
253         {
254             var descs = new System.Collections.Generic.List<Efl_Op_Description>();
255             var methods = Efl.Eo.Globals.GetUserMethods(type);
256
257             if (efl_content_get_static_delegate == null)
258             {
259                 efl_content_get_static_delegate = new efl_content_get_delegate(content_get);
260             }
261
262             if (methods.FirstOrDefault(m => m.Name == "GetContent") != null)
263             {
264                 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_content_get"), func = Marshal.GetFunctionPointerForDelegate(efl_content_get_static_delegate) });
265             }
266
267             if (efl_content_set_static_delegate == null)
268             {
269                 efl_content_set_static_delegate = new efl_content_set_delegate(content_set);
270             }
271
272             if (methods.FirstOrDefault(m => m.Name == "SetContent") != null)
273             {
274                 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_content_set"), func = Marshal.GetFunctionPointerForDelegate(efl_content_set_static_delegate) });
275             }
276
277             if (efl_content_unset_static_delegate == null)
278             {
279                 efl_content_unset_static_delegate = new efl_content_unset_delegate(content_unset);
280             }
281
282             if (methods.FirstOrDefault(m => m.Name == "UnsetContent") != null)
283             {
284                 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_content_unset"), func = Marshal.GetFunctionPointerForDelegate(efl_content_unset_static_delegate) });
285             }
286
287             descs.AddRange(base.GetEoOps(type));
288             return descs;
289         }
290         /// <summary>Returns the Eo class for the native methods of this class.</summary>
291         /// <returns>The native class pointer.</returns>
292         public override IntPtr GetEflClass()
293         {
294             return Efl.Ui.TabPage.efl_ui_tab_page_class_get();
295         }
296
297         #pragma warning disable CA1707, CS1591, SA1300, SA1600
298
299         [return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))]
300         private delegate Efl.Gfx.IEntity efl_content_get_delegate(System.IntPtr obj, System.IntPtr pd);
301
302         [return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))]
303         public delegate Efl.Gfx.IEntity efl_content_get_api_delegate(System.IntPtr obj);
304
305         public static Efl.Eo.FunctionWrapper<efl_content_get_api_delegate> efl_content_get_ptr = new Efl.Eo.FunctionWrapper<efl_content_get_api_delegate>(Module, "efl_content_get");
306
307         private static Efl.Gfx.IEntity content_get(System.IntPtr obj, System.IntPtr pd)
308         {
309             Eina.Log.Debug("function efl_content_get was called");
310             var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
311             if (ws != null)
312             {
313             Efl.Gfx.IEntity _ret_var = default(Efl.Gfx.IEntity);
314                 try
315                 {
316                     _ret_var = ((TabPage)ws.Target).GetContent();
317                 }
318                 catch (Exception e)
319                 {
320                     Eina.Log.Warning($"Callback error: {e.ToString()}");
321                     Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
322                 }
323
324         return _ret_var;
325
326             }
327             else
328             {
329                 return efl_content_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
330             }
331         }
332
333         private static efl_content_get_delegate efl_content_get_static_delegate;
334
335         [return: MarshalAs(UnmanagedType.U1)]
336         private delegate bool efl_content_set_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))] Efl.Gfx.IEntity content);
337
338         [return: MarshalAs(UnmanagedType.U1)]
339         public delegate bool efl_content_set_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))] Efl.Gfx.IEntity content);
340
341         public static Efl.Eo.FunctionWrapper<efl_content_set_api_delegate> efl_content_set_ptr = new Efl.Eo.FunctionWrapper<efl_content_set_api_delegate>(Module, "efl_content_set");
342
343         private static bool content_set(System.IntPtr obj, System.IntPtr pd, Efl.Gfx.IEntity content)
344         {
345             Eina.Log.Debug("function efl_content_set was called");
346             var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
347             if (ws != null)
348             {
349                                     bool _ret_var = default(bool);
350                 try
351                 {
352                     _ret_var = ((TabPage)ws.Target).SetContent(content);
353                 }
354                 catch (Exception e)
355                 {
356                     Eina.Log.Warning($"Callback error: {e.ToString()}");
357                     Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
358                 }
359
360                         return _ret_var;
361
362             }
363             else
364             {
365                 return efl_content_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), content);
366             }
367         }
368
369         private static efl_content_set_delegate efl_content_set_static_delegate;
370
371         [return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))]
372         private delegate Efl.Gfx.IEntity efl_content_unset_delegate(System.IntPtr obj, System.IntPtr pd);
373
374         [return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))]
375         public delegate Efl.Gfx.IEntity efl_content_unset_api_delegate(System.IntPtr obj);
376
377         public static Efl.Eo.FunctionWrapper<efl_content_unset_api_delegate> efl_content_unset_ptr = new Efl.Eo.FunctionWrapper<efl_content_unset_api_delegate>(Module, "efl_content_unset");
378
379         private static Efl.Gfx.IEntity content_unset(System.IntPtr obj, System.IntPtr pd)
380         {
381             Eina.Log.Debug("function efl_content_unset was called");
382             var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
383             if (ws != null)
384             {
385             Efl.Gfx.IEntity _ret_var = default(Efl.Gfx.IEntity);
386                 try
387                 {
388                     _ret_var = ((TabPage)ws.Target).UnsetContent();
389                 }
390                 catch (Exception e)
391                 {
392                     Eina.Log.Warning($"Callback error: {e.ToString()}");
393                     Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
394                 }
395
396         return _ret_var;
397
398             }
399             else
400             {
401                 return efl_content_unset_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
402             }
403         }
404
405         private static efl_content_unset_delegate efl_content_unset_static_delegate;
406
407         #pragma warning restore CA1707, CS1591, SA1300, SA1600
408
409 }
410 }
411 }
412
413 }
414
415 #if EFL_BETA
416 #pragma warning disable CS1591
417 public static class Efl_UiTabPage_ExtensionMethods {
418     public static Efl.BindableProperty<Efl.Gfx.IEntity> Content<T>(this Efl.Ui.ItemFactory<T> fac, Efl.Csharp.ExtensionTag<Efl.Ui.TabPage, T>magic = null) where T : Efl.Ui.TabPage {
419         return new Efl.BindableProperty<Efl.Gfx.IEntity>("content", fac);
420     }
421
422         public static Efl.BindablePart<Efl.Ui.TabPagePartTab> TabPart<T>(this Efl.Ui.ItemFactory<T> fac, Efl.Csharp.ExtensionTag<Efl.Ui.TabPage, T> x=null) where T : Efl.Ui.TabPage
423     {
424         return new Efl.BindablePart<Efl.Ui.TabPagePartTab>("tab" ,fac);
425     }
426
427 }
428 #pragma warning restore CS1591
429 #endif
430 namespace Efl {
431
432 namespace Ui {
433
434 /// <summary>Which part of the tab has changed.</summary>
435 [Efl.Eo.BindingEntity]
436 public enum TabPageTabChanged
437 {
438 /// <summary>Label has changed.</summary>
439 Label = 0,
440 /// <summary>Icon has changed.</summary>
441 Icon = 1,
442 }
443
444 }
445
446 }
447
448 namespace Efl {
449
450 namespace Ui {
451
452 /// <summary>Information of changed event.</summary>
453 [StructLayout(LayoutKind.Sequential)]
454 [Efl.Eo.BindingEntity]
455 public struct TabPageTabChangedEvent
456 {
457     /// <summary>Which part of the tab has changed.</summary>
458     /// <value>Which part of the tab has changed.</value>
459     public Efl.Ui.TabPageTabChanged Changed_info;
460     /// <summary>Constructor for TabPageTabChangedEvent.</summary>
461     /// <param name="Changed_info">Which part of the tab has changed.</param>;
462     public TabPageTabChangedEvent(
463         Efl.Ui.TabPageTabChanged Changed_info = default(Efl.Ui.TabPageTabChanged)    )
464     {
465         this.Changed_info = Changed_info;
466     }
467
468     /// <summary>Implicit conversion to the managed representation from a native pointer.</summary>
469     /// <param name="ptr">Native pointer to be converted.</param>
470     public static implicit operator TabPageTabChangedEvent(IntPtr ptr)
471     {
472         var tmp = (TabPageTabChangedEvent.NativeStruct)Marshal.PtrToStructure(ptr, typeof(TabPageTabChangedEvent.NativeStruct));
473         return tmp;
474     }
475
476     #pragma warning disable CS1591
477
478     /// <summary>Internal wrapper for struct TabPageTabChangedEvent.</summary>
479     [StructLayout(LayoutKind.Sequential)]
480     public struct NativeStruct
481     {
482         
483         public Efl.Ui.TabPageTabChanged Changed_info;
484         /// <summary>Implicit conversion to the internal/marshalling representation.</summary>
485         public static implicit operator TabPageTabChangedEvent.NativeStruct(TabPageTabChangedEvent _external_struct)
486         {
487             var _internal_struct = new TabPageTabChangedEvent.NativeStruct();
488             _internal_struct.Changed_info = _external_struct.Changed_info;
489             return _internal_struct;
490         }
491
492         /// <summary>Implicit conversion to the managed representation.</summary>
493         public static implicit operator TabPageTabChangedEvent(TabPageTabChangedEvent.NativeStruct _internal_struct)
494         {
495             var _external_struct = new TabPageTabChangedEvent();
496             _external_struct.Changed_info = _internal_struct.Changed_info;
497             return _external_struct;
498         }
499
500     }
501
502     #pragma warning restore CS1591
503
504 }
505
506 }
507
508 }
509