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 [Efl.Eo.BindingEntity]
15 public class ItemPartText : Efl.Ui.LayoutPart, Efl.IText, Efl.ITextMarkup, Efl.Ui.IL10n
17 ///<summary>Pointer to the native class description.</summary>
18 public override System.IntPtr NativeClass
22 if (((object)this).GetType() == typeof(ItemPartText))
24 return GetEflClassStatic();
28 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
33 [System.Runtime.InteropServices.DllImport(efl.Libs.Elementary)] internal static extern System.IntPtr
34 efl_ui_item_part_text_class_get();
35 /// <summary>Initializes a new instance of the <see cref="ItemPartText"/> class.</summary>
36 /// <param name="parent">Parent instance.</param>
37 public ItemPartText(Efl.Object parent= null
38 ) : base(efl_ui_item_part_text_class_get(), parent)
40 FinishInstantiation();
43 /// <summary>Constructor to be used when objects are expected to be constructed from native code.</summary>
44 /// <param name="ch">Tag struct storing the native handle of the object being constructed.</param>
45 protected ItemPartText(ConstructingHandle ch) : base(ch)
49 /// <summary>Initializes a new instance of the <see cref="ItemPartText"/> class.
50 /// Internal usage: Constructs an instance from a native pointer. This is used when interacting with C code and should not be used directly.</summary>
51 /// <param name="wh">The native pointer to be wrapped.</param>
52 protected ItemPartText(Efl.Eo.Globals.WrappingHandle wh) : base(wh)
56 /// <summary>Initializes a new instance of the <see cref="ItemPartText"/> class.
57 /// Internal usage: Constructor to forward the wrapper initialization to the root class that interfaces with native code. Should not be used directly.</summary>
58 /// <param name="baseKlass">The pointer to the base native Eo class.</param>
59 /// <param name="parent">The Efl.Object parent of this instance.</param>
60 protected ItemPartText(IntPtr baseKlass, Efl.Object parent) : base(baseKlass, parent)
64 /// <summary>Retrieves the text string currently being displayed by the given text object.
65 /// Do not free() the return value.
67 /// See also <see cref="Efl.IText.GetText"/>.
68 /// (Since EFL 1.22)</summary>
69 /// <returns>Text string to display on it.</returns>
70 virtual public System.String GetText() {
71 var _ret_var = Efl.ITextConcrete.NativeMethods.efl_text_get_ptr.Value.Delegate((IsGeneratedBindingClass ? this.NativeHandle : Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass)));
72 Eina.Error.RaiseIfUnhandledException();
75 /// <summary>Sets the text string to be displayed by the given text object.
76 /// See also <see cref="Efl.IText.GetText"/>.
77 /// (Since EFL 1.22)</summary>
78 /// <param name="text">Text string to display on it.</param>
79 virtual public void SetText(System.String text) {
80 Efl.ITextConcrete.NativeMethods.efl_text_set_ptr.Value.Delegate((IsGeneratedBindingClass ? this.NativeHandle : Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass)),text);
81 Eina.Error.RaiseIfUnhandledException();
83 /// <summary>Markup property</summary>
84 /// <returns>The markup-text representation set to this text.</returns>
85 virtual public System.String GetMarkup() {
86 var _ret_var = Efl.ITextMarkupConcrete.NativeMethods.efl_text_markup_get_ptr.Value.Delegate((IsGeneratedBindingClass ? this.NativeHandle : Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass)));
87 Eina.Error.RaiseIfUnhandledException();
90 /// <summary>Markup property</summary>
91 /// <param name="markup">The markup-text representation set to this text.</param>
92 virtual public void SetMarkup(System.String markup) {
93 Efl.ITextMarkupConcrete.NativeMethods.efl_text_markup_set_ptr.Value.Delegate((IsGeneratedBindingClass ? this.NativeHandle : Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass)),markup);
94 Eina.Error.RaiseIfUnhandledException();
96 /// <summary>A unique string to be translated.
97 /// 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.
99 /// Setting this property will enable translation for this object or part.</summary>
100 /// <param name="domain">A translation domain. If <c>null</c> this means the default domain is used.</param>
101 /// <returns>This returns the untranslated value of <c>label</c>. The translated string can usually be retrieved with <see cref="Efl.IText.GetText"/>.</returns>
102 virtual public System.String GetL10nText(out System.String domain) {
103 var _ret_var = Efl.Ui.IL10nConcrete.NativeMethods.efl_ui_l10n_text_get_ptr.Value.Delegate((IsGeneratedBindingClass ? this.NativeHandle : Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass)),out domain);
104 Eina.Error.RaiseIfUnhandledException();
107 /// <summary>Sets the new untranslated string and domain for this object.</summary>
108 /// <param name="label">A unique (untranslated) string.</param>
109 /// <param name="domain">A translation domain. If <c>null</c> this uses the default domain (eg. set by <c>textdomain</c>()).</param>
110 virtual public void SetL10nText(System.String label, System.String domain) {
111 Efl.Ui.IL10nConcrete.NativeMethods.efl_ui_l10n_text_set_ptr.Value.Delegate((IsGeneratedBindingClass ? this.NativeHandle : Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass)),label, domain);
112 Eina.Error.RaiseIfUnhandledException();
114 /// <summary>Requests this object to update its text strings for the current locale.
115 /// 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.
117 /// 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>
118 virtual public void UpdateTranslation() {
119 Efl.Ui.IL10nConcrete.NativeMethods.efl_ui_l10n_translation_update_ptr.Value.Delegate((IsGeneratedBindingClass ? this.NativeHandle : Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass)));
120 Eina.Error.RaiseIfUnhandledException();
122 /// <summary>Markup property</summary>
123 /// <value>The markup-text representation set to this text.</value>
124 public System.String Markup {
125 get { return GetMarkup(); }
126 set { SetMarkup(value); }
128 private static IntPtr GetEflClassStatic()
130 return Efl.Ui.ItemPartText.efl_ui_item_part_text_class_get();
132 /// <summary>Wrapper for native methods and virtual method delegates.
133 /// For internal use by generated code only.</summary>
134 public new class NativeMethods : Efl.Ui.LayoutPart.NativeMethods
136 private static Efl.Eo.NativeModule Module = new Efl.Eo.NativeModule( efl.Libs.Elementary);
137 /// <summary>Gets the list of Eo operations to override.</summary>
138 /// <returns>The list of Eo operations to be overload.</returns>
139 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
141 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
142 var methods = Efl.Eo.Globals.GetUserMethods(type);
144 if (efl_text_get_static_delegate == null)
146 efl_text_get_static_delegate = new efl_text_get_delegate(text_get);
149 if (methods.FirstOrDefault(m => m.Name == "GetText") != null)
151 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) });
154 if (efl_text_set_static_delegate == null)
156 efl_text_set_static_delegate = new efl_text_set_delegate(text_set);
159 if (methods.FirstOrDefault(m => m.Name == "SetText") != null)
161 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) });
164 if (efl_text_markup_get_static_delegate == null)
166 efl_text_markup_get_static_delegate = new efl_text_markup_get_delegate(markup_get);
169 if (methods.FirstOrDefault(m => m.Name == "GetMarkup") != null)
171 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) });
174 if (efl_text_markup_set_static_delegate == null)
176 efl_text_markup_set_static_delegate = new efl_text_markup_set_delegate(markup_set);
179 if (methods.FirstOrDefault(m => m.Name == "SetMarkup") != null)
181 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) });
184 if (efl_ui_l10n_text_get_static_delegate == null)
186 efl_ui_l10n_text_get_static_delegate = new efl_ui_l10n_text_get_delegate(l10n_text_get);
189 if (methods.FirstOrDefault(m => m.Name == "GetL10nText") != null)
191 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) });
194 if (efl_ui_l10n_text_set_static_delegate == null)
196 efl_ui_l10n_text_set_static_delegate = new efl_ui_l10n_text_set_delegate(l10n_text_set);
199 if (methods.FirstOrDefault(m => m.Name == "SetL10nText") != null)
201 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) });
204 if (efl_ui_l10n_translation_update_static_delegate == null)
206 efl_ui_l10n_translation_update_static_delegate = new efl_ui_l10n_translation_update_delegate(translation_update);
209 if (methods.FirstOrDefault(m => m.Name == "UpdateTranslation") != null)
211 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) });
214 descs.AddRange(base.GetEoOps(type));
217 /// <summary>Returns the Eo class for the native methods of this class.</summary>
218 /// <returns>The native class pointer.</returns>
219 public override IntPtr GetEflClass()
221 return Efl.Ui.ItemPartText.efl_ui_item_part_text_class_get();
224 #pragma warning disable CA1707, CS1591, SA1300, SA1600
226 [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))]
227 private delegate System.String efl_text_get_delegate(System.IntPtr obj, System.IntPtr pd);
229 [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))]
230 public delegate System.String efl_text_get_api_delegate(System.IntPtr obj);
232 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");
234 private static System.String text_get(System.IntPtr obj, System.IntPtr pd)
236 Eina.Log.Debug("function efl_text_get was called");
237 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
240 System.String _ret_var = default(System.String);
243 _ret_var = ((ItemPartText)ws.Target).GetText();
247 Eina.Log.Warning($"Callback error: {e.ToString()}");
248 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
256 return efl_text_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
260 private static efl_text_get_delegate efl_text_get_static_delegate;
263 private delegate void efl_text_set_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String text);
266 public delegate void efl_text_set_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String text);
268 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");
270 private static void text_set(System.IntPtr obj, System.IntPtr pd, System.String text)
272 Eina.Log.Debug("function efl_text_set was called");
273 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
279 ((ItemPartText)ws.Target).SetText(text);
283 Eina.Log.Warning($"Callback error: {e.ToString()}");
284 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
291 efl_text_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), text);
295 private static efl_text_set_delegate efl_text_set_static_delegate;
297 [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))]
298 private delegate System.String efl_text_markup_get_delegate(System.IntPtr obj, System.IntPtr pd);
300 [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))]
301 public delegate System.String efl_text_markup_get_api_delegate(System.IntPtr obj);
303 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");
305 private static System.String markup_get(System.IntPtr obj, System.IntPtr pd)
307 Eina.Log.Debug("function efl_text_markup_get was called");
308 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
311 System.String _ret_var = default(System.String);
314 _ret_var = ((ItemPartText)ws.Target).GetMarkup();
318 Eina.Log.Warning($"Callback error: {e.ToString()}");
319 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
327 return efl_text_markup_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
331 private static efl_text_markup_get_delegate efl_text_markup_get_static_delegate;
334 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);
337 public delegate void efl_text_markup_set_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String markup);
339 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");
341 private static void markup_set(System.IntPtr obj, System.IntPtr pd, System.String markup)
343 Eina.Log.Debug("function efl_text_markup_set was called");
344 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
350 ((ItemPartText)ws.Target).SetMarkup(markup);
354 Eina.Log.Warning($"Callback error: {e.ToString()}");
355 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
362 efl_text_markup_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), markup);
366 private static efl_text_markup_set_delegate efl_text_markup_set_static_delegate;
368 [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))]
369 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);
371 [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))]
372 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);
374 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");
376 private static System.String l10n_text_get(System.IntPtr obj, System.IntPtr pd, out System.String domain)
378 Eina.Log.Debug("function efl_ui_l10n_text_get was called");
379 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
382 System.String _out_domain = default(System.String);
383 System.String _ret_var = default(System.String);
386 _ret_var = ((ItemPartText)ws.Target).GetL10nText(out _out_domain);
390 Eina.Log.Warning($"Callback error: {e.ToString()}");
391 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
394 domain = _out_domain;
400 return efl_ui_l10n_text_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), out domain);
404 private static efl_ui_l10n_text_get_delegate efl_ui_l10n_text_get_static_delegate;
407 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);
410 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);
412 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");
414 private static void l10n_text_set(System.IntPtr obj, System.IntPtr pd, System.String label, System.String domain)
416 Eina.Log.Debug("function efl_ui_l10n_text_set was called");
417 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
423 ((ItemPartText)ws.Target).SetL10nText(label, domain);
427 Eina.Log.Warning($"Callback error: {e.ToString()}");
428 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
435 efl_ui_l10n_text_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), label, domain);
439 private static efl_ui_l10n_text_set_delegate efl_ui_l10n_text_set_static_delegate;
442 private delegate void efl_ui_l10n_translation_update_delegate(System.IntPtr obj, System.IntPtr pd);
445 public delegate void efl_ui_l10n_translation_update_api_delegate(System.IntPtr obj);
447 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");
449 private static void translation_update(System.IntPtr obj, System.IntPtr pd)
451 Eina.Log.Debug("function efl_ui_l10n_translation_update was called");
452 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
458 ((ItemPartText)ws.Target).UpdateTranslation();
462 Eina.Log.Warning($"Callback error: {e.ToString()}");
463 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
470 efl_ui_l10n_translation_update_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
474 private static efl_ui_l10n_translation_update_delegate efl_ui_l10n_translation_update_static_delegate;
476 #pragma warning restore CA1707, CS1591, SA1300, SA1600