2 * Copyright(c) 2017 Samsung Electronics Co., Ltd.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
21 /// public class AdaptorSignalType : global::System.IDisposable
23 /// <since_tizen> 3 </since_tizen>
24 public class AdaptorSignalType : global::System.IDisposable
26 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
30 /// <since_tizen> 3 </since_tizen>
31 protected bool swigCMemOwn;
33 internal AdaptorSignalType(global::System.IntPtr cPtr, bool cMemoryOwn)
35 swigCMemOwn = cMemoryOwn;
36 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
39 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(AdaptorSignalType obj)
41 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
47 /// <since_tizen> 3 </since_tizen>
56 /// <since_tizen> 3 </since_tizen>
57 public virtual void Dispose()
61 if (swigCPtr.Handle != global::System.IntPtr.Zero)
66 NDalicManualPINVOKE.delete_AdaptorSignalType(swigCPtr);
68 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
70 global::System.GC.SuppressFinalize(this);
75 /// Queries whether there are any connected slots.
77 /// <returns>True if there are any slots connected to the signal</returns>
78 /// <since_tizen> 3 </since_tizen>
81 bool ret = NDalicManualPINVOKE.AdaptorSignalType_Empty(swigCPtr);
82 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
87 /// Queries the number of slots.
89 /// <returns>The number of slots connected to this signal</returns>
90 /// <since_tizen> 3 </since_tizen>
91 public uint GetConnectionCount()
93 uint ret = NDalicManualPINVOKE.AdaptorSignalType_GetConnectionCount(swigCPtr);
94 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
99 /// Connects a function.
101 /// <param name="func">The function to connect</param>
102 /// <since_tizen> 3 </since_tizen>
103 public void Connect(System.Delegate func)
105 System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate<System.Delegate>(func);
107 NDalicManualPINVOKE.AdaptorSignalType_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
108 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
113 /// Disconnects a function.
115 /// <param name="func">The function to disconnect</param>
116 /// <since_tizen> 3 </since_tizen>
117 public void Disconnect(System.Delegate func)
119 System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate<System.Delegate>(func);
121 NDalicManualPINVOKE.AdaptorSignalType_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
122 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
127 /// Emits the signal.
129 /// <param name="arg">The first value to pass to callbacks</param>
130 /// <since_tizen> 3 </since_tizen>
131 public void Emit(Adaptor arg)
133 NDalicManualPINVOKE.AdaptorSignalType_Emit(swigCPtr, Adaptor.getCPtr(arg));
134 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
140 /// <since_tizen> 3 </since_tizen>
141 public AdaptorSignalType() : this(NDalicManualPINVOKE.new_AdaptorSignalType(), true)
143 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();