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>Elementary layout internal part class</summary>
13 [Efl.Ui.LayoutPartText.NativeMethods]
14 public class LayoutPartText : Efl.Ui.LayoutPart, Efl.Eo.IWrapper,Efl.IText,Efl.ITextMarkup,Efl.Ui.IL10n
16 ///<summary>Pointer to the native class description.</summary>
17 public override System.IntPtr NativeClass
21 if (((object)this).GetType() == typeof(LayoutPartText))
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_layout_part_text_class_get();
34 /// <summary>Initializes a new instance of the <see cref="LayoutPartText"/> class.</summary>
35 /// <param name="parent">Parent instance.</param>
36 public LayoutPartText(Efl.Object parent= null
37 ) : base(efl_ui_layout_part_text_class_get(), typeof(LayoutPartText), parent)
39 FinishInstantiation();
42 /// <summary>Initializes a new instance of the <see cref="LayoutPartText"/> class.
43 /// Internal usage: Constructs an instance from a native pointer. This is used when interacting with C code and should not be used directly.</summary>
44 /// <param name="raw">The native pointer to be wrapped.</param>
45 protected LayoutPartText(System.IntPtr raw) : base(raw)
49 /// <summary>Initializes a new instance of the <see cref="LayoutPartText"/> class.
50 /// Internal usage: Constructor to forward the wrapper initialization to the root class that interfaces with native code. Should not be used directly.</summary>
51 /// <param name="baseKlass">The pointer to the base native Eo class.</param>
52 /// <param name="managedType">The managed type of the public constructor that originated this call.</param>
53 /// <param name="parent">The Efl.Object parent of this instance.</param>
54 protected LayoutPartText(IntPtr baseKlass, System.Type managedType, Efl.Object parent) : base(baseKlass, managedType, parent)
58 /// <summary>Verifies if the given object is equal to this one.</summary>
59 /// <param name="instance">The object to compare to.</param>
60 /// <returns>True if both objects point to the same native object.</returns>
61 public override bool Equals(object instance)
63 var other = instance as Efl.Object;
68 return this.NativeHandle == other.NativeHandle;
71 /// <summary>Gets the hash code for this object based on the native pointer it points to.</summary>
72 /// <returns>The value of the pointer, to be used as the hash code of this object.</returns>
73 public override int GetHashCode()
75 return this.NativeHandle.ToInt32();
78 /// <summary>Turns the native pointer into a string representation.</summary>
79 /// <returns>A string with the type and the native pointer for this object.</returns>
80 public override String ToString()
82 return $"{this.GetType().Name}@[{this.NativeHandle.ToInt32():x}]";
85 /// <summary>Retrieves the text string currently being displayed by the given text object.
86 /// Do not free() the return value.
88 /// See also <see cref="Efl.IText.GetText"/>.
89 /// (Since EFL 1.22)</summary>
90 /// <returns>Text string to display on it.</returns>
91 virtual public System.String GetText() {
92 var _ret_var = Efl.ITextConcrete.NativeMethods.efl_text_get_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle));
93 Eina.Error.RaiseIfUnhandledException();
96 /// <summary>Sets the text string to be displayed by the given text object.
97 /// See also <see cref="Efl.IText.GetText"/>.
98 /// (Since EFL 1.22)</summary>
99 /// <param name="text">Text string to display on it.</param>
100 virtual public void SetText(System.String text) {
101 Efl.ITextConcrete.NativeMethods.efl_text_set_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle),text);
102 Eina.Error.RaiseIfUnhandledException();
104 /// <summary>Markup property</summary>
105 /// <returns>The markup-text representation set to this text.</returns>
106 virtual public System.String GetMarkup() {
107 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));
108 Eina.Error.RaiseIfUnhandledException();
111 /// <summary>Markup property</summary>
112 /// <param name="markup">The markup-text representation set to this text.</param>
113 virtual public void SetMarkup(System.String markup) {
114 Efl.ITextMarkupConcrete.NativeMethods.efl_text_markup_set_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle),markup);
115 Eina.Error.RaiseIfUnhandledException();
117 /// <summary>A unique string to be translated.
118 /// Often this will be a human-readable string (e.g. in English) but it can also be a unique string identifier that must then be translated to the current locale with <c>dgettext</c>() or any similar mechanism.
120 /// Setting this property will enable translation for this object or part.</summary>
121 /// <param name="domain">A translation domain. If <c>null</c> this means the default domain is used.</param>
122 /// <returns>This returns the untranslated value of <c>label</c>. The translated string can usually be retrieved with <see cref="Efl.IText.GetText"/>.</returns>
123 virtual public System.String GetL10nText(out System.String domain) {
124 var _ret_var = Efl.Ui.IL10nConcrete.NativeMethods.efl_ui_l10n_text_get_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle),out domain);
125 Eina.Error.RaiseIfUnhandledException();
128 /// <summary>Sets the new untranslated string and domain for this object.</summary>
129 /// <param name="label">A unique (untranslated) string.</param>
130 /// <param name="domain">A translation domain. If <c>null</c> this uses the default domain (eg. set by <c>textdomain</c>()).</param>
131 virtual public void SetL10nText(System.String label, System.String domain) {
132 Efl.Ui.IL10nConcrete.NativeMethods.efl_ui_l10n_text_set_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle),label, domain);
133 Eina.Error.RaiseIfUnhandledException();
135 /// <summary>Requests this object to update its text strings for the current locale.
136 /// Currently strings are translated with <c>dgettext</c>, so support for this function may depend on the platform. It is up to the application to provide its own translation data.
138 /// This function is a hook meant to be implemented by any object that supports translation. This can be called whenever a new object is created or when the current locale changes, for instance. This should only trigger further calls to <see cref="Efl.Ui.IL10n.UpdateTranslation"/> to children objects.</summary>
139 virtual public void UpdateTranslation() {
140 Efl.Ui.IL10nConcrete.NativeMethods.efl_ui_l10n_translation_update_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle));
141 Eina.Error.RaiseIfUnhandledException();
143 /// <summary>Markup property</summary>
144 /// <value>The markup-text representation set to this text.</value>
145 public System.String Markup {
146 get { return GetMarkup(); }
147 set { SetMarkup(value); }
149 private static IntPtr GetEflClassStatic()
151 return Efl.Ui.LayoutPartText.efl_ui_layout_part_text_class_get();
153 /// <summary>Wrapper for native methods and virtual method delegates.
154 /// For internal use by generated code only.</summary>
155 public new class NativeMethods : Efl.Ui.LayoutPart.NativeMethods
157 private static Efl.Eo.NativeModule Module = new Efl.Eo.NativeModule( efl.Libs.Elementary);
158 /// <summary>Gets the list of Eo operations to override.</summary>
159 /// <returns>The list of Eo operations to be overload.</returns>
160 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
162 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
163 var methods = Efl.Eo.Globals.GetUserMethods(type);
165 if (efl_text_get_static_delegate == null)
167 efl_text_get_static_delegate = new efl_text_get_delegate(text_get);
170 if (methods.FirstOrDefault(m => m.Name == "GetText") != null)
172 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) });
175 if (efl_text_set_static_delegate == null)
177 efl_text_set_static_delegate = new efl_text_set_delegate(text_set);
180 if (methods.FirstOrDefault(m => m.Name == "SetText") != null)
182 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) });
185 if (efl_text_markup_get_static_delegate == null)
187 efl_text_markup_get_static_delegate = new efl_text_markup_get_delegate(markup_get);
190 if (methods.FirstOrDefault(m => m.Name == "GetMarkup") != null)
192 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) });
195 if (efl_text_markup_set_static_delegate == null)
197 efl_text_markup_set_static_delegate = new efl_text_markup_set_delegate(markup_set);
200 if (methods.FirstOrDefault(m => m.Name == "SetMarkup") != null)
202 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) });
205 if (efl_ui_l10n_text_get_static_delegate == null)
207 efl_ui_l10n_text_get_static_delegate = new efl_ui_l10n_text_get_delegate(l10n_text_get);
210 if (methods.FirstOrDefault(m => m.Name == "GetL10nText") != null)
212 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_ui_l10n_text_get"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_l10n_text_get_static_delegate) });
215 if (efl_ui_l10n_text_set_static_delegate == null)
217 efl_ui_l10n_text_set_static_delegate = new efl_ui_l10n_text_set_delegate(l10n_text_set);
220 if (methods.FirstOrDefault(m => m.Name == "SetL10nText") != null)
222 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_ui_l10n_text_set"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_l10n_text_set_static_delegate) });
225 if (efl_ui_l10n_translation_update_static_delegate == null)
227 efl_ui_l10n_translation_update_static_delegate = new efl_ui_l10n_translation_update_delegate(translation_update);
230 if (methods.FirstOrDefault(m => m.Name == "UpdateTranslation") != null)
232 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_ui_l10n_translation_update"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_l10n_translation_update_static_delegate) });
235 descs.AddRange(base.GetEoOps(type));
238 /// <summary>Returns the Eo class for the native methods of this class.</summary>
239 /// <returns>The native class pointer.</returns>
240 public override IntPtr GetEflClass()
242 return Efl.Ui.LayoutPartText.efl_ui_layout_part_text_class_get();
245 #pragma warning disable CA1707, SA1300, SA1600
247 [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))]
248 private delegate System.String efl_text_get_delegate(System.IntPtr obj, System.IntPtr pd);
250 [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))]
251 public delegate System.String efl_text_get_api_delegate(System.IntPtr obj);
253 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");
255 private static System.String text_get(System.IntPtr obj, System.IntPtr pd)
257 Eina.Log.Debug("function efl_text_get was called");
258 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
261 System.String _ret_var = default(System.String);
264 _ret_var = ((LayoutPartText)wrapper).GetText();
268 Eina.Log.Warning($"Callback error: {e.ToString()}");
269 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
277 return efl_text_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
281 private static efl_text_get_delegate efl_text_get_static_delegate;
284 private delegate void efl_text_set_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String text);
287 public delegate void efl_text_set_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String text);
289 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");
291 private static void text_set(System.IntPtr obj, System.IntPtr pd, System.String text)
293 Eina.Log.Debug("function efl_text_set was called");
294 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
300 ((LayoutPartText)wrapper).SetText(text);
304 Eina.Log.Warning($"Callback error: {e.ToString()}");
305 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
312 efl_text_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), text);
316 private static efl_text_set_delegate efl_text_set_static_delegate;
318 [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))]
319 private delegate System.String efl_text_markup_get_delegate(System.IntPtr obj, System.IntPtr pd);
321 [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))]
322 public delegate System.String efl_text_markup_get_api_delegate(System.IntPtr obj);
324 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");
326 private static System.String markup_get(System.IntPtr obj, System.IntPtr pd)
328 Eina.Log.Debug("function efl_text_markup_get was called");
329 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
332 System.String _ret_var = default(System.String);
335 _ret_var = ((LayoutPartText)wrapper).GetMarkup();
339 Eina.Log.Warning($"Callback error: {e.ToString()}");
340 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
348 return efl_text_markup_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
352 private static efl_text_markup_get_delegate efl_text_markup_get_static_delegate;
355 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);
358 public delegate void efl_text_markup_set_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String markup);
360 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");
362 private static void markup_set(System.IntPtr obj, System.IntPtr pd, System.String markup)
364 Eina.Log.Debug("function efl_text_markup_set was called");
365 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
371 ((LayoutPartText)wrapper).SetMarkup(markup);
375 Eina.Log.Warning($"Callback error: {e.ToString()}");
376 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
383 efl_text_markup_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), markup);
387 private static efl_text_markup_set_delegate efl_text_markup_set_static_delegate;
389 [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))]
390 private delegate System.String efl_ui_l10n_text_get_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] out System.String domain);
392 [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))]
393 public delegate System.String efl_ui_l10n_text_get_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] out System.String domain);
395 public static Efl.Eo.FunctionWrapper<efl_ui_l10n_text_get_api_delegate> efl_ui_l10n_text_get_ptr = new Efl.Eo.FunctionWrapper<efl_ui_l10n_text_get_api_delegate>(Module, "efl_ui_l10n_text_get");
397 private static System.String l10n_text_get(System.IntPtr obj, System.IntPtr pd, out System.String domain)
399 Eina.Log.Debug("function efl_ui_l10n_text_get was called");
400 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
403 System.String _out_domain = default(System.String);
404 System.String _ret_var = default(System.String);
407 _ret_var = ((LayoutPartText)wrapper).GetL10nText(out _out_domain);
411 Eina.Log.Warning($"Callback error: {e.ToString()}");
412 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
415 domain = _out_domain;
421 return efl_ui_l10n_text_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), out domain);
425 private static efl_ui_l10n_text_get_delegate efl_ui_l10n_text_get_static_delegate;
428 private delegate void efl_ui_l10n_text_set_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String label, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String domain);
431 public delegate void efl_ui_l10n_text_set_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String label, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String domain);
433 public static Efl.Eo.FunctionWrapper<efl_ui_l10n_text_set_api_delegate> efl_ui_l10n_text_set_ptr = new Efl.Eo.FunctionWrapper<efl_ui_l10n_text_set_api_delegate>(Module, "efl_ui_l10n_text_set");
435 private static void l10n_text_set(System.IntPtr obj, System.IntPtr pd, System.String label, System.String domain)
437 Eina.Log.Debug("function efl_ui_l10n_text_set was called");
438 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
444 ((LayoutPartText)wrapper).SetL10nText(label, domain);
448 Eina.Log.Warning($"Callback error: {e.ToString()}");
449 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
456 efl_ui_l10n_text_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), label, domain);
460 private static efl_ui_l10n_text_set_delegate efl_ui_l10n_text_set_static_delegate;
463 private delegate void efl_ui_l10n_translation_update_delegate(System.IntPtr obj, System.IntPtr pd);
466 public delegate void efl_ui_l10n_translation_update_api_delegate(System.IntPtr obj);
468 public static Efl.Eo.FunctionWrapper<efl_ui_l10n_translation_update_api_delegate> efl_ui_l10n_translation_update_ptr = new Efl.Eo.FunctionWrapper<efl_ui_l10n_translation_update_api_delegate>(Module, "efl_ui_l10n_translation_update");
470 private static void translation_update(System.IntPtr obj, System.IntPtr pd)
472 Eina.Log.Debug("function efl_ui_l10n_translation_update was called");
473 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
479 ((LayoutPartText)wrapper).UpdateTranslation();
483 Eina.Log.Warning($"Callback error: {e.ToString()}");
484 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
491 efl_ui_l10n_translation_update_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
495 private static efl_ui_l10n_translation_update_delegate efl_ui_l10n_translation_update_static_delegate;
497 #pragma warning restore CA1707, SA1300, SA1600