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