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>List Default Item class. This class need to be sub object of list widget. text and contents can be appliable by efl_text, efl_content or efl_part APIs.</summary>
13 [Efl.Ui.ListDefaultItem.NativeMethods]
14 public class ListDefaultItem : Efl.Ui.ListItem, Efl.IContent, Efl.IText, Efl.ITextMarkup
16 ///<summary>Pointer to the native class description.</summary>
17 public override System.IntPtr NativeClass
21 if (((object)this).GetType() == typeof(ListDefaultItem))
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_list_default_item_class_get();
34 /// <summary>Initializes a new instance of the <see cref="ListDefaultItem"/> class.</summary>
35 /// <param name="parent">Parent instance.</param>
36 /// <param name="style">The widget style to use. See <see cref="Efl.Ui.Widget.SetStyle"/></param>
37 public ListDefaultItem(Efl.Object parent
38 , System.String style = null) : base(efl_ui_list_default_item_class_get(), typeof(ListDefaultItem), parent)
40 if (Efl.Eo.Globals.ParamHelperCheck(style))
42 SetStyle(Efl.Eo.Globals.GetParamHelper(style));
45 FinishInstantiation();
48 /// <summary>Initializes a new instance of the <see cref="ListDefaultItem"/> class.
49 /// Internal usage: Constructs an instance from a native pointer. This is used when interacting with C code and should not be used directly.</summary>
50 /// <param name="raw">The native pointer to be wrapped.</param>
51 protected ListDefaultItem(System.IntPtr raw) : base(raw)
55 /// <summary>Initializes a new instance of the <see cref="ListDefaultItem"/> class.
56 /// Internal usage: Constructor to forward the wrapper initialization to the root class that interfaces with native code. Should not be used directly.</summary>
57 /// <param name="baseKlass">The pointer to the base native Eo class.</param>
58 /// <param name="managedType">The managed type of the public constructor that originated this call.</param>
59 /// <param name="parent">The Efl.Object parent of this instance.</param>
60 protected ListDefaultItem(IntPtr baseKlass, System.Type managedType, Efl.Object parent) : base(baseKlass, managedType, parent)
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
72 Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) =>
74 var obj = Efl.Eo.Globals.WrapperSupervisorPtrToManaged(data).Target;
77 Efl.IContentContentChangedEvt_Args args = new Efl.IContentContentChangedEvt_Args();
78 args.arg = (Efl.Eo.Globals.CreateWrapperFor(evt.Info) as Efl.Gfx.IEntityConcrete);
81 value?.Invoke(obj, args);
85 Eina.Log.Error(e.ToString());
86 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
91 string key = "_EFL_CONTENT_EVENT_CONTENT_CHANGED";
92 AddNativeEventHandler(efl.Libs.Efl, key, callerCb, value);
100 string key = "_EFL_CONTENT_EVENT_CONTENT_CHANGED";
101 RemoveNativeEventHandler(efl.Libs.Efl, key, value);
105 ///<summary>Method to raise event ContentChangedEvt.</summary>
106 public void OnContentChangedEvt(Efl.IContentContentChangedEvt_Args e)
108 var key = "_EFL_CONTENT_EVENT_CONTENT_CHANGED";
109 IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Efl, key);
110 if (desc == IntPtr.Zero)
112 Eina.Log.Error($"Failed to get native event {key}");
116 IntPtr info = e.arg.NativeHandle;
117 Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, info);
119 /// <summary>The extra content part for list default item. extra part is the right-side content of list item.</summary>
120 public Efl.Ui.ItemPartExtra ExtraPart
124 return GetPart("extra") as Efl.Ui.ItemPartExtra;
127 /// <summary>The icon content part for list default item. icon part is the left-side content of list item.</summary>
128 public Efl.Ui.ItemPartIcon IconPart
132 return GetPart("icon") as Efl.Ui.ItemPartIcon;
135 /// <summary>The text part for list default item.</summary>
136 public Efl.Ui.ItemPartText TextPart
140 return GetPart("text") as Efl.Ui.ItemPartText;
143 /// <summary>Sub-object currently set as this object's single content.
144 /// 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).
145 /// (Since EFL 1.22)</summary>
146 /// <returns>The sub-object.</returns>
147 virtual public Efl.Gfx.IEntity GetContent() {
148 var _ret_var = Efl.IContentConcrete.NativeMethods.efl_content_get_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle));
149 Eina.Error.RaiseIfUnhandledException();
152 /// <summary>Sub-object currently set as this object's single content.
153 /// 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).
154 /// (Since EFL 1.22)</summary>
155 /// <param name="content">The sub-object.</param>
156 /// <returns><c>true</c> if <c>content</c> was successfully swallowed.</returns>
157 virtual public bool SetContent(Efl.Gfx.IEntity content) {
158 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);
159 Eina.Error.RaiseIfUnhandledException();
162 /// <summary>Remove the sub-object currently set as content of this object and return it. This object becomes empty.
163 /// (Since EFL 1.22)</summary>
164 /// <returns>Unswallowed object</returns>
165 virtual public Efl.Gfx.IEntity UnsetContent() {
166 var _ret_var = Efl.IContentConcrete.NativeMethods.efl_content_unset_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle));
167 Eina.Error.RaiseIfUnhandledException();
170 /// <summary>Retrieves the text string currently being displayed by the given text object.
171 /// Do not free() the return value.
173 /// See also <see cref="Efl.IText.GetText"/>.
174 /// (Since EFL 1.22)</summary>
175 /// <returns>Text string to display on it.</returns>
176 virtual public System.String GetText() {
177 var _ret_var = Efl.ITextConcrete.NativeMethods.efl_text_get_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle));
178 Eina.Error.RaiseIfUnhandledException();
181 /// <summary>Sets the text string to be displayed by the given text object.
182 /// See also <see cref="Efl.IText.GetText"/>.
183 /// (Since EFL 1.22)</summary>
184 /// <param name="text">Text string to display on it.</param>
185 virtual public void SetText(System.String text) {
186 Efl.ITextConcrete.NativeMethods.efl_text_set_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle),text);
187 Eina.Error.RaiseIfUnhandledException();
189 /// <summary>Markup property</summary>
190 /// <returns>The markup-text representation set to this text.</returns>
191 virtual public System.String GetMarkup() {
192 var _ret_var = Efl.ITextMarkupConcrete.NativeMethods.efl_text_markup_get_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle));
193 Eina.Error.RaiseIfUnhandledException();
196 /// <summary>Markup property</summary>
197 /// <param name="markup">The markup-text representation set to this text.</param>
198 virtual public void SetMarkup(System.String markup) {
199 Efl.ITextMarkupConcrete.NativeMethods.efl_text_markup_set_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle),markup);
200 Eina.Error.RaiseIfUnhandledException();
202 /// <summary>Sub-object currently set as this object's single content.
203 /// 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).
204 /// (Since EFL 1.22)</summary>
205 /// <value>The sub-object.</value>
206 public Efl.Gfx.IEntity Content {
207 get { return GetContent(); }
208 set { SetContent(value); }
210 /// <summary>Markup property</summary>
211 /// <value>The markup-text representation set to this text.</value>
212 public System.String Markup {
213 get { return GetMarkup(); }
214 set { SetMarkup(value); }
216 private static IntPtr GetEflClassStatic()
218 return Efl.Ui.ListDefaultItem.efl_ui_list_default_item_class_get();
220 /// <summary>Wrapper for native methods and virtual method delegates.
221 /// For internal use by generated code only.</summary>
222 public new class NativeMethods : Efl.Ui.ListItem.NativeMethods
224 private static Efl.Eo.NativeModule Module = new Efl.Eo.NativeModule( efl.Libs.Elementary);
225 /// <summary>Gets the list of Eo operations to override.</summary>
226 /// <returns>The list of Eo operations to be overload.</returns>
227 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
229 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
230 var methods = Efl.Eo.Globals.GetUserMethods(type);
232 if (efl_content_get_static_delegate == null)
234 efl_content_get_static_delegate = new efl_content_get_delegate(content_get);
237 if (methods.FirstOrDefault(m => m.Name == "GetContent") != null)
239 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) });
242 if (efl_content_set_static_delegate == null)
244 efl_content_set_static_delegate = new efl_content_set_delegate(content_set);
247 if (methods.FirstOrDefault(m => m.Name == "SetContent") != null)
249 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) });
252 if (efl_content_unset_static_delegate == null)
254 efl_content_unset_static_delegate = new efl_content_unset_delegate(content_unset);
257 if (methods.FirstOrDefault(m => m.Name == "UnsetContent") != null)
259 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) });
262 if (efl_text_get_static_delegate == null)
264 efl_text_get_static_delegate = new efl_text_get_delegate(text_get);
267 if (methods.FirstOrDefault(m => m.Name == "GetText") != null)
269 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_text_get"), func = Marshal.GetFunctionPointerForDelegate(efl_text_get_static_delegate) });
272 if (efl_text_set_static_delegate == null)
274 efl_text_set_static_delegate = new efl_text_set_delegate(text_set);
277 if (methods.FirstOrDefault(m => m.Name == "SetText") != null)
279 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_text_set"), func = Marshal.GetFunctionPointerForDelegate(efl_text_set_static_delegate) });
282 if (efl_text_markup_get_static_delegate == null)
284 efl_text_markup_get_static_delegate = new efl_text_markup_get_delegate(markup_get);
287 if (methods.FirstOrDefault(m => m.Name == "GetMarkup") != null)
289 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_text_markup_get"), func = Marshal.GetFunctionPointerForDelegate(efl_text_markup_get_static_delegate) });
292 if (efl_text_markup_set_static_delegate == null)
294 efl_text_markup_set_static_delegate = new efl_text_markup_set_delegate(markup_set);
297 if (methods.FirstOrDefault(m => m.Name == "SetMarkup") != null)
299 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_text_markup_set"), func = Marshal.GetFunctionPointerForDelegate(efl_text_markup_set_static_delegate) });
302 descs.AddRange(base.GetEoOps(type));
305 /// <summary>Returns the Eo class for the native methods of this class.</summary>
306 /// <returns>The native class pointer.</returns>
307 public override IntPtr GetEflClass()
309 return Efl.Ui.ListDefaultItem.efl_ui_list_default_item_class_get();
312 #pragma warning disable CA1707, CS1591, SA1300, SA1600
314 [return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))]
315 private delegate Efl.Gfx.IEntity efl_content_get_delegate(System.IntPtr obj, System.IntPtr pd);
317 [return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))]
318 public delegate Efl.Gfx.IEntity efl_content_get_api_delegate(System.IntPtr obj);
320 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");
322 private static Efl.Gfx.IEntity content_get(System.IntPtr obj, System.IntPtr pd)
324 Eina.Log.Debug("function efl_content_get was called");
325 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
328 Efl.Gfx.IEntity _ret_var = default(Efl.Gfx.IEntity);
331 _ret_var = ((ListDefaultItem)ws.Target).GetContent();
335 Eina.Log.Warning($"Callback error: {e.ToString()}");
336 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
344 return efl_content_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
348 private static efl_content_get_delegate efl_content_get_static_delegate;
350 [return: MarshalAs(UnmanagedType.U1)]
351 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);
353 [return: MarshalAs(UnmanagedType.U1)]
354 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);
356 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");
358 private static bool content_set(System.IntPtr obj, System.IntPtr pd, Efl.Gfx.IEntity content)
360 Eina.Log.Debug("function efl_content_set was called");
361 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
364 bool _ret_var = default(bool);
367 _ret_var = ((ListDefaultItem)ws.Target).SetContent(content);
371 Eina.Log.Warning($"Callback error: {e.ToString()}");
372 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
380 return efl_content_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), content);
384 private static efl_content_set_delegate efl_content_set_static_delegate;
386 [return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))]
387 private delegate Efl.Gfx.IEntity efl_content_unset_delegate(System.IntPtr obj, System.IntPtr pd);
389 [return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))]
390 public delegate Efl.Gfx.IEntity efl_content_unset_api_delegate(System.IntPtr obj);
392 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");
394 private static Efl.Gfx.IEntity content_unset(System.IntPtr obj, System.IntPtr pd)
396 Eina.Log.Debug("function efl_content_unset was called");
397 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
400 Efl.Gfx.IEntity _ret_var = default(Efl.Gfx.IEntity);
403 _ret_var = ((ListDefaultItem)ws.Target).UnsetContent();
407 Eina.Log.Warning($"Callback error: {e.ToString()}");
408 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
416 return efl_content_unset_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
420 private static efl_content_unset_delegate efl_content_unset_static_delegate;
422 [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))]
423 private delegate System.String efl_text_get_delegate(System.IntPtr obj, System.IntPtr pd);
425 [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))]
426 public delegate System.String efl_text_get_api_delegate(System.IntPtr obj);
428 public static Efl.Eo.FunctionWrapper<efl_text_get_api_delegate> efl_text_get_ptr = new Efl.Eo.FunctionWrapper<efl_text_get_api_delegate>(Module, "efl_text_get");
430 private static System.String text_get(System.IntPtr obj, System.IntPtr pd)
432 Eina.Log.Debug("function efl_text_get was called");
433 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
436 System.String _ret_var = default(System.String);
439 _ret_var = ((ListDefaultItem)ws.Target).GetText();
443 Eina.Log.Warning($"Callback error: {e.ToString()}");
444 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
452 return efl_text_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
456 private static efl_text_get_delegate efl_text_get_static_delegate;
459 private delegate void efl_text_set_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String text);
462 public delegate void efl_text_set_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String text);
464 public static Efl.Eo.FunctionWrapper<efl_text_set_api_delegate> efl_text_set_ptr = new Efl.Eo.FunctionWrapper<efl_text_set_api_delegate>(Module, "efl_text_set");
466 private static void text_set(System.IntPtr obj, System.IntPtr pd, System.String text)
468 Eina.Log.Debug("function efl_text_set was called");
469 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
475 ((ListDefaultItem)ws.Target).SetText(text);
479 Eina.Log.Warning($"Callback error: {e.ToString()}");
480 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
487 efl_text_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), text);
491 private static efl_text_set_delegate efl_text_set_static_delegate;
493 [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))]
494 private delegate System.String efl_text_markup_get_delegate(System.IntPtr obj, System.IntPtr pd);
496 [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))]
497 public delegate System.String efl_text_markup_get_api_delegate(System.IntPtr obj);
499 public static Efl.Eo.FunctionWrapper<efl_text_markup_get_api_delegate> efl_text_markup_get_ptr = new Efl.Eo.FunctionWrapper<efl_text_markup_get_api_delegate>(Module, "efl_text_markup_get");
501 private static System.String markup_get(System.IntPtr obj, System.IntPtr pd)
503 Eina.Log.Debug("function efl_text_markup_get was called");
504 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
507 System.String _ret_var = default(System.String);
510 _ret_var = ((ListDefaultItem)ws.Target).GetMarkup();
514 Eina.Log.Warning($"Callback error: {e.ToString()}");
515 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
523 return efl_text_markup_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
527 private static efl_text_markup_get_delegate efl_text_markup_get_static_delegate;
530 private delegate void efl_text_markup_set_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String markup);
533 public delegate void efl_text_markup_set_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String markup);
535 public static Efl.Eo.FunctionWrapper<efl_text_markup_set_api_delegate> efl_text_markup_set_ptr = new Efl.Eo.FunctionWrapper<efl_text_markup_set_api_delegate>(Module, "efl_text_markup_set");
537 private static void markup_set(System.IntPtr obj, System.IntPtr pd, System.String markup)
539 Eina.Log.Debug("function efl_text_markup_set was called");
540 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
546 ((ListDefaultItem)ws.Target).SetMarkup(markup);
550 Eina.Log.Warning($"Callback error: {e.ToString()}");
551 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
558 efl_text_markup_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), markup);
562 private static efl_text_markup_set_delegate efl_text_markup_set_static_delegate;
564 #pragma warning restore CA1707, CS1591, SA1300, SA1600