2 * Copyright(c) 2021 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.
19 using System.ComponentModel;
26 internal class WidgetViewSignal : Disposable
29 internal WidgetViewSignal(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
34 /// This will not be public opened.
35 [EditorBrowsable(EditorBrowsableState.Never)]
36 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
38 Interop.WidgetView.DeleteWidgetViewSignal(swigCPtr);
42 /// Queries whether there are any connected slots.
44 /// <returns>True if there are any slots connected to the signal</returns>
47 bool ret = Interop.WidgetView.WidgetViewSignalEmpty(SwigCPtr);
48 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
53 /// Queries the number of slots.
55 /// <returns>The number of slots connected to this signal</returns>
56 internal uint GetConnectionCount()
58 uint ret = Interop.WidgetView.WidgetViewSignalGetConnectionCount(SwigCPtr);
59 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
64 /// Connects a function.
66 /// <param name="func">The function to connect</param>
67 internal void Connect(System.Delegate func)
69 System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate<System.Delegate>(func);
71 Interop.WidgetView.WidgetViewSignalConnect(SwigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
72 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
77 /// Disconnects a function.
79 /// <param name="func">The function to disconnect</param>
80 internal void Disconnect(System.Delegate func)
82 System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate<System.Delegate>(func);
84 Interop.WidgetView.WidgetViewSignalDisconnect(SwigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
85 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
90 /// Connects a member function.
92 /// <param name="arg">The member function to connect</param>
93 internal void Emit(WidgetView arg)
95 Interop.WidgetView.WidgetViewSignalEmit(SwigCPtr, WidgetView.getCPtr(arg));
96 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
102 internal WidgetViewSignal() : this(Interop.WidgetView.NewWidgetViewSignal(), true)
104 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();