[EflSharp] Update Circle and efl cs files (#945)
[platform/core/csapi/tizenfx.git] / internals / src / EflSharp / EflSharp / efl / efl_ui_alert_popup.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>Event argument wrapper for event <see cref="Efl.Ui.AlertPopup.ButtonClickedEvt"/>.</summary>
13 [Efl.Eo.BindingEntity]
14 public class AlertPopupButtonClickedEvt_Args : EventArgs {
15     ///<summary>Actual event payload.</summary>
16     public Efl.Ui.AlertPopupButtonClickedEvent arg { get; set; }
17 }
18 /// <summary>EFL UI Alert Popup class</summary>
19 [Efl.Ui.AlertPopup.NativeMethods]
20 [Efl.Eo.BindingEntity]
21 public class AlertPopup : Efl.Ui.Popup
22 {
23     ///<summary>Pointer to the native class description.</summary>
24     public override System.IntPtr NativeClass
25     {
26         get
27         {
28             if (((object)this).GetType() == typeof(AlertPopup))
29             {
30                 return GetEflClassStatic();
31             }
32             else
33             {
34                 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
35             }
36         }
37     }
38
39     [System.Runtime.InteropServices.DllImport(efl.Libs.Elementary)] internal static extern System.IntPtr
40         efl_ui_alert_popup_class_get();
41     /// <summary>Initializes a new instance of the <see cref="AlertPopup"/> class.</summary>
42     /// <param name="parent">Parent instance.</param>
43     /// <param name="style">The widget style to use. See <see cref="Efl.Ui.Widget.SetStyle" /></param>
44     public AlertPopup(Efl.Object parent
45             , System.String style = null) : base(efl_ui_alert_popup_class_get(), parent)
46     {
47         if (Efl.Eo.Globals.ParamHelperCheck(style))
48         {
49             SetStyle(Efl.Eo.Globals.GetParamHelper(style));
50         }
51
52         FinishInstantiation();
53     }
54
55     /// <summary>Constructor to be used when objects are expected to be constructed from native code.</summary>
56     /// <param name="ch">Tag struct storing the native handle of the object being constructed.</param>
57     protected AlertPopup(ConstructingHandle ch) : base(ch)
58     {
59     }
60
61     /// <summary>Initializes a new instance of the <see cref="AlertPopup"/> class.
62     /// Internal usage: Constructs an instance from a native pointer. This is used when interacting with C code and should not be used directly.</summary>
63     /// <param name="wh">The native pointer to be wrapped.</param>
64     protected AlertPopup(Efl.Eo.Globals.WrappingHandle wh) : base(wh)
65     {
66     }
67
68     /// <summary>Initializes a new instance of the <see cref="AlertPopup"/> class.
69     /// Internal usage: Constructor to forward the wrapper initialization to the root class that interfaces with native code. Should not be used directly.</summary>
70     /// <param name="baseKlass">The pointer to the base native Eo class.</param>
71     /// <param name="parent">The Efl.Object parent of this instance.</param>
72     protected AlertPopup(IntPtr baseKlass, Efl.Object parent) : base(baseKlass, parent)
73     {
74     }
75
76     /// <summary>Called when alert popup was clicked</summary>
77     public event EventHandler<Efl.Ui.AlertPopupButtonClickedEvt_Args> ButtonClickedEvt
78     {
79         add
80         {
81             lock (eflBindingEventLock)
82             {
83                 Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) =>
84                 {
85                     var obj = Efl.Eo.Globals.WrapperSupervisorPtrToManaged(data).Target;
86                     if (obj != null)
87                     {
88                         Efl.Ui.AlertPopupButtonClickedEvt_Args args = new Efl.Ui.AlertPopupButtonClickedEvt_Args();
89                         args.arg =  evt.Info;
90                         try
91                         {
92                             value?.Invoke(obj, args);
93                         }
94                         catch (Exception e)
95                         {
96                             Eina.Log.Error(e.ToString());
97                             Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
98                         }
99                     }
100                 };
101
102                 string key = "_EFL_UI_ALERT_POPUP_EVENT_BUTTON_CLICKED";
103                 AddNativeEventHandler(efl.Libs.Elementary, key, callerCb, value);
104             }
105         }
106
107         remove
108         {
109             lock (eflBindingEventLock)
110             {
111                 string key = "_EFL_UI_ALERT_POPUP_EVENT_BUTTON_CLICKED";
112                 RemoveNativeEventHandler(efl.Libs.Elementary, key, value);
113             }
114         }
115     }
116     ///<summary>Method to raise event ButtonClickedEvt.</summary>
117     public void OnButtonClickedEvt(Efl.Ui.AlertPopupButtonClickedEvt_Args e)
118     {
119         var key = "_EFL_UI_ALERT_POPUP_EVENT_BUTTON_CLICKED";
120         IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Elementary, key);
121         if (desc == IntPtr.Zero)
122         {
123             Eina.Log.Error($"Failed to get native event {key}");
124             return;
125         }
126
127         IntPtr info = Marshal.AllocHGlobal(Marshal.SizeOf(e.arg));
128         try
129         {
130             Marshal.StructureToPtr(e.arg, info, false);
131             Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, info);
132         }
133         finally
134         {
135             Marshal.FreeHGlobal(info);
136         }
137     }
138     /// <summary>Set popup buttons.</summary>
139     /// <param name="type">Alert popup button type</param>
140     /// <param name="text">Alert string on button</param>
141     /// <param name="icon">Alert icon on button</param>
142     virtual public void SetButton(Efl.Ui.AlertPopupButton type, System.String text, Efl.Object icon) {
143                                                                                  Efl.Ui.AlertPopup.NativeMethods.efl_ui_alert_popup_button_set_ptr.Value.Delegate((IsGeneratedBindingClass ? this.NativeHandle : Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass)),type, text, icon);
144         Eina.Error.RaiseIfUnhandledException();
145                                                          }
146     private static IntPtr GetEflClassStatic()
147     {
148         return Efl.Ui.AlertPopup.efl_ui_alert_popup_class_get();
149     }
150     /// <summary>Wrapper for native methods and virtual method delegates.
151     /// For internal use by generated code only.</summary>
152     public new class NativeMethods : Efl.Ui.Popup.NativeMethods
153     {
154         private static Efl.Eo.NativeModule Module = new Efl.Eo.NativeModule(    efl.Libs.Elementary);
155         /// <summary>Gets the list of Eo operations to override.</summary>
156         /// <returns>The list of Eo operations to be overload.</returns>
157         public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
158         {
159             var descs = new System.Collections.Generic.List<Efl_Op_Description>();
160             var methods = Efl.Eo.Globals.GetUserMethods(type);
161
162             if (efl_ui_alert_popup_button_set_static_delegate == null)
163             {
164                 efl_ui_alert_popup_button_set_static_delegate = new efl_ui_alert_popup_button_set_delegate(button_set);
165             }
166
167             if (methods.FirstOrDefault(m => m.Name == "SetButton") != null)
168             {
169                 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_ui_alert_popup_button_set"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_alert_popup_button_set_static_delegate) });
170             }
171
172             descs.AddRange(base.GetEoOps(type));
173             return descs;
174         }
175         /// <summary>Returns the Eo class for the native methods of this class.</summary>
176         /// <returns>The native class pointer.</returns>
177         public override IntPtr GetEflClass()
178         {
179             return Efl.Ui.AlertPopup.efl_ui_alert_popup_class_get();
180         }
181
182         #pragma warning disable CA1707, CS1591, SA1300, SA1600
183
184         
185         private delegate void efl_ui_alert_popup_button_set_delegate(System.IntPtr obj, System.IntPtr pd,  Efl.Ui.AlertPopupButton type, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String text, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))] Efl.Object icon);
186
187         
188         public delegate void efl_ui_alert_popup_button_set_api_delegate(System.IntPtr obj,  Efl.Ui.AlertPopupButton type, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String text, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))] Efl.Object icon);
189
190         public static Efl.Eo.FunctionWrapper<efl_ui_alert_popup_button_set_api_delegate> efl_ui_alert_popup_button_set_ptr = new Efl.Eo.FunctionWrapper<efl_ui_alert_popup_button_set_api_delegate>(Module, "efl_ui_alert_popup_button_set");
191
192         private static void button_set(System.IntPtr obj, System.IntPtr pd, Efl.Ui.AlertPopupButton type, System.String text, Efl.Object icon)
193         {
194             Eina.Log.Debug("function efl_ui_alert_popup_button_set was called");
195             var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
196             if (ws != null)
197             {
198                                                                                     
199                 try
200                 {
201                     ((AlertPopup)ws.Target).SetButton(type, text, icon);
202                 }
203                 catch (Exception e)
204                 {
205                     Eina.Log.Warning($"Callback error: {e.ToString()}");
206                     Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
207                 }
208
209                                                         
210             }
211             else
212             {
213                 efl_ui_alert_popup_button_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), type, text, icon);
214             }
215         }
216
217         private static efl_ui_alert_popup_button_set_delegate efl_ui_alert_popup_button_set_static_delegate;
218
219         #pragma warning restore CA1707, CS1591, SA1300, SA1600
220
221 }
222 }
223 }
224
225 }
226
227 namespace Efl {
228
229 namespace Ui {
230
231 /// <summary>Defines the type of the alert button.</summary>
232 [Efl.Eo.BindingEntity]
233 public enum AlertPopupButton
234 {
235 /// <summary>Button having positive meaning. e.g. &quot;Yes&quot;</summary>
236 Positive = 0,
237 /// <summary>Button having negative meaning. e.g. &quot;No&quot;</summary>
238 Negative = 1,
239 /// <summary>Button having user-defined meaning. e.g. &quot;Cancel&quot;</summary>
240 User = 2,
241 }
242
243 }
244
245 }
246
247 namespace Efl {
248
249 namespace Ui {
250
251 /// <summary>Information of clicked event</summary>
252 [StructLayout(LayoutKind.Sequential)]
253 [Efl.Eo.BindingEntity]
254 public struct AlertPopupButtonClickedEvent
255 {
256     /// <summary>Clicked button type</summary>
257     public Efl.Ui.AlertPopupButton Button_type;
258     ///<summary>Constructor for AlertPopupButtonClickedEvent.</summary>
259     public AlertPopupButtonClickedEvent(
260         Efl.Ui.AlertPopupButton Button_type = default(Efl.Ui.AlertPopupButton)    )
261     {
262         this.Button_type = Button_type;
263     }
264
265     ///<summary>Implicit conversion to the managed representation from a native pointer.</summary>
266     ///<param name="ptr">Native pointer to be converted.</param>
267     public static implicit operator AlertPopupButtonClickedEvent(IntPtr ptr)
268     {
269         var tmp = (AlertPopupButtonClickedEvent.NativeStruct)Marshal.PtrToStructure(ptr, typeof(AlertPopupButtonClickedEvent.NativeStruct));
270         return tmp;
271     }
272
273     #pragma warning disable CS1591
274
275     ///<summary>Internal wrapper for struct AlertPopupButtonClickedEvent.</summary>
276     [StructLayout(LayoutKind.Sequential)]
277     public struct NativeStruct
278     {
279         
280         public Efl.Ui.AlertPopupButton Button_type;
281         ///<summary>Implicit conversion to the internal/marshalling representation.</summary>
282         public static implicit operator AlertPopupButtonClickedEvent.NativeStruct(AlertPopupButtonClickedEvent _external_struct)
283         {
284             var _internal_struct = new AlertPopupButtonClickedEvent.NativeStruct();
285             _internal_struct.Button_type = _external_struct.Button_type;
286             return _internal_struct;
287         }
288
289         ///<summary>Implicit conversion to the managed representation.</summary>
290         public static implicit operator AlertPopupButtonClickedEvent(AlertPopupButtonClickedEvent.NativeStruct _internal_struct)
291         {
292             var _external_struct = new AlertPopupButtonClickedEvent();
293             _external_struct.Button_type = _internal_struct.Button_type;
294             return _external_struct;
295         }
296
297     }
298
299     #pragma warning restore CS1591
300
301 }
302
303 }
304
305 }
306