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>Efl UI view interface</summary>
13 [Efl.Ui.IViewConcrete.NativeMethods]
14 public interface IView :
15 Efl.Eo.IWrapper, IDisposable
17 /// <summary>Model that is/will be</summary>
18 /// <returns>Efl model</returns>
19 Efl.IModel GetModel();
20 /// <summary>Model that is/will be</summary>
21 /// <param name="model">Efl model</param>
22 void SetModel(Efl.IModel model);
23 /// <summary>Model that is/will be</summary>
24 /// <value>Efl model</value>
30 /// <summary>Efl UI view interface</summary>
31 sealed public class IViewConcrete :
36 ///<summary>Pointer to the native class description.</summary>
37 public override System.IntPtr NativeClass
41 if (((object)this).GetType() == typeof(IViewConcrete))
43 return GetEflClassStatic();
47 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
52 [System.Runtime.InteropServices.DllImport(efl.Libs.Efl)] internal static extern System.IntPtr
53 efl_ui_view_interface_get();
54 /// <summary>Initializes a new instance of the <see cref="IView"/> class.
55 /// Internal usage: This is used when interacting with C code and should not be used directly.</summary>
56 private IViewConcrete(System.IntPtr raw) : base(raw)
60 /// <summary>Model that is/will be</summary>
61 /// <returns>Efl model</returns>
62 public Efl.IModel GetModel() {
63 var _ret_var = Efl.Ui.IViewConcrete.NativeMethods.efl_ui_view_model_get_ptr.Value.Delegate(this.NativeHandle);
64 Eina.Error.RaiseIfUnhandledException();
67 /// <summary>Model that is/will be</summary>
68 /// <param name="model">Efl model</param>
69 public void SetModel(Efl.IModel model) {
70 Efl.Ui.IViewConcrete.NativeMethods.efl_ui_view_model_set_ptr.Value.Delegate(this.NativeHandle,model);
71 Eina.Error.RaiseIfUnhandledException();
73 /// <summary>Model that is/will be</summary>
74 /// <value>Efl model</value>
75 public Efl.IModel Model {
76 get { return GetModel(); }
77 set { SetModel(value); }
79 private static IntPtr GetEflClassStatic()
81 return Efl.Ui.IViewConcrete.efl_ui_view_interface_get();
83 /// <summary>Wrapper for native methods and virtual method delegates.
84 /// For internal use by generated code only.</summary>
85 public class NativeMethods : Efl.Eo.NativeClass
87 private static Efl.Eo.NativeModule Module = new Efl.Eo.NativeModule( efl.Libs.Efl);
88 /// <summary>Gets the list of Eo operations to override.</summary>
89 /// <returns>The list of Eo operations to be overload.</returns>
90 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
92 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
93 var methods = Efl.Eo.Globals.GetUserMethods(type);
95 if (efl_ui_view_model_get_static_delegate == null)
97 efl_ui_view_model_get_static_delegate = new efl_ui_view_model_get_delegate(model_get);
100 if (methods.FirstOrDefault(m => m.Name == "GetModel") != null)
102 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_ui_view_model_get"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_view_model_get_static_delegate) });
105 if (efl_ui_view_model_set_static_delegate == null)
107 efl_ui_view_model_set_static_delegate = new efl_ui_view_model_set_delegate(model_set);
110 if (methods.FirstOrDefault(m => m.Name == "SetModel") != null)
112 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_ui_view_model_set"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_view_model_set_static_delegate) });
117 /// <summary>Returns the Eo class for the native methods of this class.</summary>
118 /// <returns>The native class pointer.</returns>
119 public override IntPtr GetEflClass()
121 return Efl.Ui.IViewConcrete.efl_ui_view_interface_get();
124 #pragma warning disable CA1707, CS1591, SA1300, SA1600
126 [return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))]
127 private delegate Efl.IModel efl_ui_view_model_get_delegate(System.IntPtr obj, System.IntPtr pd);
129 [return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))]
130 public delegate Efl.IModel efl_ui_view_model_get_api_delegate(System.IntPtr obj);
132 public static Efl.Eo.FunctionWrapper<efl_ui_view_model_get_api_delegate> efl_ui_view_model_get_ptr = new Efl.Eo.FunctionWrapper<efl_ui_view_model_get_api_delegate>(Module, "efl_ui_view_model_get");
134 private static Efl.IModel model_get(System.IntPtr obj, System.IntPtr pd)
136 Eina.Log.Debug("function efl_ui_view_model_get was called");
137 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
140 Efl.IModel _ret_var = default(Efl.IModel);
143 _ret_var = ((IView)ws.Target).GetModel();
147 Eina.Log.Warning($"Callback error: {e.ToString()}");
148 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
156 return efl_ui_view_model_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
160 private static efl_ui_view_model_get_delegate efl_ui_view_model_get_static_delegate;
163 private delegate void efl_ui_view_model_set_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))] Efl.IModel model);
166 public delegate void efl_ui_view_model_set_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))] Efl.IModel model);
168 public static Efl.Eo.FunctionWrapper<efl_ui_view_model_set_api_delegate> efl_ui_view_model_set_ptr = new Efl.Eo.FunctionWrapper<efl_ui_view_model_set_api_delegate>(Module, "efl_ui_view_model_set");
170 private static void model_set(System.IntPtr obj, System.IntPtr pd, Efl.IModel model)
172 Eina.Log.Debug("function efl_ui_view_model_set was called");
173 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
179 ((IView)ws.Target).SetModel(model);
183 Eina.Log.Warning($"Callback error: {e.ToString()}");
184 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
191 efl_ui_view_model_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), model);
195 private static efl_ui_view_model_set_delegate efl_ui_view_model_set_static_delegate;
197 #pragma warning restore CA1707, CS1591, SA1300, SA1600