From e5cd843d318a2acabb07e5629c97ca6df76ad77c Mon Sep 17 00:00:00 2001 From: "dongsug.song" Date: Tue, 13 Jun 2017 23:06:59 +0900 Subject: [PATCH] [Tizen] some APIs are changed for preview#4 Change-Id: I4e7479cce87fc576796b49eaa9c0b7fbeb65315c Signed-off-by: dongsug.song --- .../src/public/BaseComponents/View.cs | 4 +- src/Tizen.NUI/src/public/Property.cs | 55 +++- .../public/{ => UIComponents}/ProgressBar.cs | 0 .../src/public/UIComponents/PushButton.cs | 246 ++++++++++++++++-- src/Tizen.NUI/src/public/Window.cs | 6 +- 5 files changed, 290 insertions(+), 21 deletions(-) rename src/Tizen.NUI/src/public/{ => UIComponents}/ProgressBar.cs (100%) diff --git a/src/Tizen.NUI/src/public/BaseComponents/View.cs b/src/Tizen.NUI/src/public/BaseComponents/View.cs index 3e1ea1adb..3875e18a0 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/View.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/View.cs @@ -1772,7 +1772,7 @@ namespace Tizen.NUI.BaseComponents /// /// Readonly. /// - internal Vector3 NaturalSize + public Vector3 NaturalSize { get { @@ -3589,7 +3589,7 @@ namespace Tizen.NUI.BaseComponents } } - public event EventHandlerWithReturnType WheelRolled + public event EventHandlerWithReturnType WheelMoved { add { diff --git a/src/Tizen.NUI/src/public/Property.cs b/src/Tizen.NUI/src/public/Property.cs index 7f616634d..9abbc3ec2 100755 --- a/src/Tizen.NUI/src/public/Property.cs +++ b/src/Tizen.NUI/src/public/Property.cs @@ -903,6 +903,18 @@ namespace Tizen.NUI return ret; } + /// + /// Retrieves the key at the specified position. + /// + /// The specified position + /// A reference to the key at the specified position + public string GetKey(uint position) + { + string ret = NDalicPINVOKE.Property_Map_GetKey(swigCPtr, position); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + /// /// Retrieve the key at the specified position. /// @@ -920,7 +932,20 @@ namespace Tizen.NUI /// /// The key to find /// The value if it exists, an empty object otherwise - internal PropertyValue Find(int key) + public PropertyValue Find(string key) + { + global::System.IntPtr cPtr = NDalicPINVOKE.Property_Map_Find__SWIG_0(swigCPtr, key); + PropertyValue ret = (cPtr == global::System.IntPtr.Zero) ? null : new PropertyValue(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Finds the value for the specified key if it exists. + /// + /// The key to find + /// The value if it exists, an empty object otherwise + public PropertyValue Find(int key) { global::System.IntPtr cPtr = NDalicPINVOKE.Property_Map_Find__SWIG_2(swigCPtr, key); PropertyValue ret = (cPtr == global::System.IntPtr.Zero) ? null : new PropertyValue(cPtr, false); @@ -942,6 +967,34 @@ namespace Tizen.NUI return ret; } + /// + /// Finds the value for the specified key if it exists and its type is type. + /// + /// The key to find + /// The type to check + /// The value if it exists, an empty value otherwise + public PropertyValue Find(string key, PropertyType type) + { + global::System.IntPtr cPtr = NDalicPINVOKE.Property_Map_Find__SWIG_4(swigCPtr, key, (int)type); + PropertyValue ret = (cPtr == global::System.IntPtr.Zero) ? null : new PropertyValue(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Finds the value for the specified key if it exists and its type is type. + /// + /// The key to find + /// The type to check + /// The value if it exists, an empty value otherwise + public PropertyValue Find(int key, PropertyType type) + { + global::System.IntPtr cPtr = NDalicPINVOKE.Property_Map_Find__SWIG_5(swigCPtr, key, (int)type); + PropertyValue ret = (cPtr == global::System.IntPtr.Zero) ? null : new PropertyValue(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + /// /// Clears the map. /// diff --git a/src/Tizen.NUI/src/public/ProgressBar.cs b/src/Tizen.NUI/src/public/UIComponents/ProgressBar.cs similarity index 100% rename from src/Tizen.NUI/src/public/ProgressBar.cs rename to src/Tizen.NUI/src/public/UIComponents/ProgressBar.cs diff --git a/src/Tizen.NUI/src/public/UIComponents/PushButton.cs b/src/Tizen.NUI/src/public/UIComponents/PushButton.cs index c6ec224ec..db7986984 100755 --- a/src/Tizen.NUI/src/public/UIComponents/PushButton.cs +++ b/src/Tizen.NUI/src/public/UIComponents/PushButton.cs @@ -56,7 +56,7 @@ namespace Tizen.NUI.UIComponents return; } - if(type == DisposeTypes.Explicit) + if (type == DisposeTypes.Explicit) { //Called by User //Release your own managed resources here. @@ -99,18 +99,234 @@ namespace Tizen.NUI.UIComponents } - /// - /// Downcasts a handle to PushButton handle.
- /// If handle points to a PushButton, the downcast produces valid handle.
- /// If not the returned handle is left uninitialized.
- ///
- /// Handle to an object - /// handle to a PushButton or an uninitialized handle - internal new static PushButton DownCast(BaseHandle handle) - { - PushButton ret = new PushButton(NDalicPINVOKE.PushButton_DownCast(BaseHandle.getCPtr(handle)), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } + internal PushButton(PushButton pushButton) : this(NDalicPINVOKE.new_PushButton__SWIG_1(PushButton.getCPtr(pushButton)), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal PushButton Assign(PushButton pushButton) + { + PushButton ret = new PushButton(NDalicPINVOKE.PushButton_Assign(swigCPtr, PushButton.getCPtr(pushButton)), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Downcasts a handle to PushButton handle.
+ /// If handle points to a PushButton, the downcast produces valid handle.
+ /// If not the returned handle is left uninitialized.
+ ///
+ /// Handle to an object + /// handle to a PushButton or an uninitialized handle + internal new static PushButton DownCast(BaseHandle handle) + { + PushButton ret = new PushButton(NDalicPINVOKE.PushButton_DownCast(BaseHandle.getCPtr(handle)), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal new void SetButtonImage(Image image) + { + NDalicPINVOKE.PushButton_SetButtonImage__SWIG_0_0(swigCPtr, Image.getCPtr(image)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal void SetButtonImage(View image) + { + NDalicPINVOKE.PushButton_SetButtonImage__SWIG_1(swigCPtr, View.getCPtr(image)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal void SetBackgroundImage(View image) + { + NDalicPINVOKE.PushButton_SetBackgroundImage(swigCPtr, View.getCPtr(image)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal new void SetSelectedImage(Image image) + { + NDalicPINVOKE.PushButton_SetSelectedImage__SWIG_0_0(swigCPtr, Image.getCPtr(image)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal void SetSelectedImage(View image) + { + NDalicPINVOKE.PushButton_SetSelectedImage__SWIG_1(swigCPtr, View.getCPtr(image)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal void SetSelectedBackgroundImage(View image) + { + NDalicPINVOKE.PushButton_SetSelectedBackgroundImage(swigCPtr, View.getCPtr(image)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal void SetDisabledBackgroundImage(View image) + { + NDalicPINVOKE.PushButton_SetDisabledBackgroundImage(swigCPtr, View.getCPtr(image)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal void SetDisabledImage(View image) + { + NDalicPINVOKE.PushButton_SetDisabledImage(swigCPtr, View.getCPtr(image)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal void SetDisabledSelectedImage(View image) + { + NDalicPINVOKE.PushButton_SetDisabledSelectedImage(swigCPtr, View.getCPtr(image)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal enum PropertyRange + { + PROPERTY_START_INDEX = PropertyRanges.PROPERTY_REGISTRATION_START_INDEX, + PROPERTY_END_INDEX = View.PropertyRange.PROPERTY_START_INDEX + 1000 + } + + /// + /// Sets the unselected button image. + /// + public string UnselectedIcon + { + set + { + SetProperty(PushButton.Property.UNSELECTED_ICON, new Tizen.NUI.PropertyValue(value)); + } + } + /// + /// Sets the selected button image. + /// + public string SelectedIcon + { + set + { + SetProperty(PushButton.Property.SELECTED_ICON, new Tizen.NUI.PropertyValue(value)); + } + } + /// + /// Sets the icon alignment. + /// + public IconAlignmentType IconAlignment + { + get + { + string temp; + if (GetProperty(PushButton.Property.ICON_ALIGNMENT).Get(out temp) == false) + { +#if DEBUG_ON + Tizen.Log.Error("NUI", "IconAlignment get error!"); +#endif + } + switch (temp) + { + case "LEFT": + return IconAlignmentType.Left; + case "RIGHT": + return IconAlignmentType.Right; + case "TOP": + return IconAlignmentType.Top; + case "BOTTOM": + return IconAlignmentType.Bottom; + default: + return IconAlignmentType.Default; + } + } + set + { + string valueToString = ""; + switch (value) + { + case IconAlignmentType.Left: + { + valueToString = "LEFT"; + break; + } + case IconAlignmentType.Right: + { + valueToString = "RIGHT"; + break; + } + case IconAlignmentType.Top: + { + valueToString = "TOP"; + break; + } + case IconAlignmentType.Bottom: + { + valueToString = "BOTTOM"; + break; + } + default: + { + valueToString = "DEFAULT"; + break; + } + } + SetProperty(PushButton.Property.ICON_ALIGNMENT, new Tizen.NUI.PropertyValue(valueToString)); + } + } + /// + /// Sets the label padding value. + /// + public Vector4 LabelPadding + { + get + { + Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f); + GetProperty(PushButton.Property.LABEL_PADDING).Get(temp); + return temp; + } + set + { + SetProperty(PushButton.Property.LABEL_PADDING, new Tizen.NUI.PropertyValue(value)); + } + } + + /// + /// Sets the icon padding value. + /// + public Vector4 IconPadding + { + get + { + Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f); + GetProperty(PushButton.Property.ICON_PADDING).Get(temp); + return temp; + } + set + { + SetProperty(PushButton.Property.ICON_PADDING, new Tizen.NUI.PropertyValue(value)); + } + } + + /// + /// Enumeration for the alignment modes of the icon. + /// + public enum IconAlignmentType + { + /// + /// Icon located to the left of text. + /// + Left, + /// + /// Icon located to the right of text. + /// + Right, + /// + /// Icon located to the top of text. + /// + Top, + /// + /// Icon located to the bottom of text. + /// + Bottom, + /// + /// Icon located to the right of text by default. + /// + Default = Right + } + + } } diff --git a/src/Tizen.NUI/src/public/Window.cs b/src/Tizen.NUI/src/public/Window.cs index 866720e98..f9490efd4 100755 --- a/src/Tizen.NUI/src/public/Window.cs +++ b/src/Tizen.NUI/src/public/Window.cs @@ -863,7 +863,7 @@ namespace Tizen.NUI /// then when the last finger is lifted.
/// An interrupted event will also be emitted (if it occurs).
/// - public event EventHandler Touched + public event EventHandler Touch { add { @@ -931,7 +931,7 @@ namespace Tizen.NUI /// /// Event emitted when wheel event is received. /// - public event EventHandler WheelRolled + public event EventHandler WheelRoll { add { @@ -996,7 +996,7 @@ namespace Tizen.NUI /// /// Event emitted when key event is received. /// - public event EventHandler KeyEvent + public event EventHandler Key { add { -- 2.34.1