1 #pragma warning disable CS1591
3 using System.Runtime.InteropServices;
4 using System.Collections.Generic;
6 using System.Threading;
7 using System.ComponentModel;
10 /// <summary>Efl text interface
11 /// (Since EFL 1.22)</summary>
12 [Efl.ITextConcrete.NativeMethods]
13 [Efl.Eo.BindingEntity]
14 public interface IText :
15 Efl.Eo.IWrapper, IDisposable
17 /// <summary>Retrieves the text string currently being displayed by the given text object.
18 /// Do not free() the return value.
20 /// See also <see cref="Efl.IText.GetText"/>.
21 /// (Since EFL 1.22)</summary>
22 /// <returns>Text string to display on it.</returns>
23 System.String GetText();
24 /// <summary>Sets the text string to be displayed by the given text object.
25 /// See also <see cref="Efl.IText.GetText"/>.
26 /// (Since EFL 1.22)</summary>
27 /// <param name="text">Text string to display on it.</param>
28 void SetText(System.String text);
30 /// <summary>Efl text interface
31 /// (Since EFL 1.22)</summary>
32 sealed public class ITextConcrete :
37 ///<summary>Pointer to the native class description.</summary>
38 public override System.IntPtr NativeClass
42 if (((object)this).GetType() == typeof(ITextConcrete))
44 return GetEflClassStatic();
48 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
53 /// <summary>Constructor to be used when objects are expected to be constructed from native code.</summary>
54 /// <param name="ch">Tag struct storing the native handle of the object being constructed.</param>
55 private ITextConcrete(ConstructingHandle ch) : base(ch)
59 [System.Runtime.InteropServices.DllImport("libefl.so.1")] internal static extern System.IntPtr
60 efl_text_interface_get();
61 /// <summary>Initializes a new instance of the <see cref="IText"/> class.
62 /// Internal usage: This is used when interacting with C code and should not be used directly.</summary>
63 /// <param name="wh">The native pointer to be wrapped.</param>
64 private ITextConcrete(Efl.Eo.Globals.WrappingHandle wh) : base(wh)
68 /// <summary>Retrieves the text string currently being displayed by the given text object.
69 /// Do not free() the return value.
71 /// See also <see cref="Efl.IText.GetText"/>.
72 /// (Since EFL 1.22)</summary>
73 /// <returns>Text string to display on it.</returns>
74 public System.String GetText() {
75 var _ret_var = Efl.ITextConcrete.NativeMethods.efl_text_get_ptr.Value.Delegate(this.NativeHandle);
76 Eina.Error.RaiseIfUnhandledException();
79 /// <summary>Sets the text string to be displayed by the given text object.
80 /// See also <see cref="Efl.IText.GetText"/>.
81 /// (Since EFL 1.22)</summary>
82 /// <param name="text">Text string to display on it.</param>
83 public void SetText(System.String text) {
84 Efl.ITextConcrete.NativeMethods.efl_text_set_ptr.Value.Delegate(this.NativeHandle,text);
85 Eina.Error.RaiseIfUnhandledException();
87 private static IntPtr GetEflClassStatic()
89 return Efl.ITextConcrete.efl_text_interface_get();
91 /// <summary>Wrapper for native methods and virtual method delegates.
92 /// For internal use by generated code only.</summary>
93 public new class NativeMethods : Efl.Eo.EoWrapper.NativeMethods
95 private static Efl.Eo.NativeModule Module = new Efl.Eo.NativeModule( efl.Libs.Efl);
96 /// <summary>Gets the list of Eo operations to override.</summary>
97 /// <returns>The list of Eo operations to be overload.</returns>
98 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
100 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
101 var methods = Efl.Eo.Globals.GetUserMethods(type);
103 if (efl_text_get_static_delegate == null)
105 efl_text_get_static_delegate = new efl_text_get_delegate(text_get);
108 if (methods.FirstOrDefault(m => m.Name == "GetText") != null)
110 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) });
113 if (efl_text_set_static_delegate == null)
115 efl_text_set_static_delegate = new efl_text_set_delegate(text_set);
118 if (methods.FirstOrDefault(m => m.Name == "SetText") != null)
120 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) });
125 /// <summary>Returns the Eo class for the native methods of this class.</summary>
126 /// <returns>The native class pointer.</returns>
127 public override IntPtr GetEflClass()
129 return Efl.ITextConcrete.efl_text_interface_get();
132 #pragma warning disable CA1707, CS1591, SA1300, SA1600
134 [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))]
135 private delegate System.String efl_text_get_delegate(System.IntPtr obj, System.IntPtr pd);
137 [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))]
138 public delegate System.String efl_text_get_api_delegate(System.IntPtr obj);
140 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");
142 private static System.String text_get(System.IntPtr obj, System.IntPtr pd)
144 Eina.Log.Debug("function efl_text_get was called");
145 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
148 System.String _ret_var = default(System.String);
151 _ret_var = ((IText)ws.Target).GetText();
155 Eina.Log.Warning($"Callback error: {e.ToString()}");
156 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
164 return efl_text_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
168 private static efl_text_get_delegate efl_text_get_static_delegate;
171 private delegate void efl_text_set_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String text);
174 public delegate void efl_text_set_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String text);
176 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");
178 private static void text_set(System.IntPtr obj, System.IntPtr pd, System.String text)
180 Eina.Log.Debug("function efl_text_set was called");
181 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
187 ((IText)ws.Target).SetText(text);
191 Eina.Log.Warning($"Callback error: {e.ToString()}");
192 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
199 efl_text_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), text);
203 private static efl_text_set_delegate efl_text_set_static_delegate;
205 #pragma warning restore CA1707, CS1591, SA1300, SA1600