Release 4.0.0-preview1-00051
[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
17 using Tizen.NUI.BaseComponents;
18
19 namespace Tizen.NUI
20 {
21
22     public class ToggleButton : Tizen.NUI.UIComponents.Button
23     {
24         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
25
26         internal ToggleButton(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.ToggleButton_SWIGUpcast(cPtr), cMemoryOwn)
27         {
28             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
29         }
30
31         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ToggleButton obj)
32         {
33             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
34         }
35
36         protected override void Dispose(DisposeTypes type)
37         {
38             if (disposed)
39             {
40                 return;
41             }
42
43             if (type == DisposeTypes.Explicit)
44             {
45                 //Called by User
46                 //Release your own managed resources here.
47                 //You should release all of your own disposable objects here.
48
49             }
50
51             //Release your own unmanaged resources here.
52             //You should not access any managed member here except static instance.
53             //because the execution order of Finalizes is non-deterministic.
54
55             if (swigCPtr.Handle != global::System.IntPtr.Zero)
56             {
57                 if (swigCMemOwn)
58                 {
59                     swigCMemOwn = false;
60                     NDalicPINVOKE.delete_ToggleButton(swigCPtr);
61                 }
62                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
63             }
64
65             base.Dispose(type);
66         }
67
68         public class Property
69         {
70             public static readonly int STATE_VISUALS = NDalicPINVOKE.ToggleButton_Property_STATE_VISUALS_get();
71             public static readonly int TOOLTIPS = NDalicPINVOKE.ToggleButton_Property_TOOLTIPS_get();
72             public static readonly int CURRENT_STATE_INDEX = NDalicPINVOKE.ToggleButton_Property_CURRENT_STATE_INDEX_get();
73         }
74
75         public ToggleButton() : this(NDalicPINVOKE.ToggleButton_New(), true)
76         {
77             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
78
79         }
80
81         public Tizen.NUI.PropertyArray StateVisuals
82         {
83             get
84             {
85                 Tizen.NUI.PropertyArray temp = new Tizen.NUI.PropertyArray();
86                 GetProperty(ToggleButton.Property.STATE_VISUALS).Get(temp);
87                 return temp;
88             }
89             set
90             {
91                 SetProperty(ToggleButton.Property.STATE_VISUALS, new Tizen.NUI.PropertyValue(value));
92             }
93         }
94         public Tizen.NUI.PropertyArray Tooltips
95         {
96             get
97             {
98                 Tizen.NUI.PropertyArray temp = new Tizen.NUI.PropertyArray();
99                 GetProperty(ToggleButton.Property.TOOLTIPS).Get(temp);
100                 return temp;
101             }
102             set
103             {
104                 SetProperty(ToggleButton.Property.TOOLTIPS, new Tizen.NUI.PropertyValue(value));
105             }
106         }
107         public int CurrentStateIndex
108         {
109             get
110             {
111                 int temp = 0;
112                 GetProperty(ToggleButton.Property.CURRENT_STATE_INDEX).Get(out temp);
113                 return temp;
114             }
115             set
116             {
117                 SetProperty(ToggleButton.Property.CURRENT_STATE_INDEX, new Tizen.NUI.PropertyValue(value));
118             }
119         }
120
121     }
122
123 }