1 #pragma warning disable CS1591
3 using System.Runtime.InteropServices;
4 using System.Collections.Generic;
6 using System.Threading;
7 using System.ComponentModel;
12 ///<summary>Event argument wrapper for event <see cref="Efl.Ui.TabPage.TabChangedEvt"/>.</summary>
13 public class TabPageTabChangedEvt_Args : EventArgs {
14 ///<summary>Actual event payload.</summary>
15 public Efl.Ui.TabPageTabChangedEvent arg { get; set; }
17 /// <summary>Tab Page class</summary>
18 [Efl.Ui.TabPage.NativeMethods]
19 public class TabPage : Efl.Ui.LayoutBase, Efl.Eo.IWrapper,Efl.IContent
21 ///<summary>Pointer to the native class description.</summary>
22 public override System.IntPtr NativeClass
26 if (((object)this).GetType() == typeof(TabPage))
28 return GetEflClassStatic();
32 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
37 [System.Runtime.InteropServices.DllImport(efl.Libs.Elementary)] internal static extern System.IntPtr
38 efl_ui_tab_page_class_get();
39 /// <summary>Initializes a new instance of the <see cref="TabPage"/> class.</summary>
40 /// <param name="parent">Parent instance.</param>
41 /// <param name="style">The widget style to use. See <see cref="Efl.Ui.Widget.SetStyle"/></param>
42 public TabPage(Efl.Object parent
43 , System.String style = null) : base(efl_ui_tab_page_class_get(), typeof(TabPage), parent)
45 if (Efl.Eo.Globals.ParamHelperCheck(style))
47 SetStyle(Efl.Eo.Globals.GetParamHelper(style));
50 FinishInstantiation();
53 /// <summary>Initializes a new instance of the <see cref="TabPage"/> class.
54 /// Internal usage: Constructs an instance from a native pointer. This is used when interacting with C code and should not be used directly.</summary>
55 /// <param name="raw">The native pointer to be wrapped.</param>
56 protected TabPage(System.IntPtr raw) : base(raw)
60 /// <summary>Initializes a new instance of the <see cref="TabPage"/> class.
61 /// Internal usage: Constructor to forward the wrapper initialization to the root class that interfaces with native code. Should not be used directly.</summary>
62 /// <param name="baseKlass">The pointer to the base native Eo class.</param>
63 /// <param name="managedType">The managed type of the public constructor that originated this call.</param>
64 /// <param name="parent">The Efl.Object parent of this instance.</param>
65 protected TabPage(IntPtr baseKlass, System.Type managedType, Efl.Object parent) : base(baseKlass, managedType, parent)
69 /// <summary>Verifies if the given object is equal to this one.</summary>
70 /// <param name="instance">The object to compare to.</param>
71 /// <returns>True if both objects point to the same native object.</returns>
72 public override bool Equals(object instance)
74 var other = instance as Efl.Object;
79 return this.NativeHandle == other.NativeHandle;
82 /// <summary>Gets the hash code for this object based on the native pointer it points to.</summary>
83 /// <returns>The value of the pointer, to be used as the hash code of this object.</returns>
84 public override int GetHashCode()
86 return this.NativeHandle.ToInt32();
89 /// <summary>Turns the native pointer into a string representation.</summary>
90 /// <returns>A string with the type and the native pointer for this object.</returns>
91 public override String ToString()
93 return $"{this.GetType().Name}@[{this.NativeHandle.ToInt32():x}]";
96 /// <summary>Called when tab changed</summary>
97 public event EventHandler<Efl.Ui.TabPageTabChangedEvt_Args> TabChangedEvt
103 var wRef = new WeakReference(this);
104 Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) =>
106 var obj = wRef.Target as Efl.Eo.IWrapper;
109 Efl.Ui.TabPageTabChangedEvt_Args args = new Efl.Ui.TabPageTabChangedEvt_Args();
113 value?.Invoke(obj, args);
117 Eina.Log.Error(e.ToString());
118 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
123 string key = "_EFL_UI_TAB_PAGE_EVENT_TAB_CHANGED";
124 AddNativeEventHandler(efl.Libs.Elementary, key, callerCb, value);
132 string key = "_EFL_UI_TAB_PAGE_EVENT_TAB_CHANGED";
133 RemoveNativeEventHandler(efl.Libs.Elementary, key, value);
137 ///<summary>Method to raise event TabChangedEvt.</summary>
138 public void OnTabChangedEvt(Efl.Ui.TabPageTabChangedEvt_Args e)
140 var key = "_EFL_UI_TAB_PAGE_EVENT_TAB_CHANGED";
141 IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Elementary, key);
142 if (desc == IntPtr.Zero)
144 Eina.Log.Error($"Failed to get native event {key}");
148 IntPtr info = Marshal.AllocHGlobal(Marshal.SizeOf(e.arg));
151 Marshal.StructureToPtr(e.arg, info, false);
152 Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, info);
156 Marshal.FreeHGlobal(info);
159 /// <summary>Sent after the content is set or unset using the current content object.
160 /// (Since EFL 1.22)</summary>
161 public event EventHandler<Efl.IContentContentChangedEvt_Args> ContentChangedEvt
167 var wRef = new WeakReference(this);
168 Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) =>
170 var obj = wRef.Target as Efl.Eo.IWrapper;
173 Efl.IContentContentChangedEvt_Args args = new Efl.IContentContentChangedEvt_Args();
174 args.arg = (Efl.Eo.Globals.CreateWrapperFor(evt.Info) as Efl.Gfx.IEntityConcrete);
177 value?.Invoke(obj, args);
181 Eina.Log.Error(e.ToString());
182 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
187 string key = "_EFL_CONTENT_EVENT_CONTENT_CHANGED";
188 AddNativeEventHandler(efl.Libs.Efl, key, callerCb, value);
196 string key = "_EFL_CONTENT_EVENT_CONTENT_CHANGED";
197 RemoveNativeEventHandler(efl.Libs.Efl, key, value);
201 ///<summary>Method to raise event ContentChangedEvt.</summary>
202 public void OnContentChangedEvt(Efl.IContentContentChangedEvt_Args e)
204 var key = "_EFL_CONTENT_EVENT_CONTENT_CHANGED";
205 IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Efl, key);
206 if (desc == IntPtr.Zero)
208 Eina.Log.Error($"Failed to get native event {key}");
212 IntPtr info = e.arg.NativeHandle;
213 Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, info);
215 public Efl.Ui.TabPagePartTab Tab
219 return GetPart("tab") as Efl.Ui.TabPagePartTab;
222 /// <summary>Sub-object currently set as this object's single content.
223 /// 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).
224 /// (Since EFL 1.22)</summary>
225 /// <returns>The sub-object.</returns>
226 virtual public Efl.Gfx.IEntity GetContent() {
227 var _ret_var = Efl.IContentConcrete.NativeMethods.efl_content_get_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle));
228 Eina.Error.RaiseIfUnhandledException();
231 /// <summary>Sub-object currently set as this object's single content.
232 /// 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).
233 /// (Since EFL 1.22)</summary>
234 /// <param name="content">The sub-object.</param>
235 /// <returns><c>true</c> if <c>content</c> was successfully swallowed.</returns>
236 virtual public bool SetContent(Efl.Gfx.IEntity content) {
237 var _ret_var = Efl.IContentConcrete.NativeMethods.efl_content_set_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle),content);
238 Eina.Error.RaiseIfUnhandledException();
241 /// <summary>Remove the sub-object currently set as content of this object and return it. This object becomes empty.
242 /// (Since EFL 1.22)</summary>
243 /// <returns>Unswallowed object</returns>
244 virtual public Efl.Gfx.IEntity UnsetContent() {
245 var _ret_var = Efl.IContentConcrete.NativeMethods.efl_content_unset_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle));
246 Eina.Error.RaiseIfUnhandledException();
249 /// <summary>Sub-object currently set as this object's single content.
250 /// 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).
251 /// (Since EFL 1.22)</summary>
252 /// <value>The sub-object.</value>
253 public Efl.Gfx.IEntity Content {
254 get { return GetContent(); }
255 set { SetContent(value); }
257 private static IntPtr GetEflClassStatic()
259 return Efl.Ui.TabPage.efl_ui_tab_page_class_get();
261 /// <summary>Wrapper for native methods and virtual method delegates.
262 /// For internal use by generated code only.</summary>
263 public new class NativeMethods : Efl.Ui.LayoutBase.NativeMethods
265 private static Efl.Eo.NativeModule Module = new Efl.Eo.NativeModule( efl.Libs.Elementary);
266 /// <summary>Gets the list of Eo operations to override.</summary>
267 /// <returns>The list of Eo operations to be overload.</returns>
268 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
270 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
271 var methods = Efl.Eo.Globals.GetUserMethods(type);
273 if (efl_content_get_static_delegate == null)
275 efl_content_get_static_delegate = new efl_content_get_delegate(content_get);
278 if (methods.FirstOrDefault(m => m.Name == "GetContent") != null)
280 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) });
283 if (efl_content_set_static_delegate == null)
285 efl_content_set_static_delegate = new efl_content_set_delegate(content_set);
288 if (methods.FirstOrDefault(m => m.Name == "SetContent") != null)
290 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) });
293 if (efl_content_unset_static_delegate == null)
295 efl_content_unset_static_delegate = new efl_content_unset_delegate(content_unset);
298 if (methods.FirstOrDefault(m => m.Name == "UnsetContent") != null)
300 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) });
303 descs.AddRange(base.GetEoOps(type));
306 /// <summary>Returns the Eo class for the native methods of this class.</summary>
307 /// <returns>The native class pointer.</returns>
308 public override IntPtr GetEflClass()
310 return Efl.Ui.TabPage.efl_ui_tab_page_class_get();
313 #pragma warning disable CA1707, SA1300, SA1600
315 [return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))]
316 private delegate Efl.Gfx.IEntity efl_content_get_delegate(System.IntPtr obj, System.IntPtr pd);
318 [return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))]
319 public delegate Efl.Gfx.IEntity efl_content_get_api_delegate(System.IntPtr obj);
321 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");
323 private static Efl.Gfx.IEntity content_get(System.IntPtr obj, System.IntPtr pd)
325 Eina.Log.Debug("function efl_content_get was called");
326 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
329 Efl.Gfx.IEntity _ret_var = default(Efl.Gfx.IEntity);
332 _ret_var = ((TabPage)wrapper).GetContent();
336 Eina.Log.Warning($"Callback error: {e.ToString()}");
337 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
345 return efl_content_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
349 private static efl_content_get_delegate efl_content_get_static_delegate;
351 [return: MarshalAs(UnmanagedType.U1)]
352 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);
354 [return: MarshalAs(UnmanagedType.U1)]
355 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);
357 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");
359 private static bool content_set(System.IntPtr obj, System.IntPtr pd, Efl.Gfx.IEntity content)
361 Eina.Log.Debug("function efl_content_set was called");
362 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
365 bool _ret_var = default(bool);
368 _ret_var = ((TabPage)wrapper).SetContent(content);
372 Eina.Log.Warning($"Callback error: {e.ToString()}");
373 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
381 return efl_content_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), content);
385 private static efl_content_set_delegate efl_content_set_static_delegate;
387 [return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))]
388 private delegate Efl.Gfx.IEntity efl_content_unset_delegate(System.IntPtr obj, System.IntPtr pd);
390 [return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))]
391 public delegate Efl.Gfx.IEntity efl_content_unset_api_delegate(System.IntPtr obj);
393 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");
395 private static Efl.Gfx.IEntity content_unset(System.IntPtr obj, System.IntPtr pd)
397 Eina.Log.Debug("function efl_content_unset was called");
398 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
401 Efl.Gfx.IEntity _ret_var = default(Efl.Gfx.IEntity);
404 _ret_var = ((TabPage)wrapper).UnsetContent();
408 Eina.Log.Warning($"Callback error: {e.ToString()}");
409 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
417 return efl_content_unset_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
421 private static efl_content_unset_delegate efl_content_unset_static_delegate;
423 #pragma warning restore CA1707, SA1300, SA1600
435 public enum TabPageTabChanged
437 /// <summary>Label changed</summary>
439 /// <summary>Icon changed</summary>
451 /// <summary>Information of changed event</summary>
452 [StructLayout(LayoutKind.Sequential)]
453 public struct TabPageTabChangedEvent
455 public Efl.Ui.TabPageTabChanged Changed_info;
456 ///<summary>Constructor for TabPageTabChangedEvent.</summary>
457 public TabPageTabChangedEvent(
458 Efl.Ui.TabPageTabChanged Changed_info = default(Efl.Ui.TabPageTabChanged) )
460 this.Changed_info = Changed_info;
463 public static implicit operator TabPageTabChangedEvent(IntPtr ptr)
465 var tmp = (TabPageTabChangedEvent.NativeStruct)Marshal.PtrToStructure(ptr, typeof(TabPageTabChangedEvent.NativeStruct));
469 ///<summary>Internal wrapper for struct TabPageTabChangedEvent.</summary>
470 [StructLayout(LayoutKind.Sequential)]
471 public struct NativeStruct
474 public Efl.Ui.TabPageTabChanged Changed_info;
475 ///<summary>Implicit conversion to the internal/marshalling representation.</summary>
476 public static implicit operator TabPageTabChangedEvent.NativeStruct(TabPageTabChangedEvent _external_struct)
478 var _internal_struct = new TabPageTabChangedEvent.NativeStruct();
479 _internal_struct.Changed_info = _external_struct.Changed_info;
480 return _internal_struct;
483 ///<summary>Implicit conversion to the managed representation.</summary>
484 public static implicit operator TabPageTabChangedEvent(TabPageTabChangedEvent.NativeStruct _internal_struct)
486 var _external_struct = new TabPageTabChangedEvent();
487 _external_struct.Changed_info = _internal_struct.Changed_info;
488 return _external_struct;