1 #pragma warning disable CS1591
3 using System.Runtime.InteropServices;
4 using System.Collections.Generic;
6 using System.ComponentModel;
7 namespace Efl { namespace Ui {
8 /// <summary>Elementary radio class</summary>
10 public class Radio : Efl.Ui.Check, Efl.Eo.IWrapper
12 ///<summary>Pointer to the native class description.</summary>
13 public override System.IntPtr NativeClass {
15 if (((object)this).GetType() == typeof (Radio))
16 return Efl.Ui.RadioNativeInherit.GetEflClassStatic();
18 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
21 [System.Runtime.InteropServices.DllImport(efl.Libs.Elementary)] internal static extern System.IntPtr
22 efl_ui_radio_class_get();
23 ///<summary>Creates a new instance.</summary>
24 ///<param name="parent">Parent instance.</param>
25 ///<param name="style">The widget style to use. See <see cref="Efl.Ui.Widget.SetStyle"/></param>
26 public Radio(Efl.Object parent
27 , System.String style = null) :
28 base(efl_ui_radio_class_get(), typeof(Radio), parent)
30 if (Efl.Eo.Globals.ParamHelperCheck(style))
31 SetStyle(Efl.Eo.Globals.GetParamHelper(style));
32 FinishInstantiation();
34 ///<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>
35 protected Radio(System.IntPtr raw) : base(raw)
37 RegisterEventProxies();
39 ///<summary>Internal usage: Constructor to forward the wrapper initialization to the root class that interfaces with native code. Should not be used directly.</summary>
40 protected Radio(IntPtr base_klass, System.Type managed_type, Efl.Object parent) : base(base_klass, managed_type, parent) {}
41 ///<summary>Verifies if the given object is equal to this one.</summary>
42 public override bool Equals(object obj)
44 var other = obj as Efl.Object;
47 return this.NativeHandle == other.NativeHandle;
49 ///<summary>Gets the hash code for this object based on the native pointer it points to.</summary>
50 public override int GetHashCode()
52 return this.NativeHandle.ToInt32();
54 ///<summary>Turns the native pointer into a string representation.</summary>
55 public override String ToString()
57 return $"{this.GetType().Name}@[{this.NativeHandle.ToInt32():x}]";
59 ///<summary>Register the Eo event wrappers making the bridge to C# events. Internal usage only.</summary>
60 protected override void RegisterEventProxies()
62 base.RegisterEventProxies();
64 /// <summary>Get the integer value that this radio object represents.
65 /// This gets the value of the radio.</summary>
66 /// <returns>The value to use if this radio object is selected.</returns>
67 virtual public int GetStateValue() {
68 var _ret_var = Efl.Ui.RadioNativeInherit.efl_ui_radio_state_value_get_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle));
69 Eina.Error.RaiseIfUnhandledException();
72 /// <summary>Set the integer value that this radio object represents.
73 /// This sets the value of the radio.</summary>
74 /// <param name="value">The value to use if this radio object is selected.</param>
75 /// <returns></returns>
76 virtual public void SetStateValue( int value) {
77 Efl.Ui.RadioNativeInherit.efl_ui_radio_state_value_set_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle), value);
78 Eina.Error.RaiseIfUnhandledException();
80 /// <summary>Set a convenience pointer to an integer, which changes when radio group value changes.
81 /// This sets a pointer to an integer that in addition to the radio object state will also be modified directly. To stop setting the object pointed to, simply use NULL as the valuep argument. If valuep is not NULL then when called, the radio object state will also be modified to reflect the value of the integer valuep points to, just like calling elm_radio_value_set().</summary>
82 /// <param name="valuep">Pointer to the integer to modify</param>
83 /// <returns></returns>
84 virtual public void SetValuePointer( int valuep) {
85 var _in_valuep = Eina.PrimitiveConversion.ManagedToPointerAlloc(valuep);
86 Efl.Ui.RadioNativeInherit.efl_ui_radio_value_pointer_set_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle), _in_valuep);
87 Eina.Error.RaiseIfUnhandledException();
89 /// <summary>Get the selected radio object.</summary>
90 /// <returns>The selected radio object</returns>
91 virtual public Efl.Canvas.Object GetSelectedObject() {
92 var _ret_var = Efl.Ui.RadioNativeInherit.efl_ui_radio_selected_object_get_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle));
93 Eina.Error.RaiseIfUnhandledException();
96 /// <summary>Add this radio to a group of other radio objects
97 /// Radio objects work in groups. Each member should have a different integer value assigned. In order to have them work as a group, they need to know about each other. This adds the given radio object to the group of which the group object indicated is a member.</summary>
98 /// <param name="group">Any radio object whose group the obj is to join.</param>
99 /// <returns></returns>
100 virtual public void AddGroup( Efl.Ui.Radio group) {
101 Efl.Ui.RadioNativeInherit.efl_ui_radio_group_add_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle), group);
102 Eina.Error.RaiseIfUnhandledException();
104 /// <summary>Get the integer value that this radio object represents.
105 /// This gets the value of the radio.</summary>
106 /// <value>The value to use if this radio object is selected.</value>
107 public int StateValue {
108 get { return GetStateValue(); }
109 set { SetStateValue( value); }
111 /// <summary>Set a convenience pointer to an integer, which changes when radio group value changes.
112 /// This sets a pointer to an integer that in addition to the radio object state will also be modified directly. To stop setting the object pointed to, simply use NULL as the valuep argument. If valuep is not NULL then when called, the radio object state will also be modified to reflect the value of the integer valuep points to, just like calling elm_radio_value_set().</summary>
113 /// <value>Pointer to the integer to modify</value>
114 public int ValuePointer {
115 set { SetValuePointer( value); }
117 /// <summary>Get the selected radio object.</summary>
118 /// <value>The selected radio object</value>
119 public Efl.Canvas.Object SelectedObject {
120 get { return GetSelectedObject(); }
122 private static IntPtr GetEflClassStatic()
124 return Efl.Ui.Radio.efl_ui_radio_class_get();
127 public class RadioNativeInherit : Efl.Ui.CheckNativeInherit{
128 public new static Efl.Eo.NativeModule _Module = new Efl.Eo.NativeModule(efl.Libs.Elementary);
129 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
131 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
132 var methods = Efl.Eo.Globals.GetUserMethods(type);
133 if (efl_ui_radio_state_value_get_static_delegate == null)
134 efl_ui_radio_state_value_get_static_delegate = new efl_ui_radio_state_value_get_delegate(state_value_get);
135 if (methods.FirstOrDefault(m => m.Name == "GetStateValue") != null)
136 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_ui_radio_state_value_get"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_radio_state_value_get_static_delegate)});
137 if (efl_ui_radio_state_value_set_static_delegate == null)
138 efl_ui_radio_state_value_set_static_delegate = new efl_ui_radio_state_value_set_delegate(state_value_set);
139 if (methods.FirstOrDefault(m => m.Name == "SetStateValue") != null)
140 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_ui_radio_state_value_set"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_radio_state_value_set_static_delegate)});
141 if (efl_ui_radio_value_pointer_set_static_delegate == null)
142 efl_ui_radio_value_pointer_set_static_delegate = new efl_ui_radio_value_pointer_set_delegate(value_pointer_set);
143 if (methods.FirstOrDefault(m => m.Name == "SetValuePointer") != null)
144 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_ui_radio_value_pointer_set"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_radio_value_pointer_set_static_delegate)});
145 if (efl_ui_radio_selected_object_get_static_delegate == null)
146 efl_ui_radio_selected_object_get_static_delegate = new efl_ui_radio_selected_object_get_delegate(selected_object_get);
147 if (methods.FirstOrDefault(m => m.Name == "GetSelectedObject") != null)
148 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_ui_radio_selected_object_get"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_radio_selected_object_get_static_delegate)});
149 if (efl_ui_radio_group_add_static_delegate == null)
150 efl_ui_radio_group_add_static_delegate = new efl_ui_radio_group_add_delegate(group_add);
151 if (methods.FirstOrDefault(m => m.Name == "AddGroup") != null)
152 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_ui_radio_group_add"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_radio_group_add_static_delegate)});
153 descs.AddRange(base.GetEoOps(type));
156 public override IntPtr GetEflClass()
158 return Efl.Ui.Radio.efl_ui_radio_class_get();
160 public static new IntPtr GetEflClassStatic()
162 return Efl.Ui.Radio.efl_ui_radio_class_get();
166 private delegate int efl_ui_radio_state_value_get_delegate(System.IntPtr obj, System.IntPtr pd);
169 public delegate int efl_ui_radio_state_value_get_api_delegate(System.IntPtr obj);
170 public static Efl.Eo.FunctionWrapper<efl_ui_radio_state_value_get_api_delegate> efl_ui_radio_state_value_get_ptr = new Efl.Eo.FunctionWrapper<efl_ui_radio_state_value_get_api_delegate>(_Module, "efl_ui_radio_state_value_get");
171 private static int state_value_get(System.IntPtr obj, System.IntPtr pd)
173 Eina.Log.Debug("function efl_ui_radio_state_value_get was called");
174 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
175 if(wrapper != null) {
176 int _ret_var = default(int);
178 _ret_var = ((Radio)wrapper).GetStateValue();
179 } catch (Exception e) {
180 Eina.Log.Warning($"Callback error: {e.ToString()}");
181 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
185 return efl_ui_radio_state_value_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
188 private static efl_ui_radio_state_value_get_delegate efl_ui_radio_state_value_get_static_delegate;
191 private delegate void efl_ui_radio_state_value_set_delegate(System.IntPtr obj, System.IntPtr pd, int value);
194 public delegate void efl_ui_radio_state_value_set_api_delegate(System.IntPtr obj, int value);
195 public static Efl.Eo.FunctionWrapper<efl_ui_radio_state_value_set_api_delegate> efl_ui_radio_state_value_set_ptr = new Efl.Eo.FunctionWrapper<efl_ui_radio_state_value_set_api_delegate>(_Module, "efl_ui_radio_state_value_set");
196 private static void state_value_set(System.IntPtr obj, System.IntPtr pd, int value)
198 Eina.Log.Debug("function efl_ui_radio_state_value_set was called");
199 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
200 if(wrapper != null) {
203 ((Radio)wrapper).SetStateValue( value);
204 } catch (Exception e) {
205 Eina.Log.Warning($"Callback error: {e.ToString()}");
206 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
209 efl_ui_radio_state_value_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), value);
212 private static efl_ui_radio_state_value_set_delegate efl_ui_radio_state_value_set_static_delegate;
215 private delegate void efl_ui_radio_value_pointer_set_delegate(System.IntPtr obj, System.IntPtr pd, System.IntPtr valuep);
218 public delegate void efl_ui_radio_value_pointer_set_api_delegate(System.IntPtr obj, System.IntPtr valuep);
219 public static Efl.Eo.FunctionWrapper<efl_ui_radio_value_pointer_set_api_delegate> efl_ui_radio_value_pointer_set_ptr = new Efl.Eo.FunctionWrapper<efl_ui_radio_value_pointer_set_api_delegate>(_Module, "efl_ui_radio_value_pointer_set");
220 private static void value_pointer_set(System.IntPtr obj, System.IntPtr pd, System.IntPtr valuep)
222 Eina.Log.Debug("function efl_ui_radio_value_pointer_set was called");
223 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
224 if(wrapper != null) {
225 var _in_valuep = Eina.PrimitiveConversion.PointerToManaged<int>(valuep);
228 ((Radio)wrapper).SetValuePointer( _in_valuep);
229 } catch (Exception e) {
230 Eina.Log.Warning($"Callback error: {e.ToString()}");
231 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
234 efl_ui_radio_value_pointer_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), valuep);
237 private static efl_ui_radio_value_pointer_set_delegate efl_ui_radio_value_pointer_set_static_delegate;
240 [return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalTest<Efl.Canvas.Object, Efl.Eo.NonOwnTag>))] private delegate Efl.Canvas.Object efl_ui_radio_selected_object_get_delegate(System.IntPtr obj, System.IntPtr pd);
243 [return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalTest<Efl.Canvas.Object, Efl.Eo.NonOwnTag>))] public delegate Efl.Canvas.Object efl_ui_radio_selected_object_get_api_delegate(System.IntPtr obj);
244 public static Efl.Eo.FunctionWrapper<efl_ui_radio_selected_object_get_api_delegate> efl_ui_radio_selected_object_get_ptr = new Efl.Eo.FunctionWrapper<efl_ui_radio_selected_object_get_api_delegate>(_Module, "efl_ui_radio_selected_object_get");
245 private static Efl.Canvas.Object selected_object_get(System.IntPtr obj, System.IntPtr pd)
247 Eina.Log.Debug("function efl_ui_radio_selected_object_get was called");
248 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
249 if(wrapper != null) {
250 Efl.Canvas.Object _ret_var = default(Efl.Canvas.Object);
252 _ret_var = ((Radio)wrapper).GetSelectedObject();
253 } catch (Exception e) {
254 Eina.Log.Warning($"Callback error: {e.ToString()}");
255 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
259 return efl_ui_radio_selected_object_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
262 private static efl_ui_radio_selected_object_get_delegate efl_ui_radio_selected_object_get_static_delegate;
265 private delegate void efl_ui_radio_group_add_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalTest<Efl.Ui.Radio, Efl.Eo.NonOwnTag>))] Efl.Ui.Radio group);
268 public delegate void efl_ui_radio_group_add_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalTest<Efl.Ui.Radio, Efl.Eo.NonOwnTag>))] Efl.Ui.Radio group);
269 public static Efl.Eo.FunctionWrapper<efl_ui_radio_group_add_api_delegate> efl_ui_radio_group_add_ptr = new Efl.Eo.FunctionWrapper<efl_ui_radio_group_add_api_delegate>(_Module, "efl_ui_radio_group_add");
270 private static void group_add(System.IntPtr obj, System.IntPtr pd, Efl.Ui.Radio group)
272 Eina.Log.Debug("function efl_ui_radio_group_add was called");
273 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
274 if(wrapper != null) {
277 ((Radio)wrapper).AddGroup( group);
278 } catch (Exception e) {
279 Eina.Log.Warning($"Callback error: {e.ToString()}");
280 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
283 efl_ui_radio_group_add_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), group);
286 private static efl_ui_radio_group_add_delegate efl_ui_radio_group_add_static_delegate;