1 /** Copyright (c) 2017 Samsung Electronics Co., Ltd.
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
7 * http://www.apache.org/licenses/LICENSE-2.0
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.
16 // This File has been auto-generated by SWIG and then modified using DALi Ruby Scripts
17 //------------------------------------------------------------------------------
20 // This file was automatically generated by SWIG (http://www.swig.org).
23 // Do not make changes to this file unless you know what you are doing--modify
24 // the SWIG interface file instead.
25 //------------------------------------------------------------------------------
27 using Tizen.NUI.BaseComponents;
32 public class ToggleButton : Tizen.NUI.UIComponents.Button
34 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
36 internal ToggleButton(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.ToggleButton_SWIGUpcast(cPtr), cMemoryOwn)
38 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
41 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ToggleButton obj)
43 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
46 protected override void Dispose(DisposeTypes type)
53 if (type == DisposeTypes.Explicit)
56 //Release your own managed resources here.
57 //You should release all of your own disposable objects here.
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.
65 //Unreference this from if a static instance refer to this.
66 ViewRegistry.UnregisterView(this);
68 if (swigCPtr.Handle != global::System.IntPtr.Zero)
73 NDalicPINVOKE.delete_ToggleButton(swigCPtr);
75 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
81 public class Property : global::System.IDisposable
83 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
84 protected bool swigCMemOwn;
86 internal Property(global::System.IntPtr cPtr, bool cMemoryOwn)
88 swigCMemOwn = cMemoryOwn;
89 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
92 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Property obj)
94 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
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;
105 if (!isDisposeQueued)
107 isDisposeQueued = true;
108 DisposeQueue.Instance.Add(this);
112 public void Dispose()
114 //Throw excpetion if Dispose() is called in separate thread.
115 if (!Window.IsInstalled())
117 throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
122 Dispose(DisposeTypes.Implicit);
126 Dispose(DisposeTypes.Explicit);
127 System.GC.SuppressFinalize(this);
131 protected virtual void Dispose(DisposeTypes type)
138 if (type == DisposeTypes.Explicit)
141 //Release your own managed resources here.
142 //You should release all of your own disposable objects here.
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.
150 if (swigCPtr.Handle != global::System.IntPtr.Zero)
155 NDalicPINVOKE.delete_ToggleButton_Property(swigCPtr);
157 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
163 public Property() : this(NDalicPINVOKE.new_ToggleButton_Property(), true)
165 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
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();
174 public ToggleButton() : this(NDalicPINVOKE.ToggleButton_New(), true)
176 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
179 public ToggleButton(ToggleButton toggleButton) : this(NDalicPINVOKE.new_ToggleButton__SWIG_1(ToggleButton.getCPtr(toggleButton)), true)
181 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
184 public ToggleButton Assign(ToggleButton toggleButton)
186 ToggleButton ret = new ToggleButton(NDalicPINVOKE.ToggleButton_Assign(swigCPtr, ToggleButton.getCPtr(toggleButton)), false);
187 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
191 public new static ToggleButton DownCast(BaseHandle handle)
193 ToggleButton ret = new ToggleButton(NDalicPINVOKE.ToggleButton_DownCast(BaseHandle.getCPtr(handle)), true);
194 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
198 public enum PropertyRange
200 PROPERTY_START_INDEX = PropertyRanges.PROPERTY_REGISTRATION_START_INDEX,
201 PROPERTY_END_INDEX = View.PropertyRange.PROPERTY_START_INDEX + 1000
204 public Tizen.NUI.PropertyArray StateVisuals
208 Tizen.NUI.PropertyArray temp = new Tizen.NUI.PropertyArray();
209 GetProperty(ToggleButton.Property.STATE_VISUALS).Get(temp);
214 SetProperty(ToggleButton.Property.STATE_VISUALS, new Tizen.NUI.PropertyValue(value));
217 public Tizen.NUI.PropertyArray Tooltips
221 Tizen.NUI.PropertyArray temp = new Tizen.NUI.PropertyArray();
222 GetProperty(ToggleButton.Property.TOOLTIPS).Get(temp);
227 SetProperty(ToggleButton.Property.TOOLTIPS, new Tizen.NUI.PropertyValue(value));
230 public int CurrentStateIndex
235 GetProperty(ToggleButton.Property.CURRENT_STATE_INDEX).Get(ref temp);
240 SetProperty(ToggleButton.Property.CURRENT_STATE_INDEX, new Tizen.NUI.PropertyValue(value));