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.
17 using Tizen.NUI.BaseComponents;
23 /// A ToggleButton allows the user to change a setting between two or more states.
25 public class ToggleButton : Tizen.NUI.UIComponents.Button
27 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
29 internal ToggleButton(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.ToggleButton_SWIGUpcast(cPtr), cMemoryOwn)
31 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
34 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ToggleButton obj)
36 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
39 protected override void Dispose(DisposeTypes type)
46 if (type == DisposeTypes.Explicit)
49 //Release your own managed resources here.
50 //You should release all of your own disposable objects here.
54 //Release your own unmanaged resources here.
55 //You should not access any managed member here except static instance.
56 //because the execution order of Finalizes is non-deterministic.
58 if (swigCPtr.Handle != global::System.IntPtr.Zero)
63 NDalicPINVOKE.delete_ToggleButton(swigCPtr);
65 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
71 public new class Property
73 public static readonly int STATE_VISUALS = NDalicPINVOKE.ToggleButton_Property_STATE_VISUALS_get();
74 public static readonly int TOOLTIPS = NDalicPINVOKE.ToggleButton_Property_TOOLTIPS_get();
75 public static readonly int CURRENT_STATE_INDEX = NDalicPINVOKE.ToggleButton_Property_CURRENT_STATE_INDEX_get();
79 /// Create an instance for toggleButton.
81 /// <since_tizen> 3 </since_tizen>
82 public ToggleButton() : this(NDalicPINVOKE.ToggleButton_New(), true)
84 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
89 /// Gets and Sets the state visual array of toggle button.
91 /// <since_tizen> 3 </since_tizen>
92 public Tizen.NUI.PropertyArray StateVisuals
96 Tizen.NUI.PropertyArray temp = new Tizen.NUI.PropertyArray();
97 GetProperty(ToggleButton.Property.STATE_VISUALS).Get(temp);
102 SetProperty(ToggleButton.Property.STATE_VISUALS, new Tizen.NUI.PropertyValue(value));
107 /// Gets and Sets the tooltips of toggle button.
109 /// <since_tizen> 3 </since_tizen>
110 public Tizen.NUI.PropertyArray Tooltips
114 Tizen.NUI.PropertyArray temp = new Tizen.NUI.PropertyArray();
115 GetProperty(ToggleButton.Property.TOOLTIPS).Get(temp);
120 SetProperty(ToggleButton.Property.TOOLTIPS, new Tizen.NUI.PropertyValue(value));
125 /// Gets and Sets the current state index of toggle button.
127 /// <since_tizen> 3 </since_tizen>
128 public int CurrentStateIndex
133 GetProperty(ToggleButton.Property.CURRENT_STATE_INDEX).Get(out temp);
138 SetProperty(ToggleButton.Property.CURRENT_STATE_INDEX, new Tizen.NUI.PropertyValue(value));