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>Utility class for markup, such as conversions</summary>
11 [Efl.TextMarkupUtil.NativeMethods]
12 [Efl.Eo.BindingEntity]
13 public class TextMarkupUtil : Efl.Eo.EoWrapper
15 ///<summary>Pointer to the native class description.</summary>
16 public override System.IntPtr NativeClass
20 if (((object)this).GetType() == typeof(TextMarkupUtil))
22 return GetEflClassStatic();
26 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
31 [System.Runtime.InteropServices.DllImport("libefl.so.1")] internal static extern System.IntPtr
32 efl_text_markup_util_class_get();
33 /// <summary>Initializes a new instance of the <see cref="TextMarkupUtil"/> class.</summary>
34 /// <param name="parent">Parent instance.</param>
35 public TextMarkupUtil(Efl.Object parent= null
36 ) : base(efl_text_markup_util_class_get(), parent)
38 FinishInstantiation();
41 /// <summary>Constructor to be used when objects are expected to be constructed from native code.</summary>
42 /// <param name="ch">Tag struct storing the native handle of the object being constructed.</param>
43 protected TextMarkupUtil(ConstructingHandle ch) : base(ch)
47 /// <summary>Initializes a new instance of the <see cref="TextMarkupUtil"/> class.
48 /// Internal usage: Constructs an instance from a native pointer. This is used when interacting with C code and should not be used directly.</summary>
49 /// <param name="wh">The native pointer to be wrapped.</param>
50 protected TextMarkupUtil(Efl.Eo.Globals.WrappingHandle wh) : base(wh)
54 /// <summary>Initializes a new instance of the <see cref="TextMarkupUtil"/> class.
55 /// Internal usage: Constructor to forward the wrapper initialization to the root class that interfaces with native code. Should not be used directly.</summary>
56 /// <param name="baseKlass">The pointer to the base native Eo class.</param>
57 /// <param name="parent">The Efl.Object parent of this instance.</param>
58 protected TextMarkupUtil(IntPtr baseKlass, Efl.Object parent) : base(baseKlass, parent)
62 /// <summary>Converts a given (UTF-8) text to a markup-compatible string. This is used mainly to set a plain text with the $.markup_set property.</summary>
63 /// <param name="text">The text (UTF-8) to convert to markup</param>
64 /// <returns>The markup representation of given text</returns>
65 public static System.String TextToMarkup(System.String text) {
66 var _ret_var = Efl.TextMarkupUtil.NativeMethods.efl_text_markup_util_text_to_markup_ptr.Value.Delegate(text);
67 Eina.Error.RaiseIfUnhandledException();
70 /// <summary>Converts a given (UTF-8) text to a markup-compatible string. This is used mainly to set a plain text with the $.markup_set property.</summary>
71 /// <param name="text">The markup-text to convert to text (UTF-8)</param>
72 /// <returns>The text representation of given format</returns>
73 public static System.String MarkupToText(System.String text) {
74 var _ret_var = Efl.TextMarkupUtil.NativeMethods.efl_text_markup_util_markup_to_text_ptr.Value.Delegate(text);
75 Eina.Error.RaiseIfUnhandledException();
78 private static IntPtr GetEflClassStatic()
80 return Efl.TextMarkupUtil.efl_text_markup_util_class_get();
82 /// <summary>Wrapper for native methods and virtual method delegates.
83 /// For internal use by generated code only.</summary>
84 public new class NativeMethods : Efl.Eo.EoWrapper.NativeMethods
86 private static Efl.Eo.NativeModule Module = new Efl.Eo.NativeModule( efl.Libs.Efl);
87 /// <summary>Gets the list of Eo operations to override.</summary>
88 /// <returns>The list of Eo operations to be overload.</returns>
89 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
91 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
92 descs.AddRange(base.GetEoOps(type));
95 /// <summary>Returns the Eo class for the native methods of this class.</summary>
96 /// <returns>The native class pointer.</returns>
97 public override IntPtr GetEflClass()
99 return Efl.TextMarkupUtil.efl_text_markup_util_class_get();
102 #pragma warning disable CA1707, CS1591, SA1300, SA1600
104 [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringPassOwnershipMarshaler))]
105 private delegate System.String efl_text_markup_util_text_to_markup_delegate([MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String text);
107 [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringPassOwnershipMarshaler))]
108 public delegate System.String efl_text_markup_util_text_to_markup_api_delegate([MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String text);
110 public static Efl.Eo.FunctionWrapper<efl_text_markup_util_text_to_markup_api_delegate> efl_text_markup_util_text_to_markup_ptr = new Efl.Eo.FunctionWrapper<efl_text_markup_util_text_to_markup_api_delegate>(Module, "efl_text_markup_util_text_to_markup");
112 private static System.String text_to_markup(System.IntPtr obj, System.IntPtr pd, System.String text)
114 Eina.Log.Debug("function efl_text_markup_util_text_to_markup was called");
115 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
118 System.String _ret_var = default(System.String);
121 _ret_var = TextMarkupUtil.TextToMarkup(text);
125 Eina.Log.Warning($"Callback error: {e.ToString()}");
126 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
134 return efl_text_markup_util_text_to_markup_ptr.Value.Delegate(text);
138 [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringPassOwnershipMarshaler))]
139 private delegate System.String efl_text_markup_util_markup_to_text_delegate([MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String text);
141 [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringPassOwnershipMarshaler))]
142 public delegate System.String efl_text_markup_util_markup_to_text_api_delegate([MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String text);
144 public static Efl.Eo.FunctionWrapper<efl_text_markup_util_markup_to_text_api_delegate> efl_text_markup_util_markup_to_text_ptr = new Efl.Eo.FunctionWrapper<efl_text_markup_util_markup_to_text_api_delegate>(Module, "efl_text_markup_util_markup_to_text");
146 private static System.String markup_to_text(System.IntPtr obj, System.IntPtr pd, System.String text)
148 Eina.Log.Debug("function efl_text_markup_util_markup_to_text was called");
149 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
152 System.String _ret_var = default(System.String);
155 _ret_var = TextMarkupUtil.MarkupToText(text);
159 Eina.Log.Warning($"Callback error: {e.ToString()}");
160 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
168 return efl_text_markup_util_markup_to_text_ptr.Value.Delegate(text);
172 #pragma warning restore CA1707, CS1591, SA1300, SA1600