1 #pragma warning disable CS1591
3 using System.Runtime.InteropServices;
4 using System.Collections.Generic;
6 using System.ComponentModel;
7 namespace Efl { namespace Gfx {
8 /// <summary>Efl Gfx Text Class interface</summary>
9 [TextClassNativeInherit]
10 public interface TextClass :
11 Efl.Eo.IWrapper, IDisposable
13 /// <summary>Get font and font size from edje text class.
14 /// This function gets the font and the font size from text class. The font string will only be valid until the text class is changed or the edje object is deleted.</summary>
15 /// <param name="text_class">The text class name</param>
16 /// <param name="font">Font name</param>
17 /// <param name="size">Font Size</param>
18 /// <returns><c>true</c>, on success or <c>false</c>, on error</returns>
19 bool GetTextClass( System.String text_class, out System.String font, out Efl.Font.Size size);
20 /// <summary>Set Edje text class.
21 /// This function sets the text class for the Edje.</summary>
22 /// <param name="text_class">The text class name</param>
23 /// <param name="font">Font name</param>
24 /// <param name="size">Font Size</param>
25 /// <returns><c>true</c>, on success or <c>false</c>, on error</returns>
26 bool SetTextClass( System.String text_class, System.String font, Efl.Font.Size size);
27 /// <summary>Delete the text class.
28 /// This function deletes any values for the specified text class.
30 /// Deleting the text class will revert it to the values defined by <see cref="Efl.Gfx.TextClass.GetTextClass"/> or the text class defined in the theme file.
32 /// <param name="text_class">The text class to be deleted.</param>
33 /// <returns></returns>
34 void DelTextClass( System.String text_class);
36 /// <summary>Efl Gfx Text Class interface</summary>
37 sealed public class TextClassConcrete :
42 ///<summary>Pointer to the native class description.</summary>
43 public System.IntPtr NativeClass {
45 if (((object)this).GetType() == typeof (TextClassConcrete))
46 return Efl.Gfx.TextClassNativeInherit.GetEflClassStatic();
48 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
51 private System.IntPtr handle;
52 ///<summary>Pointer to the native instance.</summary>
53 public System.IntPtr NativeHandle {
54 get { return handle; }
56 [System.Runtime.InteropServices.DllImport(efl.Libs.Efl)] internal static extern System.IntPtr
57 efl_gfx_text_class_interface_get();
58 ///<summary>Internal usage: Constructs an instance from a native pointer. This is used when interacting with C code and should not be used directly.</summary>
59 public TextClassConcrete(System.IntPtr raw)
62 register_event_proxies();
64 ///<summary>Destructor.</summary>
69 ///<summary>Releases the underlying native instance.</summary>
70 void Dispose(bool disposing)
72 if (handle != System.IntPtr.Zero) {
73 Efl.Eo.Globals.efl_unref(handle);
74 handle = System.IntPtr.Zero;
77 ///<summary>Releases the underlying native instance.</summary>
81 GC.SuppressFinalize(this);
83 ///<summary>Casts obj into an instance of this type.</summary>
84 public static TextClassConcrete static_cast(Efl.Object obj)
87 throw new System.ArgumentNullException("obj");
88 return new TextClassConcrete(obj.NativeHandle);
90 ///<summary>Verifies if the given object is equal to this one.</summary>
91 public override bool Equals(object obj)
93 var other = obj as Efl.Object;
96 return this.NativeHandle == other.NativeHandle;
98 ///<summary>Gets the hash code for this object based on the native pointer it points to.</summary>
99 public override int GetHashCode()
101 return this.NativeHandle.ToInt32();
103 ///<summary>Turns the native pointer into a string representation.</summary>
104 public override String ToString()
106 return $"{this.GetType().Name}@[{this.NativeHandle.ToInt32():x}]";
108 void register_event_proxies()
111 /// <summary>Get font and font size from edje text class.
112 /// This function gets the font and the font size from text class. The font string will only be valid until the text class is changed or the edje object is deleted.</summary>
113 /// <param name="text_class">The text class name</param>
114 /// <param name="font">Font name</param>
115 /// <param name="size">Font Size</param>
116 /// <returns><c>true</c>, on success or <c>false</c>, on error</returns>
117 public bool GetTextClass( System.String text_class, out System.String font, out Efl.Font.Size size) {
118 var _ret_var = Efl.Gfx.TextClassNativeInherit.efl_gfx_text_class_get_ptr.Value.Delegate(this.NativeHandle, text_class, out font, out size);
119 Eina.Error.RaiseIfUnhandledException();
122 /// <summary>Set Edje text class.
123 /// This function sets the text class for the Edje.</summary>
124 /// <param name="text_class">The text class name</param>
125 /// <param name="font">Font name</param>
126 /// <param name="size">Font Size</param>
127 /// <returns><c>true</c>, on success or <c>false</c>, on error</returns>
128 public bool SetTextClass( System.String text_class, System.String font, Efl.Font.Size size) {
129 var _ret_var = Efl.Gfx.TextClassNativeInherit.efl_gfx_text_class_set_ptr.Value.Delegate(this.NativeHandle, text_class, font, size);
130 Eina.Error.RaiseIfUnhandledException();
133 /// <summary>Delete the text class.
134 /// This function deletes any values for the specified text class.
136 /// Deleting the text class will revert it to the values defined by <see cref="Efl.Gfx.TextClass.GetTextClass"/> or the text class defined in the theme file.
138 /// <param name="text_class">The text class to be deleted.</param>
139 /// <returns></returns>
140 public void DelTextClass( System.String text_class) {
141 Efl.Gfx.TextClassNativeInherit.efl_gfx_text_class_del_ptr.Value.Delegate(this.NativeHandle, text_class);
142 Eina.Error.RaiseIfUnhandledException();
145 public class TextClassNativeInherit : Efl.Eo.NativeClass{
146 public static Efl.Eo.NativeModule _Module = new Efl.Eo.NativeModule(efl.Libs.Efl);
147 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
149 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
150 if (efl_gfx_text_class_get_static_delegate == null)
151 efl_gfx_text_class_get_static_delegate = new efl_gfx_text_class_get_delegate(text_class_get);
152 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_gfx_text_class_get"), func = Marshal.GetFunctionPointerForDelegate(efl_gfx_text_class_get_static_delegate)});
153 if (efl_gfx_text_class_set_static_delegate == null)
154 efl_gfx_text_class_set_static_delegate = new efl_gfx_text_class_set_delegate(text_class_set);
155 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_gfx_text_class_set"), func = Marshal.GetFunctionPointerForDelegate(efl_gfx_text_class_set_static_delegate)});
156 if (efl_gfx_text_class_del_static_delegate == null)
157 efl_gfx_text_class_del_static_delegate = new efl_gfx_text_class_del_delegate(text_class_del);
158 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_gfx_text_class_del"), func = Marshal.GetFunctionPointerForDelegate(efl_gfx_text_class_del_static_delegate)});
161 public override IntPtr GetEflClass()
163 return Efl.Gfx.TextClassConcrete.efl_gfx_text_class_interface_get();
165 public static IntPtr GetEflClassStatic()
167 return Efl.Gfx.TextClassConcrete.efl_gfx_text_class_interface_get();
171 [return: MarshalAs(UnmanagedType.U1)] private delegate bool efl_gfx_text_class_get_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String text_class, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] out System.String font, out Efl.Font.Size size);
174 [return: MarshalAs(UnmanagedType.U1)] public delegate bool efl_gfx_text_class_get_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String text_class, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] out System.String font, out Efl.Font.Size size);
175 public static Efl.Eo.FunctionWrapper<efl_gfx_text_class_get_api_delegate> efl_gfx_text_class_get_ptr = new Efl.Eo.FunctionWrapper<efl_gfx_text_class_get_api_delegate>(_Module, "efl_gfx_text_class_get");
176 private static bool text_class_get(System.IntPtr obj, System.IntPtr pd, System.String text_class, out System.String font, out Efl.Font.Size size)
178 Eina.Log.Debug("function efl_gfx_text_class_get was called");
179 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.data_get(pd);
180 if(wrapper != null) {
181 System.String _out_font = default( System.String);
182 size = default(Efl.Font.Size); bool _ret_var = default(bool);
184 _ret_var = ((TextClass)wrapper).GetTextClass( text_class, out _out_font, out size);
185 } catch (Exception e) {
186 Eina.Log.Warning($"Callback error: {e.ToString()}");
187 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
192 return efl_gfx_text_class_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), text_class, out font, out size);
195 private static efl_gfx_text_class_get_delegate efl_gfx_text_class_get_static_delegate;
198 [return: MarshalAs(UnmanagedType.U1)] private delegate bool efl_gfx_text_class_set_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String text_class, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String font, Efl.Font.Size size);
201 [return: MarshalAs(UnmanagedType.U1)] public delegate bool efl_gfx_text_class_set_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String text_class, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String font, Efl.Font.Size size);
202 public static Efl.Eo.FunctionWrapper<efl_gfx_text_class_set_api_delegate> efl_gfx_text_class_set_ptr = new Efl.Eo.FunctionWrapper<efl_gfx_text_class_set_api_delegate>(_Module, "efl_gfx_text_class_set");
203 private static bool text_class_set(System.IntPtr obj, System.IntPtr pd, System.String text_class, System.String font, Efl.Font.Size size)
205 Eina.Log.Debug("function efl_gfx_text_class_set was called");
206 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.data_get(pd);
207 if(wrapper != null) {
208 bool _ret_var = default(bool);
210 _ret_var = ((TextClass)wrapper).SetTextClass( text_class, font, size);
211 } catch (Exception e) {
212 Eina.Log.Warning($"Callback error: {e.ToString()}");
213 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
217 return efl_gfx_text_class_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), text_class, font, size);
220 private static efl_gfx_text_class_set_delegate efl_gfx_text_class_set_static_delegate;
223 private delegate void efl_gfx_text_class_del_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String text_class);
226 public delegate void efl_gfx_text_class_del_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String text_class);
227 public static Efl.Eo.FunctionWrapper<efl_gfx_text_class_del_api_delegate> efl_gfx_text_class_del_ptr = new Efl.Eo.FunctionWrapper<efl_gfx_text_class_del_api_delegate>(_Module, "efl_gfx_text_class_del");
228 private static void text_class_del(System.IntPtr obj, System.IntPtr pd, System.String text_class)
230 Eina.Log.Debug("function efl_gfx_text_class_del was called");
231 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.data_get(pd);
232 if(wrapper != null) {
235 ((TextClass)wrapper).DelTextClass( text_class);
236 } catch (Exception e) {
237 Eina.Log.Warning($"Callback error: {e.ToString()}");
238 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
241 efl_gfx_text_class_del_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), text_class);
244 private static efl_gfx_text_class_del_delegate efl_gfx_text_class_del_static_delegate;