1 #pragma warning disable CS1591
3 using System.Runtime.InteropServices;
4 using System.Collections.Generic;
6 using System.Threading;
7 using System.ComponentModel;
12 /// <summary>Item internal content part class</summary>
13 [Efl.Ui.ItemPartContent.NativeMethods]
14 public class ItemPartContent : Efl.Ui.LayoutPart, Efl.IContent
16 ///<summary>Pointer to the native class description.</summary>
17 public override System.IntPtr NativeClass
21 if (((object)this).GetType() == typeof(ItemPartContent))
23 return GetEflClassStatic();
27 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
32 [System.Runtime.InteropServices.DllImport(efl.Libs.Elementary)] internal static extern System.IntPtr
33 efl_ui_item_part_content_class_get();
34 /// <summary>Initializes a new instance of the <see cref="ItemPartContent"/> class.</summary>
35 /// <param name="parent">Parent instance.</param>
36 public ItemPartContent(Efl.Object parent= null
37 ) : base(efl_ui_item_part_content_class_get(), typeof(ItemPartContent), parent)
39 FinishInstantiation();
42 /// <summary>Initializes a new instance of the <see cref="ItemPartContent"/> 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 ItemPartContent(System.IntPtr raw) : base(raw)
49 /// <summary>Initializes a new instance of the <see cref="ItemPartContent"/> 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 ItemPartContent(IntPtr baseKlass, System.Type managedType, Efl.Object parent) : base(baseKlass, managedType, parent)
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
66 Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) =>
68 var obj = Efl.Eo.Globals.WrapperSupervisorPtrToManaged(data).Target;
71 Efl.IContentContentChangedEvt_Args args = new Efl.IContentContentChangedEvt_Args();
72 args.arg = (Efl.Eo.Globals.CreateWrapperFor(evt.Info) as Efl.Gfx.IEntityConcrete);
75 value?.Invoke(obj, args);
79 Eina.Log.Error(e.ToString());
80 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
85 string key = "_EFL_CONTENT_EVENT_CONTENT_CHANGED";
86 AddNativeEventHandler(efl.Libs.Elementary, key, callerCb, value);
94 string key = "_EFL_CONTENT_EVENT_CONTENT_CHANGED";
95 RemoveNativeEventHandler(efl.Libs.Elementary, key, value);
99 ///<summary>Method to raise event ContentChangedEvt.</summary>
100 public void OnContentChangedEvt(Efl.IContentContentChangedEvt_Args e)
102 var key = "_EFL_CONTENT_EVENT_CONTENT_CHANGED";
103 IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Elementary, key);
104 if (desc == IntPtr.Zero)
106 Eina.Log.Error($"Failed to get native event {key}");
110 IntPtr info = e.arg.NativeHandle;
111 Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, info);
113 /// <summary>Sub-object currently set as this object'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();
122 /// <summary>Sub-object currently set as this object'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();
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();
140 /// <summary>Sub-object currently set as this object'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); }
148 private static IntPtr GetEflClassStatic()
150 return Efl.Ui.ItemPartContent.efl_ui_item_part_content_class_get();
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
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)
161 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
162 var methods = Efl.Eo.Globals.GetUserMethods(type);
164 if (efl_content_get_static_delegate == null)
166 efl_content_get_static_delegate = new efl_content_get_delegate(content_get);
169 if (methods.FirstOrDefault(m => m.Name == "GetContent") != null)
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) });
174 if (efl_content_set_static_delegate == null)
176 efl_content_set_static_delegate = new efl_content_set_delegate(content_set);
179 if (methods.FirstOrDefault(m => m.Name == "SetContent") != null)
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) });
184 if (efl_content_unset_static_delegate == null)
186 efl_content_unset_static_delegate = new efl_content_unset_delegate(content_unset);
189 if (methods.FirstOrDefault(m => m.Name == "UnsetContent") != null)
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) });
194 descs.AddRange(base.GetEoOps(type));
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()
201 return Efl.Ui.ItemPartContent.efl_ui_item_part_content_class_get();
204 #pragma warning disable CA1707, CS1591, SA1300, SA1600
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);
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);
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");
214 private static Efl.Gfx.IEntity content_get(System.IntPtr obj, System.IntPtr pd)
216 Eina.Log.Debug("function efl_content_get was called");
217 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
220 Efl.Gfx.IEntity _ret_var = default(Efl.Gfx.IEntity);
223 _ret_var = ((ItemPartContent)ws.Target).GetContent();
227 Eina.Log.Warning($"Callback error: {e.ToString()}");
228 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
236 return efl_content_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
240 private static efl_content_get_delegate efl_content_get_static_delegate;
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);
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);
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");
250 private static bool content_set(System.IntPtr obj, System.IntPtr pd, Efl.Gfx.IEntity content)
252 Eina.Log.Debug("function efl_content_set was called");
253 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
256 bool _ret_var = default(bool);
259 _ret_var = ((ItemPartContent)ws.Target).SetContent(content);
263 Eina.Log.Warning($"Callback error: {e.ToString()}");
264 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
272 return efl_content_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), content);
276 private static efl_content_set_delegate efl_content_set_static_delegate;
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);
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);
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");
286 private static Efl.Gfx.IEntity content_unset(System.IntPtr obj, System.IntPtr pd)
288 Eina.Log.Debug("function efl_content_unset was called");
289 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
292 Efl.Gfx.IEntity _ret_var = default(Efl.Gfx.IEntity);
295 _ret_var = ((ItemPartContent)ws.Target).UnsetContent();
299 Eina.Log.Warning($"Callback error: {e.ToString()}");
300 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
308 return efl_content_unset_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
312 private static efl_content_unset_delegate efl_content_unset_static_delegate;
314 #pragma warning restore CA1707, CS1591, SA1300, SA1600