[NUI] Remove APIs which have been deprecated in API7
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / internal / Widget / WidgetViewSignal.cs
1 /*
2  * Copyright(c) 2021 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
18 using System;
19 using System.ComponentModel;
20
21 namespace Tizen.NUI
22 {
23     /// <summary>
24     /// WidgetViewSignal
25     /// </summary>
26     internal class WidgetViewSignal : Disposable
27     {
28
29         internal WidgetViewSignal(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
30         {
31         }
32
33
34         /// This will not be public opened.
35         [EditorBrowsable(EditorBrowsableState.Never)]
36         protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
37         {
38             Interop.WidgetView.DeleteWidgetViewSignal(swigCPtr);
39         }
40
41         /// <summary>
42         /// Queries whether there are any connected slots.
43         /// </summary>
44         /// <returns>True if there are any slots connected to the signal</returns>
45         internal bool Empty()
46         {
47             bool ret = Interop.WidgetView.WidgetViewSignalEmpty(SwigCPtr);
48             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
49             return ret;
50         }
51
52         /// <summary>
53         /// Queries the number of slots.
54         /// </summary>
55         /// <returns>The number of slots connected to this signal</returns>
56         internal uint GetConnectionCount()
57         {
58             uint ret = Interop.WidgetView.WidgetViewSignalGetConnectionCount(SwigCPtr);
59             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
60             return ret;
61         }
62
63         /// <summary>
64         /// Connects a function.
65         /// </summary>
66         /// <param name="func">The function to connect</param>
67         internal void Connect(System.Delegate func)
68         {
69             System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate<System.Delegate>(func);
70             {
71                 Interop.WidgetView.WidgetViewSignalConnect(SwigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
72                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
73             }
74         }
75
76         /// <summary>
77         /// Disconnects a function.
78         /// </summary>
79         /// <param name="func">The function to disconnect</param>
80         internal void Disconnect(System.Delegate func)
81         {
82             System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate<System.Delegate>(func);
83             {
84                 Interop.WidgetView.WidgetViewSignalDisconnect(SwigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
85                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
86             }
87         }
88
89         /// <summary>
90         /// Connects a member function.
91         /// </summary>
92         /// <param name="arg">The member function to connect</param>
93         internal void Emit(WidgetView arg)
94         {
95             Interop.WidgetView.WidgetViewSignalEmit(SwigCPtr, WidgetView.getCPtr(arg));
96             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
97         }
98
99         /// <summary>
100         /// The contructor.
101         /// </summary>
102         internal WidgetViewSignal() : this(Interop.WidgetView.NewWidgetViewSignal(), true)
103         {
104             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
105         }
106     }
107 }