[NUI] Add Extents type Padding in View
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / internal / LanguageChangedSignalType.cs
1 /*
2  * Copyright(c) 2017 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     /// <summary>
24     /// Please do not use! this will be deprecated
25     /// </summary>
26     /// <since_tizen> 4 </since_tizen>
27     [EditorBrowsable(EditorBrowsableState.Never)]
28     public class LanguageChangedSignalType : global::System.IDisposable
29     {
30         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
31         /// <summary>
32         /// LanguageChangedSignalType
33         /// </summary>
34         /// <since_tizen> 4 </since_tizen>
35         protected bool swigCMemOwn;
36
37         internal LanguageChangedSignalType(global::System.IntPtr cPtr, bool cMemoryOwn)
38         {
39             swigCMemOwn = cMemoryOwn;
40             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
41         }
42
43         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(LanguageChangedSignalType obj)
44         {
45             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
46         }
47
48         //A Flag to check who called Dispose(). (By User or DisposeQueue)
49         private bool isDisposeQueued = false;
50         /// <summary>
51         /// A Flat to check if it is already disposed.
52         /// </summary>
53         /// <since_tizen> 4 </since_tizen>
54         protected bool disposed = false;
55
56         /// <summary>
57         /// Dispose
58         /// </summary>
59         ~LanguageChangedSignalType()
60         {
61             if (!isDisposeQueued)
62             {
63                 isDisposeQueued = true;
64                 DisposeQueue.Instance.Add(this);
65             }
66         }
67
68         /// <summary>
69         /// Dispose
70         /// </summary>
71         /// <since_tizen> 4 </since_tizen>
72         public void Dispose()
73         {
74             //Throw excpetion if Dispose() is called in separate thread.
75             if (!Window.IsInstalled())
76             {
77                 throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
78             }
79
80             if (isDisposeQueued)
81             {
82                 Dispose(DisposeTypes.Implicit);
83             }
84             else
85             {
86                 Dispose(DisposeTypes.Explicit);
87                 System.GC.SuppressFinalize(this);
88             }
89         }
90
91         /// <summary>
92         /// Dispose
93         /// </summary>
94         /// <since_tizen> 4 </since_tizen>
95         protected virtual void Dispose(DisposeTypes type)
96         {
97             if (disposed)
98             {
99                 return;
100             }
101
102             if (type == DisposeTypes.Explicit)
103             {
104                 //Called by User
105                 //Release your own managed resources here.
106                 //You should release all of your own disposable objects here.
107
108             }
109
110             //Release your own unmanaged resources here.
111             //You should not access any managed member here except static instance.
112             //because the execution order of Finalizes is non-deterministic.
113
114             if (swigCPtr.Handle != global::System.IntPtr.Zero)
115             {
116                 if (swigCMemOwn)
117                 {
118                     swigCMemOwn = false;
119                     NDalicManualPINVOKE.delete_LanguageChangedSignalType(swigCPtr);
120                 }
121                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
122             }
123
124             disposed = true;
125         }
126
127         /// <summary>
128         /// Queries whether there are any connected slots.
129         /// </summary>
130         /// <returns>True if there are any slots connected to the signal</returns>
131         /// <since_tizen> 4 </since_tizen>
132         public bool Empty()
133         {
134             bool ret = NDalicManualPINVOKE.LanguageChangedSignalType_Empty(swigCPtr);
135             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
136             return ret;
137         }
138
139         /// <summary>
140         /// Queries the number of slots.
141         /// </summary>
142         /// <returns>The number of slots connected to this signal</returns>
143         /// <since_tizen> 4 </since_tizen>
144         public uint GetConnectionCount()
145         {
146             uint ret = NDalicManualPINVOKE.LanguageChangedSignalType_GetConnectionCount(swigCPtr);
147             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
148             return ret;
149         }
150
151         /// <summary>
152         /// Connects a member function.
153         /// </summary>
154         /// <param name="func">The member function to connect</param>
155         /// <since_tizen> 4 </since_tizen>
156         public void Connect(System.Delegate func)
157         {
158             System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func);
159             {
160                 NDalicManualPINVOKE.LanguageChangedSignalType_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
161                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
162             }
163         }
164
165         /// <summary>
166         /// Disconnects a function.
167         /// </summary>
168         /// <param name="func">The function to disconnect</param>
169         /// <since_tizen> 4 </since_tizen>
170         public void Disconnect(System.Delegate func)
171         {
172             System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func);
173             {
174                 NDalicManualPINVOKE.LanguageChangedSignalType_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
175                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
176             }
177         }
178
179         /// <summary>
180         /// Emits the signal.
181         /// </summary>
182         /// <since_tizen> 4 </since_tizen>
183         public void Emit(int arg)
184         {
185             NDalicManualPINVOKE.LanguageChangedSignalType_Emit(swigCPtr, arg);
186             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
187         }
188
189         /// <summary>
190         /// The contructor.
191         /// </summary>
192         /// <since_tizen> 4 </since_tizen>
193         public LanguageChangedSignalType() : this(NDalicManualPINVOKE.new_LanguageChangedSignalType(), true)
194         {
195             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
196         }
197
198     }
199
200 }