62f08900599704f55cf3b452cc3bca81d75d8cba
[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
61                     //Unreference this instance from Registry.
62                     Registry.Unregister(this);
63
64                     NDalicPINVOKE.delete_ToggleButton(swigCPtr);
65                 }
66                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
67             }
68
69             base.Dispose(type);
70         }
71
72         public class Property
73         {
74             public static readonly int STATE_VISUALS = NDalicPINVOKE.ToggleButton_Property_STATE_VISUALS_get();
75             public static readonly int TOOLTIPS = NDalicPINVOKE.ToggleButton_Property_TOOLTIPS_get();
76             public static readonly int CURRENT_STATE_INDEX = NDalicPINVOKE.ToggleButton_Property_CURRENT_STATE_INDEX_get();
77         }
78
79         public ToggleButton() : this(NDalicPINVOKE.ToggleButton_New(), true)
80         {
81             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
82
83         }
84
85         public Tizen.NUI.PropertyArray StateVisuals
86         {
87             get
88             {
89                 Tizen.NUI.PropertyArray temp = new Tizen.NUI.PropertyArray();
90                 GetProperty(ToggleButton.Property.STATE_VISUALS).Get(temp);
91                 return temp;
92             }
93             set
94             {
95                 SetProperty(ToggleButton.Property.STATE_VISUALS, new Tizen.NUI.PropertyValue(value));
96             }
97         }
98         public Tizen.NUI.PropertyArray Tooltips
99         {
100             get
101             {
102                 Tizen.NUI.PropertyArray temp = new Tizen.NUI.PropertyArray();
103                 GetProperty(ToggleButton.Property.TOOLTIPS).Get(temp);
104                 return temp;
105             }
106             set
107             {
108                 SetProperty(ToggleButton.Property.TOOLTIPS, new Tizen.NUI.PropertyValue(value));
109             }
110         }
111         public int CurrentStateIndex
112         {
113             get
114             {
115                 int temp = 0;
116                 GetProperty(ToggleButton.Property.CURRENT_STATE_INDEX).Get(out temp);
117                 return temp;
118             }
119             set
120             {
121                 SetProperty(ToggleButton.Property.CURRENT_STATE_INDEX, new Tizen.NUI.PropertyValue(value));
122             }
123         }
124
125     }
126
127 }