[EflSharp] Update Circle and efl cs files (#945)
[platform/core/csapi/tizenfx.git] / internals / src / EflSharp / EflSharp / efl / efl_loop_message_future_handler.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 ///<summary>Event argument wrapper for event <see cref="Efl.LoopMessageFutureHandler.MessageFutureEvt"/>.</summary>
11 [Efl.Eo.BindingEntity]
12 public class LoopMessageFutureHandlerMessageFutureEvt_Args : EventArgs {
13     ///<summary>Actual event payload.</summary>
14     public Efl.LoopMessageFuture arg { get; set; }
15 }
16 /// <summary>Internal use for future on an efl loop - replacing legacy ecore events</summary>
17 [Efl.LoopMessageFutureHandler.NativeMethods]
18 [Efl.Eo.BindingEntity]
19 public class LoopMessageFutureHandler : Efl.LoopMessageHandler
20 {
21     ///<summary>Pointer to the native class description.</summary>
22     public override System.IntPtr NativeClass
23     {
24         get
25         {
26             if (((object)this).GetType() == typeof(LoopMessageFutureHandler))
27             {
28                 return GetEflClassStatic();
29             }
30             else
31             {
32                 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
33             }
34         }
35     }
36
37     [System.Runtime.InteropServices.DllImport(efl.Libs.Ecore)] internal static extern System.IntPtr
38         efl_loop_message_future_handler_class_get();
39     /// <summary>Initializes a new instance of the <see cref="LoopMessageFutureHandler"/> class.</summary>
40     /// <param name="parent">Parent instance.</param>
41     public LoopMessageFutureHandler(Efl.Object parent= null
42             ) : base(efl_loop_message_future_handler_class_get(), parent)
43     {
44         FinishInstantiation();
45     }
46
47     /// <summary>Constructor to be used when objects are expected to be constructed from native code.</summary>
48     /// <param name="ch">Tag struct storing the native handle of the object being constructed.</param>
49     protected LoopMessageFutureHandler(ConstructingHandle ch) : base(ch)
50     {
51     }
52
53     /// <summary>Initializes a new instance of the <see cref="LoopMessageFutureHandler"/> class.
54     /// Internal usage: Constructs an instance from a native pointer. This is used when interacting with C code and should not be used directly.</summary>
55     /// <param name="wh">The native pointer to be wrapped.</param>
56     protected LoopMessageFutureHandler(Efl.Eo.Globals.WrappingHandle wh) : base(wh)
57     {
58     }
59
60     /// <summary>Initializes a new instance of the <see cref="LoopMessageFutureHandler"/> class.
61     /// Internal usage: Constructor to forward the wrapper initialization to the root class that interfaces with native code. Should not be used directly.</summary>
62     /// <param name="baseKlass">The pointer to the base native Eo class.</param>
63     /// <param name="parent">The Efl.Object parent of this instance.</param>
64     protected LoopMessageFutureHandler(IntPtr baseKlass, Efl.Object parent) : base(baseKlass, parent)
65     {
66     }
67
68     /// <summary>No description supplied.</summary>
69     public event EventHandler<Efl.LoopMessageFutureHandlerMessageFutureEvt_Args> MessageFutureEvt
70     {
71         add
72         {
73             lock (eflBindingEventLock)
74             {
75                 Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) =>
76                 {
77                     var obj = Efl.Eo.Globals.WrapperSupervisorPtrToManaged(data).Target;
78                     if (obj != null)
79                     {
80                         Efl.LoopMessageFutureHandlerMessageFutureEvt_Args args = new Efl.LoopMessageFutureHandlerMessageFutureEvt_Args();
81                         args.arg = (Efl.Eo.Globals.CreateWrapperFor(evt.Info) as Efl.LoopMessageFuture);
82                         try
83                         {
84                             value?.Invoke(obj, args);
85                         }
86                         catch (Exception e)
87                         {
88                             Eina.Log.Error(e.ToString());
89                             Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
90                         }
91                     }
92                 };
93
94                 string key = "_EFL_LOOP_MESSAGE_FUTURE_HANDLER_EVENT_MESSAGE_FUTURE";
95                 AddNativeEventHandler(efl.Libs.Ecore, key, callerCb, value);
96             }
97         }
98
99         remove
100         {
101             lock (eflBindingEventLock)
102             {
103                 string key = "_EFL_LOOP_MESSAGE_FUTURE_HANDLER_EVENT_MESSAGE_FUTURE";
104                 RemoveNativeEventHandler(efl.Libs.Ecore, key, value);
105             }
106         }
107     }
108     ///<summary>Method to raise event MessageFutureEvt.</summary>
109     public void OnMessageFutureEvt(Efl.LoopMessageFutureHandlerMessageFutureEvt_Args e)
110     {
111         var key = "_EFL_LOOP_MESSAGE_FUTURE_HANDLER_EVENT_MESSAGE_FUTURE";
112         IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Ecore, key);
113         if (desc == IntPtr.Zero)
114         {
115             Eina.Log.Error($"Failed to get native event {key}");
116             return;
117         }
118
119         IntPtr info = e.arg.NativeHandle;
120         Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, info);
121     }
122     /// <summary>No description supplied.</summary>
123     /// <returns>No description supplied.</returns>
124     virtual public Efl.LoopMessageFuture AddMessageType() {
125          var _ret_var = Efl.LoopMessageFutureHandler.NativeMethods.efl_loop_message_future_handler_message_type_add_ptr.Value.Delegate((IsGeneratedBindingClass ? this.NativeHandle : Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass)));
126         Eina.Error.RaiseIfUnhandledException();
127         return _ret_var;
128  }
129     private static IntPtr GetEflClassStatic()
130     {
131         return Efl.LoopMessageFutureHandler.efl_loop_message_future_handler_class_get();
132     }
133     /// <summary>Wrapper for native methods and virtual method delegates.
134     /// For internal use by generated code only.</summary>
135     public new class NativeMethods : Efl.LoopMessageHandler.NativeMethods
136     {
137         private static Efl.Eo.NativeModule Module = new Efl.Eo.NativeModule(    efl.Libs.Ecore);
138         /// <summary>Gets the list of Eo operations to override.</summary>
139         /// <returns>The list of Eo operations to be overload.</returns>
140         public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
141         {
142             var descs = new System.Collections.Generic.List<Efl_Op_Description>();
143             var methods = Efl.Eo.Globals.GetUserMethods(type);
144
145             if (efl_loop_message_future_handler_message_type_add_static_delegate == null)
146             {
147                 efl_loop_message_future_handler_message_type_add_static_delegate = new efl_loop_message_future_handler_message_type_add_delegate(message_type_add);
148             }
149
150             if (methods.FirstOrDefault(m => m.Name == "AddMessageType") != null)
151             {
152                 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_loop_message_future_handler_message_type_add"), func = Marshal.GetFunctionPointerForDelegate(efl_loop_message_future_handler_message_type_add_static_delegate) });
153             }
154
155             descs.AddRange(base.GetEoOps(type));
156             return descs;
157         }
158         /// <summary>Returns the Eo class for the native methods of this class.</summary>
159         /// <returns>The native class pointer.</returns>
160         public override IntPtr GetEflClass()
161         {
162             return Efl.LoopMessageFutureHandler.efl_loop_message_future_handler_class_get();
163         }
164
165         #pragma warning disable CA1707, CS1591, SA1300, SA1600
166
167         [return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))]
168         private delegate Efl.LoopMessageFuture efl_loop_message_future_handler_message_type_add_delegate(System.IntPtr obj, System.IntPtr pd);
169
170         [return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))]
171         public delegate Efl.LoopMessageFuture efl_loop_message_future_handler_message_type_add_api_delegate(System.IntPtr obj);
172
173         public static Efl.Eo.FunctionWrapper<efl_loop_message_future_handler_message_type_add_api_delegate> efl_loop_message_future_handler_message_type_add_ptr = new Efl.Eo.FunctionWrapper<efl_loop_message_future_handler_message_type_add_api_delegate>(Module, "efl_loop_message_future_handler_message_type_add");
174
175         private static Efl.LoopMessageFuture message_type_add(System.IntPtr obj, System.IntPtr pd)
176         {
177             Eina.Log.Debug("function efl_loop_message_future_handler_message_type_add was called");
178             var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
179             if (ws != null)
180             {
181             Efl.LoopMessageFuture _ret_var = default(Efl.LoopMessageFuture);
182                 try
183                 {
184                     _ret_var = ((LoopMessageFutureHandler)ws.Target).AddMessageType();
185                 }
186                 catch (Exception e)
187                 {
188                     Eina.Log.Warning($"Callback error: {e.ToString()}");
189                     Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
190                 }
191
192         return _ret_var;
193
194             }
195             else
196             {
197                 return efl_loop_message_future_handler_message_type_add_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
198             }
199         }
200
201         private static efl_loop_message_future_handler_message_type_add_delegate efl_loop_message_future_handler_message_type_add_static_delegate;
202
203         #pragma warning restore CA1707, CS1591, SA1300, SA1600
204
205 }
206 }
207 }
208