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.
17 using System.ComponentModel;
21 internal class AdaptorSignalType : Disposable
23 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
27 /// <since_tizen> 4 </since_tizen>
28 /// This will be changed internal API after ACR done. Before ACR, need to be hidden as inhouse API.
29 [EditorBrowsable(EditorBrowsableState.Never)]
30 protected bool swigCMemOwn;
32 internal AdaptorSignalType(global::System.IntPtr cPtr, bool cMemoryOwn)
34 swigCMemOwn = cMemoryOwn;
35 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
38 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(AdaptorSignalType obj)
40 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
46 /// <since_tizen> 4 </since_tizen>
47 /// This will be changed internal API after ACR done. Before ACR, need to be hidden as inhouse API.
48 [EditorBrowsable(EditorBrowsableState.Never)]
49 protected override void Dispose(DisposeTypes type)
51 if (swigCPtr.Handle != global::System.IntPtr.Zero)
56 Interop.Adaptor.delete_AdaptorSignalType(swigCPtr);
58 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
64 /// Queries whether there are any connected slots.
66 /// <returns>True if there are any slots connected to the signal</returns>
67 /// <since_tizen> 4 </since_tizen>
68 /// This will be changed internal API after ACR done. Before ACR, need to be hidden as inhouse API.
69 [EditorBrowsable(EditorBrowsableState.Never)]
72 bool ret = Interop.Adaptor.AdaptorSignalType_Empty(swigCPtr);
73 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
78 /// Queries the number of slots.
80 /// <returns>The number of slots connected to this signal</returns>
81 /// <since_tizen> 4 </since_tizen>
82 /// This will be changed internal API after ACR done. Before ACR, need to be hidden as inhouse API.
83 [EditorBrowsable(EditorBrowsableState.Never)]
84 public uint GetConnectionCount()
86 uint ret = Interop.Adaptor.AdaptorSignalType_GetConnectionCount(swigCPtr);
87 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
92 /// Connects a function.
94 /// <param name="func">The function to connect</param>
95 /// <since_tizen> 4 </since_tizen>
96 /// This will be changed internal API after ACR done. Before ACR, need to be hidden as inhouse API.
97 [EditorBrowsable(EditorBrowsableState.Never)]
98 public void Connect(System.Delegate func)
100 System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate<System.Delegate>(func);
102 Interop.Adaptor.AdaptorSignalType_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
103 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
108 /// Disconnects a function.
110 /// <param name="func">The function to disconnect</param>
111 /// <since_tizen> 4 </since_tizen>
112 /// This will be changed internal API after ACR done. Before ACR, need to be hidden as inhouse API.
113 [EditorBrowsable(EditorBrowsableState.Never)]
114 public void Disconnect(System.Delegate func)
116 System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate<System.Delegate>(func);
118 Interop.Adaptor.AdaptorSignalType_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
119 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
124 /// Emits the signal.
126 /// <param name="arg">The first value to pass to callbacks</param>
127 /// <since_tizen> 4 </since_tizen>
128 /// This will be changed internal API after ACR done. Before ACR, need to be hidden as inhouse API.
129 [EditorBrowsable(EditorBrowsableState.Never)]
130 public void Emit(Adaptor arg)
132 Interop.Adaptor.AdaptorSignalType_Emit(swigCPtr, Adaptor.getCPtr(arg));
133 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
139 /// <since_tizen> 4 </since_tizen>
140 /// This will be changed internal API after ACR done. Before ACR, need to be hidden as inhouse API.
141 [EditorBrowsable(EditorBrowsableState.Never)]
142 public AdaptorSignalType() : this(Interop.Adaptor.new_AdaptorSignalType(), true)
144 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();