[EflSharp] Update Circle and efl cs files (#995)
[platform/core/csapi/tizenfx.git] / internals / src / EflSharp / EflSharp / efl / efl_part.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 /// <summary>Interface for objects supporting named parts.
12 /// An object implementing this interface will be able to provide access to some of its sub-objects by name. This gives access to parts as defined in a widget&apos;s theme.
13 /// 
14 /// Part proxy objects have a special lifetime that is limited to one and only one function call. This behavior is implemented in efl_part() which call Efl.Part.part_get(). Calling Efl.Part.part_get() directly should be avoided.
15 /// 
16 /// In other words, the caller does not hold a reference to this proxy object. It may be possible, in languages that allow it, to get an extra reference to this part object and extend its lifetime to more than a single function call.
17 /// 
18 /// In pseudo-code, this means only the following two use cases are supported:
19 /// 
20 /// obj.func(part(obj, &quot;part&quot;), args)
21 /// 
22 /// And:
23 /// 
24 /// part = ref(part(obj, &quot;part&quot;)) func1(part, args) func2(part, args) func3(part, args) unref(part)
25 /// (Since EFL 1.22)</summary>
26 [Efl.IPartConcrete.NativeMethods]
27 [Efl.Eo.BindingEntity]
28 public interface IPart : 
29     Efl.Eo.IWrapper, IDisposable
30 {
31     /// <summary>Get a proxy object referring to a part of an object.
32 /// (Since EFL 1.22)</summary>
33 /// <param name="name">The part name.</param>
34 /// <returns>A (proxy) object, valid for a single call.</returns>
35 Efl.Object GetPart(System.String name);
36     }
37 /// <summary>Interface for objects supporting named parts.
38 /// An object implementing this interface will be able to provide access to some of its sub-objects by name. This gives access to parts as defined in a widget&apos;s theme.
39 /// 
40 /// Part proxy objects have a special lifetime that is limited to one and only one function call. This behavior is implemented in efl_part() which call Efl.Part.part_get(). Calling Efl.Part.part_get() directly should be avoided.
41 /// 
42 /// In other words, the caller does not hold a reference to this proxy object. It may be possible, in languages that allow it, to get an extra reference to this part object and extend its lifetime to more than a single function call.
43 /// 
44 /// In pseudo-code, this means only the following two use cases are supported:
45 /// 
46 /// obj.func(part(obj, &quot;part&quot;), args)
47 /// 
48 /// And:
49 /// 
50 /// part = ref(part(obj, &quot;part&quot;)) func1(part, args) func2(part, args) func3(part, args) unref(part)
51 /// (Since EFL 1.22)</summary>
52 sealed public  class IPartConcrete :
53     Efl.Eo.EoWrapper
54     , IPart
55     
56 {
57     /// <summary>Pointer to the native class description.</summary>
58     public override System.IntPtr NativeClass
59     {
60         get
61         {
62             if (((object)this).GetType() == typeof(IPartConcrete))
63             {
64                 return GetEflClassStatic();
65             }
66             else
67             {
68                 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
69             }
70         }
71     }
72
73     /// <summary>Subclasses should override this constructor if they are expected to be instantiated from native code.
74     /// Do not call this constructor directly.</summary>
75     /// <param name="ch">Tag struct storing the native handle of the object being constructed.</param>
76     private IPartConcrete(ConstructingHandle ch) : base(ch)
77     {
78     }
79
80     [System.Runtime.InteropServices.DllImport("libefl.so.1")] internal static extern System.IntPtr
81         efl_part_interface_get();
82     /// <summary>Initializes a new instance of the <see cref="IPart"/> class.
83     /// Internal usage: This is used when interacting with C code and should not be used directly.</summary>
84     /// <param name="wh">The native pointer to be wrapped.</param>
85     private IPartConcrete(Efl.Eo.Globals.WrappingHandle wh) : base(wh)
86     {
87     }
88
89     /// <summary>Get a proxy object referring to a part of an object.
90     /// (Since EFL 1.22)</summary>
91     /// <param name="name">The part name.</param>
92     /// <returns>A (proxy) object, valid for a single call.</returns>
93     public Efl.Object GetPart(System.String name) {
94                                  var _ret_var = Efl.IPartConcrete.NativeMethods.efl_part_get_ptr.Value.Delegate(this.NativeHandle,name);
95         Eina.Error.RaiseIfUnhandledException();
96                         return _ret_var;
97  }
98     private static IntPtr GetEflClassStatic()
99     {
100         return Efl.IPartConcrete.efl_part_interface_get();
101     }
102     /// <summary>Wrapper for native methods and virtual method delegates.
103     /// For internal use by generated code only.</summary>
104     public new class NativeMethods : Efl.Eo.EoWrapper.NativeMethods
105     {
106         private static Efl.Eo.NativeModule Module = new Efl.Eo.NativeModule(    efl.Libs.Efl);
107         /// <summary>Gets the list of Eo operations to override.</summary>
108         /// <returns>The list of Eo operations to be overload.</returns>
109         public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
110         {
111             var descs = new System.Collections.Generic.List<Efl_Op_Description>();
112             var methods = Efl.Eo.Globals.GetUserMethods(type);
113
114             if (efl_part_get_static_delegate == null)
115             {
116                 efl_part_get_static_delegate = new efl_part_get_delegate(part_get);
117             }
118
119             if (methods.FirstOrDefault(m => m.Name == "GetPart") != null)
120             {
121                 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_part_get"), func = Marshal.GetFunctionPointerForDelegate(efl_part_get_static_delegate) });
122             }
123
124             return descs;
125         }
126         /// <summary>Returns the Eo class for the native methods of this class.</summary>
127         /// <returns>The native class pointer.</returns>
128         public override IntPtr GetEflClass()
129         {
130             return Efl.IPartConcrete.efl_part_interface_get();
131         }
132
133         #pragma warning disable CA1707, CS1591, SA1300, SA1600
134
135         [return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))]
136         private delegate Efl.Object efl_part_get_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String name);
137
138         [return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))]
139         public delegate Efl.Object efl_part_get_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String name);
140
141         public static Efl.Eo.FunctionWrapper<efl_part_get_api_delegate> efl_part_get_ptr = new Efl.Eo.FunctionWrapper<efl_part_get_api_delegate>(Module, "efl_part_get");
142
143         private static Efl.Object part_get(System.IntPtr obj, System.IntPtr pd, System.String name)
144         {
145             Eina.Log.Debug("function efl_part_get was called");
146             var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
147             if (ws != null)
148             {
149                                     Efl.Object _ret_var = default(Efl.Object);
150                 try
151                 {
152                     _ret_var = ((IPart)ws.Target).GetPart(name);
153                 }
154                 catch (Exception e)
155                 {
156                     Eina.Log.Warning($"Callback error: {e.ToString()}");
157                     Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
158                 }
159
160                         return _ret_var;
161
162             }
163             else
164             {
165                 return efl_part_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), name);
166             }
167         }
168
169         private static efl_part_get_delegate efl_part_get_static_delegate;
170
171         #pragma warning restore CA1707, CS1591, SA1300, SA1600
172
173 }
174 }
175 }
176
177 #if EFL_BETA
178 #pragma warning disable CS1591
179 public static class EflIPartConcrete_ExtensionMethods {
180 }
181 #pragma warning restore CS1591
182 #endif