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>Item internal text part class</summary>
13 [Efl.Ui.ItemPartText.NativeMethods]
14 public class ItemPartText : Efl.Ui.LayoutPart, 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(ItemPartText))
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_item_part_text_class_get();
34 /// <summary>Initializes a new instance of the <see cref="ItemPartText"/> class.</summary>
35 /// <param name="parent">Parent instance.</param>
36 public ItemPartText(Efl.Object parent= null
37 ) : base(efl_ui_item_part_text_class_get(), typeof(ItemPartText), parent)
39 FinishInstantiation();
42 /// <summary>Initializes a new instance of the <see cref="ItemPartText"/> 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 ItemPartText(System.IntPtr raw) : base(raw)
49 /// <summary>Initializes a new instance of the <see cref="ItemPartText"/> 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 ItemPartText(IntPtr baseKlass, System.Type managedType, Efl.Object parent) : base(baseKlass, managedType, parent)
58 /// <summary>Retrieves the text string currently being displayed by the given text object.
59 /// Do not free() the return value.
61 /// See also <see cref="Efl.IText.GetText"/>.
62 /// (Since EFL 1.22)</summary>
63 /// <returns>Text string to display on it.</returns>
64 virtual public System.String GetText() {
65 var _ret_var = Efl.ITextConcrete.NativeMethods.efl_text_get_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle));
66 Eina.Error.RaiseIfUnhandledException();
69 /// <summary>Sets the text string to be displayed by the given text object.
70 /// See also <see cref="Efl.IText.GetText"/>.
71 /// (Since EFL 1.22)</summary>
72 /// <param name="text">Text string to display on it.</param>
73 virtual public void SetText(System.String text) {
74 Efl.ITextConcrete.NativeMethods.efl_text_set_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle),text);
75 Eina.Error.RaiseIfUnhandledException();
77 /// <summary>Markup property</summary>
78 /// <returns>The markup-text representation set to this text.</returns>
79 virtual public System.String GetMarkup() {
80 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));
81 Eina.Error.RaiseIfUnhandledException();
84 /// <summary>Markup property</summary>
85 /// <param name="markup">The markup-text representation set to this text.</param>
86 virtual public void SetMarkup(System.String markup) {
87 Efl.ITextMarkupConcrete.NativeMethods.efl_text_markup_set_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle),markup);
88 Eina.Error.RaiseIfUnhandledException();
90 /// <summary>A unique string to be translated.
91 /// 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.
93 /// Setting this property will enable translation for this object or part.</summary>
94 /// <param name="domain">A translation domain. If <c>null</c> this means the default domain is used.</param>
95 /// <returns>This returns the untranslated value of <c>label</c>. The translated string can usually be retrieved with <see cref="Efl.IText.GetText"/>.</returns>
96 virtual public System.String GetL10nText(out System.String domain) {
97 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);
98 Eina.Error.RaiseIfUnhandledException();
101 /// <summary>Sets the new untranslated string and domain for this object.</summary>
102 /// <param name="label">A unique (untranslated) string.</param>
103 /// <param name="domain">A translation domain. If <c>null</c> this uses the default domain (eg. set by <c>textdomain</c>()).</param>
104 virtual public void SetL10nText(System.String label, System.String domain) {
105 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);
106 Eina.Error.RaiseIfUnhandledException();
108 /// <summary>Requests this object to update its text strings for the current locale.
109 /// 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.
111 /// 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>
112 virtual public void UpdateTranslation() {
113 Efl.Ui.IL10nConcrete.NativeMethods.efl_ui_l10n_translation_update_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle));
114 Eina.Error.RaiseIfUnhandledException();
116 /// <summary>Markup property</summary>
117 /// <value>The markup-text representation set to this text.</value>
118 public System.String Markup {
119 get { return GetMarkup(); }
120 set { SetMarkup(value); }
122 private static IntPtr GetEflClassStatic()
124 return Efl.Ui.ItemPartText.efl_ui_item_part_text_class_get();
126 /// <summary>Wrapper for native methods and virtual method delegates.
127 /// For internal use by generated code only.</summary>
128 public new class NativeMethods : Efl.Ui.LayoutPart.NativeMethods
130 private static Efl.Eo.NativeModule Module = new Efl.Eo.NativeModule( efl.Libs.Elementary);
131 /// <summary>Gets the list of Eo operations to override.</summary>
132 /// <returns>The list of Eo operations to be overload.</returns>
133 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
135 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
136 var methods = Efl.Eo.Globals.GetUserMethods(type);
138 if (efl_text_get_static_delegate == null)
140 efl_text_get_static_delegate = new efl_text_get_delegate(text_get);
143 if (methods.FirstOrDefault(m => m.Name == "GetText") != null)
145 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) });
148 if (efl_text_set_static_delegate == null)
150 efl_text_set_static_delegate = new efl_text_set_delegate(text_set);
153 if (methods.FirstOrDefault(m => m.Name == "SetText") != null)
155 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) });
158 if (efl_text_markup_get_static_delegate == null)
160 efl_text_markup_get_static_delegate = new efl_text_markup_get_delegate(markup_get);
163 if (methods.FirstOrDefault(m => m.Name == "GetMarkup") != null)
165 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) });
168 if (efl_text_markup_set_static_delegate == null)
170 efl_text_markup_set_static_delegate = new efl_text_markup_set_delegate(markup_set);
173 if (methods.FirstOrDefault(m => m.Name == "SetMarkup") != null)
175 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) });
178 if (efl_ui_l10n_text_get_static_delegate == null)
180 efl_ui_l10n_text_get_static_delegate = new efl_ui_l10n_text_get_delegate(l10n_text_get);
183 if (methods.FirstOrDefault(m => m.Name == "GetL10nText") != null)
185 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) });
188 if (efl_ui_l10n_text_set_static_delegate == null)
190 efl_ui_l10n_text_set_static_delegate = new efl_ui_l10n_text_set_delegate(l10n_text_set);
193 if (methods.FirstOrDefault(m => m.Name == "SetL10nText") != null)
195 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) });
198 if (efl_ui_l10n_translation_update_static_delegate == null)
200 efl_ui_l10n_translation_update_static_delegate = new efl_ui_l10n_translation_update_delegate(translation_update);
203 if (methods.FirstOrDefault(m => m.Name == "UpdateTranslation") != null)
205 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) });
208 descs.AddRange(base.GetEoOps(type));
211 /// <summary>Returns the Eo class for the native methods of this class.</summary>
212 /// <returns>The native class pointer.</returns>
213 public override IntPtr GetEflClass()
215 return Efl.Ui.ItemPartText.efl_ui_item_part_text_class_get();
218 #pragma warning disable CA1707, CS1591, SA1300, SA1600
220 [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))]
221 private delegate System.String efl_text_get_delegate(System.IntPtr obj, System.IntPtr pd);
223 [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))]
224 public delegate System.String efl_text_get_api_delegate(System.IntPtr obj);
226 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");
228 private static System.String text_get(System.IntPtr obj, System.IntPtr pd)
230 Eina.Log.Debug("function efl_text_get was called");
231 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
234 System.String _ret_var = default(System.String);
237 _ret_var = ((ItemPartText)ws.Target).GetText();
241 Eina.Log.Warning($"Callback error: {e.ToString()}");
242 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
250 return efl_text_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
254 private static efl_text_get_delegate efl_text_get_static_delegate;
257 private delegate void efl_text_set_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String text);
260 public delegate void efl_text_set_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String text);
262 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");
264 private static void text_set(System.IntPtr obj, System.IntPtr pd, System.String text)
266 Eina.Log.Debug("function efl_text_set was called");
267 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
273 ((ItemPartText)ws.Target).SetText(text);
277 Eina.Log.Warning($"Callback error: {e.ToString()}");
278 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
285 efl_text_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), text);
289 private static efl_text_set_delegate efl_text_set_static_delegate;
291 [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))]
292 private delegate System.String efl_text_markup_get_delegate(System.IntPtr obj, System.IntPtr pd);
294 [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))]
295 public delegate System.String efl_text_markup_get_api_delegate(System.IntPtr obj);
297 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");
299 private static System.String markup_get(System.IntPtr obj, System.IntPtr pd)
301 Eina.Log.Debug("function efl_text_markup_get was called");
302 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
305 System.String _ret_var = default(System.String);
308 _ret_var = ((ItemPartText)ws.Target).GetMarkup();
312 Eina.Log.Warning($"Callback error: {e.ToString()}");
313 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
321 return efl_text_markup_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
325 private static efl_text_markup_get_delegate efl_text_markup_get_static_delegate;
328 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);
331 public delegate void efl_text_markup_set_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String markup);
333 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");
335 private static void markup_set(System.IntPtr obj, System.IntPtr pd, System.String markup)
337 Eina.Log.Debug("function efl_text_markup_set was called");
338 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
344 ((ItemPartText)ws.Target).SetMarkup(markup);
348 Eina.Log.Warning($"Callback error: {e.ToString()}");
349 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
356 efl_text_markup_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), markup);
360 private static efl_text_markup_set_delegate efl_text_markup_set_static_delegate;
362 [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))]
363 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);
365 [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))]
366 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);
368 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");
370 private static System.String l10n_text_get(System.IntPtr obj, System.IntPtr pd, out System.String domain)
372 Eina.Log.Debug("function efl_ui_l10n_text_get was called");
373 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
376 System.String _out_domain = default(System.String);
377 System.String _ret_var = default(System.String);
380 _ret_var = ((ItemPartText)ws.Target).GetL10nText(out _out_domain);
384 Eina.Log.Warning($"Callback error: {e.ToString()}");
385 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
388 domain = _out_domain;
394 return efl_ui_l10n_text_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), out domain);
398 private static efl_ui_l10n_text_get_delegate efl_ui_l10n_text_get_static_delegate;
401 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);
404 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);
406 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");
408 private static void l10n_text_set(System.IntPtr obj, System.IntPtr pd, System.String label, System.String domain)
410 Eina.Log.Debug("function efl_ui_l10n_text_set was called");
411 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
417 ((ItemPartText)ws.Target).SetL10nText(label, domain);
421 Eina.Log.Warning($"Callback error: {e.ToString()}");
422 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
429 efl_ui_l10n_text_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), label, domain);
433 private static efl_ui_l10n_text_set_delegate efl_ui_l10n_text_set_static_delegate;
436 private delegate void efl_ui_l10n_translation_update_delegate(System.IntPtr obj, System.IntPtr pd);
439 public delegate void efl_ui_l10n_translation_update_api_delegate(System.IntPtr obj);
441 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");
443 private static void translation_update(System.IntPtr obj, System.IntPtr pd)
445 Eina.Log.Debug("function efl_ui_l10n_translation_update was called");
446 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
452 ((ItemPartText)ws.Target).UpdateTranslation();
456 Eina.Log.Warning($"Callback error: {e.ToString()}");
457 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
464 efl_ui_l10n_translation_update_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
468 private static efl_ui_l10n_translation_update_delegate efl_ui_l10n_translation_update_static_delegate;
470 #pragma warning restore CA1707, CS1591, SA1300, SA1600