ac4beae14571347f912c7d2158ee1be4a9a53972
[platform/core/csapi/tizenfx.git] / internals / src / EflSharp / EflSharp / efl / efl_ui_factory_bind.eo.cs
1 #pragma warning disable CS1591
2 using System;
3 using System.Runtime.InteropServices;
4 using System.Collections.Generic;
5 using System.Linq;
6 using System.Threading;
7 using System.ComponentModel;
8 namespace Efl {
9
10 namespace Ui {
11
12 /// <summary>Efl UI Property interface. view object can have <see cref="Efl.IModel"/> and need to set cotent with those model stored data. the interface can help binding the factory to create object with model property data. see <see cref="Efl.IModel"/> see <see cref="Efl.Ui.IFactory"/></summary>
13 [Efl.Ui.IFactoryBindConcrete.NativeMethods]
14 [Efl.Eo.BindingEntity]
15 public interface IFactoryBind : 
16     Efl.Eo.IWrapper, IDisposable
17 {
18     /// <summary>bind the factory with the given key string. when the data is ready or changed, factory create the object and bind the data to the key action and process promised work. Note: the input <see cref="Efl.Ui.IFactory"/> need to be <see cref="Efl.Ui.IPropertyBind.PropertyBind"/> at least once.</summary>
19 /// <param name="key">Key string for bind model property data</param>
20 /// <param name="factory"><see cref="Efl.Ui.IFactory"/> for create and bind model property data</param>
21 void FactoryBind(System.String key, Efl.Ui.IFactory factory);
22     }
23 /// <summary>Efl UI Property interface. view object can have <see cref="Efl.IModel"/> and need to set cotent with those model stored data. the interface can help binding the factory to create object with model property data. see <see cref="Efl.IModel"/> see <see cref="Efl.Ui.IFactory"/></summary>
24 sealed public class IFactoryBindConcrete :
25     Efl.Eo.EoWrapper
26     , IFactoryBind
27     
28 {
29     ///<summary>Pointer to the native class description.</summary>
30     public override System.IntPtr NativeClass
31     {
32         get
33         {
34             if (((object)this).GetType() == typeof(IFactoryBindConcrete))
35             {
36                 return GetEflClassStatic();
37             }
38             else
39             {
40                 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
41             }
42         }
43     }
44
45     /// <summary>Constructor to be used when objects are expected to be constructed from native code.</summary>
46     /// <param name="ch">Tag struct storing the native handle of the object being constructed.</param>
47     private IFactoryBindConcrete(ConstructingHandle ch) : base(ch)
48     {
49     }
50
51     [System.Runtime.InteropServices.DllImport("libefl.so.1")] internal static extern System.IntPtr
52         efl_ui_factory_bind_interface_get();
53     /// <summary>Initializes a new instance of the <see cref="IFactoryBind"/> class.
54     /// Internal usage: This is used when interacting with C code and should not be used directly.</summary>
55     /// <param name="wh">The native pointer to be wrapped.</param>
56     private IFactoryBindConcrete(Efl.Eo.Globals.WrappingHandle wh) : base(wh)
57     {
58     }
59
60     /// <summary>bind the factory with the given key string. when the data is ready or changed, factory create the object and bind the data to the key action and process promised work. Note: the input <see cref="Efl.Ui.IFactory"/> need to be <see cref="Efl.Ui.IPropertyBind.PropertyBind"/> at least once.</summary>
61     /// <param name="key">Key string for bind model property data</param>
62     /// <param name="factory"><see cref="Efl.Ui.IFactory"/> for create and bind model property data</param>
63     public void FactoryBind(System.String key, Efl.Ui.IFactory factory) {
64                                                          Efl.Ui.IFactoryBindConcrete.NativeMethods.efl_ui_factory_bind_ptr.Value.Delegate(this.NativeHandle,key, factory);
65         Eina.Error.RaiseIfUnhandledException();
66                                          }
67     private static IntPtr GetEflClassStatic()
68     {
69         return Efl.Ui.IFactoryBindConcrete.efl_ui_factory_bind_interface_get();
70     }
71     /// <summary>Wrapper for native methods and virtual method delegates.
72     /// For internal use by generated code only.</summary>
73     public new class NativeMethods : Efl.Eo.EoWrapper.NativeMethods
74     {
75         private static Efl.Eo.NativeModule Module = new Efl.Eo.NativeModule(    efl.Libs.Efl);
76         /// <summary>Gets the list of Eo operations to override.</summary>
77         /// <returns>The list of Eo operations to be overload.</returns>
78         public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
79         {
80             var descs = new System.Collections.Generic.List<Efl_Op_Description>();
81             var methods = Efl.Eo.Globals.GetUserMethods(type);
82
83             if (efl_ui_factory_bind_static_delegate == null)
84             {
85                 efl_ui_factory_bind_static_delegate = new efl_ui_factory_bind_delegate(factory_bind);
86             }
87
88             if (methods.FirstOrDefault(m => m.Name == "FactoryBind") != null)
89             {
90                 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_ui_factory_bind"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_factory_bind_static_delegate) });
91             }
92
93             return descs;
94         }
95         /// <summary>Returns the Eo class for the native methods of this class.</summary>
96         /// <returns>The native class pointer.</returns>
97         public override IntPtr GetEflClass()
98         {
99             return Efl.Ui.IFactoryBindConcrete.efl_ui_factory_bind_interface_get();
100         }
101
102         #pragma warning disable CA1707, CS1591, SA1300, SA1600
103
104         
105         private delegate void efl_ui_factory_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.MarshalEo<Efl.Eo.NonOwnTag>))] Efl.Ui.IFactory factory);
106
107         
108         public delegate void efl_ui_factory_bind_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String key, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))] Efl.Ui.IFactory factory);
109
110         public static Efl.Eo.FunctionWrapper<efl_ui_factory_bind_api_delegate> efl_ui_factory_bind_ptr = new Efl.Eo.FunctionWrapper<efl_ui_factory_bind_api_delegate>(Module, "efl_ui_factory_bind");
111
112         private static void factory_bind(System.IntPtr obj, System.IntPtr pd, System.String key, Efl.Ui.IFactory factory)
113         {
114             Eina.Log.Debug("function efl_ui_factory_bind was called");
115             var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
116             if (ws != null)
117             {
118                                                             
119                 try
120                 {
121                     ((IFactoryBind)ws.Target).FactoryBind(key, factory);
122                 }
123                 catch (Exception e)
124                 {
125                     Eina.Log.Warning($"Callback error: {e.ToString()}");
126                     Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
127                 }
128
129                                         
130             }
131             else
132             {
133                 efl_ui_factory_bind_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), key, factory);
134             }
135         }
136
137         private static efl_ui_factory_bind_delegate efl_ui_factory_bind_static_delegate;
138
139         #pragma warning restore CA1707, CS1591, SA1300, SA1600
140
141 }
142 }
143 }
144
145 }
146