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 //------------------------------------------------------------------------------
31 /// A PushButton changes its appearance when is pressed and returns to its original when is released.
33 public class PushButton : Button
35 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
37 internal PushButton(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.PushButton_SWIGUpcast(cPtr), cMemoryOwn)
39 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
42 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(PushButton obj)
44 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
49 DisposeQueue.Instance.Add(this);
52 public override void Dispose()
54 if (!Stage.IsInstalled())
56 DisposeQueue.Instance.Add(this);
62 if (swigCPtr.Handle != global::System.IntPtr.Zero)
67 NDalicPINVOKE.delete_PushButton(swigCPtr);
69 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
71 global::System.GC.SuppressFinalize(this);
77 internal class Property : global::System.IDisposable
79 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
80 protected bool swigCMemOwn;
82 internal Property(global::System.IntPtr cPtr, bool cMemoryOwn)
84 swigCMemOwn = cMemoryOwn;
85 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
88 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Property obj)
90 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
98 public virtual void Dispose()
102 if (swigCPtr.Handle != global::System.IntPtr.Zero)
107 NDalicPINVOKE.delete_PushButton_Property(swigCPtr);
109 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
111 global::System.GC.SuppressFinalize(this);
115 internal Property() : this(NDalicPINVOKE.new_PushButton_Property(), true)
117 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
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();
129 /// Creates the PushButton.
131 public PushButton() : this(NDalicPINVOKE.PushButton_New(), true)
133 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
136 internal PushButton(PushButton pushButton) : this(NDalicPINVOKE.new_PushButton__SWIG_1(PushButton.getCPtr(pushButton)), true)
138 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
141 internal PushButton Assign(PushButton pushButton)
143 PushButton ret = new PushButton(NDalicPINVOKE.PushButton_Assign(swigCPtr, PushButton.getCPtr(pushButton)), false);
144 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
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.
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)
157 PushButton ret = new PushButton(NDalicPINVOKE.PushButton_DownCast(BaseHandle.getCPtr(handle)), true);
158 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
162 internal new void SetButtonImage(Image image)
164 NDalicPINVOKE.PushButton_SetButtonImage__SWIG_0_0(swigCPtr, Image.getCPtr(image));
165 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
168 internal void SetButtonImage(Actor image)
170 NDalicPINVOKE.PushButton_SetButtonImage__SWIG_1(swigCPtr, Actor.getCPtr(image));
171 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
174 internal void SetBackgroundImage(Actor image)
176 NDalicPINVOKE.PushButton_SetBackgroundImage(swigCPtr, Actor.getCPtr(image));
177 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
180 internal new void SetSelectedImage(Image image)
182 NDalicPINVOKE.PushButton_SetSelectedImage__SWIG_0_0(swigCPtr, Image.getCPtr(image));
183 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
186 internal void SetSelectedImage(Actor image)
188 NDalicPINVOKE.PushButton_SetSelectedImage__SWIG_1(swigCPtr, Actor.getCPtr(image));
189 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
192 internal void SetSelectedBackgroundImage(Actor image)
194 NDalicPINVOKE.PushButton_SetSelectedBackgroundImage(swigCPtr, Actor.getCPtr(image));
195 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
198 internal void SetDisabledBackgroundImage(Actor image)
200 NDalicPINVOKE.PushButton_SetDisabledBackgroundImage(swigCPtr, Actor.getCPtr(image));
201 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
204 internal void SetDisabledImage(Actor image)
206 NDalicPINVOKE.PushButton_SetDisabledImage(swigCPtr, Actor.getCPtr(image));
207 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
210 internal void SetDisabledSelectedImage(Actor image)
212 NDalicPINVOKE.PushButton_SetDisabledSelectedImage(swigCPtr, Actor.getCPtr(image));
213 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
216 internal enum PropertyRange
218 PROPERTY_START_INDEX = PropertyRanges.PROPERTY_REGISTRATION_START_INDEX,
219 PROPERTY_END_INDEX = View.PropertyRange.PROPERTY_START_INDEX + 1000
223 /// Sets the unselected button image.
225 public string UnselectedIcon
229 SetProperty(PushButton.Property.UNSELECTED_ICON, new Tizen.NUI.PropertyValue(value));
233 /// Sets the selected button image.
235 public string SelectedIcon
239 SetProperty(PushButton.Property.SELECTED_ICON, new Tizen.NUI.PropertyValue(value));
243 /// Sets the icon alignment.
245 public string IconAlignment
250 GetProperty(PushButton.Property.ICON_ALIGNMENT).Get(out temp);
255 SetProperty(PushButton.Property.ICON_ALIGNMENT, new Tizen.NUI.PropertyValue(value));
259 /// Sets the label padding value.
261 public Vector4 LabelPadding
265 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
266 GetProperty(PushButton.Property.LABEL_PADDING).Get(temp);
271 SetProperty(PushButton.Property.LABEL_PADDING, new Tizen.NUI.PropertyValue(value));
276 /// Sets the icon padding value.
278 public string IconPadding
283 GetProperty(PushButton.Property.ICON_PADDING).Get(out temp);
288 SetProperty(PushButton.Property.ICON_PADDING, new Tizen.NUI.PropertyValue(value));