2 #pragma warning disable CS1591
4 using System.Runtime.InteropServices;
5 using System.Collections.Generic;
7 using System.Threading;
8 using System.ComponentModel;
11 /// <summary>Utility class for markup, such as conversions</summary>
12 /// <remarks>This is a <b>BETA</b> class. It can be modified or removed in the future. Do not use it for product development.</remarks>
13 [Efl.TextMarkupUtil.NativeMethods]
14 [Efl.Eo.BindingEntity]
15 public class TextMarkupUtil : Efl.Eo.EoWrapper
17 /// <summary>Pointer to the native class description.</summary>
18 public override System.IntPtr NativeClass
22 if (((object)this).GetType() == typeof(TextMarkupUtil))
24 return GetEflClassStatic();
28 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
33 [System.Runtime.InteropServices.DllImport("libefl.so.1")] internal static extern System.IntPtr
34 efl_text_markup_util_class_get();
35 /// <summary>Initializes a new instance of the <see cref="TextMarkupUtil"/> class.</summary>
36 /// <param name="parent">Parent instance.</param>
37 public TextMarkupUtil(Efl.Object parent= null
38 ) : base(efl_text_markup_util_class_get(), parent)
40 FinishInstantiation();
43 /// <summary>Subclasses should override this constructor if they are expected to be instantiated from native code.
44 /// Do not call this constructor directly.</summary>
45 /// <param name="ch">Tag struct storing the native handle of the object being constructed.</param>
46 protected TextMarkupUtil(ConstructingHandle ch) : base(ch)
50 /// <summary>Initializes a new instance of the <see cref="TextMarkupUtil"/> class.
51 /// Internal usage: Constructs an instance from a native pointer. This is used when interacting with C code and should not be used directly.</summary>
52 /// <param name="wh">The native pointer to be wrapped.</param>
53 protected TextMarkupUtil(Efl.Eo.Globals.WrappingHandle wh) : base(wh)
57 /// <summary>Initializes a new instance of the <see cref="TextMarkupUtil"/> class.
58 /// Internal usage: Constructor to forward the wrapper initialization to the root class that interfaces with native code. Should not be used directly.</summary>
59 /// <param name="baseKlass">The pointer to the base native Eo class.</param>
60 /// <param name="parent">The Efl.Object parent of this instance.</param>
61 protected TextMarkupUtil(IntPtr baseKlass, Efl.Object parent) : base(baseKlass, parent)
65 /// <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>
66 /// <param name="text">The text (UTF-8) to convert to markup</param>
67 /// <returns>The markup representation of given text</returns>
68 public static System.String TextToMarkup(System.String text) {
69 var _ret_var = Efl.TextMarkupUtil.NativeMethods.efl_text_markup_util_text_to_markup_ptr.Value.Delegate(text);
70 Eina.Error.RaiseIfUnhandledException();
73 /// <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>
74 /// <param name="text">The markup-text to convert to text (UTF-8)</param>
75 /// <returns>The text representation of given format</returns>
76 public static System.String MarkupToText(System.String text) {
77 var _ret_var = Efl.TextMarkupUtil.NativeMethods.efl_text_markup_util_markup_to_text_ptr.Value.Delegate(text);
78 Eina.Error.RaiseIfUnhandledException();
81 private static IntPtr GetEflClassStatic()
83 return Efl.TextMarkupUtil.efl_text_markup_util_class_get();
85 /// <summary>Wrapper for native methods and virtual method delegates.
86 /// For internal use by generated code only.</summary>
87 public new class NativeMethods : Efl.Eo.EoWrapper.NativeMethods
89 private static Efl.Eo.NativeModule Module = new Efl.Eo.NativeModule( efl.Libs.Efl);
90 /// <summary>Gets the list of Eo operations to override.</summary>
91 /// <returns>The list of Eo operations to be overload.</returns>
92 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
94 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
95 descs.AddRange(base.GetEoOps(type));
98 /// <summary>Returns the Eo class for the native methods of this class.</summary>
99 /// <returns>The native class pointer.</returns>
100 public override IntPtr GetEflClass()
102 return Efl.TextMarkupUtil.efl_text_markup_util_class_get();
105 #pragma warning disable CA1707, CS1591, SA1300, SA1600
107 [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringPassOwnershipMarshaler))]
108 private delegate System.String efl_text_markup_util_text_to_markup_delegate([MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String text);
110 [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringPassOwnershipMarshaler))]
111 public delegate System.String efl_text_markup_util_text_to_markup_api_delegate([MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String text);
113 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");
115 private static System.String text_to_markup(System.IntPtr obj, System.IntPtr pd, System.String text)
117 Eina.Log.Debug("function efl_text_markup_util_text_to_markup was called");
118 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
121 System.String _ret_var = default(System.String);
124 _ret_var = TextMarkupUtil.TextToMarkup(text);
128 Eina.Log.Warning($"Callback error: {e.ToString()}");
129 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
137 return efl_text_markup_util_text_to_markup_ptr.Value.Delegate(text);
141 [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringPassOwnershipMarshaler))]
142 private delegate System.String efl_text_markup_util_markup_to_text_delegate([MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String text);
144 [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringPassOwnershipMarshaler))]
145 public delegate System.String efl_text_markup_util_markup_to_text_api_delegate([MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String text);
147 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");
149 private static System.String markup_to_text(System.IntPtr obj, System.IntPtr pd, System.String text)
151 Eina.Log.Debug("function efl_text_markup_util_markup_to_text was called");
152 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
155 System.String _ret_var = default(System.String);
158 _ret_var = TextMarkupUtil.MarkupToText(text);
162 Eina.Log.Warning($"Callback error: {e.ToString()}");
163 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
171 return efl_text_markup_util_markup_to_text_ptr.Value.Delegate(text);
175 #pragma warning restore CA1707, CS1591, SA1300, SA1600
182 #pragma warning disable CS1591
183 public static class EflTextMarkupUtil_ExtensionMethods {
185 #pragma warning restore CS1591