[EflSharp] Update Circle and efl cs files (#819)
[platform/core/csapi/tizenfx.git] / internals / src / EflSharp / EflSharp / efl / efl_ui_check.eo.cs
1 #pragma warning disable CS1591
2 using System;
3 using System.Runtime.InteropServices;
4 using System.Collections.Generic;
5 using System.Linq;
6 using System.Threading;
7 using System.ComponentModel;
8 namespace Efl {
9
10 namespace Ui {
11
12 /// <summary>Check widget
13 /// The check widget allows for toggling a value between true and false. Check objects are a lot like radio objects in layout and functionality, except they do not work as a group, but independently, and only toggle the value of a boolean between false and true.</summary>
14 [Efl.Ui.Check.NativeMethods]
15 public class Check : Efl.Ui.Nstate, Efl.Eo.IWrapper
16 {
17     ///<summary>Pointer to the native class description.</summary>
18     public override System.IntPtr NativeClass
19     {
20         get
21         {
22             if (((object)this).GetType() == typeof(Check))
23             {
24                 return GetEflClassStatic();
25             }
26             else
27             {
28                 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
29             }
30         }
31     }
32
33     [System.Runtime.InteropServices.DllImport(efl.Libs.Elementary)] internal static extern System.IntPtr
34         efl_ui_check_class_get();
35     /// <summary>Initializes a new instance of the <see cref="Check"/> class.</summary>
36     /// <param name="parent">Parent instance.</param>
37     /// <param name="style">The widget style to use. See <see cref="Efl.Ui.Widget.SetStyle"/></param>
38     public Check(Efl.Object parent
39             , System.String style = null) : base(efl_ui_check_class_get(), typeof(Check), parent)
40     {
41         if (Efl.Eo.Globals.ParamHelperCheck(style))
42         {
43             SetStyle(Efl.Eo.Globals.GetParamHelper(style));
44         }
45
46         FinishInstantiation();
47     }
48
49     /// <summary>Initializes a new instance of the <see cref="Check"/> 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="raw">The native pointer to be wrapped.</param>
52     protected Check(System.IntPtr raw) : base(raw)
53     {
54             }
55
56     /// <summary>Initializes a new instance of the <see cref="Check"/> 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="managedType">The managed type of the public constructor that originated this call.</param>
60     /// <param name="parent">The Efl.Object parent of this instance.</param>
61     protected Check(IntPtr baseKlass, System.Type managedType, Efl.Object parent) : base(baseKlass, managedType, parent)
62     {
63     }
64
65     /// <summary>Verifies if the given object is equal to this one.</summary>
66     /// <param name="instance">The object to compare to.</param>
67     /// <returns>True if both objects point to the same native object.</returns>
68     public override bool Equals(object instance)
69     {
70         var other = instance as Efl.Object;
71         if (other == null)
72         {
73             return false;
74         }
75         return this.NativeHandle == other.NativeHandle;
76     }
77
78     /// <summary>Gets the hash code for this object based on the native pointer it points to.</summary>
79     /// <returns>The value of the pointer, to be used as the hash code of this object.</returns>
80     public override int GetHashCode()
81     {
82         return this.NativeHandle.ToInt32();
83     }
84
85     /// <summary>Turns the native pointer into a string representation.</summary>
86     /// <returns>A string with the type and the native pointer for this object.</returns>
87     public override String ToString()
88     {
89         return $"{this.GetType().Name}@[{this.NativeHandle.ToInt32():x}]";
90     }
91
92     /// <summary>The on/off state of the check object.</summary>
93     /// <returns><c>true</c> if the check object is selected, <c>false</c> otherwise</returns>
94     virtual public bool GetSelected() {
95          var _ret_var = Efl.Ui.Check.NativeMethods.efl_ui_check_selected_get_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle));
96         Eina.Error.RaiseIfUnhandledException();
97         return _ret_var;
98  }
99     /// <summary>The on/off state of the check object.</summary>
100     /// <param name="value"><c>true</c> if the check object is selected, <c>false</c> otherwise</param>
101     virtual public void SetSelected(bool value) {
102                                  Efl.Ui.Check.NativeMethods.efl_ui_check_selected_set_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle),value);
103         Eina.Error.RaiseIfUnhandledException();
104                          }
105     /// <summary>The on/off state of the check object.</summary>
106 /// <value><c>true</c> if the check object is selected, <c>false</c> otherwise</value>
107     public bool Selected {
108         get { return GetSelected(); }
109         set { SetSelected(value); }
110     }
111     private static IntPtr GetEflClassStatic()
112     {
113         return Efl.Ui.Check.efl_ui_check_class_get();
114     }
115     /// <summary>Wrapper for native methods and virtual method delegates.
116     /// For internal use by generated code only.</summary>
117     public new class NativeMethods : Efl.Ui.Nstate.NativeMethods
118     {
119         private static Efl.Eo.NativeModule Module = new Efl.Eo.NativeModule(    efl.Libs.Elementary);
120         /// <summary>Gets the list of Eo operations to override.</summary>
121         /// <returns>The list of Eo operations to be overload.</returns>
122         public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
123         {
124             var descs = new System.Collections.Generic.List<Efl_Op_Description>();
125             var methods = Efl.Eo.Globals.GetUserMethods(type);
126
127             if (efl_ui_check_selected_get_static_delegate == null)
128             {
129                 efl_ui_check_selected_get_static_delegate = new efl_ui_check_selected_get_delegate(selected_get);
130             }
131
132             if (methods.FirstOrDefault(m => m.Name == "GetSelected") != null)
133             {
134                 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_ui_check_selected_get"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_check_selected_get_static_delegate) });
135             }
136
137             if (efl_ui_check_selected_set_static_delegate == null)
138             {
139                 efl_ui_check_selected_set_static_delegate = new efl_ui_check_selected_set_delegate(selected_set);
140             }
141
142             if (methods.FirstOrDefault(m => m.Name == "SetSelected") != null)
143             {
144                 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_ui_check_selected_set"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_check_selected_set_static_delegate) });
145             }
146
147             descs.AddRange(base.GetEoOps(type));
148             return descs;
149         }
150         /// <summary>Returns the Eo class for the native methods of this class.</summary>
151         /// <returns>The native class pointer.</returns>
152         public override IntPtr GetEflClass()
153         {
154             return Efl.Ui.Check.efl_ui_check_class_get();
155         }
156
157         #pragma warning disable CA1707, SA1300, SA1600
158
159         [return: MarshalAs(UnmanagedType.U1)]
160         private delegate bool efl_ui_check_selected_get_delegate(System.IntPtr obj, System.IntPtr pd);
161
162         [return: MarshalAs(UnmanagedType.U1)]
163         public delegate bool efl_ui_check_selected_get_api_delegate(System.IntPtr obj);
164
165         public static Efl.Eo.FunctionWrapper<efl_ui_check_selected_get_api_delegate> efl_ui_check_selected_get_ptr = new Efl.Eo.FunctionWrapper<efl_ui_check_selected_get_api_delegate>(Module, "efl_ui_check_selected_get");
166
167         private static bool selected_get(System.IntPtr obj, System.IntPtr pd)
168         {
169             Eina.Log.Debug("function efl_ui_check_selected_get was called");
170             Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
171             if (wrapper != null)
172             {
173             bool _ret_var = default(bool);
174                 try
175                 {
176                     _ret_var = ((Check)wrapper).GetSelected();
177                 }
178                 catch (Exception e)
179                 {
180                     Eina.Log.Warning($"Callback error: {e.ToString()}");
181                     Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
182                 }
183
184         return _ret_var;
185
186             }
187             else
188             {
189                 return efl_ui_check_selected_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
190             }
191         }
192
193         private static efl_ui_check_selected_get_delegate efl_ui_check_selected_get_static_delegate;
194
195         
196         private delegate void efl_ui_check_selected_set_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.U1)] bool value);
197
198         
199         public delegate void efl_ui_check_selected_set_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.U1)] bool value);
200
201         public static Efl.Eo.FunctionWrapper<efl_ui_check_selected_set_api_delegate> efl_ui_check_selected_set_ptr = new Efl.Eo.FunctionWrapper<efl_ui_check_selected_set_api_delegate>(Module, "efl_ui_check_selected_set");
202
203         private static void selected_set(System.IntPtr obj, System.IntPtr pd, bool value)
204         {
205             Eina.Log.Debug("function efl_ui_check_selected_set was called");
206             Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
207             if (wrapper != null)
208             {
209                                     
210                 try
211                 {
212                     ((Check)wrapper).SetSelected(value);
213                 }
214                 catch (Exception e)
215                 {
216                     Eina.Log.Warning($"Callback error: {e.ToString()}");
217                     Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
218                 }
219
220                         
221             }
222             else
223             {
224                 efl_ui_check_selected_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), value);
225             }
226         }
227
228         private static efl_ui_check_selected_set_delegate efl_ui_check_selected_set_static_delegate;
229
230         #pragma warning restore CA1707, SA1300, SA1600
231
232 }
233 }
234 }
235
236 }
237