[ComponentManager] Change namespace (#989)
[platform/core/csapi/tizenfx.git] / internals / src / EflSharp / EflSharp / efl / efl_ui_item_part_icon.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>Item internal content of icon part class</summary>
13 [Efl.Ui.ItemPartIcon.NativeMethods]
14 [Efl.Eo.BindingEntity]
15 public class ItemPartIcon : Efl.Ui.LayoutPart, Efl.IContent
16 {
17     ///<summary>Pointer to the native class description.</summary>
18     public override System.IntPtr NativeClass
19     {
20         get
21         {
22             if (((object)this).GetType() == typeof(ItemPartIcon))
23             {
24                 return GetEflClassStatic();
25             }
26             else
27             {
28                 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
29             }
30         }
31     }
32
33     [System.Runtime.InteropServices.DllImport(efl.Libs.Elementary)] internal static extern System.IntPtr
34         efl_ui_item_part_icon_class_get();
35     /// <summary>Initializes a new instance of the <see cref="ItemPartIcon"/> class.</summary>
36     /// <param name="parent">Parent instance.</param>
37     public ItemPartIcon(Efl.Object parent= null
38             ) : base(efl_ui_item_part_icon_class_get(), parent)
39     {
40         FinishInstantiation();
41     }
42
43     /// <summary>Constructor to be used when objects are expected to be constructed from native code.</summary>
44     /// <param name="ch">Tag struct storing the native handle of the object being constructed.</param>
45     protected ItemPartIcon(ConstructingHandle ch) : base(ch)
46     {
47     }
48
49     /// <summary>Initializes a new instance of the <see cref="ItemPartIcon"/> class.
50     /// Internal usage: Constructs an instance from a native pointer. This is used when interacting with C code and should not be used directly.</summary>
51     /// <param name="wh">The native pointer to be wrapped.</param>
52     protected ItemPartIcon(Efl.Eo.Globals.WrappingHandle wh) : base(wh)
53     {
54     }
55
56     /// <summary>Initializes a new instance of the <see cref="ItemPartIcon"/> class.
57     /// Internal usage: Constructor to forward the wrapper initialization to the root class that interfaces with native code. Should not be used directly.</summary>
58     /// <param name="baseKlass">The pointer to the base native Eo class.</param>
59     /// <param name="parent">The Efl.Object parent of this instance.</param>
60     protected ItemPartIcon(IntPtr baseKlass, Efl.Object parent) : base(baseKlass, parent)
61     {
62     }
63
64     /// <summary>Sent after the content is set or unset using the current content object.
65     /// (Since EFL 1.22)</summary>
66     public event EventHandler<Efl.IContentContentChangedEvt_Args> ContentChangedEvt
67     {
68         add
69         {
70             lock (eflBindingEventLock)
71             {
72                 Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) =>
73                 {
74                     var obj = Efl.Eo.Globals.WrapperSupervisorPtrToManaged(data).Target;
75                     if (obj != null)
76                     {
77                         Efl.IContentContentChangedEvt_Args args = new Efl.IContentContentChangedEvt_Args();
78                         args.arg = (Efl.Eo.Globals.CreateWrapperFor(evt.Info) as Efl.Gfx.IEntityConcrete);
79                         try
80                         {
81                             value?.Invoke(obj, args);
82                         }
83                         catch (Exception e)
84                         {
85                             Eina.Log.Error(e.ToString());
86                             Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
87                         }
88                     }
89                 };
90
91                 string key = "_EFL_CONTENT_EVENT_CONTENT_CHANGED";
92                 AddNativeEventHandler(efl.Libs.Elementary, key, callerCb, value);
93             }
94         }
95
96         remove
97         {
98             lock (eflBindingEventLock)
99             {
100                 string key = "_EFL_CONTENT_EVENT_CONTENT_CHANGED";
101                 RemoveNativeEventHandler(efl.Libs.Elementary, key, value);
102             }
103         }
104     }
105     ///<summary>Method to raise event ContentChangedEvt.</summary>
106     public void OnContentChangedEvt(Efl.IContentContentChangedEvt_Args e)
107     {
108         var key = "_EFL_CONTENT_EVENT_CONTENT_CHANGED";
109         IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Elementary, key);
110         if (desc == IntPtr.Zero)
111         {
112             Eina.Log.Error($"Failed to get native event {key}");
113             return;
114         }
115
116         IntPtr info = e.arg.NativeHandle;
117         Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, info);
118     }
119     /// <summary>Sub-object currently set as this object&apos;s single content.
120     /// If it is set multiple times, previous sub-objects are removed first. Therefore, if an invalid <c>content</c> is set the object will become empty (it will have no sub-object).
121     /// (Since EFL 1.22)</summary>
122     /// <returns>The sub-object.</returns>
123     virtual public Efl.Gfx.IEntity GetContent() {
124          var _ret_var = Efl.IContentConcrete.NativeMethods.efl_content_get_ptr.Value.Delegate((IsGeneratedBindingClass ? this.NativeHandle : Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass)));
125         Eina.Error.RaiseIfUnhandledException();
126         return _ret_var;
127  }
128     /// <summary>Sub-object currently set as this object&apos;s single content.
129     /// If it is set multiple times, previous sub-objects are removed first. Therefore, if an invalid <c>content</c> is set the object will become empty (it will have no sub-object).
130     /// (Since EFL 1.22)</summary>
131     /// <param name="content">The sub-object.</param>
132     /// <returns><c>true</c> if <c>content</c> was successfully swallowed.</returns>
133     virtual public bool SetContent(Efl.Gfx.IEntity content) {
134                                  var _ret_var = Efl.IContentConcrete.NativeMethods.efl_content_set_ptr.Value.Delegate((IsGeneratedBindingClass ? this.NativeHandle : Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass)),content);
135         Eina.Error.RaiseIfUnhandledException();
136                         return _ret_var;
137  }
138     /// <summary>Remove the sub-object currently set as content of this object and return it. This object becomes empty.
139     /// (Since EFL 1.22)</summary>
140     /// <returns>Unswallowed object</returns>
141     virtual public Efl.Gfx.IEntity UnsetContent() {
142          var _ret_var = Efl.IContentConcrete.NativeMethods.efl_content_unset_ptr.Value.Delegate((IsGeneratedBindingClass ? this.NativeHandle : Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass)));
143         Eina.Error.RaiseIfUnhandledException();
144         return _ret_var;
145  }
146     /// <summary>Sub-object currently set as this object&apos;s single content.
147     /// If it is set multiple times, previous sub-objects are removed first. Therefore, if an invalid <c>content</c> is set the object will become empty (it will have no sub-object).
148     /// (Since EFL 1.22)</summary>
149     /// <value>The sub-object.</value>
150     public Efl.Gfx.IEntity Content {
151         get { return GetContent(); }
152         set { SetContent(value); }
153     }
154     private static IntPtr GetEflClassStatic()
155     {
156         return Efl.Ui.ItemPartIcon.efl_ui_item_part_icon_class_get();
157     }
158     /// <summary>Wrapper for native methods and virtual method delegates.
159     /// For internal use by generated code only.</summary>
160     public new class NativeMethods : Efl.Ui.LayoutPart.NativeMethods
161     {
162         private static Efl.Eo.NativeModule Module = new Efl.Eo.NativeModule(    efl.Libs.Elementary);
163         /// <summary>Gets the list of Eo operations to override.</summary>
164         /// <returns>The list of Eo operations to be overload.</returns>
165         public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
166         {
167             var descs = new System.Collections.Generic.List<Efl_Op_Description>();
168             var methods = Efl.Eo.Globals.GetUserMethods(type);
169
170             if (efl_content_get_static_delegate == null)
171             {
172                 efl_content_get_static_delegate = new efl_content_get_delegate(content_get);
173             }
174
175             if (methods.FirstOrDefault(m => m.Name == "GetContent") != null)
176             {
177                 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_content_get"), func = Marshal.GetFunctionPointerForDelegate(efl_content_get_static_delegate) });
178             }
179
180             if (efl_content_set_static_delegate == null)
181             {
182                 efl_content_set_static_delegate = new efl_content_set_delegate(content_set);
183             }
184
185             if (methods.FirstOrDefault(m => m.Name == "SetContent") != null)
186             {
187                 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_content_set"), func = Marshal.GetFunctionPointerForDelegate(efl_content_set_static_delegate) });
188             }
189
190             if (efl_content_unset_static_delegate == null)
191             {
192                 efl_content_unset_static_delegate = new efl_content_unset_delegate(content_unset);
193             }
194
195             if (methods.FirstOrDefault(m => m.Name == "UnsetContent") != null)
196             {
197                 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_content_unset"), func = Marshal.GetFunctionPointerForDelegate(efl_content_unset_static_delegate) });
198             }
199
200             descs.AddRange(base.GetEoOps(type));
201             return descs;
202         }
203         /// <summary>Returns the Eo class for the native methods of this class.</summary>
204         /// <returns>The native class pointer.</returns>
205         public override IntPtr GetEflClass()
206         {
207             return Efl.Ui.ItemPartIcon.efl_ui_item_part_icon_class_get();
208         }
209
210         #pragma warning disable CA1707, CS1591, SA1300, SA1600
211
212         [return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))]
213         private delegate Efl.Gfx.IEntity efl_content_get_delegate(System.IntPtr obj, System.IntPtr pd);
214
215         [return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))]
216         public delegate Efl.Gfx.IEntity efl_content_get_api_delegate(System.IntPtr obj);
217
218         public static Efl.Eo.FunctionWrapper<efl_content_get_api_delegate> efl_content_get_ptr = new Efl.Eo.FunctionWrapper<efl_content_get_api_delegate>(Module, "efl_content_get");
219
220         private static Efl.Gfx.IEntity content_get(System.IntPtr obj, System.IntPtr pd)
221         {
222             Eina.Log.Debug("function efl_content_get was called");
223             var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
224             if (ws != null)
225             {
226             Efl.Gfx.IEntity _ret_var = default(Efl.Gfx.IEntity);
227                 try
228                 {
229                     _ret_var = ((ItemPartIcon)ws.Target).GetContent();
230                 }
231                 catch (Exception e)
232                 {
233                     Eina.Log.Warning($"Callback error: {e.ToString()}");
234                     Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
235                 }
236
237         return _ret_var;
238
239             }
240             else
241             {
242                 return efl_content_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
243             }
244         }
245
246         private static efl_content_get_delegate efl_content_get_static_delegate;
247
248         [return: MarshalAs(UnmanagedType.U1)]
249         private delegate bool efl_content_set_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))] Efl.Gfx.IEntity content);
250
251         [return: MarshalAs(UnmanagedType.U1)]
252         public delegate bool efl_content_set_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))] Efl.Gfx.IEntity content);
253
254         public static Efl.Eo.FunctionWrapper<efl_content_set_api_delegate> efl_content_set_ptr = new Efl.Eo.FunctionWrapper<efl_content_set_api_delegate>(Module, "efl_content_set");
255
256         private static bool content_set(System.IntPtr obj, System.IntPtr pd, Efl.Gfx.IEntity content)
257         {
258             Eina.Log.Debug("function efl_content_set was called");
259             var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
260             if (ws != null)
261             {
262                                     bool _ret_var = default(bool);
263                 try
264                 {
265                     _ret_var = ((ItemPartIcon)ws.Target).SetContent(content);
266                 }
267                 catch (Exception e)
268                 {
269                     Eina.Log.Warning($"Callback error: {e.ToString()}");
270                     Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
271                 }
272
273                         return _ret_var;
274
275             }
276             else
277             {
278                 return efl_content_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), content);
279             }
280         }
281
282         private static efl_content_set_delegate efl_content_set_static_delegate;
283
284         [return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))]
285         private delegate Efl.Gfx.IEntity efl_content_unset_delegate(System.IntPtr obj, System.IntPtr pd);
286
287         [return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))]
288         public delegate Efl.Gfx.IEntity efl_content_unset_api_delegate(System.IntPtr obj);
289
290         public static Efl.Eo.FunctionWrapper<efl_content_unset_api_delegate> efl_content_unset_ptr = new Efl.Eo.FunctionWrapper<efl_content_unset_api_delegate>(Module, "efl_content_unset");
291
292         private static Efl.Gfx.IEntity content_unset(System.IntPtr obj, System.IntPtr pd)
293         {
294             Eina.Log.Debug("function efl_content_unset was called");
295             var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
296             if (ws != null)
297             {
298             Efl.Gfx.IEntity _ret_var = default(Efl.Gfx.IEntity);
299                 try
300                 {
301                     _ret_var = ((ItemPartIcon)ws.Target).UnsetContent();
302                 }
303                 catch (Exception e)
304                 {
305                     Eina.Log.Warning($"Callback error: {e.ToString()}");
306                     Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
307                 }
308
309         return _ret_var;
310
311             }
312             else
313             {
314                 return efl_content_unset_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
315             }
316         }
317
318         private static efl_content_unset_delegate efl_content_unset_static_delegate;
319
320         #pragma warning restore CA1707, CS1591, SA1300, SA1600
321
322 }
323 }
324 }
325
326 }
327