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