[Security] Fix PrivacyPrivilegeManager.RequestPermissions crash issue (#1651)
[platform/core/csapi/tizenfx.git] / internals / src / EflSharp / EflSharp / efl / efl_ui_timepicker.eo.cs
1 #define EFL_BETA
2 #pragma warning disable CS1591
3 using System;
4 using System.Runtime.InteropServices;
5 using System.Collections.Generic;
6 using System.Linq;
7 using System.Threading;
8 using System.ComponentModel;
9 namespace Efl {
10
11 namespace Ui {
12
13 /// <summary>Timepicker widget
14 /// This is a widget which allows the user to pick a time using internal spinner. User can use the internal spinner to select hour, minute, AM/PM or user can input value using internal entry.</summary>
15 /// <remarks>This is a <b>BETA</b> class. It can be modified or removed in the future. Do not use it for product development.</remarks>
16 [Efl.Ui.Timepicker.NativeMethods]
17 [Efl.Eo.BindingEntity]
18 public class Timepicker : Efl.Ui.LayoutBase
19 {
20     /// <summary>Pointer to the native class description.</summary>
21     public override System.IntPtr NativeClass
22     {
23         get
24         {
25             if (((object)this).GetType() == typeof(Timepicker))
26             {
27                 return GetEflClassStatic();
28             }
29             else
30             {
31                 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
32             }
33         }
34     }
35
36     [System.Runtime.InteropServices.DllImport(efl.Libs.Elementary)] internal static extern System.IntPtr
37         efl_ui_timepicker_class_get();
38     /// <summary>Initializes a new instance of the <see cref="Timepicker"/> class.</summary>
39     /// <param name="parent">Parent instance.</param>
40     /// <param name="style">The widget style to use. See <see cref="Efl.Ui.Widget.SetStyle" /></param>
41     public Timepicker(Efl.Object parent
42             , System.String style = null) : base(efl_ui_timepicker_class_get(), parent)
43     {
44         if (Efl.Eo.Globals.ParamHelperCheck(style))
45         {
46             SetStyle(Efl.Eo.Globals.GetParamHelper(style));
47         }
48
49         FinishInstantiation();
50     }
51
52     /// <summary>Subclasses should override this constructor if they are expected to be instantiated from native code.
53     /// Do not call this constructor directly.</summary>
54     /// <param name="ch">Tag struct storing the native handle of the object being constructed.</param>
55     protected Timepicker(ConstructingHandle ch) : base(ch)
56     {
57     }
58
59     /// <summary>Initializes a new instance of the <see cref="Timepicker"/> class.
60     /// Internal usage: Constructs an instance from a native pointer. This is used when interacting with C code and should not be used directly.</summary>
61     /// <param name="wh">The native pointer to be wrapped.</param>
62     protected Timepicker(Efl.Eo.Globals.WrappingHandle wh) : base(wh)
63     {
64     }
65
66     /// <summary>Initializes a new instance of the <see cref="Timepicker"/> class.
67     /// Internal usage: Constructor to forward the wrapper initialization to the root class that interfaces with native code. Should not be used directly.</summary>
68     /// <param name="baseKlass">The pointer to the base native Eo class.</param>
69     /// <param name="parent">The Efl.Object parent of this instance.</param>
70     protected Timepicker(IntPtr baseKlass, Efl.Object parent) : base(baseKlass, parent)
71     {
72     }
73
74     /// <summary>Called when date is changed</summary>
75     public event EventHandler ChangedEvt
76     {
77         add
78         {
79             lock (eflBindingEventLock)
80             {
81                 Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) =>
82                 {
83                     var obj = Efl.Eo.Globals.WrapperSupervisorPtrToManaged(data).Target;
84                     if (obj != null)
85                     {
86                         EventArgs args = EventArgs.Empty;
87                         try
88                         {
89                             value?.Invoke(obj, args);
90                         }
91                         catch (Exception e)
92                         {
93                             Eina.Log.Error(e.ToString());
94                             Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
95                         }
96                     }
97                 };
98
99                 string key = "_EFL_UI_TIMEPICKER_EVENT_CHANGED";
100                 AddNativeEventHandler(efl.Libs.Elementary, key, callerCb, value);
101             }
102         }
103
104         remove
105         {
106             lock (eflBindingEventLock)
107             {
108                 string key = "_EFL_UI_TIMEPICKER_EVENT_CHANGED";
109                 RemoveNativeEventHandler(efl.Libs.Elementary, key, value);
110             }
111         }
112     }
113     /// <summary>Method to raise event ChangedEvt.</summary>
114     public void OnChangedEvt(EventArgs e)
115     {
116         var key = "_EFL_UI_TIMEPICKER_EVENT_CHANGED";
117         IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Elementary, key);
118         if (desc == IntPtr.Zero)
119         {
120             Eina.Log.Error($"Failed to get native event {key}");
121             return;
122         }
123
124         Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, IntPtr.Zero);
125     }
126     /// <summary>The current value of time
127     /// <c>hour</c>: Hour. The hour value is in terms of 24 hour format from 0 to 23.
128     /// 
129     /// <c>min</c>: Minute. The minute range is from 0 to 59.</summary>
130     /// <param name="hour">The hour value from 0 to 23.</param>
131     /// <param name="min">The minute value from 0 to 59.</param>
132     virtual public void GetTime(out int hour, out int min) {
133                                                          Efl.Ui.Timepicker.NativeMethods.efl_ui_timepicker_time_get_ptr.Value.Delegate((IsGeneratedBindingClass ? this.NativeHandle : Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass)),out hour, out min);
134         Eina.Error.RaiseIfUnhandledException();
135                                          }
136     /// <summary>The current value of time
137     /// <c>hour</c>: Hour. The hour value is in terms of 24 hour format from 0 to 23.
138     /// 
139     /// <c>min</c>: Minute. The minute range is from 0 to 59.</summary>
140     /// <param name="hour">The hour value from 0 to 23.</param>
141     /// <param name="min">The minute value from 0 to 59.</param>
142     virtual public void SetTime(int hour, int min) {
143                                                          Efl.Ui.Timepicker.NativeMethods.efl_ui_timepicker_time_set_ptr.Value.Delegate((IsGeneratedBindingClass ? this.NativeHandle : Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass)),hour, min);
144         Eina.Error.RaiseIfUnhandledException();
145                                          }
146     /// <summary>Control if the Timepicker displays 24 hour time or 12 hour time including AM/PM button.</summary>
147     /// <returns><c>true</c> to display the 24 hour time, <c>false</c> to display 12 hour time including AM/PM button.</returns>
148     virtual public bool GetAmpm() {
149          var _ret_var = Efl.Ui.Timepicker.NativeMethods.efl_ui_timepicker_ampm_get_ptr.Value.Delegate((IsGeneratedBindingClass ? this.NativeHandle : Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass)));
150         Eina.Error.RaiseIfUnhandledException();
151         return _ret_var;
152  }
153     /// <summary>Control if the Timepicker displays 24 hour time or 12 hour time including AM/PM button.</summary>
154     /// <param name="is_24hour"><c>true</c> to display the 24 hour time, <c>false</c> to display 12 hour time including AM/PM button.</param>
155     virtual public void SetAmpm(bool is_24hour) {
156                                  Efl.Ui.Timepicker.NativeMethods.efl_ui_timepicker_ampm_set_ptr.Value.Delegate((IsGeneratedBindingClass ? this.NativeHandle : Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass)),is_24hour);
157         Eina.Error.RaiseIfUnhandledException();
158                          }
159     /// <summary>The current value of time
160     /// <c>hour</c>: Hour. The hour value is in terms of 24 hour format from 0 to 23.
161     /// 
162     /// <c>min</c>: Minute. The minute range is from 0 to 59.</summary>
163     /// <value>The hour value from 0 to 23.</value>
164     public (int, int) Time {
165         get {
166             int _out_hour = default(int);
167             int _out_min = default(int);
168             GetTime(out _out_hour,out _out_min);
169             return (_out_hour,_out_min);
170         }
171         set { SetTime( value.Item1,  value.Item2); }
172     }
173     /// <summary>Control if the Timepicker displays 24 hour time or 12 hour time including AM/PM button.</summary>
174     /// <value><c>true</c> to display the 24 hour time, <c>false</c> to display 12 hour time including AM/PM button.</value>
175     public bool Ampm {
176         get { return GetAmpm(); }
177         set { SetAmpm(value); }
178     }
179     private static IntPtr GetEflClassStatic()
180     {
181         return Efl.Ui.Timepicker.efl_ui_timepicker_class_get();
182     }
183     /// <summary>Wrapper for native methods and virtual method delegates.
184     /// For internal use by generated code only.</summary>
185     public new class NativeMethods : Efl.Ui.LayoutBase.NativeMethods
186     {
187         private static Efl.Eo.NativeModule Module = new Efl.Eo.NativeModule(    efl.Libs.Elementary);
188         /// <summary>Gets the list of Eo operations to override.</summary>
189         /// <returns>The list of Eo operations to be overload.</returns>
190         public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
191         {
192             var descs = new System.Collections.Generic.List<Efl_Op_Description>();
193             var methods = Efl.Eo.Globals.GetUserMethods(type);
194
195             if (efl_ui_timepicker_time_get_static_delegate == null)
196             {
197                 efl_ui_timepicker_time_get_static_delegate = new efl_ui_timepicker_time_get_delegate(time_get);
198             }
199
200             if (methods.FirstOrDefault(m => m.Name == "GetTime") != null)
201             {
202                 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_ui_timepicker_time_get"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_timepicker_time_get_static_delegate) });
203             }
204
205             if (efl_ui_timepicker_time_set_static_delegate == null)
206             {
207                 efl_ui_timepicker_time_set_static_delegate = new efl_ui_timepicker_time_set_delegate(time_set);
208             }
209
210             if (methods.FirstOrDefault(m => m.Name == "SetTime") != null)
211             {
212                 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_ui_timepicker_time_set"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_timepicker_time_set_static_delegate) });
213             }
214
215             if (efl_ui_timepicker_ampm_get_static_delegate == null)
216             {
217                 efl_ui_timepicker_ampm_get_static_delegate = new efl_ui_timepicker_ampm_get_delegate(ampm_get);
218             }
219
220             if (methods.FirstOrDefault(m => m.Name == "GetAmpm") != null)
221             {
222                 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_ui_timepicker_ampm_get"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_timepicker_ampm_get_static_delegate) });
223             }
224
225             if (efl_ui_timepicker_ampm_set_static_delegate == null)
226             {
227                 efl_ui_timepicker_ampm_set_static_delegate = new efl_ui_timepicker_ampm_set_delegate(ampm_set);
228             }
229
230             if (methods.FirstOrDefault(m => m.Name == "SetAmpm") != null)
231             {
232                 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_ui_timepicker_ampm_set"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_timepicker_ampm_set_static_delegate) });
233             }
234
235             descs.AddRange(base.GetEoOps(type));
236             return descs;
237         }
238         /// <summary>Returns the Eo class for the native methods of this class.</summary>
239         /// <returns>The native class pointer.</returns>
240         public override IntPtr GetEflClass()
241         {
242             return Efl.Ui.Timepicker.efl_ui_timepicker_class_get();
243         }
244
245         #pragma warning disable CA1707, CS1591, SA1300, SA1600
246
247         
248         private delegate void efl_ui_timepicker_time_get_delegate(System.IntPtr obj, System.IntPtr pd,  out int hour,  out int min);
249
250         
251         public delegate void efl_ui_timepicker_time_get_api_delegate(System.IntPtr obj,  out int hour,  out int min);
252
253         public static Efl.Eo.FunctionWrapper<efl_ui_timepicker_time_get_api_delegate> efl_ui_timepicker_time_get_ptr = new Efl.Eo.FunctionWrapper<efl_ui_timepicker_time_get_api_delegate>(Module, "efl_ui_timepicker_time_get");
254
255         private static void time_get(System.IntPtr obj, System.IntPtr pd, out int hour, out int min)
256         {
257             Eina.Log.Debug("function efl_ui_timepicker_time_get was called");
258             var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
259             if (ws != null)
260             {
261                         hour = default(int);        min = default(int);                            
262                 try
263                 {
264                     ((Timepicker)ws.Target).GetTime(out hour, out min);
265                 }
266                 catch (Exception e)
267                 {
268                     Eina.Log.Warning($"Callback error: {e.ToString()}");
269                     Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
270                 }
271
272                                         
273             }
274             else
275             {
276                 efl_ui_timepicker_time_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), out hour, out min);
277             }
278         }
279
280         private static efl_ui_timepicker_time_get_delegate efl_ui_timepicker_time_get_static_delegate;
281
282         
283         private delegate void efl_ui_timepicker_time_set_delegate(System.IntPtr obj, System.IntPtr pd,  int hour,  int min);
284
285         
286         public delegate void efl_ui_timepicker_time_set_api_delegate(System.IntPtr obj,  int hour,  int min);
287
288         public static Efl.Eo.FunctionWrapper<efl_ui_timepicker_time_set_api_delegate> efl_ui_timepicker_time_set_ptr = new Efl.Eo.FunctionWrapper<efl_ui_timepicker_time_set_api_delegate>(Module, "efl_ui_timepicker_time_set");
289
290         private static void time_set(System.IntPtr obj, System.IntPtr pd, int hour, int min)
291         {
292             Eina.Log.Debug("function efl_ui_timepicker_time_set was called");
293             var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
294             if (ws != null)
295             {
296                                                             
297                 try
298                 {
299                     ((Timepicker)ws.Target).SetTime(hour, min);
300                 }
301                 catch (Exception e)
302                 {
303                     Eina.Log.Warning($"Callback error: {e.ToString()}");
304                     Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
305                 }
306
307                                         
308             }
309             else
310             {
311                 efl_ui_timepicker_time_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), hour, min);
312             }
313         }
314
315         private static efl_ui_timepicker_time_set_delegate efl_ui_timepicker_time_set_static_delegate;
316
317         [return: MarshalAs(UnmanagedType.U1)]
318         private delegate bool efl_ui_timepicker_ampm_get_delegate(System.IntPtr obj, System.IntPtr pd);
319
320         [return: MarshalAs(UnmanagedType.U1)]
321         public delegate bool efl_ui_timepicker_ampm_get_api_delegate(System.IntPtr obj);
322
323         public static Efl.Eo.FunctionWrapper<efl_ui_timepicker_ampm_get_api_delegate> efl_ui_timepicker_ampm_get_ptr = new Efl.Eo.FunctionWrapper<efl_ui_timepicker_ampm_get_api_delegate>(Module, "efl_ui_timepicker_ampm_get");
324
325         private static bool ampm_get(System.IntPtr obj, System.IntPtr pd)
326         {
327             Eina.Log.Debug("function efl_ui_timepicker_ampm_get was called");
328             var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
329             if (ws != null)
330             {
331             bool _ret_var = default(bool);
332                 try
333                 {
334                     _ret_var = ((Timepicker)ws.Target).GetAmpm();
335                 }
336                 catch (Exception e)
337                 {
338                     Eina.Log.Warning($"Callback error: {e.ToString()}");
339                     Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
340                 }
341
342         return _ret_var;
343
344             }
345             else
346             {
347                 return efl_ui_timepicker_ampm_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
348             }
349         }
350
351         private static efl_ui_timepicker_ampm_get_delegate efl_ui_timepicker_ampm_get_static_delegate;
352
353         
354         private delegate void efl_ui_timepicker_ampm_set_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.U1)] bool is_24hour);
355
356         
357         public delegate void efl_ui_timepicker_ampm_set_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.U1)] bool is_24hour);
358
359         public static Efl.Eo.FunctionWrapper<efl_ui_timepicker_ampm_set_api_delegate> efl_ui_timepicker_ampm_set_ptr = new Efl.Eo.FunctionWrapper<efl_ui_timepicker_ampm_set_api_delegate>(Module, "efl_ui_timepicker_ampm_set");
360
361         private static void ampm_set(System.IntPtr obj, System.IntPtr pd, bool is_24hour)
362         {
363             Eina.Log.Debug("function efl_ui_timepicker_ampm_set was called");
364             var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
365             if (ws != null)
366             {
367                                     
368                 try
369                 {
370                     ((Timepicker)ws.Target).SetAmpm(is_24hour);
371                 }
372                 catch (Exception e)
373                 {
374                     Eina.Log.Warning($"Callback error: {e.ToString()}");
375                     Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
376                 }
377
378                         
379             }
380             else
381             {
382                 efl_ui_timepicker_ampm_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), is_24hour);
383             }
384         }
385
386         private static efl_ui_timepicker_ampm_set_delegate efl_ui_timepicker_ampm_set_static_delegate;
387
388         #pragma warning restore CA1707, CS1591, SA1300, SA1600
389
390 }
391 }
392 }
393
394 }
395
396 #if EFL_BETA
397 #pragma warning disable CS1591
398 public static class Efl_UiTimepicker_ExtensionMethods {
399     
400     public static Efl.BindableProperty<bool> Ampm<T>(this Efl.Ui.ItemFactory<T> fac, Efl.Csharp.ExtensionTag<Efl.Ui.Timepicker, T>magic = null) where T : Efl.Ui.Timepicker {
401         return new Efl.BindableProperty<bool>("ampm", fac);
402     }
403
404 }
405 #pragma warning restore CS1591
406 #endif