#pragma warning disable CS1591
using System;
using System.Runtime.InteropServices;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.ComponentModel;
namespace Efl {
namespace Ui {
/// 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.
[Efl.Ui.ListDefaultItem.NativeMethods]
public class ListDefaultItem : Efl.Ui.ListItem, Efl.IContent, Efl.IText, Efl.ITextMarkup
{
///Pointer to the native class description.
public override System.IntPtr NativeClass
{
get
{
if (((object)this).GetType() == typeof(ListDefaultItem))
{
return GetEflClassStatic();
}
else
{
return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
}
}
}
[System.Runtime.InteropServices.DllImport(efl.Libs.Elementary)] internal static extern System.IntPtr
efl_ui_list_default_item_class_get();
/// Initializes a new instance of the class.
/// Parent instance.
/// The widget style to use. See
public ListDefaultItem(Efl.Object parent
, System.String style = null) : base(efl_ui_list_default_item_class_get(), typeof(ListDefaultItem), parent)
{
if (Efl.Eo.Globals.ParamHelperCheck(style))
{
SetStyle(Efl.Eo.Globals.GetParamHelper(style));
}
FinishInstantiation();
}
/// Initializes a new instance of the class.
/// Internal usage: Constructs an instance from a native pointer. This is used when interacting with C code and should not be used directly.
/// The native pointer to be wrapped.
protected ListDefaultItem(System.IntPtr raw) : base(raw)
{
}
/// Initializes a new instance of the class.
/// Internal usage: Constructor to forward the wrapper initialization to the root class that interfaces with native code. Should not be used directly.
/// The pointer to the base native Eo class.
/// The managed type of the public constructor that originated this call.
/// The Efl.Object parent of this instance.
protected ListDefaultItem(IntPtr baseKlass, System.Type managedType, Efl.Object parent) : base(baseKlass, managedType, parent)
{
}
/// Sent after the content is set or unset using the current content object.
/// (Since EFL 1.22)
public event EventHandler ContentChangedEvt
{
add
{
lock (eventLock)
{
Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) =>
{
var obj = Efl.Eo.Globals.WrapperSupervisorPtrToManaged(data).Target;
if (obj != null)
{
Efl.IContentContentChangedEvt_Args args = new Efl.IContentContentChangedEvt_Args();
args.arg = (Efl.Eo.Globals.CreateWrapperFor(evt.Info) as Efl.Gfx.IEntityConcrete);
try
{
value?.Invoke(obj, args);
}
catch (Exception e)
{
Eina.Log.Error(e.ToString());
Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
}
}
};
string key = "_EFL_CONTENT_EVENT_CONTENT_CHANGED";
AddNativeEventHandler(efl.Libs.Efl, key, callerCb, value);
}
}
remove
{
lock (eventLock)
{
string key = "_EFL_CONTENT_EVENT_CONTENT_CHANGED";
RemoveNativeEventHandler(efl.Libs.Efl, key, value);
}
}
}
///Method to raise event ContentChangedEvt.
public void OnContentChangedEvt(Efl.IContentContentChangedEvt_Args e)
{
var key = "_EFL_CONTENT_EVENT_CONTENT_CHANGED";
IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Efl, key);
if (desc == IntPtr.Zero)
{
Eina.Log.Error($"Failed to get native event {key}");
return;
}
IntPtr info = e.arg.NativeHandle;
Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, info);
}
/// The extra content part for list default item. extra part is the right-side content of list item.
public Efl.Ui.ItemPartExtra ExtraPart
{
get
{
return GetPart("extra") as Efl.Ui.ItemPartExtra;
}
}
/// The icon content part for list default item. icon part is the left-side content of list item.
public Efl.Ui.ItemPartIcon IconPart
{
get
{
return GetPart("icon") as Efl.Ui.ItemPartIcon;
}
}
/// The text part for list default item.
public Efl.Ui.ItemPartText TextPart
{
get
{
return GetPart("text") as Efl.Ui.ItemPartText;
}
}
/// Sub-object currently set as this object's single content.
/// If it is set multiple times, previous sub-objects are removed first. Therefore, if an invalid content is set the object will become empty (it will have no sub-object).
/// (Since EFL 1.22)
/// The sub-object.
virtual public Efl.Gfx.IEntity GetContent() {
var _ret_var = Efl.IContentConcrete.NativeMethods.efl_content_get_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle));
Eina.Error.RaiseIfUnhandledException();
return _ret_var;
}
/// Sub-object currently set as this object's single content.
/// If it is set multiple times, previous sub-objects are removed first. Therefore, if an invalid content is set the object will become empty (it will have no sub-object).
/// (Since EFL 1.22)
/// The sub-object.
/// true if content was successfully swallowed.
virtual public bool SetContent(Efl.Gfx.IEntity content) {
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);
Eina.Error.RaiseIfUnhandledException();
return _ret_var;
}
/// Remove the sub-object currently set as content of this object and return it. This object becomes empty.
/// (Since EFL 1.22)
/// Unswallowed object
virtual public Efl.Gfx.IEntity UnsetContent() {
var _ret_var = Efl.IContentConcrete.NativeMethods.efl_content_unset_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle));
Eina.Error.RaiseIfUnhandledException();
return _ret_var;
}
/// Retrieves the text string currently being displayed by the given text object.
/// Do not free() the return value.
///
/// See also .
/// (Since EFL 1.22)
/// Text string to display on it.
virtual public System.String GetText() {
var _ret_var = Efl.ITextConcrete.NativeMethods.efl_text_get_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle));
Eina.Error.RaiseIfUnhandledException();
return _ret_var;
}
/// Sets the text string to be displayed by the given text object.
/// See also .
/// (Since EFL 1.22)
/// Text string to display on it.
virtual public void SetText(System.String text) {
Efl.ITextConcrete.NativeMethods.efl_text_set_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle),text);
Eina.Error.RaiseIfUnhandledException();
}
/// Markup property
/// The markup-text representation set to this text.
virtual public System.String GetMarkup() {
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));
Eina.Error.RaiseIfUnhandledException();
return _ret_var;
}
/// Markup property
/// The markup-text representation set to this text.
virtual public void SetMarkup(System.String markup) {
Efl.ITextMarkupConcrete.NativeMethods.efl_text_markup_set_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle),markup);
Eina.Error.RaiseIfUnhandledException();
}
/// Sub-object currently set as this object's single content.
/// If it is set multiple times, previous sub-objects are removed first. Therefore, if an invalid content is set the object will become empty (it will have no sub-object).
/// (Since EFL 1.22)
/// The sub-object.
public Efl.Gfx.IEntity Content {
get { return GetContent(); }
set { SetContent(value); }
}
/// Markup property
/// The markup-text representation set to this text.
public System.String Markup {
get { return GetMarkup(); }
set { SetMarkup(value); }
}
private static IntPtr GetEflClassStatic()
{
return Efl.Ui.ListDefaultItem.efl_ui_list_default_item_class_get();
}
/// Wrapper for native methods and virtual method delegates.
/// For internal use by generated code only.
public new class NativeMethods : Efl.Ui.ListItem.NativeMethods
{
private static Efl.Eo.NativeModule Module = new Efl.Eo.NativeModule( efl.Libs.Elementary);
/// Gets the list of Eo operations to override.
/// The list of Eo operations to be overload.
public override System.Collections.Generic.List GetEoOps(System.Type type)
{
var descs = new System.Collections.Generic.List();
var methods = Efl.Eo.Globals.GetUserMethods(type);
if (efl_content_get_static_delegate == null)
{
efl_content_get_static_delegate = new efl_content_get_delegate(content_get);
}
if (methods.FirstOrDefault(m => m.Name == "GetContent") != null)
{
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) });
}
if (efl_content_set_static_delegate == null)
{
efl_content_set_static_delegate = new efl_content_set_delegate(content_set);
}
if (methods.FirstOrDefault(m => m.Name == "SetContent") != null)
{
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) });
}
if (efl_content_unset_static_delegate == null)
{
efl_content_unset_static_delegate = new efl_content_unset_delegate(content_unset);
}
if (methods.FirstOrDefault(m => m.Name == "UnsetContent") != null)
{
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) });
}
if (efl_text_get_static_delegate == null)
{
efl_text_get_static_delegate = new efl_text_get_delegate(text_get);
}
if (methods.FirstOrDefault(m => m.Name == "GetText") != null)
{
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) });
}
if (efl_text_set_static_delegate == null)
{
efl_text_set_static_delegate = new efl_text_set_delegate(text_set);
}
if (methods.FirstOrDefault(m => m.Name == "SetText") != null)
{
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) });
}
if (efl_text_markup_get_static_delegate == null)
{
efl_text_markup_get_static_delegate = new efl_text_markup_get_delegate(markup_get);
}
if (methods.FirstOrDefault(m => m.Name == "GetMarkup") != null)
{
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) });
}
if (efl_text_markup_set_static_delegate == null)
{
efl_text_markup_set_static_delegate = new efl_text_markup_set_delegate(markup_set);
}
if (methods.FirstOrDefault(m => m.Name == "SetMarkup") != null)
{
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) });
}
descs.AddRange(base.GetEoOps(type));
return descs;
}
/// Returns the Eo class for the native methods of this class.
/// The native class pointer.
public override IntPtr GetEflClass()
{
return Efl.Ui.ListDefaultItem.efl_ui_list_default_item_class_get();
}
#pragma warning disable CA1707, CS1591, SA1300, SA1600
[return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo))]
private delegate Efl.Gfx.IEntity efl_content_get_delegate(System.IntPtr obj, System.IntPtr pd);
[return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo))]
public delegate Efl.Gfx.IEntity efl_content_get_api_delegate(System.IntPtr obj);
public static Efl.Eo.FunctionWrapper efl_content_get_ptr = new Efl.Eo.FunctionWrapper(Module, "efl_content_get");
private static Efl.Gfx.IEntity content_get(System.IntPtr obj, System.IntPtr pd)
{
Eina.Log.Debug("function efl_content_get was called");
var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
if (ws != null)
{
Efl.Gfx.IEntity _ret_var = default(Efl.Gfx.IEntity);
try
{
_ret_var = ((ListDefaultItem)ws.Target).GetContent();
}
catch (Exception e)
{
Eina.Log.Warning($"Callback error: {e.ToString()}");
Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
}
return _ret_var;
}
else
{
return efl_content_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
}
}
private static efl_content_get_delegate efl_content_get_static_delegate;
[return: MarshalAs(UnmanagedType.U1)]
private delegate bool efl_content_set_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo))] Efl.Gfx.IEntity content);
[return: MarshalAs(UnmanagedType.U1)]
public delegate bool efl_content_set_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo))] Efl.Gfx.IEntity content);
public static Efl.Eo.FunctionWrapper efl_content_set_ptr = new Efl.Eo.FunctionWrapper(Module, "efl_content_set");
private static bool content_set(System.IntPtr obj, System.IntPtr pd, Efl.Gfx.IEntity content)
{
Eina.Log.Debug("function efl_content_set was called");
var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
if (ws != null)
{
bool _ret_var = default(bool);
try
{
_ret_var = ((ListDefaultItem)ws.Target).SetContent(content);
}
catch (Exception e)
{
Eina.Log.Warning($"Callback error: {e.ToString()}");
Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
}
return _ret_var;
}
else
{
return efl_content_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), content);
}
}
private static efl_content_set_delegate efl_content_set_static_delegate;
[return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo))]
private delegate Efl.Gfx.IEntity efl_content_unset_delegate(System.IntPtr obj, System.IntPtr pd);
[return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo))]
public delegate Efl.Gfx.IEntity efl_content_unset_api_delegate(System.IntPtr obj);
public static Efl.Eo.FunctionWrapper efl_content_unset_ptr = new Efl.Eo.FunctionWrapper(Module, "efl_content_unset");
private static Efl.Gfx.IEntity content_unset(System.IntPtr obj, System.IntPtr pd)
{
Eina.Log.Debug("function efl_content_unset was called");
var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
if (ws != null)
{
Efl.Gfx.IEntity _ret_var = default(Efl.Gfx.IEntity);
try
{
_ret_var = ((ListDefaultItem)ws.Target).UnsetContent();
}
catch (Exception e)
{
Eina.Log.Warning($"Callback error: {e.ToString()}");
Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
}
return _ret_var;
}
else
{
return efl_content_unset_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
}
}
private static efl_content_unset_delegate efl_content_unset_static_delegate;
[return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))]
private delegate System.String efl_text_get_delegate(System.IntPtr obj, System.IntPtr pd);
[return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))]
public delegate System.String efl_text_get_api_delegate(System.IntPtr obj);
public static Efl.Eo.FunctionWrapper efl_text_get_ptr = new Efl.Eo.FunctionWrapper(Module, "efl_text_get");
private static System.String text_get(System.IntPtr obj, System.IntPtr pd)
{
Eina.Log.Debug("function efl_text_get was called");
var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
if (ws != null)
{
System.String _ret_var = default(System.String);
try
{
_ret_var = ((ListDefaultItem)ws.Target).GetText();
}
catch (Exception e)
{
Eina.Log.Warning($"Callback error: {e.ToString()}");
Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
}
return _ret_var;
}
else
{
return efl_text_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
}
}
private static efl_text_get_delegate efl_text_get_static_delegate;
private delegate void efl_text_set_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String text);
public delegate void efl_text_set_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String text);
public static Efl.Eo.FunctionWrapper efl_text_set_ptr = new Efl.Eo.FunctionWrapper(Module, "efl_text_set");
private static void text_set(System.IntPtr obj, System.IntPtr pd, System.String text)
{
Eina.Log.Debug("function efl_text_set was called");
var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
if (ws != null)
{
try
{
((ListDefaultItem)ws.Target).SetText(text);
}
catch (Exception e)
{
Eina.Log.Warning($"Callback error: {e.ToString()}");
Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
}
}
else
{
efl_text_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), text);
}
}
private static efl_text_set_delegate efl_text_set_static_delegate;
[return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))]
private delegate System.String efl_text_markup_get_delegate(System.IntPtr obj, System.IntPtr pd);
[return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))]
public delegate System.String efl_text_markup_get_api_delegate(System.IntPtr obj);
public static Efl.Eo.FunctionWrapper efl_text_markup_get_ptr = new Efl.Eo.FunctionWrapper(Module, "efl_text_markup_get");
private static System.String markup_get(System.IntPtr obj, System.IntPtr pd)
{
Eina.Log.Debug("function efl_text_markup_get was called");
var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
if (ws != null)
{
System.String _ret_var = default(System.String);
try
{
_ret_var = ((ListDefaultItem)ws.Target).GetMarkup();
}
catch (Exception e)
{
Eina.Log.Warning($"Callback error: {e.ToString()}");
Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
}
return _ret_var;
}
else
{
return efl_text_markup_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
}
}
private static efl_text_markup_get_delegate efl_text_markup_get_static_delegate;
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);
public delegate void efl_text_markup_set_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String markup);
public static Efl.Eo.FunctionWrapper efl_text_markup_set_ptr = new Efl.Eo.FunctionWrapper(Module, "efl_text_markup_set");
private static void markup_set(System.IntPtr obj, System.IntPtr pd, System.String markup)
{
Eina.Log.Debug("function efl_text_markup_set was called");
var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
if (ws != null)
{
try
{
((ListDefaultItem)ws.Target).SetMarkup(markup);
}
catch (Exception e)
{
Eina.Log.Warning($"Callback error: {e.ToString()}");
Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
}
}
else
{
efl_text_markup_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), markup);
}
}
private static efl_text_markup_set_delegate efl_text_markup_set_static_delegate;
#pragma warning restore CA1707, CS1591, SA1300, SA1600
}
}
}
}