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>Tab Bar 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.TabBar.NativeMethods]
16 [Efl.Eo.BindingEntity]
17 public class TabBar : Efl.Ui.LayoutBase
19 /// <summary>Pointer to the native class description.</summary>
20 public override System.IntPtr NativeClass
24 if (((object)this).GetType() == typeof(TabBar))
26 return GetEflClassStatic();
30 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
35 [System.Runtime.InteropServices.DllImport(efl.Libs.Elementary)] internal static extern System.IntPtr
36 efl_ui_tab_bar_class_get();
37 /// <summary>Initializes a new instance of the <see cref="TabBar"/> class.</summary>
38 /// <param name="parent">Parent instance.</param>
39 /// <param name="style">The widget style to use. See <see cref="Efl.Ui.Widget.SetStyle" /></param>
40 public TabBar(Efl.Object parent
41 , System.String style = null) : base(efl_ui_tab_bar_class_get(), parent)
43 if (Efl.Eo.Globals.ParamHelperCheck(style))
45 SetStyle(Efl.Eo.Globals.GetParamHelper(style));
48 FinishInstantiation();
51 /// <summary>Subclasses should override this constructor if they are expected to be instantiated from native code.
52 /// Do not call this constructor directly.</summary>
53 /// <param name="ch">Tag struct storing the native handle of the object being constructed.</param>
54 protected TabBar(ConstructingHandle ch) : base(ch)
58 /// <summary>Initializes a new instance of the <see cref="TabBar"/> class.
59 /// Internal usage: Constructs an instance from a native pointer. This is used when interacting with C code and should not be used directly.</summary>
60 /// <param name="wh">The native pointer to be wrapped.</param>
61 protected TabBar(Efl.Eo.Globals.WrappingHandle wh) : base(wh)
65 /// <summary>Initializes a new instance of the <see cref="TabBar"/> class.
66 /// Internal usage: Constructor to forward the wrapper initialization to the root class that interfaces with native code. Should not be used directly.</summary>
67 /// <param name="baseKlass">The pointer to the base native Eo class.</param>
68 /// <param name="parent">The Efl.Object parent of this instance.</param>
69 protected TabBar(IntPtr baseKlass, Efl.Object parent) : base(baseKlass, parent)
73 virtual public int GetCurrentTab() {
74 var _ret_var = Efl.Ui.TabBar.NativeMethods.efl_ui_tab_bar_current_tab_get_ptr.Value.Delegate((IsGeneratedBindingClass ? this.NativeHandle : Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass)));
75 Eina.Error.RaiseIfUnhandledException();
78 virtual public void SetCurrentTab(int index) {
79 Efl.Ui.TabBar.NativeMethods.efl_ui_tab_bar_current_tab_set_ptr.Value.Delegate((IsGeneratedBindingClass ? this.NativeHandle : Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass)),index);
80 Eina.Error.RaiseIfUnhandledException();
82 virtual public uint TabCount() {
83 var _ret_var = Efl.Ui.TabBar.NativeMethods.efl_ui_tab_bar_tab_count_ptr.Value.Delegate((IsGeneratedBindingClass ? this.NativeHandle : Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass)));
84 Eina.Error.RaiseIfUnhandledException();
87 virtual public void AddTab(int index, System.String label, System.String icon) {
88 Efl.Ui.TabBar.NativeMethods.efl_ui_tab_bar_tab_add_ptr.Value.Delegate((IsGeneratedBindingClass ? this.NativeHandle : Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass)),index, label, icon);
89 Eina.Error.RaiseIfUnhandledException();
91 virtual public void TabRemove(int index) {
92 Efl.Ui.TabBar.NativeMethods.efl_ui_tab_bar_tab_remove_ptr.Value.Delegate((IsGeneratedBindingClass ? this.NativeHandle : Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass)),index);
93 Eina.Error.RaiseIfUnhandledException();
95 virtual public void SetTabLabel(int index, System.String label) {
96 Efl.Ui.TabBar.NativeMethods.efl_ui_tab_bar_tab_label_set_ptr.Value.Delegate((IsGeneratedBindingClass ? this.NativeHandle : Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass)),index, label);
97 Eina.Error.RaiseIfUnhandledException();
99 virtual public void SetTabIcon(int index, System.String icon) {
100 Efl.Ui.TabBar.NativeMethods.efl_ui_tab_bar_tab_icon_set_ptr.Value.Delegate((IsGeneratedBindingClass ? this.NativeHandle : Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass)),index, icon);
101 Eina.Error.RaiseIfUnhandledException();
103 public int CurrentTab {
104 get { return GetCurrentTab(); }
105 set { SetCurrentTab(value); }
107 private static IntPtr GetEflClassStatic()
109 return Efl.Ui.TabBar.efl_ui_tab_bar_class_get();
111 /// <summary>Wrapper for native methods and virtual method delegates.
112 /// For internal use by generated code only.</summary>
113 public new class NativeMethods : Efl.Ui.LayoutBase.NativeMethods
115 private static Efl.Eo.NativeModule Module = new Efl.Eo.NativeModule( efl.Libs.Elementary);
116 /// <summary>Gets the list of Eo operations to override.</summary>
117 /// <returns>The list of Eo operations to be overload.</returns>
118 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
120 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
121 var methods = Efl.Eo.Globals.GetUserMethods(type);
123 if (efl_ui_tab_bar_current_tab_get_static_delegate == null)
125 efl_ui_tab_bar_current_tab_get_static_delegate = new efl_ui_tab_bar_current_tab_get_delegate(current_tab_get);
128 if (methods.FirstOrDefault(m => m.Name == "GetCurrentTab") != null)
130 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_ui_tab_bar_current_tab_get"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_tab_bar_current_tab_get_static_delegate) });
133 if (efl_ui_tab_bar_current_tab_set_static_delegate == null)
135 efl_ui_tab_bar_current_tab_set_static_delegate = new efl_ui_tab_bar_current_tab_set_delegate(current_tab_set);
138 if (methods.FirstOrDefault(m => m.Name == "SetCurrentTab") != null)
140 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_ui_tab_bar_current_tab_set"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_tab_bar_current_tab_set_static_delegate) });
143 if (efl_ui_tab_bar_tab_count_static_delegate == null)
145 efl_ui_tab_bar_tab_count_static_delegate = new efl_ui_tab_bar_tab_count_delegate(tab_count);
148 if (methods.FirstOrDefault(m => m.Name == "TabCount") != null)
150 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_ui_tab_bar_tab_count"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_tab_bar_tab_count_static_delegate) });
153 if (efl_ui_tab_bar_tab_add_static_delegate == null)
155 efl_ui_tab_bar_tab_add_static_delegate = new efl_ui_tab_bar_tab_add_delegate(tab_add);
158 if (methods.FirstOrDefault(m => m.Name == "AddTab") != null)
160 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_ui_tab_bar_tab_add"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_tab_bar_tab_add_static_delegate) });
163 if (efl_ui_tab_bar_tab_remove_static_delegate == null)
165 efl_ui_tab_bar_tab_remove_static_delegate = new efl_ui_tab_bar_tab_remove_delegate(tab_remove);
168 if (methods.FirstOrDefault(m => m.Name == "TabRemove") != null)
170 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_ui_tab_bar_tab_remove"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_tab_bar_tab_remove_static_delegate) });
173 if (efl_ui_tab_bar_tab_label_set_static_delegate == null)
175 efl_ui_tab_bar_tab_label_set_static_delegate = new efl_ui_tab_bar_tab_label_set_delegate(tab_label_set);
178 if (methods.FirstOrDefault(m => m.Name == "SetTabLabel") != null)
180 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_ui_tab_bar_tab_label_set"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_tab_bar_tab_label_set_static_delegate) });
183 if (efl_ui_tab_bar_tab_icon_set_static_delegate == null)
185 efl_ui_tab_bar_tab_icon_set_static_delegate = new efl_ui_tab_bar_tab_icon_set_delegate(tab_icon_set);
188 if (methods.FirstOrDefault(m => m.Name == "SetTabIcon") != null)
190 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_ui_tab_bar_tab_icon_set"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_tab_bar_tab_icon_set_static_delegate) });
193 descs.AddRange(base.GetEoOps(type));
196 /// <summary>Returns the Eo class for the native methods of this class.</summary>
197 /// <returns>The native class pointer.</returns>
198 public override IntPtr GetEflClass()
200 return Efl.Ui.TabBar.efl_ui_tab_bar_class_get();
203 #pragma warning disable CA1707, CS1591, SA1300, SA1600
206 private delegate int efl_ui_tab_bar_current_tab_get_delegate(System.IntPtr obj, System.IntPtr pd);
209 public delegate int efl_ui_tab_bar_current_tab_get_api_delegate(System.IntPtr obj);
211 public static Efl.Eo.FunctionWrapper<efl_ui_tab_bar_current_tab_get_api_delegate> efl_ui_tab_bar_current_tab_get_ptr = new Efl.Eo.FunctionWrapper<efl_ui_tab_bar_current_tab_get_api_delegate>(Module, "efl_ui_tab_bar_current_tab_get");
213 private static int current_tab_get(System.IntPtr obj, System.IntPtr pd)
215 Eina.Log.Debug("function efl_ui_tab_bar_current_tab_get was called");
216 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
219 int _ret_var = default(int);
222 _ret_var = ((TabBar)ws.Target).GetCurrentTab();
226 Eina.Log.Warning($"Callback error: {e.ToString()}");
227 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
235 return efl_ui_tab_bar_current_tab_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
239 private static efl_ui_tab_bar_current_tab_get_delegate efl_ui_tab_bar_current_tab_get_static_delegate;
242 private delegate void efl_ui_tab_bar_current_tab_set_delegate(System.IntPtr obj, System.IntPtr pd, int index);
245 public delegate void efl_ui_tab_bar_current_tab_set_api_delegate(System.IntPtr obj, int index);
247 public static Efl.Eo.FunctionWrapper<efl_ui_tab_bar_current_tab_set_api_delegate> efl_ui_tab_bar_current_tab_set_ptr = new Efl.Eo.FunctionWrapper<efl_ui_tab_bar_current_tab_set_api_delegate>(Module, "efl_ui_tab_bar_current_tab_set");
249 private static void current_tab_set(System.IntPtr obj, System.IntPtr pd, int index)
251 Eina.Log.Debug("function efl_ui_tab_bar_current_tab_set was called");
252 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
258 ((TabBar)ws.Target).SetCurrentTab(index);
262 Eina.Log.Warning($"Callback error: {e.ToString()}");
263 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
270 efl_ui_tab_bar_current_tab_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), index);
274 private static efl_ui_tab_bar_current_tab_set_delegate efl_ui_tab_bar_current_tab_set_static_delegate;
277 private delegate uint efl_ui_tab_bar_tab_count_delegate(System.IntPtr obj, System.IntPtr pd);
280 public delegate uint efl_ui_tab_bar_tab_count_api_delegate(System.IntPtr obj);
282 public static Efl.Eo.FunctionWrapper<efl_ui_tab_bar_tab_count_api_delegate> efl_ui_tab_bar_tab_count_ptr = new Efl.Eo.FunctionWrapper<efl_ui_tab_bar_tab_count_api_delegate>(Module, "efl_ui_tab_bar_tab_count");
284 private static uint tab_count(System.IntPtr obj, System.IntPtr pd)
286 Eina.Log.Debug("function efl_ui_tab_bar_tab_count was called");
287 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
290 uint _ret_var = default(uint);
293 _ret_var = ((TabBar)ws.Target).TabCount();
297 Eina.Log.Warning($"Callback error: {e.ToString()}");
298 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
306 return efl_ui_tab_bar_tab_count_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
310 private static efl_ui_tab_bar_tab_count_delegate efl_ui_tab_bar_tab_count_static_delegate;
313 private delegate void efl_ui_tab_bar_tab_add_delegate(System.IntPtr obj, System.IntPtr pd, int index, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String label, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String icon);
316 public delegate void efl_ui_tab_bar_tab_add_api_delegate(System.IntPtr obj, int index, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String label, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String icon);
318 public static Efl.Eo.FunctionWrapper<efl_ui_tab_bar_tab_add_api_delegate> efl_ui_tab_bar_tab_add_ptr = new Efl.Eo.FunctionWrapper<efl_ui_tab_bar_tab_add_api_delegate>(Module, "efl_ui_tab_bar_tab_add");
320 private static void tab_add(System.IntPtr obj, System.IntPtr pd, int index, System.String label, System.String icon)
322 Eina.Log.Debug("function efl_ui_tab_bar_tab_add was called");
323 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
329 ((TabBar)ws.Target).AddTab(index, label, icon);
333 Eina.Log.Warning($"Callback error: {e.ToString()}");
334 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
341 efl_ui_tab_bar_tab_add_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), index, label, icon);
345 private static efl_ui_tab_bar_tab_add_delegate efl_ui_tab_bar_tab_add_static_delegate;
348 private delegate void efl_ui_tab_bar_tab_remove_delegate(System.IntPtr obj, System.IntPtr pd, int index);
351 public delegate void efl_ui_tab_bar_tab_remove_api_delegate(System.IntPtr obj, int index);
353 public static Efl.Eo.FunctionWrapper<efl_ui_tab_bar_tab_remove_api_delegate> efl_ui_tab_bar_tab_remove_ptr = new Efl.Eo.FunctionWrapper<efl_ui_tab_bar_tab_remove_api_delegate>(Module, "efl_ui_tab_bar_tab_remove");
355 private static void tab_remove(System.IntPtr obj, System.IntPtr pd, int index)
357 Eina.Log.Debug("function efl_ui_tab_bar_tab_remove was called");
358 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
364 ((TabBar)ws.Target).TabRemove(index);
368 Eina.Log.Warning($"Callback error: {e.ToString()}");
369 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
376 efl_ui_tab_bar_tab_remove_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), index);
380 private static efl_ui_tab_bar_tab_remove_delegate efl_ui_tab_bar_tab_remove_static_delegate;
383 private delegate void efl_ui_tab_bar_tab_label_set_delegate(System.IntPtr obj, System.IntPtr pd, int index, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String label);
386 public delegate void efl_ui_tab_bar_tab_label_set_api_delegate(System.IntPtr obj, int index, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String label);
388 public static Efl.Eo.FunctionWrapper<efl_ui_tab_bar_tab_label_set_api_delegate> efl_ui_tab_bar_tab_label_set_ptr = new Efl.Eo.FunctionWrapper<efl_ui_tab_bar_tab_label_set_api_delegate>(Module, "efl_ui_tab_bar_tab_label_set");
390 private static void tab_label_set(System.IntPtr obj, System.IntPtr pd, int index, System.String label)
392 Eina.Log.Debug("function efl_ui_tab_bar_tab_label_set was called");
393 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
399 ((TabBar)ws.Target).SetTabLabel(index, label);
403 Eina.Log.Warning($"Callback error: {e.ToString()}");
404 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
411 efl_ui_tab_bar_tab_label_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), index, label);
415 private static efl_ui_tab_bar_tab_label_set_delegate efl_ui_tab_bar_tab_label_set_static_delegate;
418 private delegate void efl_ui_tab_bar_tab_icon_set_delegate(System.IntPtr obj, System.IntPtr pd, int index, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String icon);
421 public delegate void efl_ui_tab_bar_tab_icon_set_api_delegate(System.IntPtr obj, int index, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String icon);
423 public static Efl.Eo.FunctionWrapper<efl_ui_tab_bar_tab_icon_set_api_delegate> efl_ui_tab_bar_tab_icon_set_ptr = new Efl.Eo.FunctionWrapper<efl_ui_tab_bar_tab_icon_set_api_delegate>(Module, "efl_ui_tab_bar_tab_icon_set");
425 private static void tab_icon_set(System.IntPtr obj, System.IntPtr pd, int index, System.String icon)
427 Eina.Log.Debug("function efl_ui_tab_bar_tab_icon_set was called");
428 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
434 ((TabBar)ws.Target).SetTabIcon(index, icon);
438 Eina.Log.Warning($"Callback error: {e.ToString()}");
439 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
446 efl_ui_tab_bar_tab_icon_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), index, icon);
450 private static efl_ui_tab_bar_tab_icon_set_delegate efl_ui_tab_bar_tab_icon_set_static_delegate;
452 #pragma warning restore CA1707, CS1591, SA1300, SA1600
461 #pragma warning disable CS1591
462 public static class Efl_UiTabBar_ExtensionMethods {
463 public static Efl.BindableProperty<int> CurrentTab<T>(this Efl.Ui.ItemFactory<T> fac, Efl.Csharp.ExtensionTag<Efl.Ui.TabBar, T>magic = null) where T : Efl.Ui.TabBar {
464 return new Efl.BindableProperty<int>("current_tab", fac);
468 #pragma warning restore CS1591