[EflSharp] Update Circle and efl cs files (#995)
[platform/core/csapi/tizenfx.git] / internals / src / EflSharp / EflSharp / efl / efl_loop_message.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 /// <summary>Event argument wrapper for event <see cref="Efl.LoopMessage.MessageEvt"/>.</summary>
12 [Efl.Eo.BindingEntity]
13 public class LoopMessageMessageEvt_Args : EventArgs {
14     /// <summary>Actual event payload.</summary>
15     /// <value>The message payload data</value>
16     public Efl.LoopMessage arg { get; set; }
17 }
18 /// <summary>Base message payload object class. Inherit this and extend for specific message types.</summary>
19 /// <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>
20 [Efl.LoopMessage.NativeMethods]
21 [Efl.Eo.BindingEntity]
22 public class LoopMessage : Efl.Object
23 {
24     /// <summary>Pointer to the native class description.</summary>
25     public override System.IntPtr NativeClass
26     {
27         get
28         {
29             if (((object)this).GetType() == typeof(LoopMessage))
30             {
31                 return GetEflClassStatic();
32             }
33             else
34             {
35                 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
36             }
37         }
38     }
39
40     [System.Runtime.InteropServices.DllImport(efl.Libs.Ecore)] internal static extern System.IntPtr
41         efl_loop_message_class_get();
42     /// <summary>Initializes a new instance of the <see cref="LoopMessage"/> class.</summary>
43     /// <param name="parent">Parent instance.</param>
44     public LoopMessage(Efl.Object parent= null
45             ) : base(efl_loop_message_class_get(), parent)
46     {
47         FinishInstantiation();
48     }
49
50     /// <summary>Subclasses should override this constructor if they are expected to be instantiated from native code.
51     /// Do not call this constructor directly.</summary>
52     /// <param name="ch">Tag struct storing the native handle of the object being constructed.</param>
53     protected LoopMessage(ConstructingHandle ch) : base(ch)
54     {
55     }
56
57     /// <summary>Initializes a new instance of the <see cref="LoopMessage"/> class.
58     /// Internal usage: Constructs an instance from a native pointer. This is used when interacting with C code and should not be used directly.</summary>
59     /// <param name="wh">The native pointer to be wrapped.</param>
60     protected LoopMessage(Efl.Eo.Globals.WrappingHandle wh) : base(wh)
61     {
62     }
63
64     /// <summary>Initializes a new instance of the <see cref="LoopMessage"/> class.
65     /// Internal usage: Constructor to forward the wrapper initialization to the root class that interfaces with native code. Should not be used directly.</summary>
66     /// <param name="baseKlass">The pointer to the base native Eo class.</param>
67     /// <param name="parent">The Efl.Object parent of this instance.</param>
68     protected LoopMessage(IntPtr baseKlass, Efl.Object parent) : base(baseKlass, parent)
69     {
70     }
71
72     /// <summary>The message payload data</summary>
73     /// <value><see cref="Efl.LoopMessageMessageEvt_Args"/></value>
74     public event EventHandler<Efl.LoopMessageMessageEvt_Args> MessageEvt
75     {
76         add
77         {
78             lock (eflBindingEventLock)
79             {
80                 Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) =>
81                 {
82                     var obj = Efl.Eo.Globals.WrapperSupervisorPtrToManaged(data).Target;
83                     if (obj != null)
84                     {
85                         Efl.LoopMessageMessageEvt_Args args = new Efl.LoopMessageMessageEvt_Args();
86                         args.arg = (Efl.Eo.Globals.CreateWrapperFor(evt.Info) as Efl.LoopMessage);
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_LOOP_MESSAGE_EVENT_MESSAGE";
100                 AddNativeEventHandler(efl.Libs.Ecore, key, callerCb, value);
101             }
102         }
103
104         remove
105         {
106             lock (eflBindingEventLock)
107             {
108                 string key = "_EFL_LOOP_MESSAGE_EVENT_MESSAGE";
109                 RemoveNativeEventHandler(efl.Libs.Ecore, key, value);
110             }
111         }
112     }
113     /// <summary>Method to raise event MessageEvt.</summary>
114     public void OnMessageEvt(Efl.LoopMessageMessageEvt_Args e)
115     {
116         var key = "_EFL_LOOP_MESSAGE_EVENT_MESSAGE";
117         IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Ecore, key);
118         if (desc == IntPtr.Zero)
119         {
120             Eina.Log.Error($"Failed to get native event {key}");
121             return;
122         }
123
124         IntPtr info = e.arg.NativeHandle;
125         Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, info);
126     }
127     private static IntPtr GetEflClassStatic()
128     {
129         return Efl.LoopMessage.efl_loop_message_class_get();
130     }
131     /// <summary>Wrapper for native methods and virtual method delegates.
132     /// For internal use by generated code only.</summary>
133     public new class NativeMethods : Efl.Object.NativeMethods
134     {
135         /// <summary>Gets the list of Eo operations to override.</summary>
136         /// <returns>The list of Eo operations to be overload.</returns>
137         public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
138         {
139             var descs = new System.Collections.Generic.List<Efl_Op_Description>();
140             descs.AddRange(base.GetEoOps(type));
141             return descs;
142         }
143         /// <summary>Returns the Eo class for the native methods of this class.</summary>
144         /// <returns>The native class pointer.</returns>
145         public override IntPtr GetEflClass()
146         {
147             return Efl.LoopMessage.efl_loop_message_class_get();
148         }
149
150         #pragma warning disable CA1707, CS1591, SA1300, SA1600
151
152         #pragma warning restore CA1707, CS1591, SA1300, SA1600
153
154 }
155 }
156 }
157
158 #if EFL_BETA
159 #pragma warning disable CS1591
160 public static class EflLoopMessage_ExtensionMethods {
161 }
162 #pragma warning restore CS1591
163 #endif