[NUI] Add license, delete unnecessary code (#2679)
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / internal / Common / LanguageChangedSignalType.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 using System;
18 using System.Runtime.InteropServices;
19 using System.ComponentModel;
20
21 namespace Tizen.NUI
22 {
23     internal class LanguageChangedSignalType : Disposable
24     {
25         internal LanguageChangedSignalType(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
26         {
27         }
28
29         protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
30         {
31             Interop.LanguageChangedSignalType.DeleteLanguageChangedSignalType(swigCPtr);
32         }
33
34         /// <summary>
35         /// Queries whether there are any connected slots.
36         /// </summary>
37         /// <returns>True if there are any slots connected to the signal</returns>
38         public bool Empty()
39         {
40             bool ret = Interop.LanguageChangedSignalType.Empty(SwigCPtr);
41             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
42             return ret;
43         }
44
45         /// <summary>
46         /// Queries the number of slots.
47         /// </summary>
48         /// <returns>The number of slots connected to this signal</returns>
49         public uint GetConnectionCount()
50         {
51             uint ret = Interop.LanguageChangedSignalType.GetConnectionCount(SwigCPtr);
52             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
53             return ret;
54         }
55
56         /// <summary>
57         /// Connects a member function.
58         /// </summary>
59         /// <param name="func">The member function to connect</param>
60         public void Connect(System.Delegate func)
61         {
62             System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func);
63             {
64                 Interop.LanguageChangedSignalType.Connect(SwigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
65                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
66             }
67         }
68
69         /// <summary>
70         /// Disconnects a function.
71         /// </summary>
72         /// <param name="func">The function to disconnect</param>
73         public void Disconnect(System.Delegate func)
74         {
75             System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func);
76             {
77                 Interop.LanguageChangedSignalType.Disconnect(SwigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
78                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
79             }
80         }
81
82         /// <summary>
83         /// Emits the signal.
84         /// </summary>
85         public void Emit(int arg)
86         {
87             Interop.LanguageChangedSignalType.Emit(SwigCPtr, arg);
88             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
89         }
90
91         /// <summary>
92         /// The contructor.
93         /// </summary>
94         public LanguageChangedSignalType() : this(Interop.LanguageChangedSignalType.NewLanguageChangedSignalType(), true)
95         {
96             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
97         }
98     }
99 }