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>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; }
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
26 /// <summary>Pointer to the native class description.</summary>
27 public override System.IntPtr NativeClass
31 if (((object)this).GetType() == typeof(TabPage))
33 return GetEflClassStatic();
37 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
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)
50 if (Efl.Eo.Globals.ParamHelperCheck(style))
52 SetStyle(Efl.Eo.Globals.GetParamHelper(style));
55 FinishInstantiation();
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)
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)
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)
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
86 lock (eflBindingEventLock)
88 Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) =>
90 var obj = Efl.Eo.Globals.WrapperSupervisorPtrToManaged(data).Target;
93 Efl.Ui.TabPageTabChangedEvt_Args args = new Efl.Ui.TabPageTabChangedEvt_Args();
97 value?.Invoke(obj, args);
101 Eina.Log.Error(e.ToString());
102 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
107 string key = "_EFL_UI_TAB_PAGE_EVENT_TAB_CHANGED";
108 AddNativeEventHandler(efl.Libs.Elementary, key, callerCb, value);
114 lock (eflBindingEventLock)
116 string key = "_EFL_UI_TAB_PAGE_EVENT_TAB_CHANGED";
117 RemoveNativeEventHandler(efl.Libs.Elementary, key, value);
121 /// <summary>Method to raise event TabChangedEvt.</summary>
122 public void OnTabChangedEvt(Efl.Ui.TabPageTabChangedEvt_Args e)
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)
128 Eina.Log.Error($"Failed to get native event {key}");
132 IntPtr info = Marshal.AllocHGlobal(Marshal.SizeOf(e.arg));
135 Marshal.StructureToPtr(e.arg, info, false);
136 Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, info);
140 Marshal.FreeHGlobal(info);
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
150 lock (eflBindingEventLock)
152 Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) =>
154 var obj = Efl.Eo.Globals.WrapperSupervisorPtrToManaged(data).Target;
157 Efl.IContentContentChangedEvt_Args args = new Efl.IContentContentChangedEvt_Args();
158 args.arg = (Efl.Eo.Globals.CreateWrapperFor(evt.Info) as Efl.Gfx.IEntityConcrete);
161 value?.Invoke(obj, args);
165 Eina.Log.Error(e.ToString());
166 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
171 string key = "_EFL_CONTENT_EVENT_CONTENT_CHANGED";
172 AddNativeEventHandler(efl.Libs.Elementary, key, callerCb, value);
178 lock (eflBindingEventLock)
180 string key = "_EFL_CONTENT_EVENT_CONTENT_CHANGED";
181 RemoveNativeEventHandler(efl.Libs.Elementary, key, value);
185 /// <summary>Method to raise event ContentChangedEvt.</summary>
186 public void OnContentChangedEvt(Efl.IContentContentChangedEvt_Args e)
188 var key = "_EFL_CONTENT_EVENT_CONTENT_CHANGED";
189 IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Elementary, key);
190 if (desc == IntPtr.Zero)
192 Eina.Log.Error($"Failed to get native event {key}");
196 IntPtr info = e.arg.NativeHandle;
197 Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, info);
199 public Efl.Ui.TabPagePartTab TabPart
203 return GetPart("tab") as Efl.Ui.TabPagePartTab;
206 /// <summary>Sub-object currently set as this object'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();
215 /// <summary>Sub-object currently set as this object'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();
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();
233 /// <summary>Sub-object currently set as this object'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); }
241 private static IntPtr GetEflClassStatic()
243 return Efl.Ui.TabPage.efl_ui_tab_page_class_get();
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
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)
254 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
255 var methods = Efl.Eo.Globals.GetUserMethods(type);
257 if (efl_content_get_static_delegate == null)
259 efl_content_get_static_delegate = new efl_content_get_delegate(content_get);
262 if (methods.FirstOrDefault(m => m.Name == "GetContent") != null)
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) });
267 if (efl_content_set_static_delegate == null)
269 efl_content_set_static_delegate = new efl_content_set_delegate(content_set);
272 if (methods.FirstOrDefault(m => m.Name == "SetContent") != null)
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) });
277 if (efl_content_unset_static_delegate == null)
279 efl_content_unset_static_delegate = new efl_content_unset_delegate(content_unset);
282 if (methods.FirstOrDefault(m => m.Name == "UnsetContent") != null)
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) });
287 descs.AddRange(base.GetEoOps(type));
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()
294 return Efl.Ui.TabPage.efl_ui_tab_page_class_get();
297 #pragma warning disable CA1707, CS1591, SA1300, SA1600
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);
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);
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");
307 private static Efl.Gfx.IEntity content_get(System.IntPtr obj, System.IntPtr pd)
309 Eina.Log.Debug("function efl_content_get was called");
310 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
313 Efl.Gfx.IEntity _ret_var = default(Efl.Gfx.IEntity);
316 _ret_var = ((TabPage)ws.Target).GetContent();
320 Eina.Log.Warning($"Callback error: {e.ToString()}");
321 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
329 return efl_content_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
333 private static efl_content_get_delegate efl_content_get_static_delegate;
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);
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);
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");
343 private static bool content_set(System.IntPtr obj, System.IntPtr pd, Efl.Gfx.IEntity content)
345 Eina.Log.Debug("function efl_content_set was called");
346 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
349 bool _ret_var = default(bool);
352 _ret_var = ((TabPage)ws.Target).SetContent(content);
356 Eina.Log.Warning($"Callback error: {e.ToString()}");
357 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
365 return efl_content_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), content);
369 private static efl_content_set_delegate efl_content_set_static_delegate;
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);
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);
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");
379 private static Efl.Gfx.IEntity content_unset(System.IntPtr obj, System.IntPtr pd)
381 Eina.Log.Debug("function efl_content_unset was called");
382 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
385 Efl.Gfx.IEntity _ret_var = default(Efl.Gfx.IEntity);
388 _ret_var = ((TabPage)ws.Target).UnsetContent();
392 Eina.Log.Warning($"Callback error: {e.ToString()}");
393 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
401 return efl_content_unset_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
405 private static efl_content_unset_delegate efl_content_unset_static_delegate;
407 #pragma warning restore CA1707, CS1591, SA1300, SA1600
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);
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
424 return new Efl.BindablePart<Efl.Ui.TabPagePartTab>("tab" ,fac);
428 #pragma warning restore CS1591
434 /// <summary>Which part of the tab has changed.</summary>
435 [Efl.Eo.BindingEntity]
436 public enum TabPageTabChanged
438 /// <summary>Label has changed.</summary>
440 /// <summary>Icon has changed.</summary>
452 /// <summary>Information of changed event.</summary>
453 [StructLayout(LayoutKind.Sequential)]
454 [Efl.Eo.BindingEntity]
455 public struct TabPageTabChangedEvent
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) )
465 this.Changed_info = Changed_info;
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)
472 var tmp = (TabPageTabChangedEvent.NativeStruct)Marshal.PtrToStructure(ptr, typeof(TabPageTabChangedEvent.NativeStruct));
476 #pragma warning disable CS1591
478 /// <summary>Internal wrapper for struct TabPageTabChangedEvent.</summary>
479 [StructLayout(LayoutKind.Sequential)]
480 public struct NativeStruct
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)
487 var _internal_struct = new TabPageTabChangedEvent.NativeStruct();
488 _internal_struct.Changed_info = _external_struct.Changed_info;
489 return _internal_struct;
492 /// <summary>Implicit conversion to the managed representation.</summary>
493 public static implicit operator TabPageTabChangedEvent(TabPageTabChangedEvent.NativeStruct _internal_struct)
495 var _external_struct = new TabPageTabChangedEvent();
496 _external_struct.Changed_info = _internal_struct.Changed_info;
497 return _external_struct;
502 #pragma warning restore CS1591