1 #pragma warning disable CS1591
3 using System.Runtime.InteropServices;
4 using System.Collections.Generic;
6 using System.ComponentModel;
7 namespace Efl { namespace Ui {
8 /// <summary>Efl UI Property_Bind interface. view object can have <see cref="Efl.Model"/> to manage the data, the interface can help loading and tracking child data from the model property. see <see cref="Efl.Model"/> see <see cref="Efl.Ui.Factory"/></summary>
9 [PropertyBindNativeInherit]
10 public interface PropertyBind :
11 Efl.Eo.IWrapper, IDisposable
13 /// <summary>bind property data with the given key string. when the data is ready or changed, bind the data to the key action and process promised work.</summary>
14 /// <param name="key">key string for bind model property data</param>
15 /// <param name="property">Model property name</param>
16 /// <returns></returns>
17 void PropertyBind( System.String key, System.String property);
19 /// <summary>Efl UI Property_Bind interface. view object can have <see cref="Efl.Model"/> to manage the data, the interface can help loading and tracking child data from the model property. see <see cref="Efl.Model"/> see <see cref="Efl.Ui.Factory"/></summary>
20 sealed public class PropertyBindConcrete :
25 ///<summary>Pointer to the native class description.</summary>
26 public System.IntPtr NativeClass {
28 if (((object)this).GetType() == typeof (PropertyBindConcrete))
29 return Efl.Ui.PropertyBindNativeInherit.GetEflClassStatic();
31 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
34 private System.IntPtr handle;
35 ///<summary>Pointer to the native instance.</summary>
36 public System.IntPtr NativeHandle {
37 get { return handle; }
39 [System.Runtime.InteropServices.DllImport(efl.Libs.Efl)] internal static extern System.IntPtr
40 efl_ui_property_bind_interface_get();
41 ///<summary>Internal usage: Constructs an instance from a native pointer. This is used when interacting with C code and should not be used directly.</summary>
42 public PropertyBindConcrete(System.IntPtr raw)
45 register_event_proxies();
47 ///<summary>Destructor.</summary>
48 ~PropertyBindConcrete()
52 ///<summary>Releases the underlying native instance.</summary>
53 void Dispose(bool disposing)
55 if (handle != System.IntPtr.Zero) {
56 Efl.Eo.Globals.efl_unref(handle);
57 handle = System.IntPtr.Zero;
60 ///<summary>Releases the underlying native instance.</summary>
64 GC.SuppressFinalize(this);
66 ///<summary>Casts obj into an instance of this type.</summary>
67 public static PropertyBindConcrete static_cast(Efl.Object obj)
70 throw new System.ArgumentNullException("obj");
71 return new PropertyBindConcrete(obj.NativeHandle);
73 ///<summary>Verifies if the given object is equal to this one.</summary>
74 public override bool Equals(object obj)
76 var other = obj as Efl.Object;
79 return this.NativeHandle == other.NativeHandle;
81 ///<summary>Gets the hash code for this object based on the native pointer it points to.</summary>
82 public override int GetHashCode()
84 return this.NativeHandle.ToInt32();
86 ///<summary>Turns the native pointer into a string representation.</summary>
87 public override String ToString()
89 return $"{this.GetType().Name}@[{this.NativeHandle.ToInt32():x}]";
91 void register_event_proxies()
94 /// <summary>bind property data with the given key string. when the data is ready or changed, bind the data to the key action and process promised work.</summary>
95 /// <param name="key">key string for bind model property data</param>
96 /// <param name="property">Model property name</param>
97 /// <returns></returns>
98 public void PropertyBind( System.String key, System.String property) {
99 Efl.Ui.PropertyBindNativeInherit.efl_ui_property_bind_ptr.Value.Delegate(this.NativeHandle, key, property);
100 Eina.Error.RaiseIfUnhandledException();
103 public class PropertyBindNativeInherit : Efl.Eo.NativeClass{
104 public static Efl.Eo.NativeModule _Module = new Efl.Eo.NativeModule(efl.Libs.Efl);
105 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
107 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
108 if (efl_ui_property_bind_static_delegate == null)
109 efl_ui_property_bind_static_delegate = new efl_ui_property_bind_delegate(property_bind);
110 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_ui_property_bind"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_property_bind_static_delegate)});
113 public override IntPtr GetEflClass()
115 return Efl.Ui.PropertyBindConcrete.efl_ui_property_bind_interface_get();
117 public static IntPtr GetEflClassStatic()
119 return Efl.Ui.PropertyBindConcrete.efl_ui_property_bind_interface_get();
123 private delegate void efl_ui_property_bind_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String key, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String property);
126 public delegate void efl_ui_property_bind_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String key, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String property);
127 public static Efl.Eo.FunctionWrapper<efl_ui_property_bind_api_delegate> efl_ui_property_bind_ptr = new Efl.Eo.FunctionWrapper<efl_ui_property_bind_api_delegate>(_Module, "efl_ui_property_bind");
128 private static void property_bind(System.IntPtr obj, System.IntPtr pd, System.String key, System.String property)
130 Eina.Log.Debug("function efl_ui_property_bind was called");
131 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.data_get(pd);
132 if(wrapper != null) {
135 ((PropertyBind)wrapper).PropertyBind( key, property);
136 } catch (Exception e) {
137 Eina.Log.Warning($"Callback error: {e.ToString()}");
138 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
141 efl_ui_property_bind_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), key, property);
144 private static efl_ui_property_bind_delegate efl_ui_property_bind_static_delegate;