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