manual bind tts player for nui
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / UIComponents / ToggleButton.cs
1 /** Copyright (c) 2017 Samsung Electronics Co., Ltd.
2 *
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 *
15 */
16 // This File has been auto-generated by SWIG and then modified using DALi Ruby Scripts
17 //------------------------------------------------------------------------------
18 // <auto-generated />
19 //
20 // This file was automatically generated by SWIG (http://www.swig.org).
21 // Version 3.0.9
22 //
23 // Do not make changes to this file unless you know what you are doing--modify
24 // the SWIG interface file instead.
25 //------------------------------------------------------------------------------
26
27 using Tizen.NUI.BaseComponents;
28
29 namespace Tizen.NUI
30 {
31
32     public class ToggleButton : Tizen.NUI.UIComponents.Button
33     {
34         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
35
36         internal ToggleButton(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.ToggleButton_SWIGUpcast(cPtr), cMemoryOwn)
37         {
38             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
39         }
40
41         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ToggleButton obj)
42         {
43             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
44         }
45
46         protected override void Dispose(DisposeTypes type)
47         {
48             if (disposed)
49             {
50                 return;
51             }
52
53             if (type == DisposeTypes.Explicit)
54             {
55                 //Called by User
56                 //Release your own managed resources here.
57                 //You should release all of your own disposable objects here.
58
59             }
60
61             //Release your own unmanaged resources here.
62             //You should not access any managed member here except static instance.
63             //because the execution order of Finalizes is non-deterministic.
64
65             //Unreference this from if a static instance refer to this. 
66             ViewRegistry.UnregisterView(this);
67
68             if (swigCPtr.Handle != global::System.IntPtr.Zero)
69             {
70                 if (swigCMemOwn)
71                 {
72                     swigCMemOwn = false;
73                     NDalicPINVOKE.delete_ToggleButton(swigCPtr);
74                 }
75                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
76             }
77
78             base.Dispose(type);
79         }
80
81         public class Property : global::System.IDisposable
82         {
83             private global::System.Runtime.InteropServices.HandleRef swigCPtr;
84             protected bool swigCMemOwn;
85
86             internal Property(global::System.IntPtr cPtr, bool cMemoryOwn)
87             {
88                 swigCMemOwn = cMemoryOwn;
89                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
90             }
91
92             internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Property obj)
93             {
94                 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
95             }
96
97             //A Flag to check who called Dispose(). (By User or DisposeQueue)
98             private bool isDisposeQueued = false;
99             //A Flat to check if it is already disposed.
100             protected bool disposed = false;
101
102
103             ~Property()
104             {
105                 if (!isDisposeQueued)
106                 {
107                     isDisposeQueued = true;
108                     DisposeQueue.Instance.Add(this);
109                 }
110             }
111
112             public void Dispose()
113             {
114                 //Throw excpetion if Dispose() is called in separate thread.
115                 if (!Window.IsInstalled())
116                 {
117                     throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
118                 }
119
120                 if (isDisposeQueued)
121                 {
122                     Dispose(DisposeTypes.Implicit);
123                 }
124                 else
125                 {
126                     Dispose(DisposeTypes.Explicit);
127                     System.GC.SuppressFinalize(this);
128                 }
129             }
130
131             protected virtual void Dispose(DisposeTypes type)
132             {
133                 if (disposed)
134                 {
135                     return;
136                 }
137
138                 if (type == DisposeTypes.Explicit)
139                 {
140                     //Called by User
141                     //Release your own managed resources here.
142                     //You should release all of your own disposable objects here.
143
144                 }
145
146                 //Release your own unmanaged resources here.
147                 //You should not access any managed member here except static instance.
148                 //because the execution order of Finalizes is non-deterministic.
149
150                 if (swigCPtr.Handle != global::System.IntPtr.Zero)
151                 {
152                     if (swigCMemOwn)
153                     {
154                         swigCMemOwn = false;
155                         NDalicPINVOKE.delete_ToggleButton_Property(swigCPtr);
156                     }
157                     swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
158                 }
159
160                 disposed = true;
161             }
162
163             public Property() : this(NDalicPINVOKE.new_ToggleButton_Property(), true)
164             {
165                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
166             }
167
168             public static readonly int STATE_VISUALS = NDalicPINVOKE.ToggleButton_Property_STATE_VISUALS_get();
169             public static readonly int TOOLTIPS = NDalicPINVOKE.ToggleButton_Property_TOOLTIPS_get();
170             public static readonly int CURRENT_STATE_INDEX = NDalicPINVOKE.ToggleButton_Property_CURRENT_STATE_INDEX_get();
171
172         }
173
174         public ToggleButton() : this(NDalicPINVOKE.ToggleButton_New(), true)
175         {
176             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
177
178         }
179         public ToggleButton(ToggleButton toggleButton) : this(NDalicPINVOKE.new_ToggleButton__SWIG_1(ToggleButton.getCPtr(toggleButton)), true)
180         {
181             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
182         }
183
184         public ToggleButton Assign(ToggleButton toggleButton)
185         {
186             ToggleButton ret = new ToggleButton(NDalicPINVOKE.ToggleButton_Assign(swigCPtr, ToggleButton.getCPtr(toggleButton)), false);
187             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
188             return ret;
189         }
190
191         public new static ToggleButton DownCast(BaseHandle handle)
192         {
193             ToggleButton ret = new ToggleButton(NDalicPINVOKE.ToggleButton_DownCast(BaseHandle.getCPtr(handle)), true);
194             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
195             return ret;
196         }
197
198         public enum PropertyRange
199         {
200             PROPERTY_START_INDEX = PropertyRanges.PROPERTY_REGISTRATION_START_INDEX,
201             PROPERTY_END_INDEX = View.PropertyRange.PROPERTY_START_INDEX + 1000
202         }
203
204         public Tizen.NUI.PropertyArray StateVisuals
205         {
206             get
207             {
208                 Tizen.NUI.PropertyArray temp = new Tizen.NUI.PropertyArray();
209                 GetProperty(ToggleButton.Property.STATE_VISUALS).Get(temp);
210                 return temp;
211             }
212             set
213             {
214                 SetProperty(ToggleButton.Property.STATE_VISUALS, new Tizen.NUI.PropertyValue(value));
215             }
216         }
217         public Tizen.NUI.PropertyArray Tooltips
218         {
219             get
220             {
221                 Tizen.NUI.PropertyArray temp = new Tizen.NUI.PropertyArray();
222                 GetProperty(ToggleButton.Property.TOOLTIPS).Get(temp);
223                 return temp;
224             }
225             set
226             {
227                 SetProperty(ToggleButton.Property.TOOLTIPS, new Tizen.NUI.PropertyValue(value));
228             }
229         }
230         public int CurrentStateIndex
231         {
232             get
233             {
234                 int temp = 0;
235                 GetProperty(ToggleButton.Property.CURRENT_STATE_INDEX).Get(ref temp);
236                 return temp;
237             }
238             set
239             {
240                 SetProperty(ToggleButton.Property.CURRENT_STATE_INDEX, new Tizen.NUI.PropertyValue(value));
241             }
242         }
243
244     }
245
246 }