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>A common Internationalization interface for UI objects.</summary>
13 [Efl.Ui.II18nConcrete.NativeMethods]
14 [Efl.Eo.BindingEntity]
15 public interface II18n :
16 Efl.Eo.IWrapper, IDisposable
18 /// <summary>Whether this object should be mirrored.
19 /// If mirrored, an object is in RTL (right to left) mode instead of LTR (left to right).</summary>
20 /// <returns><c>true</c> for RTL, <c>false</c> for LTR (default).</returns>
22 /// <summary>Whether this object should be mirrored.
23 /// If mirrored, an object is in RTL (right to left) mode instead of LTR (left to right).</summary>
24 /// <param name="rtl"><c>true</c> for RTL, <c>false</c> for LTR (default).</param>
25 void SetMirrored(bool rtl);
26 /// <summary>Whether the property <see cref="Efl.Ui.II18n.Mirrored"/> should be set automatically.
27 /// If enabled, the system or application configuration will be used to set the value of <see cref="Efl.Ui.II18n.Mirrored"/>.
29 /// This property may be implemented by high-level widgets (in Efl.Ui) but not by low-level widgets (in <see cref="Efl.Canvas.IScene"/>) as the configuration should affect only high-level widgets.</summary>
30 /// <returns>Whether the widget uses automatic mirroring</returns>
31 bool GetMirroredAutomatic();
32 /// <summary>Whether the property <see cref="Efl.Ui.II18n.Mirrored"/> should be set automatically.
33 /// If enabled, the system or application configuration will be used to set the value of <see cref="Efl.Ui.II18n.Mirrored"/>.
35 /// This property may be implemented by high-level widgets (in Efl.Ui) but not by low-level widgets (in <see cref="Efl.Canvas.IScene"/>) as the configuration should affect only high-level widgets.</summary>
36 /// <param name="automatic">Whether the widget uses automatic mirroring</param>
37 void SetMirroredAutomatic(bool automatic);
38 /// <summary>Gets the language for this object.</summary>
39 /// <returns>The current language.</returns>
40 System.String GetLanguage();
41 /// <summary>Sets the language for this object.</summary>
42 /// <param name="language">The current language.</param>
43 void SetLanguage(System.String language);
44 /// <summary>Whether this object should be mirrored.
45 /// If mirrored, an object is in RTL (right to left) mode instead of LTR (left to right).</summary>
46 /// <value><c>true</c> for RTL, <c>false</c> for LTR (default).</value>
51 /// <summary>Whether the property <see cref="Efl.Ui.II18n.Mirrored"/> should be set automatically.
52 /// If enabled, the system or application configuration will be used to set the value of <see cref="Efl.Ui.II18n.Mirrored"/>.
54 /// This property may be implemented by high-level widgets (in Efl.Ui) but not by low-level widgets (in <see cref="Efl.Canvas.IScene"/>) as the configuration should affect only high-level widgets.</summary>
55 /// <value>Whether the widget uses automatic mirroring</value>
56 bool MirroredAutomatic {
60 /// <summary>The (human) language for this object.</summary>
61 /// <value>The current language.</value>
62 System.String Language {
67 /// <summary>A common Internationalization interface for UI objects.</summary>
68 sealed public class II18nConcrete :
73 ///<summary>Pointer to the native class description.</summary>
74 public override System.IntPtr NativeClass
78 if (((object)this).GetType() == typeof(II18nConcrete))
80 return GetEflClassStatic();
84 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
89 /// <summary>Constructor to be used when objects are expected to be constructed from native code.</summary>
90 /// <param name="ch">Tag struct storing the native handle of the object being constructed.</param>
91 private II18nConcrete(ConstructingHandle ch) : base(ch)
95 [System.Runtime.InteropServices.DllImport("libefl.so.1")] internal static extern System.IntPtr
96 efl_ui_i18n_interface_get();
97 /// <summary>Initializes a new instance of the <see cref="II18n"/> class.
98 /// Internal usage: This is used when interacting with C code and should not be used directly.</summary>
99 /// <param name="wh">The native pointer to be wrapped.</param>
100 private II18nConcrete(Efl.Eo.Globals.WrappingHandle wh) : base(wh)
104 /// <summary>Whether this object should be mirrored.
105 /// If mirrored, an object is in RTL (right to left) mode instead of LTR (left to right).</summary>
106 /// <returns><c>true</c> for RTL, <c>false</c> for LTR (default).</returns>
107 public bool GetMirrored() {
108 var _ret_var = Efl.Ui.II18nConcrete.NativeMethods.efl_ui_mirrored_get_ptr.Value.Delegate(this.NativeHandle);
109 Eina.Error.RaiseIfUnhandledException();
112 /// <summary>Whether this object should be mirrored.
113 /// If mirrored, an object is in RTL (right to left) mode instead of LTR (left to right).</summary>
114 /// <param name="rtl"><c>true</c> for RTL, <c>false</c> for LTR (default).</param>
115 public void SetMirrored(bool rtl) {
116 Efl.Ui.II18nConcrete.NativeMethods.efl_ui_mirrored_set_ptr.Value.Delegate(this.NativeHandle,rtl);
117 Eina.Error.RaiseIfUnhandledException();
119 /// <summary>Whether the property <see cref="Efl.Ui.II18n.Mirrored"/> should be set automatically.
120 /// If enabled, the system or application configuration will be used to set the value of <see cref="Efl.Ui.II18n.Mirrored"/>.
122 /// This property may be implemented by high-level widgets (in Efl.Ui) but not by low-level widgets (in <see cref="Efl.Canvas.IScene"/>) as the configuration should affect only high-level widgets.</summary>
123 /// <returns>Whether the widget uses automatic mirroring</returns>
124 public bool GetMirroredAutomatic() {
125 var _ret_var = Efl.Ui.II18nConcrete.NativeMethods.efl_ui_mirrored_automatic_get_ptr.Value.Delegate(this.NativeHandle);
126 Eina.Error.RaiseIfUnhandledException();
129 /// <summary>Whether the property <see cref="Efl.Ui.II18n.Mirrored"/> should be set automatically.
130 /// If enabled, the system or application configuration will be used to set the value of <see cref="Efl.Ui.II18n.Mirrored"/>.
132 /// This property may be implemented by high-level widgets (in Efl.Ui) but not by low-level widgets (in <see cref="Efl.Canvas.IScene"/>) as the configuration should affect only high-level widgets.</summary>
133 /// <param name="automatic">Whether the widget uses automatic mirroring</param>
134 public void SetMirroredAutomatic(bool automatic) {
135 Efl.Ui.II18nConcrete.NativeMethods.efl_ui_mirrored_automatic_set_ptr.Value.Delegate(this.NativeHandle,automatic);
136 Eina.Error.RaiseIfUnhandledException();
138 /// <summary>Gets the language for this object.</summary>
139 /// <returns>The current language.</returns>
140 public System.String GetLanguage() {
141 var _ret_var = Efl.Ui.II18nConcrete.NativeMethods.efl_ui_language_get_ptr.Value.Delegate(this.NativeHandle);
142 Eina.Error.RaiseIfUnhandledException();
145 /// <summary>Sets the language for this object.</summary>
146 /// <param name="language">The current language.</param>
147 public void SetLanguage(System.String language) {
148 Efl.Ui.II18nConcrete.NativeMethods.efl_ui_language_set_ptr.Value.Delegate(this.NativeHandle,language);
149 Eina.Error.RaiseIfUnhandledException();
151 /// <summary>Whether this object should be mirrored.
152 /// If mirrored, an object is in RTL (right to left) mode instead of LTR (left to right).</summary>
153 /// <value><c>true</c> for RTL, <c>false</c> for LTR (default).</value>
154 public bool Mirrored {
155 get { return GetMirrored(); }
156 set { SetMirrored(value); }
158 /// <summary>Whether the property <see cref="Efl.Ui.II18n.Mirrored"/> should be set automatically.
159 /// If enabled, the system or application configuration will be used to set the value of <see cref="Efl.Ui.II18n.Mirrored"/>.
161 /// This property may be implemented by high-level widgets (in Efl.Ui) but not by low-level widgets (in <see cref="Efl.Canvas.IScene"/>) as the configuration should affect only high-level widgets.</summary>
162 /// <value>Whether the widget uses automatic mirroring</value>
163 public bool MirroredAutomatic {
164 get { return GetMirroredAutomatic(); }
165 set { SetMirroredAutomatic(value); }
167 /// <summary>The (human) language for this object.</summary>
168 /// <value>The current language.</value>
169 public System.String Language {
170 get { return GetLanguage(); }
171 set { SetLanguage(value); }
173 private static IntPtr GetEflClassStatic()
175 return Efl.Ui.II18nConcrete.efl_ui_i18n_interface_get();
177 /// <summary>Wrapper for native methods and virtual method delegates.
178 /// For internal use by generated code only.</summary>
179 public new class NativeMethods : Efl.Eo.EoWrapper.NativeMethods
181 private static Efl.Eo.NativeModule Module = new Efl.Eo.NativeModule( efl.Libs.Efl);
182 /// <summary>Gets the list of Eo operations to override.</summary>
183 /// <returns>The list of Eo operations to be overload.</returns>
184 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
186 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
187 var methods = Efl.Eo.Globals.GetUserMethods(type);
189 if (efl_ui_mirrored_get_static_delegate == null)
191 efl_ui_mirrored_get_static_delegate = new efl_ui_mirrored_get_delegate(mirrored_get);
194 if (methods.FirstOrDefault(m => m.Name == "GetMirrored") != null)
196 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_ui_mirrored_get"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_mirrored_get_static_delegate) });
199 if (efl_ui_mirrored_set_static_delegate == null)
201 efl_ui_mirrored_set_static_delegate = new efl_ui_mirrored_set_delegate(mirrored_set);
204 if (methods.FirstOrDefault(m => m.Name == "SetMirrored") != null)
206 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_ui_mirrored_set"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_mirrored_set_static_delegate) });
209 if (efl_ui_mirrored_automatic_get_static_delegate == null)
211 efl_ui_mirrored_automatic_get_static_delegate = new efl_ui_mirrored_automatic_get_delegate(mirrored_automatic_get);
214 if (methods.FirstOrDefault(m => m.Name == "GetMirroredAutomatic") != null)
216 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_ui_mirrored_automatic_get"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_mirrored_automatic_get_static_delegate) });
219 if (efl_ui_mirrored_automatic_set_static_delegate == null)
221 efl_ui_mirrored_automatic_set_static_delegate = new efl_ui_mirrored_automatic_set_delegate(mirrored_automatic_set);
224 if (methods.FirstOrDefault(m => m.Name == "SetMirroredAutomatic") != null)
226 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_ui_mirrored_automatic_set"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_mirrored_automatic_set_static_delegate) });
229 if (efl_ui_language_get_static_delegate == null)
231 efl_ui_language_get_static_delegate = new efl_ui_language_get_delegate(language_get);
234 if (methods.FirstOrDefault(m => m.Name == "GetLanguage") != null)
236 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_ui_language_get"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_language_get_static_delegate) });
239 if (efl_ui_language_set_static_delegate == null)
241 efl_ui_language_set_static_delegate = new efl_ui_language_set_delegate(language_set);
244 if (methods.FirstOrDefault(m => m.Name == "SetLanguage") != null)
246 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_ui_language_set"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_language_set_static_delegate) });
251 /// <summary>Returns the Eo class for the native methods of this class.</summary>
252 /// <returns>The native class pointer.</returns>
253 public override IntPtr GetEflClass()
255 return Efl.Ui.II18nConcrete.efl_ui_i18n_interface_get();
258 #pragma warning disable CA1707, CS1591, SA1300, SA1600
260 [return: MarshalAs(UnmanagedType.U1)]
261 private delegate bool efl_ui_mirrored_get_delegate(System.IntPtr obj, System.IntPtr pd);
263 [return: MarshalAs(UnmanagedType.U1)]
264 public delegate bool efl_ui_mirrored_get_api_delegate(System.IntPtr obj);
266 public static Efl.Eo.FunctionWrapper<efl_ui_mirrored_get_api_delegate> efl_ui_mirrored_get_ptr = new Efl.Eo.FunctionWrapper<efl_ui_mirrored_get_api_delegate>(Module, "efl_ui_mirrored_get");
268 private static bool mirrored_get(System.IntPtr obj, System.IntPtr pd)
270 Eina.Log.Debug("function efl_ui_mirrored_get was called");
271 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
274 bool _ret_var = default(bool);
277 _ret_var = ((II18n)ws.Target).GetMirrored();
281 Eina.Log.Warning($"Callback error: {e.ToString()}");
282 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
290 return efl_ui_mirrored_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
294 private static efl_ui_mirrored_get_delegate efl_ui_mirrored_get_static_delegate;
297 private delegate void efl_ui_mirrored_set_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.U1)] bool rtl);
300 public delegate void efl_ui_mirrored_set_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.U1)] bool rtl);
302 public static Efl.Eo.FunctionWrapper<efl_ui_mirrored_set_api_delegate> efl_ui_mirrored_set_ptr = new Efl.Eo.FunctionWrapper<efl_ui_mirrored_set_api_delegate>(Module, "efl_ui_mirrored_set");
304 private static void mirrored_set(System.IntPtr obj, System.IntPtr pd, bool rtl)
306 Eina.Log.Debug("function efl_ui_mirrored_set was called");
307 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
313 ((II18n)ws.Target).SetMirrored(rtl);
317 Eina.Log.Warning($"Callback error: {e.ToString()}");
318 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
325 efl_ui_mirrored_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), rtl);
329 private static efl_ui_mirrored_set_delegate efl_ui_mirrored_set_static_delegate;
331 [return: MarshalAs(UnmanagedType.U1)]
332 private delegate bool efl_ui_mirrored_automatic_get_delegate(System.IntPtr obj, System.IntPtr pd);
334 [return: MarshalAs(UnmanagedType.U1)]
335 public delegate bool efl_ui_mirrored_automatic_get_api_delegate(System.IntPtr obj);
337 public static Efl.Eo.FunctionWrapper<efl_ui_mirrored_automatic_get_api_delegate> efl_ui_mirrored_automatic_get_ptr = new Efl.Eo.FunctionWrapper<efl_ui_mirrored_automatic_get_api_delegate>(Module, "efl_ui_mirrored_automatic_get");
339 private static bool mirrored_automatic_get(System.IntPtr obj, System.IntPtr pd)
341 Eina.Log.Debug("function efl_ui_mirrored_automatic_get was called");
342 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
345 bool _ret_var = default(bool);
348 _ret_var = ((II18n)ws.Target).GetMirroredAutomatic();
352 Eina.Log.Warning($"Callback error: {e.ToString()}");
353 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
361 return efl_ui_mirrored_automatic_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
365 private static efl_ui_mirrored_automatic_get_delegate efl_ui_mirrored_automatic_get_static_delegate;
368 private delegate void efl_ui_mirrored_automatic_set_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.U1)] bool automatic);
371 public delegate void efl_ui_mirrored_automatic_set_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.U1)] bool automatic);
373 public static Efl.Eo.FunctionWrapper<efl_ui_mirrored_automatic_set_api_delegate> efl_ui_mirrored_automatic_set_ptr = new Efl.Eo.FunctionWrapper<efl_ui_mirrored_automatic_set_api_delegate>(Module, "efl_ui_mirrored_automatic_set");
375 private static void mirrored_automatic_set(System.IntPtr obj, System.IntPtr pd, bool automatic)
377 Eina.Log.Debug("function efl_ui_mirrored_automatic_set was called");
378 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
384 ((II18n)ws.Target).SetMirroredAutomatic(automatic);
388 Eina.Log.Warning($"Callback error: {e.ToString()}");
389 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
396 efl_ui_mirrored_automatic_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), automatic);
400 private static efl_ui_mirrored_automatic_set_delegate efl_ui_mirrored_automatic_set_static_delegate;
402 [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))]
403 private delegate System.String efl_ui_language_get_delegate(System.IntPtr obj, System.IntPtr pd);
405 [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))]
406 public delegate System.String efl_ui_language_get_api_delegate(System.IntPtr obj);
408 public static Efl.Eo.FunctionWrapper<efl_ui_language_get_api_delegate> efl_ui_language_get_ptr = new Efl.Eo.FunctionWrapper<efl_ui_language_get_api_delegate>(Module, "efl_ui_language_get");
410 private static System.String language_get(System.IntPtr obj, System.IntPtr pd)
412 Eina.Log.Debug("function efl_ui_language_get was called");
413 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
416 System.String _ret_var = default(System.String);
419 _ret_var = ((II18n)ws.Target).GetLanguage();
423 Eina.Log.Warning($"Callback error: {e.ToString()}");
424 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
432 return efl_ui_language_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
436 private static efl_ui_language_get_delegate efl_ui_language_get_static_delegate;
439 private delegate void efl_ui_language_set_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String language);
442 public delegate void efl_ui_language_set_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String language);
444 public static Efl.Eo.FunctionWrapper<efl_ui_language_set_api_delegate> efl_ui_language_set_ptr = new Efl.Eo.FunctionWrapper<efl_ui_language_set_api_delegate>(Module, "efl_ui_language_set");
446 private static void language_set(System.IntPtr obj, System.IntPtr pd, System.String language)
448 Eina.Log.Debug("function efl_ui_language_set was called");
449 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
455 ((II18n)ws.Target).SetLanguage(language);
459 Eina.Log.Warning($"Callback error: {e.ToString()}");
460 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
467 efl_ui_language_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), language);
471 private static efl_ui_language_set_delegate efl_ui_language_set_static_delegate;
473 #pragma warning restore CA1707, CS1591, SA1300, SA1600