[EflSharp] Update Circle and efl cs files (#819)
[platform/core/csapi/tizenfx.git] / internals / src / EflSharp / EflSharp / efl / efl_playable.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>Efl media playable interface</summary>
11 [Efl.IPlayableConcrete.NativeMethods]
12 public interface IPlayable : 
13     Efl.Eo.IWrapper, IDisposable
14 {
15     /// <summary>Get the length of play for the media file.</summary>
16 /// <returns>The length of the stream in seconds.</returns>
17 double GetLength();
18     bool GetPlayable();
19     /// <summary>Get whether the media file is seekable.</summary>
20 /// <returns><c>true</c> if seekable.</returns>
21 bool GetSeekable();
22                 /// <summary>Get the length of play for the media file.</summary>
23 /// <value>The length of the stream in seconds.</value>
24     double Length {
25         get ;
26     }
27         bool Playable {
28         get ;
29     }
30     /// <summary>Get whether the media file is seekable.</summary>
31 /// <value><c>true</c> if seekable.</value>
32     bool Seekable {
33         get ;
34     }
35 }
36 /// <summary>Efl media playable interface</summary>
37 sealed public class IPlayableConcrete : 
38
39 IPlayable
40     
41 {
42     ///<summary>Pointer to the native class description.</summary>
43     public System.IntPtr NativeClass
44     {
45         get
46         {
47             if (((object)this).GetType() == typeof(IPlayableConcrete))
48             {
49                 return GetEflClassStatic();
50             }
51             else
52             {
53                 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
54             }
55         }
56     }
57
58     private  System.IntPtr handle;
59     ///<summary>Pointer to the native instance.</summary>
60     public System.IntPtr NativeHandle
61     {
62         get { return handle; }
63     }
64
65     [System.Runtime.InteropServices.DllImport(efl.Libs.Efl)] internal static extern System.IntPtr
66         efl_playable_interface_get();
67     /// <summary>Initializes a new instance of the <see cref="IPlayable"/> class.
68     /// Internal usage: This is used when interacting with C code and should not be used directly.</summary>
69     private IPlayableConcrete(System.IntPtr raw)
70     {
71         handle = raw;
72     }
73     ///<summary>Destructor.</summary>
74     ~IPlayableConcrete()
75     {
76         Dispose(false);
77     }
78
79     ///<summary>Releases the underlying native instance.</summary>
80     private void Dispose(bool disposing)
81     {
82         if (handle != System.IntPtr.Zero)
83         {
84             IntPtr h = handle;
85             handle = IntPtr.Zero;
86
87             IntPtr gcHandlePtr = IntPtr.Zero;
88             if (disposing)
89             {
90                 Efl.Eo.Globals.efl_mono_native_dispose(h, gcHandlePtr);
91             }
92             else
93             {
94                 Monitor.Enter(Efl.All.InitLock);
95                 if (Efl.All.MainLoopInitialized)
96                 {
97                     Efl.Eo.Globals.efl_mono_thread_safe_native_dispose(h, gcHandlePtr);
98                 }
99
100                 Monitor.Exit(Efl.All.InitLock);
101             }
102         }
103
104     }
105
106     ///<summary>Releases the underlying native instance.</summary>
107     public void Dispose()
108     {
109         Dispose(true);
110         GC.SuppressFinalize(this);
111     }
112
113     /// <summary>Verifies if the given object is equal to this one.</summary>
114     /// <param name="instance">The object to compare to.</param>
115     /// <returns>True if both objects point to the same native object.</returns>
116     public override bool Equals(object instance)
117     {
118         var other = instance as Efl.Object;
119         if (other == null)
120         {
121             return false;
122         }
123         return this.NativeHandle == other.NativeHandle;
124     }
125
126     /// <summary>Gets the hash code for this object based on the native pointer it points to.</summary>
127     /// <returns>The value of the pointer, to be used as the hash code of this object.</returns>
128     public override int GetHashCode()
129     {
130         return this.NativeHandle.ToInt32();
131     }
132
133     /// <summary>Turns the native pointer into a string representation.</summary>
134     /// <returns>A string with the type and the native pointer for this object.</returns>
135     public override String ToString()
136     {
137         return $"{this.GetType().Name}@[{this.NativeHandle.ToInt32():x}]";
138     }
139
140     /// <summary>Get the length of play for the media file.</summary>
141     /// <returns>The length of the stream in seconds.</returns>
142     public double GetLength() {
143          var _ret_var = Efl.IPlayableConcrete.NativeMethods.efl_playable_length_get_ptr.Value.Delegate(this.NativeHandle);
144         Eina.Error.RaiseIfUnhandledException();
145         return _ret_var;
146  }
147     public bool GetPlayable() {
148          var _ret_var = Efl.IPlayableConcrete.NativeMethods.efl_playable_get_ptr.Value.Delegate(this.NativeHandle);
149         Eina.Error.RaiseIfUnhandledException();
150         return _ret_var;
151  }
152     /// <summary>Get whether the media file is seekable.</summary>
153     /// <returns><c>true</c> if seekable.</returns>
154     public bool GetSeekable() {
155          var _ret_var = Efl.IPlayableConcrete.NativeMethods.efl_playable_seekable_get_ptr.Value.Delegate(this.NativeHandle);
156         Eina.Error.RaiseIfUnhandledException();
157         return _ret_var;
158  }
159     /// <summary>Get the length of play for the media file.</summary>
160 /// <value>The length of the stream in seconds.</value>
161     public double Length {
162         get { return GetLength(); }
163     }
164         public bool Playable {
165         get { return GetPlayable(); }
166     }
167     /// <summary>Get whether the media file is seekable.</summary>
168 /// <value><c>true</c> if seekable.</value>
169     public bool Seekable {
170         get { return GetSeekable(); }
171     }
172     private static IntPtr GetEflClassStatic()
173     {
174         return Efl.IPlayableConcrete.efl_playable_interface_get();
175     }
176     /// <summary>Wrapper for native methods and virtual method delegates.
177     /// For internal use by generated code only.</summary>
178     public class NativeMethods  : Efl.Eo.NativeClass
179     {
180         private static Efl.Eo.NativeModule Module = new Efl.Eo.NativeModule(    efl.Libs.Efl);
181         /// <summary>Gets the list of Eo operations to override.</summary>
182         /// <returns>The list of Eo operations to be overload.</returns>
183         public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
184         {
185             var descs = new System.Collections.Generic.List<Efl_Op_Description>();
186             var methods = Efl.Eo.Globals.GetUserMethods(type);
187
188             if (efl_playable_length_get_static_delegate == null)
189             {
190                 efl_playable_length_get_static_delegate = new efl_playable_length_get_delegate(length_get);
191             }
192
193             if (methods.FirstOrDefault(m => m.Name == "GetLength") != null)
194             {
195                 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_playable_length_get"), func = Marshal.GetFunctionPointerForDelegate(efl_playable_length_get_static_delegate) });
196             }
197
198             if (efl_playable_get_static_delegate == null)
199             {
200                 efl_playable_get_static_delegate = new efl_playable_get_delegate(playable_get);
201             }
202
203             if (methods.FirstOrDefault(m => m.Name == "GetPlayable") != null)
204             {
205                 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_playable_get"), func = Marshal.GetFunctionPointerForDelegate(efl_playable_get_static_delegate) });
206             }
207
208             if (efl_playable_seekable_get_static_delegate == null)
209             {
210                 efl_playable_seekable_get_static_delegate = new efl_playable_seekable_get_delegate(seekable_get);
211             }
212
213             if (methods.FirstOrDefault(m => m.Name == "GetSeekable") != null)
214             {
215                 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_playable_seekable_get"), func = Marshal.GetFunctionPointerForDelegate(efl_playable_seekable_get_static_delegate) });
216             }
217
218             return descs;
219         }
220         /// <summary>Returns the Eo class for the native methods of this class.</summary>
221         /// <returns>The native class pointer.</returns>
222         public override IntPtr GetEflClass()
223         {
224             return Efl.IPlayableConcrete.efl_playable_interface_get();
225         }
226
227         #pragma warning disable CA1707, SA1300, SA1600
228
229         
230         private delegate double efl_playable_length_get_delegate(System.IntPtr obj, System.IntPtr pd);
231
232         
233         public delegate double efl_playable_length_get_api_delegate(System.IntPtr obj);
234
235         public static Efl.Eo.FunctionWrapper<efl_playable_length_get_api_delegate> efl_playable_length_get_ptr = new Efl.Eo.FunctionWrapper<efl_playable_length_get_api_delegate>(Module, "efl_playable_length_get");
236
237         private static double length_get(System.IntPtr obj, System.IntPtr pd)
238         {
239             Eina.Log.Debug("function efl_playable_length_get was called");
240             Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
241             if (wrapper != null)
242             {
243             double _ret_var = default(double);
244                 try
245                 {
246                     _ret_var = ((IPlayable)wrapper).GetLength();
247                 }
248                 catch (Exception e)
249                 {
250                     Eina.Log.Warning($"Callback error: {e.ToString()}");
251                     Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
252                 }
253
254         return _ret_var;
255
256             }
257             else
258             {
259                 return efl_playable_length_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
260             }
261         }
262
263         private static efl_playable_length_get_delegate efl_playable_length_get_static_delegate;
264
265         [return: MarshalAs(UnmanagedType.U1)]
266         private delegate bool efl_playable_get_delegate(System.IntPtr obj, System.IntPtr pd);
267
268         [return: MarshalAs(UnmanagedType.U1)]
269         public delegate bool efl_playable_get_api_delegate(System.IntPtr obj);
270
271         public static Efl.Eo.FunctionWrapper<efl_playable_get_api_delegate> efl_playable_get_ptr = new Efl.Eo.FunctionWrapper<efl_playable_get_api_delegate>(Module, "efl_playable_get");
272
273         private static bool playable_get(System.IntPtr obj, System.IntPtr pd)
274         {
275             Eina.Log.Debug("function efl_playable_get was called");
276             Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
277             if (wrapper != null)
278             {
279             bool _ret_var = default(bool);
280                 try
281                 {
282                     _ret_var = ((IPlayable)wrapper).GetPlayable();
283                 }
284                 catch (Exception e)
285                 {
286                     Eina.Log.Warning($"Callback error: {e.ToString()}");
287                     Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
288                 }
289
290         return _ret_var;
291
292             }
293             else
294             {
295                 return efl_playable_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
296             }
297         }
298
299         private static efl_playable_get_delegate efl_playable_get_static_delegate;
300
301         [return: MarshalAs(UnmanagedType.U1)]
302         private delegate bool efl_playable_seekable_get_delegate(System.IntPtr obj, System.IntPtr pd);
303
304         [return: MarshalAs(UnmanagedType.U1)]
305         public delegate bool efl_playable_seekable_get_api_delegate(System.IntPtr obj);
306
307         public static Efl.Eo.FunctionWrapper<efl_playable_seekable_get_api_delegate> efl_playable_seekable_get_ptr = new Efl.Eo.FunctionWrapper<efl_playable_seekable_get_api_delegate>(Module, "efl_playable_seekable_get");
308
309         private static bool seekable_get(System.IntPtr obj, System.IntPtr pd)
310         {
311             Eina.Log.Debug("function efl_playable_seekable_get was called");
312             Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
313             if (wrapper != null)
314             {
315             bool _ret_var = default(bool);
316                 try
317                 {
318                     _ret_var = ((IPlayable)wrapper).GetSeekable();
319                 }
320                 catch (Exception e)
321                 {
322                     Eina.Log.Warning($"Callback error: {e.ToString()}");
323                     Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
324                 }
325
326         return _ret_var;
327
328             }
329             else
330             {
331                 return efl_playable_seekable_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
332             }
333         }
334
335         private static efl_playable_seekable_get_delegate efl_playable_seekable_get_static_delegate;
336
337         #pragma warning restore CA1707, SA1300, SA1600
338
339 }
340 }
341 }
342