[NUI] Fix Svace issue (#949)
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / internal / AdaptorSignalType.cs
1 /*
2  * Copyright(c) 2017 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17 using System.ComponentModel;
18
19 namespace Tizen.NUI
20 {
21     /// <summary>
22     /// public class AdaptorSignalType : global::System.IDisposable
23     /// </summary>
24     /// <since_tizen> 4 </since_tizen>
25     /// This will be changed internal API after ACR done. Before ACR, need to be hidden as inhouse API.
26     [EditorBrowsable(EditorBrowsableState.Never)]
27     public class AdaptorSignalType : global::System.IDisposable
28     {
29         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
30         /// <summary>
31         /// swigCMemOwn
32         /// </summary>
33         /// <since_tizen> 4 </since_tizen>
34         /// This will be changed internal API after ACR done. Before ACR, need to be hidden as inhouse API.
35         [EditorBrowsable(EditorBrowsableState.Never)]
36         protected bool swigCMemOwn;
37
38         internal AdaptorSignalType(global::System.IntPtr cPtr, bool cMemoryOwn)
39         {
40             swigCMemOwn = cMemoryOwn;
41             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
42         }
43
44         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(AdaptorSignalType obj)
45         {
46             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
47         }
48
49         /// <summary>
50         /// Dispose
51         /// </summary>
52         /// <since_tizen> 3 </since_tizen>
53         /// This will be changed internal API after ACR done. Before ACR, need to be hidden as inhouse API.
54         [EditorBrowsable(EditorBrowsableState.Never)]
55         ~AdaptorSignalType()
56         {
57             Dispose();
58         }
59
60         /// <summary>
61         /// Dispose
62         /// </summary>
63         /// <since_tizen> 4 </since_tizen>
64         /// This will be changed internal API after ACR done. Before ACR, need to be hidden as inhouse API.
65         [EditorBrowsable(EditorBrowsableState.Never)]
66         public virtual void Dispose()
67         {
68             lock (this)
69             {
70                 if (swigCPtr.Handle != global::System.IntPtr.Zero)
71                 {
72                     if (swigCMemOwn)
73                     {
74                         swigCMemOwn = false;
75                         Interop.Adaptor.delete_AdaptorSignalType(swigCPtr);
76                     }
77                     swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
78                 }
79                 global::System.GC.SuppressFinalize(this);
80             }
81         }
82
83         /// <summary>
84         /// Queries whether there are any connected slots.
85         /// </summary>
86         /// <returns>True if there are any slots connected to the signal</returns>
87         /// <since_tizen> 4 </since_tizen>
88         /// This will be changed internal API after ACR done. Before ACR, need to be hidden as inhouse API.
89         [EditorBrowsable(EditorBrowsableState.Never)]
90         public bool Empty()
91         {
92             bool ret = Interop.Adaptor.AdaptorSignalType_Empty(swigCPtr);
93             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
94             return ret;
95         }
96
97         /// <summary>
98         /// Queries the number of slots.
99         /// </summary>
100         /// <returns>The number of slots connected to this signal</returns>
101         /// <since_tizen> 4 </since_tizen>
102         /// This will be changed internal API after ACR done. Before ACR, need to be hidden as inhouse API.
103         [EditorBrowsable(EditorBrowsableState.Never)]
104         public uint GetConnectionCount()
105         {
106             uint ret = Interop.Adaptor.AdaptorSignalType_GetConnectionCount(swigCPtr);
107             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
108             return ret;
109         }
110
111         /// <summary>
112         /// Connects a function.
113         /// </summary>
114         /// <param name="func">The function to connect</param>
115         /// <since_tizen> 4 </since_tizen>
116         /// This will be changed internal API after ACR done. Before ACR, need to be hidden as inhouse API.
117         [EditorBrowsable(EditorBrowsableState.Never)]
118         public void Connect(System.Delegate func)
119         {
120             System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate<System.Delegate>(func);
121             {
122                 Interop.Adaptor.AdaptorSignalType_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
123                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
124             }
125         }
126
127         /// <summary>
128         /// Disconnects a function.
129         /// </summary>
130         /// <param name="func">The function to disconnect</param>
131         /// <since_tizen> 4 </since_tizen>
132         /// This will be changed internal API after ACR done. Before ACR, need to be hidden as inhouse API.
133         [EditorBrowsable(EditorBrowsableState.Never)]
134         public void Disconnect(System.Delegate func)
135         {
136             System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate<System.Delegate>(func);
137             {
138                 Interop.Adaptor.AdaptorSignalType_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
139                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
140             }
141         }
142
143         /// <summary>
144         /// Emits the signal.
145         /// </summary>
146         /// <param name="arg">The first value to pass to callbacks</param>
147         /// <since_tizen> 4 </since_tizen>
148         /// This will be changed internal API after ACR done. Before ACR, need to be hidden as inhouse API.
149         [EditorBrowsable(EditorBrowsableState.Never)]
150         public void Emit(Adaptor arg)
151         {
152             Interop.Adaptor.AdaptorSignalType_Emit(swigCPtr, Adaptor.getCPtr(arg));
153             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
154         }
155
156         /// <summary>
157         /// The contructor.
158         /// </summary>
159         /// <since_tizen> 4 </since_tizen>
160         /// This will be changed internal API after ACR done. Before ACR, need to be hidden as inhouse API.
161         [EditorBrowsable(EditorBrowsableState.Never)]
162         public AdaptorSignalType() : this(Interop.Adaptor.new_AdaptorSignalType(), true)
163         {
164             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
165         }
166
167     }
168
169 }