[NUI] Refactor dispose pattern to reduce duplication (#1112)
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / internal / KeyboardResizedSignalType.cs
1 /*
2  * Copyright(c) 2019 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;
18 using System.Runtime.InteropServices;
19 using System.ComponentModel;
20
21 namespace Tizen.NUI
22 {
23     internal class KeyboardResizedSignalType : Disposable
24     {
25
26         internal KeyboardResizedSignalType(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
27         {
28         }
29
30         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(KeyboardResizedSignalType obj)
31         {
32             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
33         }
34
35         protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
36         {
37             Interop.KeyboardResizedSignalType.delete_KeyboardResizedSignalType(swigCPtr);
38         }
39
40         /// <summary>
41         /// Queries whether there are any connected slots.
42         /// </summary>
43         /// <returns>True if there are any slots connected to the signal</returns>
44         /// <since_tizen> 4 </since_tizen>
45         public bool Empty()
46         {
47             bool ret = Interop.KeyboardResizedSignalType.KeyboardResizedSignalType_Empty(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         /// <since_tizen> 4 </since_tizen>
57         public uint GetConnectionCount()
58         {
59             uint ret = Interop.KeyboardResizedSignalType.KeyboardResizedSignalType_GetConnectionCount(swigCPtr);
60             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
61             return ret;
62         }
63
64         /// <summary>
65         /// Connects a function.
66         /// </summary>
67         /// <param name="func">The function to connect</param>
68         /// <since_tizen> 4 </since_tizen>
69         public void Connect(System.Delegate func)
70         {
71             System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func);
72             {
73                 Interop.KeyboardResizedSignalType.KeyboardResizedSignalType_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
74                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
75             }
76         }
77
78         /// <summary>
79         /// Disconnects a function.
80         /// </summary>
81         /// <param name="func">The function to disconnect</param>
82         /// <since_tizen> 4 </since_tizen>
83         public void Disconnect(System.Delegate func)
84         {
85             System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func);
86             {
87                 Interop.KeyboardResizedSignalType.KeyboardResizedSignalType_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
88                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
89             }
90         }
91
92         /// <summary>
93         /// Connects a member function.
94         /// </summary>
95         /// <param name="arg">The member function to connect</param>
96         /// <since_tizen> 4 </since_tizen>
97         public void Emit(int arg)
98         {
99             Interop.KeyboardResizedSignalType.KeyboardResizedSignalType_Emit(swigCPtr, arg);
100             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
101         }
102
103         /// <summary>
104         /// The contructor.
105         /// </summary>
106         /// <since_tizen> 4 </since_tizen>
107         public KeyboardResizedSignalType() : this(Interop.KeyboardResizedSignalType.new_KeyboardResizedSignalType(), true)
108         {
109             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
110         }
111     }
112 }