nui 0.2.32 manual merge, mapping to dali 1.2.32
[platform/core/csapi/tizenfx.git] / NUISamples / Tizen.NUI / src / public / PushButton.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 namespace Tizen.NUI
28 {
29
30     /// <summary>
31     /// A PushButton changes its appearance when is pressed and returns to its original when is released.
32     /// </summary>
33     public class PushButton : Button
34     {
35         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
36
37         internal PushButton(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.PushButton_SWIGUpcast(cPtr), cMemoryOwn)
38         {
39             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
40         }
41
42         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(PushButton obj)
43         {
44             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
45         }
46
47         ~PushButton()
48         {
49             DisposeQueue.Instance.Add(this);
50         }
51
52         public override void Dispose()
53         {
54             if (!Stage.IsInstalled())
55             {
56                 DisposeQueue.Instance.Add(this);
57                 return;
58             }
59
60             lock (this)
61             {
62                 if (swigCPtr.Handle != global::System.IntPtr.Zero)
63                 {
64                     if (swigCMemOwn)
65                     {
66                         swigCMemOwn = false;
67                         NDalicPINVOKE.delete_PushButton(swigCPtr);
68                     }
69                     swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
70                 }
71                 global::System.GC.SuppressFinalize(this);
72                 base.Dispose();
73             }
74         }
75
76
77         internal class Property : global::System.IDisposable
78         {
79             private global::System.Runtime.InteropServices.HandleRef swigCPtr;
80             protected bool swigCMemOwn;
81
82             internal Property(global::System.IntPtr cPtr, bool cMemoryOwn)
83             {
84                 swigCMemOwn = cMemoryOwn;
85                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
86             }
87
88             internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Property obj)
89             {
90                 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
91             }
92
93             ~Property()
94             {
95                 Dispose();
96             }
97
98             public virtual void Dispose()
99             {
100                 lock (this)
101                 {
102                     if (swigCPtr.Handle != global::System.IntPtr.Zero)
103                     {
104                         if (swigCMemOwn)
105                         {
106                             swigCMemOwn = false;
107                             NDalicPINVOKE.delete_PushButton_Property(swigCPtr);
108                         }
109                         swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
110                     }
111                     global::System.GC.SuppressFinalize(this);
112                 }
113             }
114
115             internal Property() : this(NDalicPINVOKE.new_PushButton_Property(), true)
116             {
117                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
118             }
119
120             internal static readonly int UNSELECTED_ICON = NDalicPINVOKE.PushButton_Property_UNSELECTED_ICON_get();
121             internal static readonly int SELECTED_ICON = NDalicPINVOKE.PushButton_Property_SELECTED_ICON_get();
122             internal static readonly int ICON_ALIGNMENT = NDalicPINVOKE.PushButton_Property_ICON_ALIGNMENT_get();
123             internal static readonly int LABEL_PADDING = NDalicPINVOKE.PushButton_Property_LABEL_PADDING_get();
124             internal static readonly int ICON_PADDING = NDalicPINVOKE.PushButton_Property_ICON_PADDING_get();
125
126         }
127
128         /// <summary>
129         /// Creates the PushButton.
130         /// </summary>
131         public PushButton() : this(NDalicPINVOKE.PushButton_New(), true)
132         {
133             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
134
135         }
136         internal PushButton(PushButton pushButton) : this(NDalicPINVOKE.new_PushButton__SWIG_1(PushButton.getCPtr(pushButton)), true)
137         {
138             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
139         }
140
141         internal PushButton Assign(PushButton pushButton)
142         {
143             PushButton ret = new PushButton(NDalicPINVOKE.PushButton_Assign(swigCPtr, PushButton.getCPtr(pushButton)), false);
144             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
145             return ret;
146         }
147
148         /// <summary>
149         /// Downcasts a handle to PushButton handle.
150         /// If handle points to a PushButton, the downcast produces valid handle.
151         /// If not the returned handle is left uninitialized.
152         /// </summary>
153         /// <param name="handle">Handle to an object</param>
154         /// <returns>handle to a PushButton or an uninitialized handle</returns>
155         public new static PushButton DownCast(BaseHandle handle)
156         {
157             PushButton ret = new PushButton(NDalicPINVOKE.PushButton_DownCast(BaseHandle.getCPtr(handle)), true);
158             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
159             return ret;
160         }
161
162         internal new void SetButtonImage(Image image)
163         {
164             NDalicPINVOKE.PushButton_SetButtonImage__SWIG_0_0(swigCPtr, Image.getCPtr(image));
165             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
166         }
167
168         internal void SetButtonImage(Actor image)
169         {
170             NDalicPINVOKE.PushButton_SetButtonImage__SWIG_1(swigCPtr, Actor.getCPtr(image));
171             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
172         }
173
174         internal void SetBackgroundImage(Actor image)
175         {
176             NDalicPINVOKE.PushButton_SetBackgroundImage(swigCPtr, Actor.getCPtr(image));
177             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
178         }
179
180         internal new void SetSelectedImage(Image image)
181         {
182             NDalicPINVOKE.PushButton_SetSelectedImage__SWIG_0_0(swigCPtr, Image.getCPtr(image));
183             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
184         }
185
186         internal void SetSelectedImage(Actor image)
187         {
188             NDalicPINVOKE.PushButton_SetSelectedImage__SWIG_1(swigCPtr, Actor.getCPtr(image));
189             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
190         }
191
192         internal void SetSelectedBackgroundImage(Actor image)
193         {
194             NDalicPINVOKE.PushButton_SetSelectedBackgroundImage(swigCPtr, Actor.getCPtr(image));
195             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
196         }
197
198         internal void SetDisabledBackgroundImage(Actor image)
199         {
200             NDalicPINVOKE.PushButton_SetDisabledBackgroundImage(swigCPtr, Actor.getCPtr(image));
201             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
202         }
203
204         internal void SetDisabledImage(Actor image)
205         {
206             NDalicPINVOKE.PushButton_SetDisabledImage(swigCPtr, Actor.getCPtr(image));
207             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
208         }
209
210         internal void SetDisabledSelectedImage(Actor image)
211         {
212             NDalicPINVOKE.PushButton_SetDisabledSelectedImage(swigCPtr, Actor.getCPtr(image));
213             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
214         }
215
216         internal enum PropertyRange
217         {
218             PROPERTY_START_INDEX = PropertyRanges.PROPERTY_REGISTRATION_START_INDEX,
219             PROPERTY_END_INDEX = View.PropertyRange.PROPERTY_START_INDEX + 1000
220         }
221
222         /// <summary>
223         /// Sets the unselected button image.
224         /// </summary>
225         public string UnselectedIcon
226         {
227             set
228             {
229                 SetProperty(PushButton.Property.UNSELECTED_ICON, new Tizen.NUI.PropertyValue(value));
230             }
231         }
232         /// <summary>
233         /// Sets the selected button image.
234         /// </summary>
235         public string SelectedIcon
236         {
237             set
238             {
239                 SetProperty(PushButton.Property.SELECTED_ICON, new Tizen.NUI.PropertyValue(value));
240             }
241         }
242         /// <summary>
243         /// Sets the icon alignment.
244         /// </summary>
245         public string IconAlignment
246         {
247             get
248             {
249                 string temp;
250                 GetProperty(PushButton.Property.ICON_ALIGNMENT).Get(out temp);
251                 return temp;
252             }
253             set
254             {
255                 SetProperty(PushButton.Property.ICON_ALIGNMENT, new Tizen.NUI.PropertyValue(value));
256             }
257         }
258         /// <summary>
259         /// Sets the label padding value.
260         /// </summary>
261         public Vector4 LabelPadding
262         {
263             get
264             {
265                 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
266                 GetProperty(PushButton.Property.LABEL_PADDING).Get(temp);
267                 return temp;
268             }
269             set
270             {
271                 SetProperty(PushButton.Property.LABEL_PADDING, new Tizen.NUI.PropertyValue(value));
272             }
273         }
274
275         /// <summary>
276         /// Sets the icon padding value.
277         /// </summary>
278         public string IconPadding
279         {
280             get
281             {
282                 string temp;
283                 GetProperty(PushButton.Property.ICON_PADDING).Get(out temp);
284                 return temp;
285             }
286             set
287             {
288                 SetProperty(PushButton.Property.ICON_PADDING, new Tizen.NUI.PropertyValue(value));
289             }
290         }
291
292     }
293
294 }