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