103ae50fc9d0a637cffab5f37d2c1e2e78d4a76e
[platform/core/csapi/tizenfx.git] / internals / src / EflSharp / EflSharp / efl / efl_ui_win_socket.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.ComponentModel;
7 namespace Efl { namespace Ui { 
8 /// <summary>An off-screen window to be displayed in a remote process.
9 /// The window is rendered onto an image buffer to be displayed in another process&apos; plug image object. No actual window is created for this type. The window contents can then be sent over a socket so that another process displays it inside a plug image.</summary>
10 [WinSocketNativeInherit]
11 public class WinSocket : Efl.Ui.Win, Efl.Eo.IWrapper
12 {
13     ///<summary>Pointer to the native class description.</summary>
14     public override System.IntPtr NativeClass {
15         get {
16             if (((object)this).GetType() == typeof (WinSocket))
17                 return Efl.Ui.WinSocketNativeInherit.GetEflClassStatic();
18             else
19                 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
20         }
21     }
22     [System.Runtime.InteropServices.DllImport(efl.Libs.Elementary)] internal static extern System.IntPtr
23         efl_ui_win_socket_class_get();
24     ///<summary>Creates a new instance.</summary>
25     ///<param name="parent">Parent instance.</param>
26     ///<param name="style">The widget style to use. See <see cref="Efl.Ui.Widget.SetStyle"/></param>
27     ///<param name="winName">The window name. See <see cref="Efl.Ui.Win.SetWinName"/></param>
28     ///<param name="winType">The type of the window. See <see cref="Efl.Ui.Win.SetWinType"/></param>
29     ///<param name="accelPreference">The hardware acceleration preference for this window. See <see cref="Efl.Ui.Win.SetAccelPreference"/></param>
30     public WinSocket(Efl.Object parent
31             , System.String style = null, System.String winName = null, Efl.Ui.WinType? winType = null, System.String accelPreference = null) :
32         base(efl_ui_win_socket_class_get(), typeof(WinSocket), parent)
33     {
34         if (Efl.Eo.Globals.ParamHelperCheck(style))
35             SetStyle(Efl.Eo.Globals.GetParamHelper(style));
36         if (Efl.Eo.Globals.ParamHelperCheck(winName))
37             SetWinName(Efl.Eo.Globals.GetParamHelper(winName));
38         if (Efl.Eo.Globals.ParamHelperCheck(winType))
39             SetWinType(Efl.Eo.Globals.GetParamHelper(winType));
40         if (Efl.Eo.Globals.ParamHelperCheck(accelPreference))
41             SetAccelPreference(Efl.Eo.Globals.GetParamHelper(accelPreference));
42         FinishInstantiation();
43     }
44     ///<summary>Internal usage: Constructs an instance from a native pointer. This is used when interacting with C code and should not be used directly.</summary>
45     protected WinSocket(System.IntPtr raw) : base(raw)
46     {
47                 RegisterEventProxies();
48     }
49     ///<summary>Internal usage: Constructor to forward the wrapper initialization to the root class that interfaces with native code. Should not be used directly.</summary>
50     protected WinSocket(IntPtr base_klass, System.Type managed_type, Efl.Object parent) : base(base_klass, managed_type, parent) {}
51     ///<summary>Verifies if the given object is equal to this one.</summary>
52     public override bool Equals(object obj)
53     {
54         var other = obj as Efl.Object;
55         if (other == null)
56             return false;
57         return this.NativeHandle == other.NativeHandle;
58     }
59     ///<summary>Gets the hash code for this object based on the native pointer it points to.</summary>
60     public override int GetHashCode()
61     {
62         return this.NativeHandle.ToInt32();
63     }
64     ///<summary>Turns the native pointer into a string representation.</summary>
65     public override String ToString()
66     {
67         return $"{this.GetType().Name}@[{this.NativeHandle.ToInt32():x}]";
68     }
69     ///<summary>Register the Eo event wrappers making the bridge to C# events. Internal usage only.</summary>
70     protected override void RegisterEventProxies()
71     {
72         base.RegisterEventProxies();
73     }
74     /// <summary>Create a socket to provide the service for Plug widget.</summary>
75     /// <param name="svcname">The name of the service to be advertised. Ensure that it is unique (when combined with <c>svcnum</c>) otherwise creation may fail.</param>
76     /// <param name="svcnum">A number (any value, 0 being the common default) to differentiate multiple instances of services with the same name.</param>
77     /// <param name="svcsys">A boolean which when true specifies the creation of a system-wide service to which all users can connect, otherwise the service is private to the user id that created it.</param>
78     /// <returns><c>true</c> on success, <c>false</c> otherwise</returns>
79     virtual public bool SocketListen( System.String svcname,  int svcnum,  bool svcsys) {
80                                                                                  var _ret_var = Efl.Ui.WinSocketNativeInherit.efl_ui_win_socket_listen_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle), svcname,  svcnum,  svcsys);
81         Eina.Error.RaiseIfUnhandledException();
82                                                         return _ret_var;
83  }
84     private static IntPtr GetEflClassStatic()
85     {
86         return Efl.Ui.WinSocket.efl_ui_win_socket_class_get();
87     }
88 }
89 public class WinSocketNativeInherit : Efl.Ui.WinNativeInherit{
90     public new  static Efl.Eo.NativeModule _Module = new Efl.Eo.NativeModule(efl.Libs.Elementary);
91     public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
92     {
93         var descs = new System.Collections.Generic.List<Efl_Op_Description>();
94         var methods = Efl.Eo.Globals.GetUserMethods(type);
95         if (efl_ui_win_socket_listen_static_delegate == null)
96             efl_ui_win_socket_listen_static_delegate = new efl_ui_win_socket_listen_delegate(socket_listen);
97         if (methods.FirstOrDefault(m => m.Name == "SocketListen") != null)
98             descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_ui_win_socket_listen"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_win_socket_listen_static_delegate)});
99         descs.AddRange(base.GetEoOps(type));
100         return descs;
101     }
102     public override IntPtr GetEflClass()
103     {
104         return Efl.Ui.WinSocket.efl_ui_win_socket_class_get();
105     }
106     public static new  IntPtr GetEflClassStatic()
107     {
108         return Efl.Ui.WinSocket.efl_ui_win_socket_class_get();
109     }
110
111
112      [return: MarshalAs(UnmanagedType.U1)] private delegate bool efl_ui_win_socket_listen_delegate(System.IntPtr obj, System.IntPtr pd,  [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))]  System.String svcname,   int svcnum,  [MarshalAs(UnmanagedType.U1)]  bool svcsys);
113
114
115      [return: MarshalAs(UnmanagedType.U1)] public delegate bool efl_ui_win_socket_listen_api_delegate(System.IntPtr obj,  [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))]  System.String svcname,   int svcnum,  [MarshalAs(UnmanagedType.U1)]  bool svcsys);
116      public static Efl.Eo.FunctionWrapper<efl_ui_win_socket_listen_api_delegate> efl_ui_win_socket_listen_ptr = new Efl.Eo.FunctionWrapper<efl_ui_win_socket_listen_api_delegate>(_Module, "efl_ui_win_socket_listen");
117      private static bool socket_listen(System.IntPtr obj, System.IntPtr pd,  System.String svcname,  int svcnum,  bool svcsys)
118     {
119         Eina.Log.Debug("function efl_ui_win_socket_listen was called");
120         Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
121         if(wrapper != null) {
122                                                                                                 bool _ret_var = default(bool);
123             try {
124                 _ret_var = ((WinSocket)wrapper).SocketListen( svcname,  svcnum,  svcsys);
125             } catch (Exception e) {
126                 Eina.Log.Warning($"Callback error: {e.ToString()}");
127                 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
128             }
129                                                         return _ret_var;
130         } else {
131             return efl_ui_win_socket_listen_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)),  svcname,  svcnum,  svcsys);
132         }
133     }
134     private static efl_ui_win_socket_listen_delegate efl_ui_win_socket_listen_static_delegate;
135 }
136 } }