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;
29 namespace Tizen.NUI.UIComponents
33 /// A PushButton changes its appearance when is pressed and returns to its original when is released.
35 public class PushButton : Button
37 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
39 internal PushButton(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.PushButton_SWIGUpcast(cPtr), cMemoryOwn)
41 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
44 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(PushButton obj)
46 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
50 /// To make PushButton instance be disposed.
52 protected override void Dispose(DisposeTypes type)
59 if (type == DisposeTypes.Explicit)
62 //Release your own managed resources here.
63 //You should release all of your own disposable objects here.
66 //Release your own unmanaged resources here.
67 //You should not access any managed member here except static instance.
68 //because the execution order of Finalizes is non-deterministic.
70 if (swigCPtr.Handle != global::System.IntPtr.Zero)
75 NDalicPINVOKE.delete_PushButton(swigCPtr);
77 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
84 internal class Property
86 internal static readonly int UNSELECTED_ICON = NDalicPINVOKE.PushButton_Property_UNSELECTED_ICON_get();
87 internal static readonly int SELECTED_ICON = NDalicPINVOKE.PushButton_Property_SELECTED_ICON_get();
88 internal static readonly int ICON_ALIGNMENT = NDalicPINVOKE.PushButton_Property_ICON_ALIGNMENT_get();
89 internal static readonly int LABEL_PADDING = NDalicPINVOKE.PushButton_Property_LABEL_PADDING_get();
90 internal static readonly int ICON_PADDING = NDalicPINVOKE.PushButton_Property_ICON_PADDING_get();
94 /// Creates the PushButton.
96 public PushButton() : this(NDalicPINVOKE.PushButton_New(), true)
98 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
102 internal PushButton(PushButton pushButton) : this(NDalicPINVOKE.new_PushButton__SWIG_1(PushButton.getCPtr(pushButton)), true)
\r
104 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
\r
107 internal PushButton Assign(PushButton pushButton)
\r
109 PushButton ret = new PushButton(NDalicPINVOKE.PushButton_Assign(swigCPtr, PushButton.getCPtr(pushButton)), false);
\r
110 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
\r
115 /// Downcasts a handle to PushButton handle.<br>
\r
116 /// If handle points to a PushButton, the downcast produces valid handle.<br>
\r
117 /// If not the returned handle is left uninitialized.<br>
\r
119 /// <param name="handle">Handle to an object</param>
\r
120 /// <returns>handle to a PushButton or an uninitialized handle</returns>
\r
121 internal new static PushButton DownCast(BaseHandle handle)
\r
123 PushButton ret = new PushButton(NDalicPINVOKE.PushButton_DownCast(BaseHandle.getCPtr(handle)), true);
\r
124 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
\r
128 internal new void SetButtonImage(Image image)
\r
130 NDalicPINVOKE.PushButton_SetButtonImage__SWIG_0_0(swigCPtr, Image.getCPtr(image));
\r
131 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
\r
134 internal void SetButtonImage(View image)
\r
136 NDalicPINVOKE.PushButton_SetButtonImage__SWIG_1(swigCPtr, View.getCPtr(image));
\r
137 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
\r
140 internal void SetBackgroundImage(View image)
\r
142 NDalicPINVOKE.PushButton_SetBackgroundImage(swigCPtr, View.getCPtr(image));
\r
143 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
\r
146 internal new void SetSelectedImage(Image image)
\r
148 NDalicPINVOKE.PushButton_SetSelectedImage__SWIG_0_0(swigCPtr, Image.getCPtr(image));
\r
149 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
\r
152 internal void SetSelectedImage(View image)
\r
154 NDalicPINVOKE.PushButton_SetSelectedImage__SWIG_1(swigCPtr, View.getCPtr(image));
\r
155 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
\r
158 internal void SetSelectedBackgroundImage(View image)
\r
160 NDalicPINVOKE.PushButton_SetSelectedBackgroundImage(swigCPtr, View.getCPtr(image));
\r
161 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
\r
164 internal void SetDisabledBackgroundImage(View image)
\r
166 NDalicPINVOKE.PushButton_SetDisabledBackgroundImage(swigCPtr, View.getCPtr(image));
\r
167 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
\r
170 internal void SetDisabledImage(View image)
\r
172 NDalicPINVOKE.PushButton_SetDisabledImage(swigCPtr, View.getCPtr(image));
\r
173 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
\r
176 internal void SetDisabledSelectedImage(View image)
\r
178 NDalicPINVOKE.PushButton_SetDisabledSelectedImage(swigCPtr, View.getCPtr(image));
\r
179 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
\r
182 internal enum PropertyRange
\r
184 PROPERTY_START_INDEX = PropertyRanges.PROPERTY_REGISTRATION_START_INDEX,
\r
185 PROPERTY_END_INDEX = View.PropertyRange.PROPERTY_START_INDEX + 1000
\r
189 /// Sets the unselected button image.
\r
191 public string UnselectedIcon
\r
195 SetProperty(PushButton.Property.UNSELECTED_ICON, new Tizen.NUI.PropertyValue(value));
\r
199 /// Sets the selected button image.
\r
201 public string SelectedIcon
\r
205 SetProperty(PushButton.Property.SELECTED_ICON, new Tizen.NUI.PropertyValue(value));
\r
209 /// Sets the icon alignment.
\r
211 public IconAlignmentType IconAlignment
\r
216 if (GetProperty(PushButton.Property.ICON_ALIGNMENT).Get(out temp) == false)
\r
219 Tizen.Log.Error("NUI", "IconAlignment get error!");
\r
225 return IconAlignmentType.Left;
\r
227 return IconAlignmentType.Right;
\r
229 return IconAlignmentType.Top;
\r
231 return IconAlignmentType.Bottom;
\r
233 return IconAlignmentType.Default;
\r
238 string valueToString = "";
\r
241 case IconAlignmentType.Left:
\r
243 valueToString = "LEFT";
\r
246 case IconAlignmentType.Right:
\r
248 valueToString = "RIGHT";
\r
251 case IconAlignmentType.Top:
\r
253 valueToString = "TOP";
\r
256 case IconAlignmentType.Bottom:
\r
258 valueToString = "BOTTOM";
\r
263 valueToString = "DEFAULT";
\r
267 SetProperty(PushButton.Property.ICON_ALIGNMENT, new Tizen.NUI.PropertyValue(valueToString));
\r
271 /// Sets the label padding value.
\r
273 public Vector4 LabelPadding
\r
277 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
\r
278 GetProperty(PushButton.Property.LABEL_PADDING).Get(temp);
\r
283 SetProperty(PushButton.Property.LABEL_PADDING, new Tizen.NUI.PropertyValue(value));
\r
288 /// Sets the icon padding value.
\r
290 public Vector4 IconPadding
\r
294 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
\r
295 GetProperty(PushButton.Property.ICON_PADDING).Get(temp);
\r
300 SetProperty(PushButton.Property.ICON_PADDING, new Tizen.NUI.PropertyValue(value));
\r
305 /// Enumeration for the alignment modes of the icon.
\r
307 public enum IconAlignmentType
\r
310 /// Icon located to the left of text.
\r
314 /// Icon located to the right of text.
\r
318 /// Icon located to the top of text.
\r
322 /// Icon located to the bottom of text.
\r
326 /// Icon located to the right of text by default.
\r