From ed2f6c68fa315f66578c231912ded2af9fa8e98d Mon Sep 17 00:00:00 2001 From: Dongsug Song Date: Thu, 25 Feb 2021 16:49:12 +0900 Subject: [PATCH] Revert "[NUI] Remove APIs which have been deprecated in API7" This reverts commit 2a98e467a23af86d104a956b74f02e944bd3b73f. --- src/Tizen.NUI/src/internal/Common/ButtonSignal.cs | 75 + .../src/internal/Common/KeyboardTypeSignalType.cs | 35 +- .../Common/ProgressBarValueChangedSignal.cs | 74 + .../internal/Common/ScrollViewSnapStartedSignal.cs | 74 + .../src/internal/Common/SliderMarkReachedSignal.cs | 75 + .../internal/Common/SliderValueChangedSignal.cs | 75 + .../internal/NativeBinding/SWIGTYPE_p_bundle.cs | 47 + src/Tizen.NUI/src/internal/Utility/ItemView.cs | 103 +- .../src/internal/Widget/WidgetViewSignal.cs | 35 +- src/Tizen.NUI/src/internal/Xaml/XamlParser.cs | 1 + src/Tizen.NUI/src/public/Animation/Animation.cs | 5 +- .../src/public/BaseComponents/FlexContainer.cs | 8 +- .../src/public/BaseComponents/Scrollable.cs | 77 +- src/Tizen.NUI/src/public/Common/Layer.cs | 8 + src/Tizen.NUI/src/public/Common/PropertyBuffer.cs | 7 +- .../src/public/Common/PropertyNotification.cs | 19 +- .../src/public/Common/PropertyNotifySignal.cs | 46 +- src/Tizen.NUI/src/public/CustomView/Spin.cs | 1 + src/Tizen.NUI/src/public/Rendering/Renderer.cs | 201 ++- src/Tizen.NUI/src/public/Rendering/Shader.cs | 12 +- src/Tizen.NUI/src/public/UIComponents/Button.cs | 1188 ++++++++++++++++ .../src/public/UIComponents/CheckBoxButton.cs | 62 + src/Tizen.NUI/src/public/UIComponents/Popup.cs | 1120 +++++++++++++++ .../public/UIComponents/PopupBindableProperty.cs | 528 +++++++ .../src/public/UIComponents/ProgressBar.cs | 584 ++++++++ .../src/public/UIComponents/PushButton.cs | 136 ++ .../src/public/UIComponents/RadioButton.cs | 80 ++ src/Tizen.NUI/src/public/UIComponents/ScrollBar.cs | 824 +++++++++++ .../src/public/UIComponents/ScrollView.cs | 1469 ++++++++++++++++++++ .../UIComponents/ScrollViewBindableProperty.cs | 356 +++++ .../src/public/UIComponents/ScrollViewEvent.cs | 283 ++++ src/Tizen.NUI/src/public/UIComponents/Slider.cs | 1098 +++++++++++++++ .../src/public/UIComponents/ToggleButton.cs | 210 +++ 33 files changed, 8831 insertions(+), 85 deletions(-) create mode 100755 src/Tizen.NUI/src/internal/Common/ButtonSignal.cs create mode 100755 src/Tizen.NUI/src/internal/Common/ProgressBarValueChangedSignal.cs create mode 100755 src/Tizen.NUI/src/internal/Common/ScrollViewSnapStartedSignal.cs create mode 100755 src/Tizen.NUI/src/internal/Common/SliderMarkReachedSignal.cs create mode 100755 src/Tizen.NUI/src/internal/Common/SliderValueChangedSignal.cs create mode 100755 src/Tizen.NUI/src/internal/NativeBinding/SWIGTYPE_p_bundle.cs create mode 100755 src/Tizen.NUI/src/public/UIComponents/Button.cs create mode 100755 src/Tizen.NUI/src/public/UIComponents/CheckBoxButton.cs create mode 100755 src/Tizen.NUI/src/public/UIComponents/Popup.cs create mode 100755 src/Tizen.NUI/src/public/UIComponents/PopupBindableProperty.cs create mode 100755 src/Tizen.NUI/src/public/UIComponents/ProgressBar.cs create mode 100755 src/Tizen.NUI/src/public/UIComponents/PushButton.cs create mode 100755 src/Tizen.NUI/src/public/UIComponents/RadioButton.cs create mode 100755 src/Tizen.NUI/src/public/UIComponents/ScrollBar.cs create mode 100755 src/Tizen.NUI/src/public/UIComponents/ScrollView.cs create mode 100755 src/Tizen.NUI/src/public/UIComponents/ScrollViewBindableProperty.cs create mode 100755 src/Tizen.NUI/src/public/UIComponents/ScrollViewEvent.cs create mode 100755 src/Tizen.NUI/src/public/UIComponents/Slider.cs create mode 100755 src/Tizen.NUI/src/public/UIComponents/ToggleButton.cs diff --git a/src/Tizen.NUI/src/internal/Common/ButtonSignal.cs b/src/Tizen.NUI/src/internal/Common/ButtonSignal.cs new file mode 100755 index 0000000..870127f --- /dev/null +++ b/src/Tizen.NUI/src/internal/Common/ButtonSignal.cs @@ -0,0 +1,75 @@ +/* + * Copyright(c) 2021 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +namespace Tizen.NUI +{ + internal class ButtonSignal : Disposable + { + internal ButtonSignal(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn) + { + } + + protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr) + { + Interop.ButtonSignal.DeleteButtonSignal(swigCPtr); + } + + public bool Empty() + { + bool ret = Interop.ButtonSignal.Empty(SwigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + public uint GetConnectionCount() + { + uint ret = Interop.ButtonSignal.GetConnectionCount(SwigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + public void Connect(System.Delegate func) + { + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + { + Interop.ButtonSignal.Connect(SwigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + } + + public void Disconnect(System.Delegate func) + { + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + { + Interop.ButtonSignal.Disconnect(SwigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + } + + public bool Emit(Tizen.NUI.UIComponents.Button arg) + { + bool ret = Interop.ButtonSignal.Emit(SwigCPtr, Tizen.NUI.UIComponents.Button.getCPtr(arg)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + public ButtonSignal() : this(Interop.ButtonSignal.NewButtonSignal(), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + } +} diff --git a/src/Tizen.NUI/src/internal/Common/KeyboardTypeSignalType.cs b/src/Tizen.NUI/src/internal/Common/KeyboardTypeSignalType.cs index 8ffeaca..b0c848c 100755 --- a/src/Tizen.NUI/src/internal/Common/KeyboardTypeSignalType.cs +++ b/src/Tizen.NUI/src/internal/Common/KeyboardTypeSignalType.cs @@ -23,7 +23,10 @@ namespace Tizen.NUI /// /// KeyboardTypeSignalType /// - internal class KeyboardTypeSignalType : Disposable + /// 4 + [Obsolete("Deprecated in API6, Will be removed in API9, Please use InputMethodContext.KeyboardTypeChanged event instead!")] + [EditorBrowsable(EditorBrowsableState.Never)] + public class KeyboardTypeSignalType : Disposable { internal KeyboardTypeSignalType(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn) @@ -42,7 +45,10 @@ namespace Tizen.NUI /// Queries whether there are any connected slots. /// /// True if there are any slots connected to the signal - internal bool Empty() + /// 4 + [Obsolete("Deprecated in API6, Will be removed in API9, Please use InputMethodContext.KeyboardTypeChanged event instead!")] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool Empty() { bool ret = Interop.KeyboardTypeSignalType.Empty(SwigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -53,7 +59,10 @@ namespace Tizen.NUI /// Queries the number of slots. /// /// The number of slots connected to this signal - internal uint GetConnectionCount() + /// 4 + [Obsolete("Deprecated in API6, Will be removed in API9, Please use InputMethodContext.KeyboardTypeChanged event instead!")] + [EditorBrowsable(EditorBrowsableState.Never)] + public uint GetConnectionCount() { uint ret = Interop.KeyboardTypeSignalType.GetConnectionCount(SwigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -64,7 +73,10 @@ namespace Tizen.NUI /// Connects a function. /// /// The function to connect - internal void Connect(System.Delegate func) + /// 4 + [Obsolete("Deprecated in API6, Will be removed in API9, Please use InputMethodContext.KeyboardTypeChanged event instead!")] + [EditorBrowsable(EditorBrowsableState.Never)] + public void Connect(System.Delegate func) { System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { @@ -77,7 +89,10 @@ namespace Tizen.NUI /// Disconnects a function. /// /// The function to disconnect - internal void Disconnect(System.Delegate func) + /// 4 + [Obsolete("Deprecated in API6, Will be removed in API9, Please use InputMethodContext.KeyboardTypeChanged event instead!")] + [EditorBrowsable(EditorBrowsableState.Never)] + public void Disconnect(System.Delegate func) { System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { @@ -90,7 +105,10 @@ namespace Tizen.NUI /// Connects a member function. /// /// The member function to connect - internal void Emit(InputMethodContext.KeyboardType arg) + /// 5 + [Obsolete("Deprecated in API6, Will be removed in API9, Please use InputMethodContext.KeyboardTypeChanged event instead!")] + [EditorBrowsable(EditorBrowsableState.Never)] + public void Emit(InputMethodContext.KeyboardType arg) { Interop.KeyboardTypeSignalType.Emit(SwigCPtr, (int)arg); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -99,7 +117,10 @@ namespace Tizen.NUI /// /// The contructor. /// - internal KeyboardTypeSignalType() : this(Interop.KeyboardTypeSignalType.NewKeyboardTypeSignalType(), true) + /// 4 + [Obsolete("Deprecated in API6, Will be removed in API9, Please use InputMethodContext.KeyboardTypeChanged event instead!")] + [EditorBrowsable(EditorBrowsableState.Never)] + public KeyboardTypeSignalType() : this(Interop.KeyboardTypeSignalType.NewKeyboardTypeSignalType(), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } diff --git a/src/Tizen.NUI/src/internal/Common/ProgressBarValueChangedSignal.cs b/src/Tizen.NUI/src/internal/Common/ProgressBarValueChangedSignal.cs new file mode 100755 index 0000000..93a00f4 --- /dev/null +++ b/src/Tizen.NUI/src/internal/Common/ProgressBarValueChangedSignal.cs @@ -0,0 +1,74 @@ +/* + * Copyright(c) 2021 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +namespace Tizen.NUI +{ + internal class ProgressBarValueChangedSignal : Disposable + { + internal ProgressBarValueChangedSignal(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn) + { + } + + protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr) + { + Interop.ProgressBar.DeleteProgressBarValueChangedSignal(swigCPtr); + } + + public bool Empty() + { + bool ret = Interop.ProgressBar.ProgressBarValueChangedSignalEmpty(SwigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + public uint GetConnectionCount() + { + uint ret = Interop.ProgressBar.ProgressBarValueChangedSignalGetConnectionCount(SwigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + public void Connect(System.Delegate func) + { + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + { + Interop.ProgressBar.ProgressBarValueChangedSignalConnect(SwigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + } + + public void Disconnect(System.Delegate func) + { + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + { + Interop.ProgressBar.ProgressBarValueChangedSignalDisconnect(SwigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + } + + public void Emit(Tizen.NUI.UIComponents.ProgressBar arg1, float arg2, float arg3) + { + Interop.ProgressBar.ProgressBarValueChangedSignalEmit(SwigCPtr, Tizen.NUI.UIComponents.ProgressBar.getCPtr(arg1), arg2, arg3); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + public ProgressBarValueChangedSignal() : this(Interop.ProgressBar.NewProgressBarValueChangedSignal(), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + } +} diff --git a/src/Tizen.NUI/src/internal/Common/ScrollViewSnapStartedSignal.cs b/src/Tizen.NUI/src/internal/Common/ScrollViewSnapStartedSignal.cs new file mode 100755 index 0000000..f33a4af --- /dev/null +++ b/src/Tizen.NUI/src/internal/Common/ScrollViewSnapStartedSignal.cs @@ -0,0 +1,74 @@ +/* + * Copyright(c) 2021 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +namespace Tizen.NUI +{ + internal class ScrollViewSnapStartedSignal : Disposable + { + internal ScrollViewSnapStartedSignal(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn) + { + } + + protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr) + { + Interop.ScrollView.DeleteScrollViewSnapStartedSignal(swigCPtr); + } + + public bool Empty() + { + bool ret = Interop.ScrollView.ScrollViewSnapStartedSignalEmpty(SwigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + public uint GetConnectionCount() + { + uint ret = Interop.ScrollView.ScrollViewSnapStartedSignalGetConnectionCount(SwigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + public void Connect(System.Delegate func) + { + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + { + Interop.ScrollView.ScrollViewSnapStartedSignalConnect(SwigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + } + + public void Disconnect(System.Delegate func) + { + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + { + Interop.ScrollView.ScrollViewSnapStartedSignalDisconnect(SwigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + } + + public void Emit(ScrollView.SnapEvent arg) + { + Interop.ScrollView.ScrollViewSnapStartedSignalEmit(SwigCPtr, ScrollView.SnapEvent.getCPtr(arg)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + public ScrollViewSnapStartedSignal() : this(Interop.ScrollView.NewScrollViewSnapStartedSignal(), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + } +} diff --git a/src/Tizen.NUI/src/internal/Common/SliderMarkReachedSignal.cs b/src/Tizen.NUI/src/internal/Common/SliderMarkReachedSignal.cs new file mode 100755 index 0000000..cbc1bfc --- /dev/null +++ b/src/Tizen.NUI/src/internal/Common/SliderMarkReachedSignal.cs @@ -0,0 +1,75 @@ +/* + * Copyright(c) 2021 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +namespace Tizen.NUI +{ + internal class SliderMarkReachedSignal : Disposable + { + internal SliderMarkReachedSignal(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn) + { + } + + protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr) + { + Interop.Slider.DeleteSliderMarkReachedSignal(swigCPtr); + } + + public bool Empty() + { + bool ret = Interop.Slider.SliderMarkReachedSignalEmpty(SwigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + public uint GetConnectionCount() + { + uint ret = Interop.Slider.SliderMarkReachedSignalGetConnectionCount(SwigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + public void Connect(System.Delegate func) + { + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + { + Interop.Slider.SliderMarkReachedSignalConnect(SwigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + } + + public void Disconnect(System.Delegate func) + { + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + { + Interop.Slider.SliderMarkReachedSignalDisconnect(SwigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + } + + public bool Emit(Tizen.NUI.UIComponents.Slider arg1, int arg2) + { + bool ret = Interop.Slider.SliderMarkReachedSignalEmit(SwigCPtr, Tizen.NUI.UIComponents.Slider.getCPtr(arg1), arg2); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + public SliderMarkReachedSignal() : this(Interop.Slider.NewSliderMarkReachedSignal(), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + } +} diff --git a/src/Tizen.NUI/src/internal/Common/SliderValueChangedSignal.cs b/src/Tizen.NUI/src/internal/Common/SliderValueChangedSignal.cs new file mode 100755 index 0000000..8c0aaac --- /dev/null +++ b/src/Tizen.NUI/src/internal/Common/SliderValueChangedSignal.cs @@ -0,0 +1,75 @@ +/* + * Copyright(c) 2021 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +namespace Tizen.NUI +{ + internal class SliderValueChangedSignal : Disposable + { + internal SliderValueChangedSignal(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn) + { + } + + protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr) + { + Interop.Slider.DeleteSliderValueChangedSignal(swigCPtr); + } + + public bool Empty() + { + bool ret = Interop.Slider.SliderValueChangedSignalEmpty(SwigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + public uint GetConnectionCount() + { + uint ret = Interop.Slider.SliderValueChangedSignalGetConnectionCount(SwigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + public void Connect(System.Delegate func) + { + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + { + Interop.Slider.SliderValueChangedSignalConnect(SwigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + } + + public void Disconnect(System.Delegate func) + { + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + { + Interop.Slider.SliderValueChangedSignalDisconnect(SwigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + } + + public bool Emit(Tizen.NUI.UIComponents.Slider arg1, float arg2) + { + bool ret = Interop.Slider.SliderValueChangedSignalEmit(SwigCPtr, Tizen.NUI.UIComponents.Slider.getCPtr(arg1), arg2); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + public SliderValueChangedSignal() : this(Interop.Slider.NewSliderValueChangedSignal(), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + } +} diff --git a/src/Tizen.NUI/src/internal/NativeBinding/SWIGTYPE_p_bundle.cs b/src/Tizen.NUI/src/internal/NativeBinding/SWIGTYPE_p_bundle.cs new file mode 100755 index 0000000..1f5051a --- /dev/null +++ b/src/Tizen.NUI/src/internal/NativeBinding/SWIGTYPE_p_bundle.cs @@ -0,0 +1,47 @@ +/* + * Copyright(c) 2021 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +using System; +using System.ComponentModel; + +namespace Tizen.NUI +{ + /// + /// This should be internal, please do not use. + /// + /// 4 + [Obsolete("Deprecated in API6, Will be removed in API9, Please do not use! IntPtr(native integer pointer) is supposed to be not used in Application!")] + [EditorBrowsable(EditorBrowsableState.Never)] + public class SWIGTYPE_p_bundle + { + private global::System.Runtime.InteropServices.HandleRef swigCPtr; + + internal SWIGTYPE_p_bundle(global::System.IntPtr cPtr) + { + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + } + + /// + /// The Constructor. + /// + /// 4 + protected SWIGTYPE_p_bundle() + { + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + } +} diff --git a/src/Tizen.NUI/src/internal/Utility/ItemView.cs b/src/Tizen.NUI/src/internal/Utility/ItemView.cs index dae69aa..4b2f8ef 100755 --- a/src/Tizen.NUI/src/internal/Utility/ItemView.cs +++ b/src/Tizen.NUI/src/internal/Utility/ItemView.cs @@ -63,20 +63,95 @@ namespace Tizen.NUI /// /// Property for ItemView. This is internal use only, so not recommended to use. Need to use ItemView's properties. /// - internal new class Property - { - internal static readonly int LAYOUT = Interop.ItemView.LayoutGet(); - internal static readonly int MinimumSwipeSpeed = Interop.ItemView.MinimumSwipeSpeedGet(); - internal static readonly int MinimumSwipeDistance = Interop.ItemView.MinimumSwipeDistanceGet(); - internal static readonly int WheelScrollDistanceStep = Interop.ItemView.WheelScrollDistanceStepGet(); - internal static readonly int SnapToItemEnabled = Interop.ItemView.SnapToItemEnabledGet(); - internal static readonly int RefreshInterval = Interop.ItemView.RefreshIntervalGet(); - internal static readonly int LayoutPosition = Interop.ItemView.LayoutPositionGet(); - internal static readonly int ScrollSpeed = Interop.ItemView.ScrollSpeedGet(); - internal static readonly int OVERSHOOT = Interop.ItemView.OvershootGet(); - internal static readonly int ScrollDirection = Interop.ItemView.ScrollDirectionGet(); - internal static readonly int LayoutOrientation = Interop.ItemView.LayoutOrientationGet(); - internal static readonly int ScrollContentSize = Interop.ItemView.ScrollContentSizeGet(); + [Obsolete("Deprecated in API6; Will be removed in API9.")] + [EditorBrowsable(EditorBrowsableState.Never)] +#pragma warning disable CA1034, CA1052, CA1716 // Identifiers should not match keywords + public new class Property +#pragma warning restore CA1034, CA1052, CA1716 // Identifiers should not match keywords + { + /// + /// LAYOUT. This is internal use only, so not recommended to use. Need to use ItemView's properties. + /// + [Obsolete("Deprecated in API6; Will be removed in API9.")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly int LAYOUT = Interop.ItemView.LayoutGet(); + + /// + /// MINIMUM_SWIPE_SPEED. This is internal use only, so not recommended to use. Need to use ItemView's properties. + /// + [Obsolete("Deprecated in API6; Will be removed in API9.")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly int MinimumSwipeSpeed = Interop.ItemView.MinimumSwipeSpeedGet(); + + /// + /// MINIMUM_SWIPE_DISTANCE. This is internal use only, so not recommended to use. Need to use ItemView's properties. + /// + [Obsolete("Deprecated in API6; Will be removed in API9.")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly int MinimumSwipeDistance = Interop.ItemView.MinimumSwipeDistanceGet(); + + /// + /// WHEEL_SCROLL_DISTANCE_STEP. This is internal use only, so not recommended to use. Need to use ItemView's properties. + /// + [Obsolete("Deprecated in API6; Will be removed in API9.")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly int WheelScrollDistanceStep = Interop.ItemView.WheelScrollDistanceStepGet(); + + /// + /// SNAP_TO_ITEM_ENABLED. This is internal use only, so not recommended to use. Need to use ItemView's properties. + /// + [Obsolete("Deprecated in API6; Will be removed in API9.")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly int SnapToItemEnabled = Interop.ItemView.SnapToItemEnabledGet(); + + /// + /// REFRESH_INTERVAL. This is internal use only, so not recommended to use. Need to use ItemView's properties. + /// + [Obsolete("Deprecated in API6; Will be removed in API9.")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly int RefreshInterval = Interop.ItemView.RefreshIntervalGet(); + + /// + /// LAYOUT_POSITION. This is internal use only, so not recommended to use. Need to use ItemView's properties. + /// + [Obsolete("Deprecated in API6; Will be removed in API9.")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly int LayoutPosition = Interop.ItemView.LayoutPositionGet(); + + /// + /// SCROLL_SPEED. This is internal use only, so not recommended to use. Need to use ItemView's properties. + /// + [Obsolete("Deprecated in API6; Will be removed in API9.")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly int ScrollSpeed = Interop.ItemView.ScrollSpeedGet(); + + /// + /// OVERSHOOT. This is internal use only, so not recommended to use. Need to use ItemView's properties. + /// + [Obsolete("Deprecated in API6; Will be removed in API9.")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly int OVERSHOOT = Interop.ItemView.OvershootGet(); + + /// + /// SCROLL_DIRECTION. This is internal use only, so not recommended to use. Need to use ItemView's properties. + /// + [Obsolete("Deprecated in API6; Will be removed in API9.")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly int ScrollDirection = Interop.ItemView.ScrollDirectionGet(); + + /// + /// LAYOUT_ORIENTATION. This is internal use only, so not recommended to use. Need to use ItemView's properties. + /// + [Obsolete("Deprecated in API6; Will be removed in API9.")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly int LayoutOrientation = Interop.ItemView.LayoutOrientationGet(); + + /// + /// SCROLL_CONTENT_SIZE. This is internal use only, so not recommended to use. Need to use ItemView's properties. + /// + [Obsolete("Deprecated in API6; Will be removed in API9.")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly int ScrollContentSize = Interop.ItemView.ScrollContentSizeGet(); } /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. diff --git a/src/Tizen.NUI/src/internal/Widget/WidgetViewSignal.cs b/src/Tizen.NUI/src/internal/Widget/WidgetViewSignal.cs index 5e5acff..9b9eee7 100755 --- a/src/Tizen.NUI/src/internal/Widget/WidgetViewSignal.cs +++ b/src/Tizen.NUI/src/internal/Widget/WidgetViewSignal.cs @@ -23,7 +23,10 @@ namespace Tizen.NUI /// /// WidgetViewSignal /// - internal class WidgetViewSignal : Disposable + /// 3 + [Obsolete("Deprecated in API6, Will be removed in API9, Please use WidgetView.WidgetAdded, WidgetDeleted events instead!")] + [EditorBrowsable(EditorBrowsableState.Never)] + public class WidgetViewSignal : Disposable { internal WidgetViewSignal(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn) @@ -42,7 +45,10 @@ namespace Tizen.NUI /// Queries whether there are any connected slots. /// /// True if there are any slots connected to the signal - internal bool Empty() + /// 3 + [Obsolete("Deprecated in API6, Will be removed in API9, Please use WidgetView.WidgetAdded, WidgetDeleted events instead!")] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool Empty() { bool ret = Interop.WidgetView.WidgetViewSignalEmpty(SwigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -53,7 +59,10 @@ namespace Tizen.NUI /// Queries the number of slots. /// /// The number of slots connected to this signal - internal uint GetConnectionCount() + /// 3 + [Obsolete("Deprecated in API6, Will be removed in API9, Please use WidgetView.WidgetAdded, WidgetDeleted events instead!")] + [EditorBrowsable(EditorBrowsableState.Never)] + public uint GetConnectionCount() { uint ret = Interop.WidgetView.WidgetViewSignalGetConnectionCount(SwigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -64,7 +73,10 @@ namespace Tizen.NUI /// Connects a function. /// /// The function to connect - internal void Connect(System.Delegate func) + /// 3 + [Obsolete("Deprecated in API6, Will be removed in API9, Please use WidgetView.WidgetAdded, WidgetDeleted events instead!")] + [EditorBrowsable(EditorBrowsableState.Never)] + public void Connect(System.Delegate func) { System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { @@ -77,7 +89,10 @@ namespace Tizen.NUI /// Disconnects a function. /// /// The function to disconnect - internal void Disconnect(System.Delegate func) + /// 3 + [Obsolete("Deprecated in API6, Will be removed in API9, Please use WidgetView.WidgetAdded, WidgetDeleted events instead!")] + [EditorBrowsable(EditorBrowsableState.Never)] + public void Disconnect(System.Delegate func) { System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { @@ -90,7 +105,10 @@ namespace Tizen.NUI /// Connects a member function. /// /// The member function to connect - internal void Emit(WidgetView arg) + /// 3 + [Obsolete("Deprecated in API6, Will be removed in API9, Please use WidgetView.WidgetAdded, WidgetDeleted events instead!")] + [EditorBrowsable(EditorBrowsableState.Never)] + public void Emit(WidgetView arg) { Interop.WidgetView.WidgetViewSignalEmit(SwigCPtr, WidgetView.getCPtr(arg)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -99,7 +117,10 @@ namespace Tizen.NUI /// /// The contructor. /// - internal WidgetViewSignal() : this(Interop.WidgetView.NewWidgetViewSignal(), true) + /// 3 + [Obsolete("Deprecated in API6, Will be removed in API9, Please use WidgetView.WidgetAdded, WidgetDeleted events instead!")] + [EditorBrowsable(EditorBrowsableState.Never)] + public WidgetViewSignal() : this(Interop.WidgetView.NewWidgetViewSignal(), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } diff --git a/src/Tizen.NUI/src/internal/Xaml/XamlParser.cs b/src/Tizen.NUI/src/internal/Xaml/XamlParser.cs index 12794e2..03d92ee 100755 --- a/src/Tizen.NUI/src/internal/Xaml/XamlParser.cs +++ b/src/Tizen.NUI/src/internal/Xaml/XamlParser.cs @@ -49,6 +49,7 @@ using System.Reflection; using System.Xml; using Tizen.NUI.Binding; using Tizen.NUI.BaseComponents; +using Tizen.NUI.UIComponents; using Tizen.NUI.Binding.Internals; namespace Tizen.NUI.Xaml diff --git a/src/Tizen.NUI/src/public/Animation/Animation.cs b/src/Tizen.NUI/src/public/Animation/Animation.cs index c4ce272..85dfe92 100755 --- a/src/Tizen.NUI/src/public/Animation/Animation.cs +++ b/src/Tizen.NUI/src/public/Animation/Animation.cs @@ -599,7 +599,10 @@ namespace Tizen.NUI /// Handle to an object. /// Handle to an animation object or an uninitialized handle. /// Thrown when handle is null. - internal static Animation DownCast(BaseHandle handle) + /// 3 + [Obsolete("Deprecated in API6, Will be removed in API9, Please use as keyword instead!")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static Animation DownCast(BaseHandle handle) { if (handle == null) { diff --git a/src/Tizen.NUI/src/public/BaseComponents/FlexContainer.cs b/src/Tizen.NUI/src/public/BaseComponents/FlexContainer.cs index 9a54fba..72b31ba 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/FlexContainer.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/FlexContainer.cs @@ -432,7 +432,13 @@ namespace Tizen.NUI.BaseComponents /// /// Enumeration for the instance of child properties belonging to the FlexContainer class. /// - internal class ChildProperty + /// 3 + [SuppressMessage("Microsoft.Design", "CA1052:StaticHolderTypesShouldBeStaticOrNotInheritable")] + [Obsolete("Deprecated in API6, Will be removed in API9, " + + "Please use View.Flex, View.AlignSelf, View.FlexMargin instead!")] + [EditorBrowsable(EditorBrowsableState.Never)] + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")] + public class ChildProperty { internal static readonly int FLEX = Interop.FlexContainer.ChildPropertyFlexGet(); internal static readonly int AlignSelf = Interop.FlexContainer.ChildPropertyAlignSelfGet(); diff --git a/src/Tizen.NUI/src/public/BaseComponents/Scrollable.cs b/src/Tizen.NUI/src/public/BaseComponents/Scrollable.cs index 3f4898b..14182eb 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/Scrollable.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/Scrollable.cs @@ -728,64 +728,111 @@ namespace Tizen.NUI.BaseComponents /// /// Enumeration for the instance of properties belonging to the Scrollable class. /// - internal new class Property + /// 3 + [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("Deprecated in API6; Will be removed in API9.")] +#pragma warning disable CA1716, CA1052, CA1034 // Identifiers should not match keywords + public new class Property +#pragma warning restore CA1716, CA1052, CA1034 // Identifiers should not match keywords { /// /// The color of the overshoot effect. /// - internal static readonly int OvershootEffectColor = Interop.Scrollable.OvershootEffectColorGet(); + /// 3 + [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("Deprecated in API6; Will be removed in API9.")] + public static readonly int OvershootEffectColor = Interop.Scrollable.OvershootEffectColorGet(); /// /// The speed of overshoot animation in pixels per second. /// - internal static readonly int OvershootAnimationSpeed = Interop.Scrollable.OvershootAnimationSpeedGet(); + /// 3 + [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("Deprecated in API6; Will be removed in API9.")] + public static readonly int OvershootAnimationSpeed = Interop.Scrollable.OvershootAnimationSpeedGet(); /// /// Whether to enables or disable scroll overshoot. /// - internal static readonly int OvershootEnabled = Interop.Scrollable.OvershootEnabledGet(); + /// 3 + [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("Deprecated in API6; Will be removed in API9.")] + public static readonly int OvershootEnabled = Interop.Scrollable.OvershootEnabledGet(); /// /// The size of the overshoot. /// - internal static readonly int OvershootSize = Interop.Scrollable.OvershootSizeGet(); + /// 3 + [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("Deprecated in API6; Will be removed in API9.")] + public static readonly int OvershootSize = Interop.Scrollable.OvershootSizeGet(); /// /// scrollToAlphaFunction. /// - internal static readonly int ScrollToAlphaFunction = Interop.Scrollable.ScrollToAlphaFunctionGet(); + /// 3 + [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("Deprecated in API6; Will be removed in API9.")] + public static readonly int ScrollToAlphaFunction = Interop.Scrollable.ScrollToAlphaFunctionGet(); /// /// scrollRelativePosition /// - internal static readonly int ScrollRelativePosition = Interop.Scrollable.ScrollRelativePositionGet(); + /// 3 + [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("Deprecated in API6; Will be removed in API9.")] + public static readonly int ScrollRelativePosition = Interop.Scrollable.ScrollRelativePositionGet(); /// /// scrollPositionMin /// - internal static readonly int ScrollPositionMin = Interop.Scrollable.ScrollPositionMinGet(); + /// 3 + [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("Deprecated in API6; Will be removed in API9.")] + public static readonly int ScrollPositionMin = Interop.Scrollable.ScrollPositionMinGet(); /// /// scrollPositionMinX. /// - internal static readonly int ScrollPositionMinX = Interop.Scrollable.ScrollPositionMinXGet(); + /// 3 + [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("Deprecated in API6; Will be removed in API9.")] + public static readonly int ScrollPositionMinX = Interop.Scrollable.ScrollPositionMinXGet(); /// /// scrollPositionMinY. /// - internal static readonly int ScrollPositionMinY = Interop.Scrollable.ScrollPositionMinYGet(); + /// 3 + [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("Deprecated in API6; Will be removed in API9.")] + public static readonly int ScrollPositionMinY = Interop.Scrollable.ScrollPositionMinYGet(); /// /// scrollPositionMax. /// - internal static readonly int ScrollPositionMax = Interop.Scrollable.ScrollPositionMaxGet(); + /// 3 + [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("Deprecated in API6; Will be removed in API9.")] + public static readonly int ScrollPositionMax = Interop.Scrollable.ScrollPositionMaxGet(); /// /// scrollPositionMaxX. /// - internal static readonly int ScrollPositionMaxX = Interop.Scrollable.ScrollPositionMaxXGet(); + /// 3 + [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("Deprecated in API6; Will be removed in API9.")] + public static readonly int ScrollPositionMaxX = Interop.Scrollable.ScrollPositionMaxXGet(); /// /// scrollPositionMaxY. /// - internal static readonly int ScrollPositionMaxY = Interop.Scrollable.ScrollPositionMaxYGet(); + /// 3 + [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("Deprecated in API6; Will be removed in API9.")] + public static readonly int ScrollPositionMaxY = Interop.Scrollable.ScrollPositionMaxYGet(); /// /// canScrollVertical /// - internal static readonly int CanScrollVertical = Interop.Scrollable.CanScrollVerticalGet(); + /// 3 + [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("Deprecated in API6; Will be removed in API9.")] + public static readonly int CanScrollVertical = Interop.Scrollable.CanScrollVerticalGet(); /// /// canScrollHorizontal. /// - internal static readonly int CanScrollHorizontal = Interop.Scrollable.CanScrollHorizontalGet(); + /// 3 + [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("Deprecated in API6; Will be removed in API9.")] + public static readonly int CanScrollHorizontal = Interop.Scrollable.CanScrollHorizontalGet(); } } } diff --git a/src/Tizen.NUI/src/public/Common/Layer.cs b/src/Tizen.NUI/src/public/Common/Layer.cs index 3c40e9b..9abbe28 100755 --- a/src/Tizen.NUI/src/public/Common/Layer.cs +++ b/src/Tizen.NUI/src/public/Common/Layer.cs @@ -64,6 +64,14 @@ namespace Tizen.NUI LayerUI, /// + /// Deprecated in API6; Will be removed in API9. Please use LayerUI instead. + /// + /// 3 + [Obsolete("Deprecated in API6; Will be removed in API9. Please use LayerUI instead.")] + [EditorBrowsable(EditorBrowsableState.Never)] + Layer2D = LayerUI, + + /// /// Layer will use depth test. /// This mode is designed for a 3 dimensional scene where actors in front /// of other actors will obscure them, i.e. the actors are sorted by the diff --git a/src/Tizen.NUI/src/public/Common/PropertyBuffer.cs b/src/Tizen.NUI/src/public/Common/PropertyBuffer.cs index 1cc9301..103c8a0 100755 --- a/src/Tizen.NUI/src/public/Common/PropertyBuffer.cs +++ b/src/Tizen.NUI/src/public/Common/PropertyBuffer.cs @@ -51,7 +51,12 @@ namespace Tizen.NUI /// /// A pointer to the data that will be copied to the buffer. /// Number of elements to expand or contract the buffer. - internal void SetData(System.IntPtr data, uint size) + /// 3 + [Obsolete("Deprecated in API6, Will be removed in API9, " + + "Please use PropertyBuffer(PropertyMap bufferFormat) constructor instead!" + + "IntPtr(native integer pointer) is supposed to be not used in Application!")] + [EditorBrowsable(EditorBrowsableState.Never)] + public void SetData(System.IntPtr data, uint size) { Interop.PropertyBuffer.SetData(SwigCPtr, data, size); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); diff --git a/src/Tizen.NUI/src/public/Common/PropertyNotification.cs b/src/Tizen.NUI/src/public/Common/PropertyNotification.cs index 656dca4..95db10f 100755 --- a/src/Tizen.NUI/src/public/Common/PropertyNotification.cs +++ b/src/Tizen.NUI/src/public/Common/PropertyNotification.cs @@ -121,7 +121,12 @@ namespace Tizen.NUI /// /// An object of IntPtr type. /// An object of the PropertyNotification type. - internal static PropertyNotification GetPropertyNotificationFromPtr(global::System.IntPtr cPtr) + /// 4 + [Obsolete("Deprecated in API6, Will be removed in API9, " + + "Please use Notified event instead!" + + "IntPtr(native integer pointer) is supposed to be not used in Application!")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static PropertyNotification GetPropertyNotificationFromPtr(global::System.IntPtr cPtr) { PropertyNotification ret = new PropertyNotification(cPtr, false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -151,7 +156,11 @@ namespace Tizen.NUI /// /// A reference to the copied handle. /// A reference to this. - internal PropertyNotification Assign(PropertyNotification rhs) + /// 4 + [Obsolete("Deprecated in API6, Will be removed in API9, " + + "Please use PropertyNotification() constructor instead!")] + [EditorBrowsable(EditorBrowsableState.Never)] + public PropertyNotification Assign(PropertyNotification rhs) { PropertyNotification ret = new PropertyNotification(Interop.PropertyNotification.Assign(SwigCPtr, PropertyNotification.getCPtr(rhs)), false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -232,7 +241,11 @@ namespace Tizen.NUI /// Connects to this signal to be notified when the notification has occurred. /// /// A signal object to Connect() with - internal PropertyNotifySignal NotifySignal() + /// 4 + [Obsolete("Deprecated in API6, Will be removed in API9, " + + "Please use Notified event instead!")] + [EditorBrowsable(EditorBrowsableState.Never)] + public PropertyNotifySignal NotifySignal() { PropertyNotifySignal ret = new PropertyNotifySignal(Interop.PropertyNotification.NotifySignal(SwigCPtr), false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); diff --git a/src/Tizen.NUI/src/public/Common/PropertyNotifySignal.cs b/src/Tizen.NUI/src/public/Common/PropertyNotifySignal.cs index 07b8087..8fa51ed 100755 --- a/src/Tizen.NUI/src/public/Common/PropertyNotifySignal.cs +++ b/src/Tizen.NUI/src/public/Common/PropertyNotifySignal.cs @@ -1,5 +1,5 @@ /* - * Copyright(c) 2020 Samsung Electronics Co., Ltd. + * Copyright(c) 2019 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,12 +23,21 @@ namespace Tizen.NUI /// /// Signal connection class for PropertyNotification /// - internal class PropertyNotifySignal : Disposable + /// 4 + [Obsolete("Deprecated in API6, Will be removed in API9, " + + "Please use PropertyNotification.Notified event instead!")] + [EditorBrowsable(EditorBrowsableState.Never)] + public class PropertyNotifySignal : Disposable { + /// /// The constructor. /// - internal PropertyNotifySignal() : this(Interop.PropertyNotifySignal.NewPropertyNotifySignal(), true) + /// 4 + [Obsolete("Deprecated in API6, Will be removed in API9, " + + "Please use PropertyNotification.Notified event instead!")] + [EditorBrowsable(EditorBrowsableState.Never)] + public PropertyNotifySignal() : this(Interop.PropertyNotifySignal.NewPropertyNotifySignal(), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } @@ -41,7 +50,11 @@ namespace Tizen.NUI /// Queries whether there are any connected slots. /// /// True if there are any slots connected to the signal. - internal bool Empty() + /// 4 + [Obsolete("Deprecated in API6, Will be removed in API9, " + + "Please use PropertyNotification.Notified event instead!")] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool Empty() { bool ret = Interop.PropertyNotifySignal.Empty(SwigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -52,7 +65,11 @@ namespace Tizen.NUI /// Queries the number of slots. /// /// The number of slots connected to this signal - internal uint GetConnectionCount() + /// 4 + [Obsolete("Deprecated in API6, Will be removed in API9, " + + "Please use PropertyNotification.Notified event instead!")] + [EditorBrowsable(EditorBrowsableState.Never)] + public uint GetConnectionCount() { uint ret = Interop.PropertyNotifySignal.GetConnectionCount(SwigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -63,7 +80,11 @@ namespace Tizen.NUI /// Connects a function. /// /// The function to connect - internal void Connect(System.Delegate func) + /// 4 + [Obsolete("Deprecated in API6, Will be removed in API9, " + + "Please use PropertyNotification.Notified event instead!")] + [EditorBrowsable(EditorBrowsableState.Never)] + public void Connect(System.Delegate func) { System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { @@ -76,7 +97,11 @@ namespace Tizen.NUI /// Disconnects a function. /// /// The function to disconnect. - internal void Disconnect(System.Delegate func) + /// 4 + [Obsolete("Deprecated in API6, Will be removed in API9, " + + "Please use PropertyNotification.Notified event instead!")] + [EditorBrowsable(EditorBrowsableState.Never)] + public void Disconnect(System.Delegate func) { System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { @@ -89,12 +114,17 @@ namespace Tizen.NUI /// Emits a signal with 1 parameter. /// /// The first value to pass to callbacks. - internal void Emit(PropertyNotification arg) + /// 4 + [Obsolete("Deprecated in API6, Will be removed in API9, " + + "Please use PropertyNotification.Notified event instead!")] + [EditorBrowsable(EditorBrowsableState.Never)] + public void Emit(PropertyNotification arg) { Interop.PropertyNotifySignal.Emit(SwigCPtr, PropertyNotification.getCPtr(arg)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } + /// This will not be public opened. [EditorBrowsable(EditorBrowsableState.Never)] protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr) diff --git a/src/Tizen.NUI/src/public/CustomView/Spin.cs b/src/Tizen.NUI/src/public/CustomView/Spin.cs index 43a5a60..06419e2 100755 --- a/src/Tizen.NUI/src/public/CustomView/Spin.cs +++ b/src/Tizen.NUI/src/public/CustomView/Spin.cs @@ -18,6 +18,7 @@ using System; using System.Runtime.InteropServices; using Tizen.NUI; +using Tizen.NUI.UIComponents; using Tizen.NUI.BaseComponents; // A spin control (for continously changing values when users can easily predict a set of values) diff --git a/src/Tizen.NUI/src/public/Rendering/Renderer.cs b/src/Tizen.NUI/src/public/Rendering/Renderer.cs index fc6c420..33342c8 100755 --- a/src/Tizen.NUI/src/public/Rendering/Renderer.cs +++ b/src/Tizen.NUI/src/public/Rendering/Renderer.cs @@ -725,32 +725,181 @@ namespace Tizen.NUI /// /// Enumeration for instances of properties belonging to the Renderer class. /// - internal class Property - { - internal static readonly int DepthIndex = Interop.Renderer.DepthIndexGet(); - internal static readonly int FaceCullingMode = Interop.Renderer.FaceCullingModeGet(); - internal static readonly int BlendMode = Interop.Renderer.BlendModeGet(); - internal static readonly int BlendEquationRgb = Interop.Renderer.BlendEquationRgbGet(); - internal static readonly int BlendEquationAlpha = Interop.Renderer.BlendEquationAlphaGet(); - internal static readonly int BlendFactorSrcRgb = Interop.Renderer.BlendFactorSrcRgbGet(); - internal static readonly int BlendFactorDestRgb = Interop.Renderer.BlendFactorDestRgbGet(); - internal static readonly int BlendFactorSrcAlpha = Interop.Renderer.BlendFactorSrcAlphaGet(); - internal static readonly int BlendFactorDestAlpha = Interop.Renderer.BlendFactorDestAlphaGet(); - internal static readonly int BlendColor = Interop.Renderer.BlendColorGet(); - internal static readonly int BlendPreMultipliedAlpha = Interop.Renderer.BlendPreMultipliedAlphaGet(); - internal static readonly int IndexRangeFirst = Interop.Renderer.IndexRangeFirstGet(); - internal static readonly int IndexRangeCount = Interop.Renderer.IndexRangeCountGet(); - internal static readonly int DepthWriteMode = Interop.Renderer.DepthWriteModeGet(); - internal static readonly int DepthFunction = Interop.Renderer.DepthFunctionGet(); - internal static readonly int DepthTestMode = Interop.Renderer.DepthTestModeGet(); - internal static readonly int RenderMode = Interop.Renderer.RenderModeGet(); - internal static readonly int StencilFunction = Interop.Renderer.StencilFunctionGet(); - internal static readonly int StencilFunctionMask = Interop.Renderer.StencilFunctionMaskGet(); - internal static readonly int StencilFunctionReference = Interop.Renderer.StencilFunctionReferenceGet(); - internal static readonly int StencilMask = Interop.Renderer.StencilMaskGet(); - internal static readonly int StencilOperationOnFail = Interop.Renderer.StencilOperationOnFailGet(); - internal static readonly int StencilOperationOnZFail = Interop.Renderer.StencilOperationOnZFailGet(); - internal static readonly int StencilOperationOnZPass = Interop.Renderer.StencilOperationOnZPassGet(); + /// 3 + [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("Deprecated in API6; Will be removed in API9.")] +#pragma warning disable CA1716, CA1052, CA1034 // Identifiers should not match keywords + public class Property +#pragma warning restore CA1716, CA1052, CA1034 // Identifiers should not match keywords + { + /// + /// This should be internal, please do not use. + /// + /// 3 + [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("Deprecated in API6; Will be removed in API9.")] + public static readonly int DepthIndex = Interop.Renderer.DepthIndexGet(); + /// + /// This should be internal, please do not use. + /// + /// 3 + [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("Deprecated in API6; Will be removed in API9.")] + public static readonly int FaceCullingMode = Interop.Renderer.FaceCullingModeGet(); + /// + /// This should be internal, please do not use. + /// + /// 3 + [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("Deprecated in API6; Will be removed in API9.")] + public static readonly int BlendMode = Interop.Renderer.BlendModeGet(); + /// + /// This should be internal, please do not use. + /// + /// 3 + [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("Deprecated in API6; Will be removed in API9.")] + public static readonly int BlendEquationRgb = Interop.Renderer.BlendEquationRgbGet(); + /// + /// This should be internal, please do not use. + /// + /// 3 + [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("Deprecated in API6; Will be removed in API9.")] + public static readonly int BlendEquationAlpha = Interop.Renderer.BlendEquationAlphaGet(); + /// + /// This should be internal, please do not use. + /// + /// 3 + [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("Deprecated in API6; Will be removed in API9.")] + public static readonly int BlendFactorSrcRgb = Interop.Renderer.BlendFactorSrcRgbGet(); + /// + /// This should be internal, please do not use. + /// + /// 3 + [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("Deprecated in API6; Will be removed in API9.")] + public static readonly int BlendFactorDestRgb = Interop.Renderer.BlendFactorDestRgbGet(); + /// + /// This should be internal, please do not use. + /// + /// 3 + [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("Deprecated in API6; Will be removed in API9.")] + public static readonly int BlendFactorSrcAlpha = Interop.Renderer.BlendFactorSrcAlphaGet(); + /// + /// This should be internal, please do not use. + /// + /// 3 + [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("Deprecated in API6; Will be removed in API9.")] + public static readonly int BlendFactorDestAlpha = Interop.Renderer.BlendFactorDestAlphaGet(); + /// + /// This should be internal, please do not use. + /// + /// 3 + [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("Deprecated in API6; Will be removed in API9.")] + public static readonly int BlendColor = Interop.Renderer.BlendColorGet(); + /// + /// This should be internal, please do not use. + /// + /// 3 + [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("Deprecated in API6; Will be removed in API9.")] + public static readonly int BlendPreMultipliedAlpha = Interop.Renderer.BlendPreMultipliedAlphaGet(); + /// + /// This should be internal, please do not use. + /// + /// 3 + [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("Deprecated in API6; Will be removed in API9.")] + public static readonly int IndexRangeFirst = Interop.Renderer.IndexRangeFirstGet(); + /// + /// This should be internal, please do not use. + /// + /// 3 + [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("Deprecated in API6; Will be removed in API9.")] + public static readonly int IndexRangeCount = Interop.Renderer.IndexRangeCountGet(); + /// + /// This should be internal, please do not use. + /// + /// 3 + [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("Deprecated in API6; Will be removed in API9.")] + public static readonly int DepthWriteMode = Interop.Renderer.DepthWriteModeGet(); + /// + /// This should be internal, please do not use. + /// + /// 3 + [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("Deprecated in API6; Will be removed in API9.")] + public static readonly int DepthFunction = Interop.Renderer.DepthFunctionGet(); + /// + /// This should be internal, please do not use. + /// + /// 3 + [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("Deprecated in API6; Will be removed in API9.")] + public static readonly int DepthTestMode = Interop.Renderer.DepthTestModeGet(); + /// + /// This should be internal, please do not use. + /// + /// 3 + [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("Deprecated in API6; Will be removed in API9.")] + public static readonly int RenderMode = Interop.Renderer.RenderModeGet(); + /// + /// This should be internal, please do not use. + /// + /// 3 + [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("Deprecated in API6; Will be removed in API9.")] + public static readonly int StencilFunction = Interop.Renderer.StencilFunctionGet(); + /// + /// This should be internal, please do not use. + /// + /// 3 + [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("Deprecated in API6; Will be removed in API9.")] + public static readonly int StencilFunctionMask = Interop.Renderer.StencilFunctionMaskGet(); + /// + /// This should be internal, please do not use. + /// + /// 3 + [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("Deprecated in API6; Will be removed in API9.")] + public static readonly int StencilFunctionReference = Interop.Renderer.StencilFunctionReferenceGet(); + /// + /// This should be internal, please do not use. + /// + /// 3 + [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("Deprecated in API6; Will be removed in API9.")] + public static readonly int StencilMask = Interop.Renderer.StencilMaskGet(); + /// + /// This should be internal, please do not use. + /// + /// 3 + [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("Deprecated in API6; Will be removed in API9.")] + public static readonly int StencilOperationOnFail = Interop.Renderer.StencilOperationOnFailGet(); + /// + /// This should be internal, please do not use. + /// + /// 3 + [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("Deprecated in API6; Will be removed in API9.")] + public static readonly int StencilOperationOnZFail = Interop.Renderer.StencilOperationOnZFailGet(); + /// + /// This should be internal, please do not use. + /// + /// 3 + [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("Deprecated in API6; Will be removed in API9.")] + public static readonly int StencilOperationOnZPass = Interop.Renderer.StencilOperationOnZPassGet(); } } } diff --git a/src/Tizen.NUI/src/public/Rendering/Shader.cs b/src/Tizen.NUI/src/public/Rendering/Shader.cs index 915d886..64ba5df 100755 --- a/src/Tizen.NUI/src/public/Rendering/Shader.cs +++ b/src/Tizen.NUI/src/public/Rendering/Shader.cs @@ -123,13 +123,21 @@ namespace Tizen.NUI /// /// Enumeration for instances of properties belonging to the Shader class. /// - internal class Property + /// 3 + [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("Deprecated in API6; Will be removed in API9.")] +#pragma warning disable CA1716, CA1052, CA1034 // Identifiers should not match keywords + public class Property +#pragma warning restore CA1716, CA1052, CA1034 // Identifiers should not match keywords { /// /// The default value is empty. /// Format: {"vertex":"","fragment":"",hints:"","vertexPrefix":"","fragmentPrefix":""} /// - internal static readonly int PROGRAM = Interop.Shader.ProgramGet(); + /// 3 + [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("Deprecated in API6; Will be removed in API9.")] + public static readonly int PROGRAM = Interop.Shader.ProgramGet(); } } } diff --git a/src/Tizen.NUI/src/public/UIComponents/Button.cs b/src/Tizen.NUI/src/public/UIComponents/Button.cs new file mode 100755 index 0000000..36f69fa --- /dev/null +++ b/src/Tizen.NUI/src/public/UIComponents/Button.cs @@ -0,0 +1,1188 @@ +/* + * Copyright(c) 2019 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +using System; +using System.ComponentModel; +using System.Runtime.InteropServices; +using Tizen.NUI.BaseComponents; +using Tizen.NUI.Binding; + +namespace Tizen.NUI.UIComponents +{ + /// + /// The Button class is a base class for different kinds of buttons.
+ /// This class provides the disabled property and the clicked signal.
+ /// The clicked event handler is emitted when the button is touched, and the touch point doesn't leave the boundary of the button.
+ /// When the disabled property is set to true, no signal is emitted.
+ /// The 'Visual' describes not just traditional images like PNG and BMP, but also refers to whatever is used to show the button. It could be a color, gradient, or some other kind of renderer.
+ /// The button's appearance can be modified by setting properties for the various visuals or images.
+ /// It is not mandatory to set all the visuals. A button could be defined only by setting its background visual, or by setting its background and selected visuals.
+ /// The button visual is shown over the background visual.
+ /// When pressed, the unselected visuals are replaced by the selected visuals.
+ /// The text label is always placed on the top of all images.
+ /// When the button is disabled, the background button and the selected visuals are replaced by their disabled visuals.
+ ///
+ /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public class Button : View + { + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty UnselectedVisualProperty = BindableProperty.Create(nameof(UnselectedVisual), typeof(PropertyMap), typeof(Button), new PropertyMap(), propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var button = (Button)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((HandleRef)button.SwigCPtr, Button.Property.UnselectedVisual, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var button = (Button)bindable; + Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap(); + Tizen.NUI.Object.GetProperty((HandleRef)button.SwigCPtr, Button.Property.UnselectedVisual).Get(temp); + return temp; + })); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty SelectedVisualProperty = BindableProperty.Create(nameof(SelectedVisual), typeof(PropertyMap), typeof(Button), new PropertyMap(), propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var button = (Button)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((HandleRef)button.SwigCPtr, Button.Property.SelectedVisual, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var button = (Button)bindable; + Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap(); + Tizen.NUI.Object.GetProperty((HandleRef)button.SwigCPtr, Button.Property.SelectedVisual).Get(temp); + return temp; + })); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty DisabledSelectedVisualProperty = BindableProperty.Create(nameof(DisabledSelectedVisual), typeof(PropertyMap), typeof(Button), new PropertyMap(), propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var button = (Button)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((HandleRef)button.SwigCPtr, Button.Property.DisabledSelectedVisual, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var button = (Button)bindable; + Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap(); + Tizen.NUI.Object.GetProperty((HandleRef)button.SwigCPtr, Button.Property.DisabledSelectedVisual).Get(temp); + return temp; + })); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty DisabledUnselectedVisualProperty = BindableProperty.Create(nameof(DisabledUnselectedVisual), typeof(PropertyMap), typeof(Button), new PropertyMap(), propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var button = (Button)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((HandleRef)button.SwigCPtr, Button.Property.DisabledUnselectedVisual, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var button = (Button)bindable; + Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap(); + Tizen.NUI.Object.GetProperty((HandleRef)button.SwigCPtr, Button.Property.DisabledUnselectedVisual).Get(temp); + return temp; + })); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty UnselectedBackgroundVisualProperty = BindableProperty.Create(nameof(UnselectedBackgroundVisual), typeof(PropertyMap), typeof(Button), new PropertyMap(), propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var button = (Button)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((HandleRef)button.SwigCPtr, Button.Property.UnselectedBackgroundVisual, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var button = (Button)bindable; + Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap(); + Tizen.NUI.Object.GetProperty((HandleRef)button.SwigCPtr, Button.Property.UnselectedBackgroundVisual).Get(temp); + return temp; + })); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty SelectedBackgroundVisualProperty = BindableProperty.Create(nameof(SelectedBackgroundVisual), typeof(PropertyMap), typeof(Button), new PropertyMap(), propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var button = (Button)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((HandleRef)button.SwigCPtr, Button.Property.SelectedBackgroundVisual, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var button = (Button)bindable; + Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap(); + Tizen.NUI.Object.GetProperty((HandleRef)button.SwigCPtr, Button.Property.SelectedBackgroundVisual).Get(temp); + return temp; + })); + /// This will be deprecated + [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + public static readonly BindableProperty DisabledUnselectedBackgroundVisualProperty = BindableProperty.Create(nameof(DisabledUnselectedBackgroundVisual), typeof(PropertyMap), typeof(Button), new PropertyMap(), propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var button = (Button)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((HandleRef)button.SwigCPtr, Button.Property.DisabledUnselectedBackgroundVisual, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var button = (Button)bindable; + Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap(); + Tizen.NUI.Object.GetProperty((HandleRef)button.SwigCPtr, Button.Property.DisabledUnselectedBackgroundVisual).Get(temp); + return temp; + })); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty DisabledSelectedBackgroundVisualProperty = BindableProperty.Create(nameof(DisabledSelectedBackgroundVisual), typeof(PropertyMap), typeof(Button), new PropertyMap(), propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var button = (Button)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((HandleRef)button.SwigCPtr, Button.Property.DisabledSelectedBackgroundVisual, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var button = (Button)bindable; + Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap(); + Tizen.NUI.Object.GetProperty((HandleRef)button.SwigCPtr, Button.Property.DisabledSelectedBackgroundVisual).Get(temp); + return temp; + })); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty LabelRelativeAlignmentProperty = BindableProperty.Create(nameof(LabelRelativeAlignment), typeof(Align), typeof(Button), Align.End, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var button = (Button)bindable; + string valueToString = ""; + if (newValue != null) + { + switch ((Align)newValue) + { + case Align.Begin: { valueToString = "BEGIN"; break; } + case Align.End: { valueToString = "END"; break; } + case Align.Top: { valueToString = "TOP"; break; } + case Align.Bottom: { valueToString = "BOTTOM"; break; } + default: { valueToString = "END"; break; } + } + Tizen.NUI.Object.SetProperty((HandleRef)button.SwigCPtr, Button.Property.LabelRelativeAlignment, new Tizen.NUI.PropertyValue(valueToString)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var button = (Button)bindable; + string temp; + if (Tizen.NUI.Object.GetProperty((HandleRef)button.SwigCPtr, Button.Property.LabelRelativeAlignment).Get(out temp) == false) + { + NUILog.Error("LabelRelativeAlignment get error!"); + } + switch (temp) + { + case "BEGIN": return Align.Begin; + case "END": return Align.End; + case "TOP": return Align.Top; + case "BOTTOM": return Align.Bottom; + default: return Align.End; + } + })); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty LabelPaddingProperty = BindableProperty.Create(nameof(LabelPadding), typeof(Vector4), typeof(Button), Vector4.Zero, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var button = (Button)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((HandleRef)button.SwigCPtr, Button.Property.LabelPadding, new Tizen.NUI.PropertyValue((Vector4)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var button = (Button)bindable; + Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f); + Tizen.NUI.Object.GetProperty((HandleRef)button.SwigCPtr, Button.Property.LabelPadding).Get(temp); + return temp; + })); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty ForegroundVisualPaddingProperty = BindableProperty.Create(nameof(ForegroundVisualPadding), typeof(Vector4), typeof(Button), Vector4.Zero, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var button = (Button)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((HandleRef)button.SwigCPtr, Button.Property.ForegroundVisualPadding, new Tizen.NUI.PropertyValue((Vector4)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var button = (Button)bindable; + Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f); + Tizen.NUI.Object.GetProperty((HandleRef)button.SwigCPtr, Button.Property.ForegroundVisualPadding).Get(temp); + return temp; + })); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty AutoRepeatingProperty = BindableProperty.Create(nameof(AutoRepeating), typeof(bool), typeof(Button), false, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var button = (Button)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((HandleRef)button.SwigCPtr, Button.Property.AutoRepeating, new Tizen.NUI.PropertyValue((bool)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var button = (Button)bindable; + bool temp = false; + Tizen.NUI.Object.GetProperty((HandleRef)button.SwigCPtr, Button.Property.AutoRepeating).Get(out temp); + return temp; + })); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty InitialAutoRepeatingDelayProperty = BindableProperty.Create(nameof(InitialAutoRepeatingDelay), typeof(float), typeof(Button), default(float), propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var button = (Button)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((HandleRef)button.SwigCPtr, Button.Property.InitialAutoRepeatingDelay, new Tizen.NUI.PropertyValue((float)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var button = (Button)bindable; + float temp = 0.0f; + Tizen.NUI.Object.GetProperty((HandleRef)button.SwigCPtr, Button.Property.InitialAutoRepeatingDelay).Get(out temp); + return temp; + })); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty NextAutoRepeatingDelayProperty = BindableProperty.Create(nameof(NextAutoRepeatingDelay), typeof(float), typeof(Button), default(float), propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var button = (Button)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((HandleRef)button.SwigCPtr, Button.Property.NextAutoRepeatingDelay, new Tizen.NUI.PropertyValue((float)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var button = (Button)bindable; + float temp = 0.0f; + Tizen.NUI.Object.GetProperty((HandleRef)button.SwigCPtr, Button.Property.NextAutoRepeatingDelay).Get(out temp); + return temp; + })); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty TogglableProperty = BindableProperty.Create(nameof(Togglable), typeof(bool), typeof(Button), false, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var button = (Button)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((HandleRef)button.SwigCPtr, Button.Property.TOGGLABLE, new Tizen.NUI.PropertyValue((bool)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var button = (Button)bindable; + bool temp = false; + Tizen.NUI.Object.GetProperty((HandleRef)button.SwigCPtr, Button.Property.TOGGLABLE).Get(out temp); + return temp; + })); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty SelectedProperty = BindableProperty.Create(nameof(Selected), typeof(bool), typeof(Button), false, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var button = (Button)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((HandleRef)button.SwigCPtr, Button.Property.SELECTED, new Tizen.NUI.PropertyValue((bool)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var button = (Button)bindable; + bool temp = false; + Tizen.NUI.Object.GetProperty((HandleRef)button.SwigCPtr, Button.Property.SELECTED).Get(out temp); + return temp; + })); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty UnselectedColorProperty = BindableProperty.Create(nameof(UnselectedColor), typeof(Color), typeof(Button), Color.Transparent, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var button = (Button)bindable; + if (newValue != null) + { + PropertyMap background = new PropertyMap(); + background.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Color)) + .Add(ColorVisualProperty.MixColor, new PropertyValue((Color)newValue)); + Tizen.NUI.Object.SetProperty((HandleRef)button.SwigCPtr, Button.Property.UnselectedBackgroundVisual, new Tizen.NUI.PropertyValue(background)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var button = (Button)bindable; + Color temp = new Color(0.0f, 0.0f, 0.0f, 0.0f); + Tizen.NUI.PropertyMap map = new Tizen.NUI.PropertyMap(); + Tizen.NUI.Object.GetProperty((HandleRef)button.SwigCPtr, Button.Property.UnselectedBackgroundVisual).Get(map); + Tizen.NUI.PropertyValue value = map.Find(Visual.Property.MixColor); + value?.Get(temp); + return temp; + })); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty SelectedColorProperty = BindableProperty.Create(nameof(SelectedColor), typeof(Color), typeof(Button), Color.Transparent, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var button = (Button)bindable; + if (newValue != null) + { + PropertyMap background = new PropertyMap(); + background.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Color)) + .Add(ColorVisualProperty.MixColor, new PropertyValue((Color)newValue)); + Tizen.NUI.Object.SetProperty((HandleRef)button.SwigCPtr, Button.Property.SelectedBackgroundVisual, new Tizen.NUI.PropertyValue(background)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var button = (Button)bindable; + Color temp = new Color(0.0f, 0.0f, 0.0f, 0.0f); + Tizen.NUI.PropertyMap map = new Tizen.NUI.PropertyMap(); + Tizen.NUI.Object.GetProperty((HandleRef)button.SwigCPtr, Button.Property.SelectedBackgroundVisual).Get(map); + Tizen.NUI.PropertyValue value = map.Find(Visual.Property.MixColor); + value?.Get(temp); + return temp; + })); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty LabelProperty = BindableProperty.Create(nameof(Label), typeof(PropertyMap), typeof(Button), new PropertyMap(), propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var button = (Button)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((HandleRef)button.SwigCPtr, Button.Property.LABEL, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var button = (Button)bindable; + Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap(); + Tizen.NUI.Object.GetProperty((HandleRef)button.SwigCPtr, Button.Property.LABEL).Get(temp); + return temp; + })); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty LabelTextProperty = BindableProperty.Create(nameof(LabelText), typeof(string), typeof(Button), string.Empty, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var button = (Button)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((HandleRef)button.SwigCPtr, Button.Property.LABEL, new Tizen.NUI.PropertyValue((string)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var button = (Button)bindable; + Tizen.NUI.PropertyMap map = new Tizen.NUI.PropertyMap(); + Tizen.NUI.Object.GetProperty((HandleRef)button.SwigCPtr, Button.Property.LABEL).Get(map); + Tizen.NUI.PropertyValue value = map.Find(TextVisualProperty.Text, "Text"); + string str = ""; + value?.Get(out str); + return str; + })); + + private EventHandlerWithReturnType _clickedEventHandler; + private ClickedCallbackType _clickedCallback; + private EventHandlerWithReturnType _pressedEventHandler; + private PressedCallbackType _pressedCallback; + private EventHandlerWithReturnType _releasedEventHandler; + private ReleasedCallbackType _releasedCallback; + private EventHandlerWithReturnType _stateChangedEventHandler; + private StateChangedCallback _stateChangedCallback; + + /// + /// Creates an uninitialized button.
+ /// Only the derived versions can be instantiated.
+ ///
+ /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public Button() : this(Interop.Button.NewButton(), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal Button(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn) + { + } + + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate bool ClickedCallbackType(global::System.IntPtr data); + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate bool PressedCallbackType(global::System.IntPtr data); + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate bool ReleasedCallbackType(global::System.IntPtr data); + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate bool StateChangedCallback(global::System.IntPtr data); + + /// + /// The Clicked event will be triggered when the button is touched and the touch point doesn't leave the boundary of the button. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1710: Rename EventHandlerWithReturnType to end in 'EventHandler'.")] + public event EventHandlerWithReturnType Clicked + { + add + { + if (_clickedEventHandler == null) + { + _clickedCallback = OnClicked; + ButtonSignal clickSignal = ClickedSignal(); + clickSignal?.Connect(_clickedCallback); + clickSignal?.Dispose(); + } + + _clickedEventHandler += value; + } + + remove + { + _clickedEventHandler -= value; + + ButtonSignal clickSignal = ClickedSignal(); + if (_clickedEventHandler == null && clickSignal.Empty() == false) + { + clickSignal?.Disconnect(_clickedCallback); + } + clickSignal?.Dispose(); + } + } + + /// + /// The Pressed event will be triggered when the button is touched. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1710: Rename EventHandlerWithReturnType to end in 'EventHandler'.")] + public event EventHandlerWithReturnType Pressed + { + add + { + if (_pressedEventHandler == null) + { + _pressedCallback = OnPressed; + ButtonSignal pressSignal = PressedSignal(); + pressSignal?.Connect(_pressedCallback); + pressSignal?.Dispose(); + } + + _pressedEventHandler += value; + } + + remove + { + _pressedEventHandler -= value; + + ButtonSignal pressSignal = this.PressedSignal(); + if (_pressedEventHandler == null && pressSignal.Empty() == false) + { + pressSignal?.Disconnect(_pressedCallback); + } + pressSignal?.Dispose(); + } + } + + /// + /// The Released event will be triggered when the button is touched and the touch point leaves the boundary of the button. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1710: Rename EventHandlerWithReturnType to end in 'EventHandler'.")] + public event EventHandlerWithReturnType Released + { + add + { + if (_releasedEventHandler == null) + { + _releasedCallback = OnReleased; + ButtonSignal releaseSignal = ReleasedSignal(); + releaseSignal?.Connect(_releasedCallback); + releaseSignal?.Dispose(); + } + _releasedEventHandler += value; + } + + remove + { + _releasedEventHandler -= value; + + ButtonSignal releaseSignal = ReleasedSignal(); + if (_releasedEventHandler == null && releaseSignal.Empty() == false) + { + releaseSignal?.Disconnect(_releasedCallback); + } + releaseSignal?.Dispose(); + + } + } + + /// + /// The StateChanged event will be triggered when the button's state is changed. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1710: Rename EventHandlerWithReturnType to end in 'EventHandler'.")] + public event EventHandlerWithReturnType StateChanged + { + add + { + if (_stateChangedEventHandler == null) + { + _stateChangedCallback = OnStateChanged; + ButtonSignal stateChanged = StateChangedSignal(); + stateChanged?.Connect(_stateChangedCallback); + stateChanged?.Dispose(); + } + + _stateChangedEventHandler += value; + } + + remove + { + _stateChangedEventHandler -= value; + + ButtonSignal stateChanged = StateChangedSignal(); + if (_stateChangedEventHandler == null && stateChanged.Empty() == false) + { + stateChanged?.Disconnect(_stateChangedCallback); + } + stateChanged?.Dispose(); + } + } + + /// + /// Enumeration for describing the position, the text label can be, in relation to the control (and foreground/icon). + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public enum Align + { + /// + /// At the start of the control before the foreground or icon. + /// + Begin, + /// + /// At the end of the control after the foreground or icon. + /// + End, + /// + /// At the top of the control above the foreground or icon. + /// + Top, + /// + /// At the bottom of the control below the foreground or icon. + /// + Bottom + } + + /// + /// Gets or sets the unselected button foreground or icon visual. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public Tizen.NUI.PropertyMap UnselectedVisual + { + get + { + return (PropertyMap)GetValue(UnselectedVisualProperty); + } + set + { + SetValue(UnselectedVisualProperty, value); + } + } + + /// + /// Gets or sets the selected button foreground or icon visual. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public Tizen.NUI.PropertyMap SelectedVisual + { + get + { + return (PropertyMap)GetValue(SelectedVisualProperty); + } + set + { + SetValue(SelectedVisualProperty, value); + } + } + + /// + /// Gets or sets the disabled selected state foreground or icon button visual. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public Tizen.NUI.PropertyMap DisabledSelectedVisual + { + get + { + return (PropertyMap)GetValue(DisabledSelectedVisualProperty); + } + set + { + SetValue(DisabledSelectedVisualProperty, value); + } + } + + /// + /// Gets or sets the disabled unselected state foreground or icon visual. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public Tizen.NUI.PropertyMap DisabledUnselectedVisual + { + get + { + return (PropertyMap)GetValue(DisabledUnselectedVisualProperty); + } + set + { + SetValue(DisabledUnselectedVisualProperty, value); + } + } + + /// + /// Gets or sets the disabled unselected state background button visual. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public Tizen.NUI.PropertyMap UnselectedBackgroundVisual + { + get + { + return (PropertyMap)GetValue(UnselectedBackgroundVisualProperty); + } + set + { + SetValue(UnselectedBackgroundVisualProperty, value); + } + } + + /// + /// Gets or sets the selected background button visual. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public Tizen.NUI.PropertyMap SelectedBackgroundVisual + { + get + { + return (PropertyMap)GetValue(SelectedBackgroundVisualProperty); + } + set + { + SetValue(SelectedBackgroundVisualProperty, value); + } + } + + /// + /// Gets or sets the disabled while unselected background button visual. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public Tizen.NUI.PropertyMap DisabledUnselectedBackgroundVisual + { + get + { + return (PropertyMap)GetValue(DisabledUnselectedBackgroundVisualProperty); + } + set + { + SetValue(DisabledUnselectedBackgroundVisualProperty, value); + } + } + + /// + /// Gets or sets the disabled while selected background button visual. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public Tizen.NUI.PropertyMap DisabledSelectedBackgroundVisual + { + get + { + return (PropertyMap)GetValue(DisabledSelectedBackgroundVisualProperty); + } + set + { + SetValue(DisabledSelectedBackgroundVisualProperty, value); + } + } + + /// + /// Gets or sets the position of the the label in relation to the foreground or icon, if both present. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public Align LabelRelativeAlignment + { + get + { + return (Align)GetValue(LabelRelativeAlignmentProperty); + } + set + { + SetValue(LabelRelativeAlignmentProperty, value); + } + } + + /// + /// Gets or sets the padding around the text. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public Vector4 LabelPadding + { + get + { + return (Vector4)GetValue(LabelPaddingProperty); + } + set + { + SetValue(LabelPaddingProperty, value); + } + } + + /// + /// Gets or sets the padding around the foreground visual. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public Vector4 ForegroundVisualPadding + { + get + { + return (Vector4)GetValue(ForegroundVisualPaddingProperty); + } + set + { + SetValue(ForegroundVisualPaddingProperty, value); + } + } + + /// + /// If the autorepeating property is set to true, then the togglable property is set to false. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool AutoRepeating + { + get + { + return (bool)GetValue(AutoRepeatingProperty); + } + set + { + SetValue(AutoRepeatingProperty, value); + } + } + + /// + /// By default, this value is set to 0.15 seconds. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public float InitialAutoRepeatingDelay + { + get + { + return (float)GetValue(InitialAutoRepeatingDelayProperty); + } + set + { + SetValue(InitialAutoRepeatingDelayProperty, value); + } + } + + /// + /// By default, this value is set to 0.05 seconds. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public float NextAutoRepeatingDelay + { + get + { + return (float)GetValue(NextAutoRepeatingDelayProperty); + } + set + { + SetValue(NextAutoRepeatingDelayProperty, value); + } + } + + /// + /// If the togglable property is set to true, then the autorepeating property is set to false. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool Togglable + { + get + { + return (bool)GetValue(TogglableProperty); + } + set + { + SetValue(TogglableProperty, value); + } + } + + /// + /// Gets or sets the togglable button as either selected or unselected, togglable property must be set to true. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool Selected + { + get + { + return (bool)GetValue(SelectedProperty); + } + set + { + SetValue(SelectedProperty, value); + } + } + + /// + /// Gets or sets the unselected color. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public Color UnselectedColor + { + get + { + return (Color)GetValue(UnselectedColorProperty); + } + set + { + SetValue(UnselectedColorProperty, value); + } + } + + /// + /// Gets or sets the selected color. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public Color SelectedColor + { + get + { + return (Color)GetValue(SelectedColorProperty); + } + set + { + SetValue(SelectedColorProperty, value); + } + } + + /// + /// Gets or sets the label. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public Tizen.NUI.PropertyMap Label + { + get + { + return (PropertyMap)GetValue(LabelProperty); + } + set + { + SetValue(LabelProperty, value); + } + } + + /// + /// Gets or sets the text of the label. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public string LabelText + { + get + { + return (string)GetValue(LabelTextProperty); + } + set + { + SetValue(LabelTextProperty, value); + } + } + + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Button obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.SwigCPtr; + } + + internal ButtonSignal PressedSignal() + { + ButtonSignal ret = new ButtonSignal(Interop.Button.PressedSignal(SwigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal ButtonSignal ReleasedSignal() + { + ButtonSignal ret = new ButtonSignal(Interop.Button.ReleasedSignal(SwigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal ButtonSignal ClickedSignal() + { + ButtonSignal ret = new ButtonSignal(Interop.Button.ClickedSignal(SwigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal ButtonSignal StateChangedSignal() + { + ButtonSignal ret = new ButtonSignal(Interop.Button.StateChangedSignal(SwigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// To dispose the button instance. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + protected override void Dispose(DisposeTypes type) + { + if (disposed) + { + return; + } + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + if (this != null) + { + DisConnectFromSignals(); + } + + base.Dispose(type); + } + + /// This will not be public opened. + [EditorBrowsable(EditorBrowsableState.Never)] + protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr) + { + Interop.Button.DeleteButton(swigCPtr); + } + + private void DisConnectFromSignals() + { + // Save current CPtr. + global::System.Runtime.InteropServices.HandleRef currentCPtr = SwigCPtr; + + // Use BaseHandle CPtr as current might have been deleted already in derived classes. + SwigCPtr = GetBaseHandleCPtrHandleRef; + + if (_stateChangedCallback != null) + { + ButtonSignal stateChanged = StateChangedSignal(); + stateChanged?.Disconnect(_stateChangedCallback); + stateChanged?.Dispose(); + } + + if (_releasedCallback != null) + { + ButtonSignal released = ReleasedSignal(); + released?.Disconnect(_releasedCallback); + released?.Dispose(); + } + + if (_pressedCallback != null) + { + ButtonSignal pressSignal = PressedSignal(); + pressSignal?.Disconnect(_pressedCallback); + pressSignal?.Dispose(); + } + + if (_clickedCallback != null) + { + ButtonSignal clickSignal = ClickedSignal(); + clickSignal?.Disconnect(_clickedCallback); + clickSignal?.Dispose(); + } + + // BaseHandle CPtr is used in Registry and there is danger of deletion if we keep using it here. + // Restore current CPtr. + SwigCPtr = currentCPtr; + } + + private bool OnClicked(IntPtr data) + { + if (_clickedEventHandler != null) + { + return _clickedEventHandler(this, null); + } + return false; + } + + private bool OnPressed(IntPtr data) + { + if (_pressedEventHandler != null) + { + return _pressedEventHandler(this, null); + } + return false; + } + + private bool OnReleased(IntPtr data) + { + if (_releasedEventHandler != null) + { + return _releasedEventHandler(this, null); + } + return false; + } + + private bool OnStateChanged(IntPtr data) + { + if (_stateChangedEventHandler != null) + { + return _stateChangedEventHandler(this, null); + } + return false; + } + + internal new class Property + { + internal static readonly int UnselectedVisual = Interop.Button.UnselectedVisualGet(); + internal static readonly int SelectedVisual = Interop.Button.SelectedVisualGet(); + internal static readonly int DisabledSelectedVisual = Interop.Button.DisabledSelectedVisualGet(); + internal static readonly int DisabledUnselectedVisual = Interop.Button.DisabledUnselectedVisualGet(); + internal static readonly int UnselectedBackgroundVisual = Interop.Button.UnselectedBackgroundVisualGet(); + internal static readonly int SelectedBackgroundVisual = Interop.Button.SelectedBackgroundVisualGet(); + internal static readonly int DisabledUnselectedBackgroundVisual = Interop.Button.DisabledUnselectedBackgroundVisualGet(); + internal static readonly int DisabledSelectedBackgroundVisual = Interop.Button.DisabledSelectedBackgroundVisualGet(); + internal static readonly int LabelRelativeAlignment = Interop.Button.LabelRelativeAlignmentGet(); + internal static readonly int LabelPadding = Interop.Button.LabelPaddingGet(); + internal static readonly int ForegroundVisualPadding = Interop.Button.VisualPaddingGet(); + internal static readonly int AutoRepeating = Interop.Button.AutoRepeatingGet(); + internal static readonly int InitialAutoRepeatingDelay = Interop.Button.InitialAutoRepeatingDelayGet(); + internal static readonly int NextAutoRepeatingDelay = Interop.Button.NextAutoRepeatingDelayGet(); + internal static readonly int TOGGLABLE = Interop.Button.TogglableGet(); + internal static readonly int SELECTED = Interop.Button.SelectedGet(); + internal static readonly int LABEL = Interop.Button.LabelGet(); + } + } +} diff --git a/src/Tizen.NUI/src/public/UIComponents/CheckBoxButton.cs b/src/Tizen.NUI/src/public/UIComponents/CheckBoxButton.cs new file mode 100755 index 0000000..3cbe292 --- /dev/null +++ b/src/Tizen.NUI/src/public/UIComponents/CheckBoxButton.cs @@ -0,0 +1,62 @@ +/* + * Copyright(c) 2017 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +using System; +using System.ComponentModel; + +namespace Tizen.NUI.UIComponents +{ + /// + /// The CheckBoxButton provides a checkbox button which the user can check or uncheck.
+ /// By default, the CheckBoxButton emits a Button.Clicked event when the button changes its state to selected or unselected.
+ /// The button's appearance could be modified by Button.UnselectedImage, Button.BackgroundImage, Button.SelectedImage, Button.SelectedBackgroundImage, Button.DisabledBackgroundImage, Button.DisabledImage, and Button.DisabledSelectedImage.
+ /// When the button is not disabled, if it's not selected, it only shows the background image.
+ /// The selected image is shown over the background image when the box is selected (background image is not replaced by \e selected image).
+ /// When the button is disabled, the background image and the selected image are replaced by disabled images.
+ /// ///
+ /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public class CheckBoxButton : Button + { + + /// + /// Creates an initialized CheckBoxButton. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public CheckBoxButton() : this(Interop.CheckBoxButton.New(), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal CheckBoxButton(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn) + { + } + + + /// This will not be public opened. + [EditorBrowsable(EditorBrowsableState.Never)] + protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr) + { + Interop.CheckBoxButton.DeleteCheckBoxButton(swigCPtr); + } + } +} diff --git a/src/Tizen.NUI/src/public/UIComponents/Popup.cs b/src/Tizen.NUI/src/public/UIComponents/Popup.cs new file mode 100755 index 0000000..87a2e25 --- /dev/null +++ b/src/Tizen.NUI/src/public/UIComponents/Popup.cs @@ -0,0 +1,1120 @@ +/* + * Copyright(c) 2019 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +using System; +using System.ComponentModel; +using System.Runtime.InteropServices; +using Tizen.NUI.BaseComponents; +using Tizen.NUI.Binding; + +namespace Tizen.NUI.UIComponents +{ + /// + /// The Popup widget provides a configurable popup dialog with a built-in layout of three main fields. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public partial class Popup : View + { + private EventHandler _popUpOutsideTouchedEventHandler; + private OutsideTouchedEventCallbackDelegate _popUpOutsideTouchedEventCallbackDelegate; + private EventHandler _popUpShowingEventHandler; + private ShowingEventCallbackDelegate _popUpShowingEventCallbackDelegate; + private EventHandler _popUpShownEventHandler; + private ShownEventCallbackDelegate _popUpShownEventCallbackDelegate; + private EventHandler _popUpHidingEventHandler; + private HidingEventCallbackDelegate _popUpHidingEventCallbackDelegate; + private EventHandler _popUpHiddenEventHandler; + private HiddenEventCallbackDelegate _popUpHiddenEventCallbackDelegate; + + /// + /// Creates the popup. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public Popup() : this(Interop.Popup.New(), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal Popup(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn) + { + } + + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate void OutsideTouchedEventCallbackDelegate(); + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate void ShowingEventCallbackDelegate(); + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate void ShownEventCallbackDelegate(); + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate void HidingEventCallbackDelegate(); + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate void HiddenEventCallbackDelegate(); + + /// + /// An event is sent when the user has touched outside the dialog. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public event EventHandler TouchedOutside + { + add + { + if (_popUpOutsideTouchedEventHandler == null) + { + _popUpOutsideTouchedEventCallbackDelegate = (OnOutsideTouched); + VoidSignal outsideTouchedSignal = OutsideTouchedSignal(); + outsideTouchedSignal?.Connect(_popUpOutsideTouchedEventCallbackDelegate); + outsideTouchedSignal?.Dispose(); + } + _popUpOutsideTouchedEventHandler += value; + } + remove + { + _popUpOutsideTouchedEventHandler -= value; + VoidSignal outsideTouchedSignal = OutsideTouchedSignal(); + if (_popUpOutsideTouchedEventHandler == null && outsideTouchedSignal.Empty() == false) + { + outsideTouchedSignal?.Disconnect(_popUpOutsideTouchedEventCallbackDelegate); + } + outsideTouchedSignal?.Dispose(); + } + } + + /// + /// An event is sent when the popup starts showing. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public event EventHandler Showing + { + add + { + if (_popUpShowingEventHandler == null) + { + _popUpShowingEventCallbackDelegate = (OnShowing); + VoidSignal showingSignal = ShowingSignal(); + showingSignal?.Connect(_popUpShowingEventCallbackDelegate); + showingSignal?.Dispose(); + } + _popUpShowingEventHandler += value; + } + remove + { + _popUpShowingEventHandler -= value; + VoidSignal showingSignal = ShowingSignal(); + if (_popUpShowingEventHandler == null && showingSignal.Empty() == false) + { + showingSignal?.Disconnect(_popUpShowingEventCallbackDelegate); + } + showingSignal?.Dispose(); + } + } + + /// + /// An event is sent when the popup has been fully displayed. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public event EventHandler Shown + { + add + { + if (_popUpShownEventHandler == null) + { + _popUpShownEventCallbackDelegate = (OnShown); + VoidSignal shownSignal = ShownSignal(); + shownSignal?.Connect(_popUpShownEventCallbackDelegate); + shownSignal?.Dispose(); + } + _popUpShownEventHandler += value; + } + remove + { + _popUpShownEventHandler -= value; + VoidSignal shownSignal = ShownSignal(); + if (_popUpShownEventHandler == null && shownSignal.Empty() == false) + { + shownSignal?.Disconnect(_popUpShownEventCallbackDelegate); + } + shownSignal?.Dispose(); + } + } + + /// + /// An event is sent when the popup starts to hide. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public event EventHandler Hiding + { + add + { + if (_popUpHidingEventHandler == null) + { + _popUpHidingEventCallbackDelegate = (OnHiding); + VoidSignal hidingSignal = HidingSignal(); + hidingSignal?.Connect(_popUpHidingEventCallbackDelegate); + hidingSignal?.Dispose(); + } + _popUpHidingEventHandler += value; + } + remove + { + _popUpHidingEventHandler -= value; + VoidSignal hidingSignal = HidingSignal(); + if (_popUpHidingEventHandler == null && hidingSignal.Empty() == false) + { + hidingSignal?.Disconnect(_popUpHidingEventCallbackDelegate); + } + hidingSignal?.Dispose(); + } + } + + /// + /// An event is sent when the popup has been completely hidden. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public event EventHandler Hidden + { + add + { + if (_popUpHiddenEventHandler == null) + { + _popUpHiddenEventCallbackDelegate = (OnHidden); + VoidSignal hiddenSignal = HiddenSignal(); + hiddenSignal?.Connect(_popUpHiddenEventCallbackDelegate); + hiddenSignal?.Dispose(); + } + _popUpHiddenEventHandler += value; + } + remove + { + _popUpHiddenEventHandler -= value; + VoidSignal hiddenSignal = HiddenSignal(); + if (_popUpHiddenEventHandler == null && hiddenSignal.Empty() == false) + { + hiddenSignal?.Disconnect(_popUpHiddenEventCallbackDelegate); + } + hiddenSignal?.Dispose(); + } + } + + /// + /// The display states of the popup. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public enum DisplayStateType + { + /// + /// The popup is transitioning in + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + Showing, + /// + /// The popup is fully shown + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + Shown, + /// + /// The popup is transitioning out + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + Hiding, + /// + /// The popup is fully hidden + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + Hidden + } + + /// + /// The animation modes within the popup.
+ /// Choose from a predefined mode or "CUSTOM" to use the ANIMATION_IN and ANIMATION_OUT properties.
+ ///
+ /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public enum AnimationModeType + { + /// + /// No animation. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + None, + /// + /// Popup zooms in and out animating the scale property. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + Zoom, + /// + /// Popup fades in and out + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + Fade, + /// + /// Use the EntryAnimation and ExitAnimation animation properties. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + Custom + } + + /// + /// The types of the contextual layout.
+ /// The popup is positioned adjacent to it's parent in the direction specified by this mode.
+ /// NON_CONTEXTUAL disables any contextual positioning.
+ ///
+ /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public enum ContextualModeType + { + /// + /// any contextual positioning + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + NonContextual, + /// + /// Above + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + Above, + /// + /// Rright + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + Rright, + /// + /// Below + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + Below, + /// + /// Left + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + Left + } + + /// + /// The popup title. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public PropertyMap Title + { + get + { + return (PropertyMap)GetValue(TitleProperty); + } + set + { + SetValue(TitleProperty, value); + } + } + + /// + /// The popup content. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public PropertyMap Content + { + get + { + return (PropertyMap)GetValue(ContentProperty); + } + set + { + SetValue(ContentProperty, value); + } + } + + /// + /// The popup footer. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public PropertyMap Footer + { + get + { + return (PropertyMap)GetValue(FooterProperty); + } + set + { + SetValue(FooterProperty, value); + } + } + + /// + /// The popup display state. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public DisplayStateType DisplayState + { + get + { + return (DisplayStateType)GetValue(DisplayStateProperty); + } + set + { + SetValue(DisplayStateProperty, value); + } + } + + /// + /// The touch transparent. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool TouchTransparent + { + get + { + return (bool)GetValue(TouchTransparentProperty); + } + set + { + SetValue(TouchTransparentProperty, value); + } + } + + /// + /// The popup tail visibility. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool TailVisibility + { + get + { + return (bool)GetValue(TailVisibilityProperty); + } + set + { + SetValue(TailVisibilityProperty, value); + } + } + + /// + /// The popup tail position. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public Vector3 TailPosition + { + get + { + return (Vector3)GetValue(TailPositionProperty); + } + set + { + SetValue(TailPositionProperty, value); + } + } + + /// + /// The contextual mode. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public ContextualModeType ContextualMode + { + get + { + return (ContextualModeType)GetValue(ContextualModeProperty); + } + set + { + SetValue(ContextualModeProperty, value); + } + } + + /// + /// The animation duration. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public float AnimationDuration + { + get + { + return (float)GetValue(AnimationDurationProperty); + } + set + { + SetValue(AnimationDurationProperty, value); + } + } + + /// + /// The animation mode. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public AnimationModeType AnimationMode + { + get + { + return (AnimationModeType)GetValue(AnimationModeProperty); + } + set + { + SetValue(AnimationModeProperty, value); + } + } + + /// + /// The entry animation. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public PropertyMap EntryAnimation + { + get + { + return (PropertyMap)GetValue(EntryAnimationProperty); + } + set + { + SetValue(EntryAnimationProperty, value); + } + } + + /// + /// The exit animation. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public PropertyMap ExitAnimation + { + get + { + return (PropertyMap)GetValue(ExitAnimationProperty); + } + set + { + SetValue(ExitAnimationProperty, value); + } + } + + /// + /// The auto hide delay. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public int AutoHideDelay + { + get + { + return (int)GetValue(AutoHideDelayProperty); + } + set + { + SetValue(AutoHideDelayProperty, value); + } + } + + /// + /// The backing enabled. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool BackingEnabled + { + get + { + return (bool)GetValue(BackingEnabledProperty); + } + set + { + SetValue(BackingEnabledProperty, value); + } + } + + /// + /// The backing color. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public Vector4 BackingColor + { + get + { + return (Vector4)GetValue(BackingColorProperty); + } + set + { + SetValue(BackingColorProperty, value); + } + } + + /// + /// The background image. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public string PopupBackgroundImage + { + get + { + return (string)GetValue(PopupBackgroundImageProperty); + } + set + { + SetValue(PopupBackgroundImageProperty, value); + } + } + + /// + /// The background border. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public Rectangle PopupBackgroundBorder + { + get + { + return (Rectangle)GetValue(PopupBackgroundBorderProperty); + } + set + { + SetValue(PopupBackgroundBorderProperty, value); + } + } + + /// + /// The tail up image. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public string TailUpImage + { + get + { + return (string)GetValue(TailUpImageProperty); + } + set + { + SetValue(TailUpImageProperty, value); + } + } + + /// + /// The tail down image. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public string TailDownImage + { + get + { + return (string)GetValue(TailDownImageProperty); + } + set + { + SetValue(TailDownImageProperty, value); + } + } + + /// + /// The tail left image. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public string TailLeftImage + { + get + { + return (string)GetValue(TailLeftImageProperty); + } + set + { + SetValue(TailLeftImageProperty, value); + } + } + + /// + /// The tail right image. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public string TailRightImage + { + get + { + return (string)GetValue(TailRightImageProperty); + } + set + { + SetValue(TailRightImageProperty, value); + } + } + + /// + /// Sets the title for this popup. + /// + /// The actor to set the title. + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public void SetTitle(View titleView) + { + Interop.Popup.SetTitle(SwigCPtr, View.getCPtr(titleView)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Sets the content actor. + /// + /// The actor to use. + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public void SetContent(View content) + { + Interop.Popup.SetContent(SwigCPtr, View.getCPtr(content)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Sets the actor to use for the footer in this popup. + /// + /// The footer actor to be added to this popup. + /// 3 + /// This will be deprecated + [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + public void SetFooter(View footer) + { + Interop.Popup.SetFooter(SwigCPtr, View.getCPtr(footer)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Sets the display state of popup.
+ /// There are 4 total display states.
+ /// Only 2 can be set, but all four can be read for better inspection of the current popup state.
+ ///
+ /// The other two states are getable, but not setable, and are there for consistency.
+ ///
+ /// | Value | Setting the state | Getting the state |
+ /// |----------|--------------------------------|--------------------------------|
+ /// | SHOWN | Show the popup | The popup is fully shown |
+ /// | HIDDEN | Hide the popup | The popup is fully hidden |
+ /// | SHOWING | | The popup is transitioning in |
+ /// | HIDING | | The popup is transitioning out |
+ ///
+ /// All 4 states changes cause notifications via 4 respective signals that can be connected to.
+ ///
+ /// The desired display state to change to. + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public void SetDisplayState(Popup.DisplayStateType displayState) + { + Interop.Popup.SetDisplayState(SwigCPtr, (int)displayState); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal View GetTitle() + { + //to fix memory leak issue, match the handle count with native side. + IntPtr cPtr = Interop.Popup.GetTitle(SwigCPtr); + View ret = this.GetInstanceSafely(cPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal View GetContent() + { + //to fix memory leak issue, match the handle count with native side. + IntPtr cPtr = Interop.Popup.GetContent(SwigCPtr); + View ret = this.GetInstanceSafely(cPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal View GetFooter() + { + //to fix memory leak issue, match the handle count with native side. + IntPtr cPtr = Interop.Popup.GetFooter(SwigCPtr); + View ret = this.GetInstanceSafely(cPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal Popup.DisplayStateType GetDisplayState() + { + Popup.DisplayStateType ret = (Popup.DisplayStateType)Interop.Popup.GetDisplayState(SwigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal VoidSignal OutsideTouchedSignal() + { + VoidSignal ret = new VoidSignal(Interop.Popup.OutsideTouchedSignal(SwigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal VoidSignal ShowingSignal() + { + VoidSignal ret = new VoidSignal(Interop.Popup.ShowingSignal(SwigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal VoidSignal ShownSignal() + { + VoidSignal ret = new VoidSignal(Interop.Popup.ShownSignal(SwigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal VoidSignal HidingSignal() + { + VoidSignal ret = new VoidSignal(Interop.Popup.HidingSignal(SwigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal VoidSignal HiddenSignal() + { + VoidSignal ret = new VoidSignal(Interop.Popup.HiddenSignal(SwigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Dispose. + /// + /// The dispose type + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + protected override void Dispose(DisposeTypes type) + { + if (disposed) + { + return; + } + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + if (this != null) + { + if (_popUpHiddenEventCallbackDelegate != null) + { + VoidSignal hiddenSignal = HiddenSignal(); + hiddenSignal?.Disconnect(_popUpHiddenEventCallbackDelegate); + hiddenSignal?.Dispose(); + } + + if (_popUpHidingEventCallbackDelegate != null) + { + VoidSignal hidingSignal = HidingSignal(); + hidingSignal?.Disconnect(_popUpHidingEventCallbackDelegate); + hidingSignal?.Dispose(); + } + } + + if (_popUpShownEventCallbackDelegate != null) + { + VoidSignal shownSignal = ShownSignal(); + shownSignal?.Disconnect(_popUpShownEventCallbackDelegate); + shownSignal?.Dispose(); + } + + if (_popUpShowingEventCallbackDelegate != null) + { + VoidSignal showingSignal = ShowingSignal(); + showingSignal?.Disconnect(_popUpShowingEventCallbackDelegate); + showingSignal?.Dispose(); + } + + if (_popUpOutsideTouchedEventCallbackDelegate != null) + { + VoidSignal outsideTouchedSingal = this.OutsideTouchedSignal(); + outsideTouchedSingal?.Disconnect(_popUpOutsideTouchedEventCallbackDelegate); + outsideTouchedSingal?.Dispose(); + } + + base.Dispose(type); + } + + /// This will not be public opened. + [EditorBrowsable(EditorBrowsableState.Never)] + protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr) + { + Interop.Popup.DeletePopup(swigCPtr); + } + + // Callback for Popup OutsideTouchedSignal + private void OnOutsideTouched() + { + TouchedOutsideEventArgs e = new TouchedOutsideEventArgs(); + + if (_popUpOutsideTouchedEventHandler != null) + { + //here we send all data to user event handlers + _popUpOutsideTouchedEventHandler(this, e); + } + } + + // Callback for ShowingSignal + private void OnShowing() + { + ShowingEventArgs e = new ShowingEventArgs(); + + if (_popUpShowingEventHandler != null) + { + //here we send all data to user event handlers + _popUpShowingEventHandler(this, e); + } + } + + // Callback for ShownSignal + private void OnShown() + { + ShownEventArgs e = new ShownEventArgs(); + + if (_popUpShownEventHandler != null) + { + //here we send all data to user event handlers + _popUpShownEventHandler(this, e); + } + } + + // Callback for HidingSignal + private void OnHiding() + { + HidingEventArgs e = new HidingEventArgs(); + + if (_popUpHidingEventHandler != null) + { + //here we send all data to user event handlers + _popUpHidingEventHandler(this, e); + } + } + + // Callback for HiddenSignal + private void OnHidden() + { + HiddenEventArgs e = new HiddenEventArgs(); + + if (_popUpHiddenEventHandler != null) + { + //here we send all data to user event handlers + _popUpHiddenEventHandler(this, e); + } + } + + /// + /// Event arguments that passed via the OutsideTouchedEvent. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")] + public class TouchedOutsideEventArgs : EventArgs + { + } + + /// + /// Event arguments that passed via the ShowingEventArgs. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")] + public class ShowingEventArgs : EventArgs + { + } + + /// + /// Event arguments that passed via the ShownEventArgs. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")] + public class ShownEventArgs : EventArgs + { + } + + /// + /// Event arguments that passed via the HidingEventArgs. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")] + public class HidingEventArgs : EventArgs + { + } + + /// + /// Event arguments that passed via the HiddenEventArgs. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")] + public class HiddenEventArgs : EventArgs + { + } + + internal new class Property + { + internal static readonly int TITLE = Interop.Popup.TitleGet(); + internal static readonly int CONTENT = Interop.Popup.ContentGet(); + internal static readonly int FOOTER = Interop.Popup.FooterGet(); + internal static readonly int DisplayState = Interop.Popup.DisplayStateGet(); + internal static readonly int TouchTransparent = Interop.Popup.TouchTransparentGet(); + internal static readonly int TailVisibility = Interop.Popup.TailVisibilityGet(); + internal static readonly int TailPosition = Interop.Popup.TailPositionGet(); + internal static readonly int ContextualMode = Interop.Popup.ContextualModeGet(); + internal static readonly int AnimationDuration = Interop.Popup.AnimationDurationGet(); + internal static readonly int AnimationMode = Interop.Popup.AnimationModeGet(); + internal static readonly int EntryAnimation = Interop.Popup.EntryAnimationGet(); + internal static readonly int ExitAnimation = Interop.Popup.ExitAnimationGet(); + internal static readonly int AutoHideDelay = Interop.Popup.AutoHideDelayGet(); + internal static readonly int BackingEnabled = Interop.Popup.BackingEnabledGet(); + internal static readonly int BackingColor = Interop.Popup.BackingColorGet(); + internal static readonly int PopupBackgroundImage = Interop.Popup.PopupBackgroundImageGet(); + internal static readonly int PopupBackgroundBorder = Interop.Popup.PopupBackgroundBorderGet(); + internal static readonly int TailUpImage = Interop.Popup.TailUpImageGet(); + internal static readonly int TailDownImage = Interop.Popup.TailDownImageGet(); + internal static readonly int TailLeftImage = Interop.Popup.TailLeftImageGet(); + internal static readonly int TailRightImage = Interop.Popup.TailRightImageGet(); + } + } +} diff --git a/src/Tizen.NUI/src/public/UIComponents/PopupBindableProperty.cs b/src/Tizen.NUI/src/public/UIComponents/PopupBindableProperty.cs new file mode 100755 index 0000000..4c98421 --- /dev/null +++ b/src/Tizen.NUI/src/public/UIComponents/PopupBindableProperty.cs @@ -0,0 +1,528 @@ +using System; +using System.ComponentModel; +using Tizen.NUI.Binding; + +namespace Tizen.NUI.UIComponents +{ + public partial class Popup + { + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty TitleProperty = BindableProperty.Create(nameof(Title), typeof(PropertyMap), typeof(Popup), new PropertyMap(), propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var popup = (Popup)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)popup.SwigCPtr, Popup.Property.TITLE, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var popup = (Popup)bindable; + PropertyMap temp = new PropertyMap(); + Tizen.NUI.Object.GetProperty((System.Runtime.InteropServices.HandleRef)popup.SwigCPtr, Popup.Property.TITLE).Get(temp); + return temp; + })); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty ContentProperty = BindableProperty.Create(nameof(Content), typeof(PropertyMap), typeof(Popup), new PropertyMap(), propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var popup = (Popup)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)popup.SwigCPtr, Popup.Property.CONTENT, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var popup = (Popup)bindable; + PropertyMap temp = new PropertyMap(); + Tizen.NUI.Object.GetProperty((System.Runtime.InteropServices.HandleRef)popup.SwigCPtr, Popup.Property.CONTENT).Get(temp); + return temp; + })); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty FooterProperty = BindableProperty.Create(nameof(Footer), typeof(PropertyMap), typeof(Popup), new PropertyMap(), propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var popup = (Popup)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)popup.SwigCPtr, Popup.Property.FOOTER, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var popup = (Popup)bindable; + PropertyMap temp = new PropertyMap(); + Tizen.NUI.Object.GetProperty((System.Runtime.InteropServices.HandleRef)popup.SwigCPtr, Popup.Property.FOOTER).Get(temp); + return temp; + })); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty DisplayStateProperty = BindableProperty.Create(nameof(DisplayState), typeof(DisplayStateType), typeof(Popup), DisplayStateType.Hidden, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var popup = (Popup)bindable; + string valueToString = ""; + if (newValue != null) + { + switch ((DisplayStateType)newValue) + { + case DisplayStateType.Showing: + { + valueToString = "SHOWING"; + break; + } + case DisplayStateType.Shown: + { + valueToString = "SHOWN"; + break; + } + case DisplayStateType.Hiding: + { + valueToString = "HIDING"; + break; + } + case DisplayStateType.Hidden: + { + valueToString = "HIDDEN"; + break; + } + default: + { + valueToString = "HIDDEN"; + break; + } + } + Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)popup.SwigCPtr, Popup.Property.DisplayState, new Tizen.NUI.PropertyValue(valueToString)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var popup = (Popup)bindable; + string temp; + if (Tizen.NUI.Object.GetProperty((System.Runtime.InteropServices.HandleRef)popup.SwigCPtr, Popup.Property.DisplayState).Get(out temp) == false) + { + NUILog.Error("DisplayState get error!"); + } + switch (temp) + { + case "SHOWING": + return DisplayStateType.Showing; + case "SHOWN": + return DisplayStateType.Shown; + case "HIDING": + return DisplayStateType.Hiding; + case "HIDDEN": + return DisplayStateType.Hidden; + default: + return DisplayStateType.Hidden; + } + })); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty TouchTransparentProperty = BindableProperty.Create(nameof(TouchTransparent), typeof(bool), typeof(Popup), false, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var popup = (Popup)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)popup.SwigCPtr, Popup.Property.TouchTransparent, new Tizen.NUI.PropertyValue((bool)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var popup = (Popup)bindable; + bool temp = false; + Tizen.NUI.Object.GetProperty((System.Runtime.InteropServices.HandleRef)popup.SwigCPtr, Popup.Property.TouchTransparent).Get(out temp); + return temp; + })); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty TailVisibilityProperty = BindableProperty.Create(nameof(TailVisibility), typeof(bool), typeof(Popup), false, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var popup = (Popup)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)popup.SwigCPtr, Popup.Property.TailVisibility, new Tizen.NUI.PropertyValue((bool)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var popup = (Popup)bindable; + bool temp = false; + Tizen.NUI.Object.GetProperty((System.Runtime.InteropServices.HandleRef)popup.SwigCPtr, Popup.Property.TailVisibility).Get(out temp); + return temp; + })); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty TailPositionProperty = BindableProperty.Create(nameof(TailPosition), typeof(Vector3), typeof(Popup), Vector3.Zero, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var popup = (Popup)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)popup.SwigCPtr, Popup.Property.TailPosition, new Tizen.NUI.PropertyValue((Vector3)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var popup = (Popup)bindable; + Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f); + Tizen.NUI.Object.GetProperty((System.Runtime.InteropServices.HandleRef)popup.SwigCPtr, Popup.Property.TailPosition).Get(temp); + return temp; + })); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty ContextualModeProperty = BindableProperty.Create(nameof(ContextualMode), typeof(ContextualModeType), typeof(Popup), ContextualModeType.Below, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var popup = (Popup)bindable; + string valueToString = ""; + if (newValue != null) + { + switch ((ContextualModeType)newValue) + { + case ContextualModeType.NonContextual: + { + valueToString = "NON_CONTEXTUAL"; + break; + } + case ContextualModeType.Above: + { + valueToString = "ABOVE"; + break; + } + case ContextualModeType.Rright: + { + valueToString = "RIGHT"; + break; + } + case ContextualModeType.Below: + { + valueToString = "BELOW"; + break; + } + case ContextualModeType.Left: + { + valueToString = "LEFT"; + break; + } + default: + { + valueToString = "BELOW"; + break; + } + } + Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)popup.SwigCPtr, Popup.Property.ContextualMode, new Tizen.NUI.PropertyValue(valueToString)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var popup = (Popup)bindable; + string temp; + if (Tizen.NUI.Object.GetProperty((System.Runtime.InteropServices.HandleRef)popup.SwigCPtr, Popup.Property.ContextualMode).Get(out temp) == false) + { + NUILog.Error("ContextualMode get error!"); + } + switch (temp) + { + case "NON_CONTEXTUAL": + return ContextualModeType.NonContextual; + case "ABOVE": + return ContextualModeType.Above; + case "RIGHT": + return ContextualModeType.Rright; + case "BELOW": + return ContextualModeType.Below; + case "LEFT": + return ContextualModeType.Left; + default: + return ContextualModeType.Below; + } + })); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty AnimationDurationProperty = BindableProperty.Create(nameof(AnimationDuration), typeof(float), typeof(Popup), default(float), propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var popup = (Popup)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)popup.SwigCPtr, Popup.Property.AnimationDuration, new Tizen.NUI.PropertyValue((float)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var popup = (Popup)bindable; + float temp = 0.0f; + Tizen.NUI.Object.GetProperty((System.Runtime.InteropServices.HandleRef)popup.SwigCPtr, Popup.Property.AnimationDuration).Get(out temp); + return temp; + })); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty AnimationModeProperty = BindableProperty.Create(nameof(AnimationMode), typeof(AnimationModeType), typeof(Popup), AnimationModeType.Fade, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var popup = (Popup)bindable; + string valueToString = ""; + if (newValue != null) + { + switch ((AnimationModeType)newValue) + { + case AnimationModeType.None: + { + valueToString = "NONE"; + break; + } + case AnimationModeType.Zoom: + { + valueToString = "ZOOM"; + break; + } + case AnimationModeType.Fade: + { + valueToString = "FADE"; + break; + } + case AnimationModeType.Custom: + { + valueToString = "CUSTOM"; + break; + } + default: + { + valueToString = "FADE"; + break; + } + } + Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)popup.SwigCPtr, Popup.Property.AnimationMode, new Tizen.NUI.PropertyValue(valueToString)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var popup = (Popup)bindable; + string temp; + if (Tizen.NUI.Object.GetProperty((System.Runtime.InteropServices.HandleRef)popup.SwigCPtr, Popup.Property.AnimationMode).Get(out temp) == false) + { + NUILog.Error("AnimationMode get error!"); + } + switch (temp) + { + case "NONE": + return AnimationModeType.None; + case "ZOOM": + return AnimationModeType.Zoom; + case "FADE": + return AnimationModeType.Fade; + case "CUSTOM": + return AnimationModeType.Custom; + default: + return AnimationModeType.Fade; + } + })); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty EntryAnimationProperty = BindableProperty.Create(nameof(EntryAnimation), typeof(PropertyMap), typeof(Popup), new PropertyMap(), propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var popup = (Popup)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)popup.SwigCPtr, Popup.Property.EntryAnimation, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var popup = (Popup)bindable; + PropertyMap temp = new PropertyMap(); + Tizen.NUI.Object.GetProperty((System.Runtime.InteropServices.HandleRef)popup.SwigCPtr, Popup.Property.EntryAnimation).Get(temp); + return temp; + })); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty ExitAnimationProperty = BindableProperty.Create(nameof(ExitAnimation), typeof(PropertyMap), typeof(Popup), new PropertyMap(), propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var popup = (Popup)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)popup.SwigCPtr, Popup.Property.ExitAnimation, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var popup = (Popup)bindable; + PropertyMap temp = new PropertyMap(); + Tizen.NUI.Object.GetProperty((System.Runtime.InteropServices.HandleRef)popup.SwigCPtr, Popup.Property.ExitAnimation).Get(temp); + return temp; + })); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty AutoHideDelayProperty = BindableProperty.Create(nameof(AutoHideDelay), typeof(int), typeof(Popup), default(int), propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var popup = (Popup)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)popup.SwigCPtr, Popup.Property.AutoHideDelay, new Tizen.NUI.PropertyValue((int)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var popup = (Popup)bindable; + int temp = 0; + Tizen.NUI.Object.GetProperty((System.Runtime.InteropServices.HandleRef)popup.SwigCPtr, Popup.Property.AutoHideDelay).Get(out temp); + return temp; + })); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty BackingEnabledProperty = BindableProperty.Create(nameof(BackingEnabled), typeof(bool), typeof(Popup), false, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var popup = (Popup)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)popup.SwigCPtr, Popup.Property.BackingEnabled, new Tizen.NUI.PropertyValue((bool)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var popup = (Popup)bindable; + bool temp = false; + Tizen.NUI.Object.GetProperty((System.Runtime.InteropServices.HandleRef)popup.SwigCPtr, Popup.Property.BackingEnabled).Get(out temp); + return temp; + })); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty BackingColorProperty = BindableProperty.Create(nameof(BackingColor), typeof(Vector4), typeof(Popup), Vector4.Zero, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var popup = (Popup)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)popup.SwigCPtr, Popup.Property.BackingColor, new Tizen.NUI.PropertyValue((Vector4)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var popup = (Popup)bindable; + Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f); + Tizen.NUI.Object.GetProperty((System.Runtime.InteropServices.HandleRef)popup.SwigCPtr, Popup.Property.BackingColor).Get(temp); + return temp; + })); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty PopupBackgroundImageProperty = BindableProperty.Create(nameof(PopupBackgroundImage), typeof(string), typeof(Popup), string.Empty, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var popup = (Popup)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)popup.SwigCPtr, Popup.Property.PopupBackgroundImage, new Tizen.NUI.PropertyValue((string)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var popup = (Popup)bindable; + string temp; + Tizen.NUI.Object.GetProperty((System.Runtime.InteropServices.HandleRef)popup.SwigCPtr, Popup.Property.PopupBackgroundImage).Get(out temp); + return temp; + })); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty PopupBackgroundBorderProperty = BindableProperty.Create(nameof(PopupBackgroundBorder), typeof(Rectangle), typeof(Popup), new Rectangle(0, 0, 0, 0), propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var popup = (Popup)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)popup.SwigCPtr, Popup.Property.PopupBackgroundBorder, new Tizen.NUI.PropertyValue((Rectangle)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var popup = (Popup)bindable; + Rectangle temp = new Rectangle(0, 0, 0, 0); + Tizen.NUI.Object.GetProperty((System.Runtime.InteropServices.HandleRef)popup.SwigCPtr, Popup.Property.PopupBackgroundBorder).Get(temp); + return temp; + })); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty TailUpImageProperty = BindableProperty.Create(nameof(TailUpImage), typeof(string), typeof(Popup), string.Empty, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var popup = (Popup)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)popup.SwigCPtr, Popup.Property.TailUpImage, new Tizen.NUI.PropertyValue((string)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var popup = (Popup)bindable; + string temp; + Tizen.NUI.Object.GetProperty((System.Runtime.InteropServices.HandleRef)popup.SwigCPtr, Popup.Property.TailUpImage).Get(out temp); + return temp; + })); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty TailDownImageProperty = BindableProperty.Create(nameof(TailDownImage), typeof(string), typeof(Popup), string.Empty, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var popup = (Popup)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)popup.SwigCPtr, Popup.Property.TailDownImage, new Tizen.NUI.PropertyValue((string)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var popup = (Popup)bindable; + string temp; + Tizen.NUI.Object.GetProperty((System.Runtime.InteropServices.HandleRef)popup.SwigCPtr, Popup.Property.TailDownImage).Get(out temp); + return temp; + })); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty TailLeftImageProperty = BindableProperty.Create(nameof(TailLeftImage), typeof(string), typeof(Popup), string.Empty, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var popup = (Popup)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)popup.SwigCPtr, Popup.Property.TailLeftImage, new Tizen.NUI.PropertyValue((string)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var popup = (Popup)bindable; + string temp; + Tizen.NUI.Object.GetProperty((System.Runtime.InteropServices.HandleRef)popup.SwigCPtr, Popup.Property.TailLeftImage).Get(out temp); + return temp; + })); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty TailRightImageProperty = BindableProperty.Create(nameof(TailRightImage), typeof(string), typeof(Popup), string.Empty, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var popup = (Popup)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)popup.SwigCPtr, Popup.Property.TailRightImage, new Tizen.NUI.PropertyValue((string)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var popup = (Popup)bindable; + string temp; + Tizen.NUI.Object.GetProperty((System.Runtime.InteropServices.HandleRef)popup.SwigCPtr, Popup.Property.TailRightImage).Get(out temp); + return temp; + })); + + } +} diff --git a/src/Tizen.NUI/src/public/UIComponents/ProgressBar.cs b/src/Tizen.NUI/src/public/UIComponents/ProgressBar.cs new file mode 100755 index 0000000..7981b74 --- /dev/null +++ b/src/Tizen.NUI/src/public/UIComponents/ProgressBar.cs @@ -0,0 +1,584 @@ +/* + * Copyright(c) 2018 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +using System; +using System.ComponentModel; +using System.Runtime.InteropServices; +using Tizen.NUI.BaseComponents; +using Tizen.NUI.Binding; + +namespace Tizen.NUI.UIComponents +{ + /// + /// The ProgressBar is a control to give the user an indication of the progress of an operation. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public class ProgressBar : View + { + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty ProgressValueProperty = BindableProperty.Create(nameof(ProgressValue), typeof(float), typeof(ProgressBar), default(float), propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var progressBar = (ProgressBar)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((HandleRef)progressBar.SwigCPtr, ProgressBar.Property.ProgressValue, new Tizen.NUI.PropertyValue((float)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var progressBar = (ProgressBar)bindable; + float temp = 0.0f; + Tizen.NUI.Object.GetProperty((HandleRef)progressBar.SwigCPtr, ProgressBar.Property.ProgressValue).Get(out temp); + return temp; + })); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty SecondaryProgressValueProperty = BindableProperty.Create(nameof(SecondaryProgressValue), typeof(float), typeof(ProgressBar), default(float), propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var progressBar = (ProgressBar)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((HandleRef)progressBar.SwigCPtr, ProgressBar.Property.SecondaryProgressValue, new Tizen.NUI.PropertyValue((float)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var progressBar = (ProgressBar)bindable; + float temp = 0.0f; + Tizen.NUI.Object.GetProperty((HandleRef)progressBar.SwigCPtr, ProgressBar.Property.SecondaryProgressValue).Get(out temp); + return temp; + })); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty IndeterminateProperty = BindableProperty.Create(nameof(Indeterminate), typeof(bool), typeof(ProgressBar), false, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var progressBar = (ProgressBar)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((HandleRef)progressBar.SwigCPtr, ProgressBar.Property.INDETERMINATE, new Tizen.NUI.PropertyValue((bool)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var progressBar = (ProgressBar)bindable; + bool temp = false; + Tizen.NUI.Object.GetProperty((HandleRef)progressBar.SwigCPtr, ProgressBar.Property.INDETERMINATE).Get(out temp); + return temp; + })); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty TrackVisualProperty = BindableProperty.Create(nameof(TrackVisual), typeof(PropertyMap), typeof(ProgressBar), new PropertyMap(), propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var progressBar = (ProgressBar)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((HandleRef)progressBar.SwigCPtr, ProgressBar.Property.TrackVisual, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var progressBar = (ProgressBar)bindable; + Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap(); + Tizen.NUI.Object.GetProperty((HandleRef)progressBar.SwigCPtr, ProgressBar.Property.TrackVisual).Get(temp); + return temp; + })); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty ProgressVisualProperty = BindableProperty.Create(nameof(ProgressVisual), typeof(PropertyMap), typeof(ProgressBar), new PropertyMap(), propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var progressBar = (ProgressBar)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((HandleRef)progressBar.SwigCPtr, ProgressBar.Property.ProgressVisual, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var progressBar = (ProgressBar)bindable; + Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap(); + Tizen.NUI.Object.GetProperty((HandleRef)progressBar.SwigCPtr, ProgressBar.Property.ProgressVisual).Get(temp); + return temp; + })); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty SecondaryProgressVisualProperty = BindableProperty.Create(nameof(SecondaryProgressVisual), typeof(PropertyMap), typeof(ProgressBar), new PropertyMap(), propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var progressBar = (ProgressBar)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((HandleRef)progressBar.SwigCPtr, ProgressBar.Property.SecondaryProgressVisual, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var progressBar = (ProgressBar)bindable; + Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap(); + Tizen.NUI.Object.GetProperty((HandleRef)progressBar.SwigCPtr, ProgressBar.Property.SecondaryProgressVisual).Get(temp); + return temp; + })); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty IndeterminateVisualProperty = BindableProperty.Create(nameof(IndeterminateVisual), typeof(PropertyMap), typeof(ProgressBar), new PropertyMap(), propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var progressBar = (ProgressBar)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((HandleRef)progressBar.SwigCPtr, ProgressBar.Property.IndeterminateVisual, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var progressBar = (ProgressBar)bindable; + Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap(); + Tizen.NUI.Object.GetProperty((HandleRef)progressBar.SwigCPtr, ProgressBar.Property.IndeterminateVisual).Get(temp); + return temp; + })); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty IndeterminateVisualAnimationProperty = BindableProperty.Create(nameof(IndeterminateVisualAnimation), typeof(PropertyArray), typeof(ProgressBar), new PropertyArray(), propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var progressBar = (ProgressBar)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((HandleRef)progressBar.SwigCPtr, ProgressBar.Property.IndeterminateVisualAnimation, new Tizen.NUI.PropertyValue((PropertyArray)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var progressBar = (ProgressBar)bindable; + Tizen.NUI.PropertyArray temp = new Tizen.NUI.PropertyArray(); + Tizen.NUI.Object.GetProperty((HandleRef)progressBar.SwigCPtr, ProgressBar.Property.IndeterminateVisualAnimation).Get(temp); + return temp; + })); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty LabelVisualProperty = BindableProperty.Create(nameof(LabelVisual), typeof(PropertyMap), typeof(ProgressBar), new PropertyMap(), propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var progressBar = (ProgressBar)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((HandleRef)progressBar.SwigCPtr, ProgressBar.Property.LabelVisual, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var progressBar = (ProgressBar)bindable; + Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap(); + Tizen.NUI.Object.GetProperty((HandleRef)progressBar.SwigCPtr, ProgressBar.Property.LabelVisual).Get(temp); + return temp; + })); + + private EventHandler _progressBarValueChangedEventHandler; + private ValueChangedCallbackDelegate _progressBarValueChangedCallbackDelegate; + + /// + /// Creates the ProgressBar. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public ProgressBar() : this(Interop.ProgressBar.New(), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + } + + internal ProgressBar(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn) + { + } + + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate void ValueChangedCallbackDelegate(IntPtr progressBar, float progressValue, float secondaryProgressValue); + + /// + /// The event is sent when the ProgressBar value changes. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public event EventHandler ValueChanged + { + add + { + if (_progressBarValueChangedEventHandler == null) + { + _progressBarValueChangedCallbackDelegate = (OnValueChanged); + ProgressBarValueChangedSignal valueChanged = ValueChangedSignal(); + valueChanged?.Connect(_progressBarValueChangedCallbackDelegate); + valueChanged?.Dispose(); + } + _progressBarValueChangedEventHandler += value; + } + remove + { + _progressBarValueChangedEventHandler -= value; + ProgressBarValueChangedSignal valueChanged = ValueChangedSignal(); + if (_progressBarValueChangedEventHandler == null && valueChanged.Empty() == false) + { + valueChanged?.Disconnect(_progressBarValueChangedCallbackDelegate); + } + valueChanged?.Dispose(); + } + } + + /// + /// The progress value of the progress bar, the progress runs from 0 to 1.
+ /// If the value is set to 0, then the progress bar will be set to beginning.
+ /// If the value is set to 1, then the progress bar will be set to end.
+ /// Any value outside the range is ignored.
+ ///
+ /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public float ProgressValue + { + get + { + return (float)GetValue(ProgressValueProperty); + } + set + { + SetValue(ProgressValueProperty, value); + } + } + + /// + /// The secondary progress value of the progress bar, the secondary progress runs from 0 to 1.
+ /// Optional. If not supplied, the default is 0.
+ /// If the value is set to 0, then the progress bar will be set secondary progress to beginning.
+ /// If the value is set to 1, then the progress bar will be set secondary progress to end.
+ /// Any value outside of the range is ignored.
+ ///
+ /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public float SecondaryProgressValue + { + get + { + return (float)GetValue(SecondaryProgressValueProperty); + } + set + { + SetValue(SecondaryProgressValueProperty, value); + } + } + + /// + /// Sets the progress bar as \e indeterminate state. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool Indeterminate + { + get + { + return (bool)GetValue(IndeterminateProperty); + } + set + { + SetValue(IndeterminateProperty, value); + } + } + + /// + /// The track visual value of progress bar, it's full progress area, and it's shown behind the PROGRESS_VISUAL.
+ /// Optional. If not supplied, the default track visual will be shown.
+ ///
+ /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public Tizen.NUI.PropertyMap TrackVisual + { + get + { + return (PropertyMap)GetValue(TrackVisualProperty); + } + set + { + SetValue(TrackVisualProperty, value); + } + } + + /// + /// The progress visual value of the progress bar, the size of the progress visual is changed based on the PROGRESS_VALUE.
+ /// Optional. If not supplied, then the default progress visual will be shown.
+ ///
+ /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public Tizen.NUI.PropertyMap ProgressVisual + { + get + { + return (PropertyMap)GetValue(ProgressVisualProperty); + } + set + { + SetValue(ProgressVisualProperty, value); + } + } + + /// + /// The secondary progress visual of the progress bar, the size of the secondary progress visual is changed based on the SECONDARY_PROGRESS_VALUE.
+ /// Optional. If not supplied, then the secondary progress visual will not be shown.
+ ///
+ /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public Tizen.NUI.PropertyMap SecondaryProgressVisual + { + get + { + return (PropertyMap)GetValue(SecondaryProgressVisualProperty); + } + set + { + SetValue(SecondaryProgressVisualProperty, value); + } + } + + /// + /// The indeterminate visual of the progress bar.
+ /// Optional. If not supplied, then the default indeterminate visual will be shown.
+ ///
+ /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public Tizen.NUI.PropertyMap IndeterminateVisual + { + get + { + return (PropertyMap)GetValue(IndeterminateVisualProperty); + } + set + { + SetValue(IndeterminateVisualProperty, value); + } + } + + /// + /// The transition data for the indeterminate visual animation.
+ /// Optional. If not supplied, then the default animation will be played.
+ ///
+ /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public Tizen.NUI.PropertyArray IndeterminateVisualAnimation + { + get + { + return (PropertyArray)GetValue(IndeterminateVisualAnimationProperty); + } + set + { + SetValue(IndeterminateVisualAnimationProperty, value); + } + } + + /// + /// The label visual of the progress bar. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public Tizen.NUI.PropertyMap LabelVisual + { + get + { + return (PropertyMap)GetValue(LabelVisualProperty); + } + set + { + SetValue(LabelVisualProperty, value); + } + } + + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ProgressBar obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.SwigCPtr; + } + + internal ProgressBarValueChangedSignal ValueChangedSignal() + { + ProgressBarValueChangedSignal ret = new ProgressBarValueChangedSignal(Interop.ProgressBar.ValueChangedSignal(SwigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// To dispose the ProgressBar instance. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + protected override void Dispose(DisposeTypes type) + { + if (disposed) + { + return; + } + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + + if (this != null && _progressBarValueChangedCallbackDelegate != null) + { + ProgressBarValueChangedSignal valueChanged = ValueChangedSignal(); + valueChanged?.Disconnect(_progressBarValueChangedCallbackDelegate); + valueChanged?.Dispose(); + } + + base.Dispose(type); + } + + /// This will not be public opened. + [EditorBrowsable(EditorBrowsableState.Never)] + protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr) + { + Interop.ProgressBar.DeleteProgressBar(swigCPtr); + } + + // Callback for ProgressBar ValueChanged signal + private void OnValueChanged(IntPtr progressBar, float progressValue, float secondaryProgressValue) + { + ValueChangedEventArgs e = new ValueChangedEventArgs(); + + // Populate all members of "e" (ValueChangedEventArgs) with real page + e.ProgressBar = Registry.GetManagedBaseHandleFromNativePtr(progressBar) as ProgressBar; + e.ProgressValue = progressValue; + e.SecondaryProgressValue = secondaryProgressValue; + + if (_progressBarValueChangedEventHandler != null) + { + _progressBarValueChangedEventHandler(this, e); + } + } + + /// + /// Event arguments that passed via the ValueChangedEventArgs. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")] + public class ValueChangedEventArgs : EventArgs + { + private ProgressBar _progressBar; + private float _progressValue; + private float _secondaryProgressValue; + + /// + /// ProgressBar + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public ProgressBar ProgressBar + { + get + { + return _progressBar; + } + set + { + _progressBar = value; + } + } + + /// + /// The progress value of the progress bar, the progress runs from 0 to 1. + /// + /// 3 + /// This will be deprecated + [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + public float ProgressValue + { + get + { + return _progressValue; + } + set + { + _progressValue = value; + } + } + + /// + /// The secondary progress value of the progress bar, the secondary progress runs from 0 to 1. + /// + /// 3 + /// This will be deprecated + [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + public float SecondaryProgressValue + { + get + { + return _secondaryProgressValue; + } + set + { + _secondaryProgressValue = value; + } + } + + } + + internal new class Property + { + internal static readonly int ProgressValue = Interop.ProgressBar.ProgressValueGet(); + internal static readonly int SecondaryProgressValue = Interop.ProgressBar.SecondaryProgressValueGet(); + internal static readonly int INDETERMINATE = Interop.ProgressBar.IndeterminateGet(); + internal static readonly int TrackVisual = Interop.ProgressBar.TrackVisualGet(); + internal static readonly int ProgressVisual = Interop.ProgressBar.ProgressVisualGet(); + internal static readonly int SecondaryProgressVisual = Interop.ProgressBar.SecondaryProgressVisualGet(); + internal static readonly int IndeterminateVisual = Interop.ProgressBar.IndeterminateVisualGet(); + internal static readonly int IndeterminateVisualAnimation = Interop.ProgressBar.IndeterminateVisualAnimationGet(); + internal static readonly int LabelVisual = Interop.ProgressBar.LabelVisualGet(); + } + } +} diff --git a/src/Tizen.NUI/src/public/UIComponents/PushButton.cs b/src/Tizen.NUI/src/public/UIComponents/PushButton.cs new file mode 100755 index 0000000..b6540c6 --- /dev/null +++ b/src/Tizen.NUI/src/public/UIComponents/PushButton.cs @@ -0,0 +1,136 @@ +/* + * Copyright(c) 2018 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +using System; +using System.ComponentModel; +using Tizen.NUI.BaseComponents; +using Tizen.NUI.Binding; +using System.Windows.Input; +using System.Collections.Generic; + +namespace Tizen.NUI.UIComponents +{ + /// + /// The PushButton changes its appearance when it is pressed, and returns to its original when it is released. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public class PushButton : Button + { + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty CommandProperty = BindableProperty.Create(nameof(Command), typeof(ICommand), typeof(PushButton), null, + BindingMode.OneWay, null, null, null, null, null as BindableProperty.CreateDefaultValueDelegate); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty CommandParameterProperty = BindableProperty.Create(nameof(CommandParameter), typeof(object), typeof(PushButton), null, + BindingMode.OneWay, null, null, null, null, null as BindableProperty.CreateDefaultValueDelegate); + + + + /// + /// Creates the PushButton. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public PushButton() : this(Interop.PushButton.New(), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal PushButton(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn) + { + } + + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public ICommand Command + { + get + { + return (ICommand)base.GetValue(PushButton.CommandProperty); + } + set + { + base.SetValue(PushButton.CommandProperty, value); + } + } + + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public object CommandParameter + { + get + { + return base.GetValue(PushButton.CommandParameterProperty); + } + set + { + base.SetValue(PushButton.CommandParameterProperty, value); + } + } + + /// Only used by the IL of xaml, will never changed to not hidden. + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool IsCreateByXaml + { + get + { + return base.IsCreateByXaml; + } + set + { + base.IsCreateByXaml = value; + + if (value == true) + { + this.Clicked += (sender, e) => + { + ICommand command = this.Command; + if (command != null) + { + command.Execute(this.CommandParameter); + } + return true; + }; + } + } + } + + + /// This will not be public opened. + [EditorBrowsable(EditorBrowsableState.Never)] + protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr) + { + Interop.PushButton.DeletePushButton(swigCPtr); + } + + internal new class Property + { + internal static readonly int LabelPadding = Interop.PushButton.LabelPaddingGet(); + internal static readonly int IconPadding = Interop.PushButton.IconPaddingGet(); + } + } +} diff --git a/src/Tizen.NUI/src/public/UIComponents/RadioButton.cs b/src/Tizen.NUI/src/public/UIComponents/RadioButton.cs new file mode 100755 index 0000000..4ca6fcc --- /dev/null +++ b/src/Tizen.NUI/src/public/UIComponents/RadioButton.cs @@ -0,0 +1,80 @@ +/* + * Copyright(c) 2017 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +using System; +using System.ComponentModel; + +namespace Tizen.NUI.UIComponents +{ + /// + /// A RadioButton provides a radio button with two states, \e selected or \e unselected.
+ /// Radio buttons are designed to select one of the many options at the same time.
+ /// A RadioButton can change its current state using the selected.
+ ///
+ /// RadioButtons can be grouped.
+ /// Two or more RadioButtons are in one group when they have this same parent.
+ /// In each groups only one RadioButton can be \e selected at a given time.
+ /// So when a RadioButton is set to \e selected, other RadioButtons in its group are set to \e unselected.
+ /// When \e selected RadioButton is set to \e unselected, no other RadioButtons in this group are set to \e selected.
+ ///
+ /// The StateChanged event is emitted when the RadioButton change its state to \e selected or \e unselected.
+ ///
+ /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public class RadioButton : Button + { + + /// + /// Creates an uninitialized RadioButton. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public RadioButton() : this(Interop.RadioButton.New(), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Creates an uninitialized RadioButton with the label. + /// + /// The label text. + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public RadioButton(string label) : this(Interop.RadioButton.New(label), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal RadioButton(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn) + { + } + + + /// This will not be public opened. + [EditorBrowsable(EditorBrowsableState.Never)] + protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr) + { + Interop.RadioButton.DeleteRadioButton(swigCPtr); + } + } +} diff --git a/src/Tizen.NUI/src/public/UIComponents/ScrollBar.cs b/src/Tizen.NUI/src/public/UIComponents/ScrollBar.cs new file mode 100755 index 0000000..08ba35a --- /dev/null +++ b/src/Tizen.NUI/src/public/UIComponents/ScrollBar.cs @@ -0,0 +1,824 @@ +/* + * Copyright(c) 2018 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +using System; +using System.ComponentModel; +using System.Runtime.InteropServices; +using Tizen.NUI.BaseComponents; +using Tizen.NUI.Binding; + +namespace Tizen.NUI.UIComponents +{ + /// + /// The ScrollBar is a UI component that can be linked to the scrollable objects + /// indicating the current scroll position of the scrollable object.
+ ///
+ /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public class ScrollBar : View + { + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty ScrollDirectionProperty = BindableProperty.Create(nameof(ScrollDirection), typeof(Direction), typeof(ScrollBar), Direction.Vertical, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var scrollBar = (ScrollBar)bindable; + string valueToString = ""; + if (newValue != null) + { + switch ((Direction)newValue) + { + case Direction.Vertical: { valueToString = "Vertical"; break; } + case Direction.Horizontal: { valueToString = "Horizontal"; break; } + default: { valueToString = "Vertical"; break; } + } + Tizen.NUI.Object.SetProperty((HandleRef)scrollBar.SwigCPtr, ScrollBar.Property.ScrollDirection, new Tizen.NUI.PropertyValue(valueToString)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var scrollBar = (ScrollBar)bindable; + string temp; + if (Tizen.NUI.Object.GetProperty((HandleRef)scrollBar.SwigCPtr, ScrollBar.Property.ScrollDirection).Get(out temp) == false) + { + NUILog.Error("ScrollDirection get error!"); + } + + switch (temp) + { + case "Vertical": return Direction.Vertical; + case "Horizontal": return Direction.Horizontal; + default: return Direction.Vertical; + } + })); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty IndicatorHeightPolicyProperty = BindableProperty.Create(nameof(IndicatorHeightPolicy), typeof(IndicatorHeightPolicyType), typeof(ScrollBar), IndicatorHeightPolicyType.Variable, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var scrollBar = (ScrollBar)bindable; + string valueToString = ""; + if (newValue != null) + { + switch ((IndicatorHeightPolicyType)newValue) + { + case IndicatorHeightPolicyType.Variable: { valueToString = "Variable"; break; } + case IndicatorHeightPolicyType.Fixed: { valueToString = "Fixed"; break; } + default: { valueToString = "Variable"; break; } + } + Tizen.NUI.Object.SetProperty((HandleRef)scrollBar.SwigCPtr, ScrollBar.Property.IndicatorHeightPolicy, new Tizen.NUI.PropertyValue(valueToString)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var scrollBar = (ScrollBar)bindable; + string temp; + if (Tizen.NUI.Object.GetProperty((HandleRef)scrollBar.SwigCPtr, ScrollBar.Property.IndicatorHeightPolicy).Get(out temp) == false) + { + NUILog.Error("IndicatorHeightPolicy get error!"); + } + + switch (temp) + { + case "Variable": return IndicatorHeightPolicyType.Variable; + case "Fixed": return IndicatorHeightPolicyType.Fixed; + default: return IndicatorHeightPolicyType.Variable; + } + })); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty IndicatorFixedHeightProperty = BindableProperty.Create(nameof(IndicatorFixedHeight), typeof(float), typeof(ScrollBar), default(float), propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var scrollBar = (ScrollBar)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((HandleRef)scrollBar.SwigCPtr, ScrollBar.Property.IndicatorFixedHeight, new Tizen.NUI.PropertyValue((float)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var scrollBar = (ScrollBar)bindable; + float temp = 0.0f; + Tizen.NUI.Object.GetProperty((HandleRef)scrollBar.SwigCPtr, ScrollBar.Property.IndicatorFixedHeight).Get(out temp); + return temp; + })); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty IndicatorShowDurationProperty = BindableProperty.Create(nameof(IndicatorShowDuration), typeof(float), typeof(ScrollBar), default(float), propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var scrollBar = (ScrollBar)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((HandleRef)scrollBar.SwigCPtr, ScrollBar.Property.IndicatorShowDuration, new Tizen.NUI.PropertyValue((float)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var scrollBar = (ScrollBar)bindable; + float temp = 0.0f; + Tizen.NUI.Object.GetProperty((HandleRef)scrollBar.SwigCPtr, ScrollBar.Property.IndicatorShowDuration).Get(out temp); + return temp; + })); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty IndicatorHideDurationProperty = BindableProperty.Create(nameof(IndicatorHideDuration), typeof(float), typeof(ScrollBar), default(float), propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var scrollBar = (ScrollBar)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((HandleRef)scrollBar.SwigCPtr, ScrollBar.Property.IndicatorHideDuration, new Tizen.NUI.PropertyValue((float)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var scrollBar = (ScrollBar)bindable; + float temp = 0.0f; + Tizen.NUI.Object.GetProperty((HandleRef)scrollBar.SwigCPtr, ScrollBar.Property.IndicatorHideDuration).Get(out temp); + return temp; + })); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty ScrollPositionIntervalsProperty = BindableProperty.Create(nameof(ScrollPositionIntervals), typeof(PropertyArray), typeof(ScrollBar), new PropertyArray(), propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var scrollBar = (ScrollBar)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((HandleRef)scrollBar.SwigCPtr, ScrollBar.Property.ScrollPositionIntervals, new Tizen.NUI.PropertyValue((PropertyArray)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var scrollBar = (ScrollBar)bindable; + Tizen.NUI.PropertyArray temp = new Tizen.NUI.PropertyArray(); + Tizen.NUI.Object.GetProperty((HandleRef)scrollBar.SwigCPtr, ScrollBar.Property.ScrollPositionIntervals).Get(temp); + return temp; + })); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty IndicatorMinimumHeightProperty = BindableProperty.Create(nameof(IndicatorMinimumHeight), typeof(float), typeof(ScrollBar), default(float), propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var scrollBar = (ScrollBar)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((HandleRef)scrollBar.SwigCPtr, ScrollBar.Property.IndicatorMinimumHeight, new Tizen.NUI.PropertyValue((float)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var scrollBar = (ScrollBar)bindable; + float temp = 0.0f; + Tizen.NUI.Object.GetProperty((HandleRef)scrollBar.SwigCPtr, ScrollBar.Property.IndicatorMinimumHeight).Get(out temp); + return temp; + })); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty IndicatorStartPaddingProperty = BindableProperty.Create(nameof(IndicatorStartPadding), typeof(float), typeof(ScrollBar), default(float), propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var scrollBar = (ScrollBar)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((HandleRef)scrollBar.SwigCPtr, ScrollBar.Property.IndicatorStartPadding, new Tizen.NUI.PropertyValue((float)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var scrollBar = (ScrollBar)bindable; + float temp = 0.0f; + Tizen.NUI.Object.GetProperty((HandleRef)scrollBar.SwigCPtr, ScrollBar.Property.IndicatorStartPadding).Get(out temp); + return temp; + })); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty IndicatorEndPaddingProperty = BindableProperty.Create(nameof(IndicatorEndPadding), typeof(float), typeof(ScrollBar), default(float), propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var scrollBar = (ScrollBar)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((HandleRef)scrollBar.SwigCPtr, ScrollBar.Property.IndicatorEndPadding, new Tizen.NUI.PropertyValue((float)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var scrollBar = (ScrollBar)bindable; + float temp = 0.0f; + Tizen.NUI.Object.GetProperty((HandleRef)scrollBar.SwigCPtr, ScrollBar.Property.IndicatorEndPadding).Get(out temp); + return temp; + })); + + + private EventHandler _scrollBarPanFinishedEventHandler; + private PanFinishedEventCallbackDelegate _scrollBarPanFinishedEventCallbackDelegate; + + private EventHandler _scrollBarScrollPositionIntervalReachedEventHandler; + private ScrollPositionIntervalReachedEventCallbackDelegate _scrollBarScrollPositionIntervalReachedEventCallbackDelegate; + + /// + /// Creates an initialized scrollbar. + /// + /// The direction of the scrollbar (either vertically or horizontally). + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public ScrollBar(ScrollBar.Direction direction) : this(Interop.ScrollBar.New((int)direction), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Creates an uninitialized scrollbar. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public ScrollBar() : this(Interop.ScrollBar.New(), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal ScrollBar(ScrollBar scrollBar) : this(Interop.ScrollBar.NewScrollBar(ScrollBar.getCPtr(scrollBar)), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal ScrollBar(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn) + { + } + + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate void PanFinishedEventCallbackDelegate(); + + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate void ScrollPositionIntervalReachedEventCallbackDelegate(float position); + + /// + /// The event emitted when panning is finished on the scroll indicator. + /// + /// Event only emitted when the source of the scroll position properties are set. + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public event EventHandler PanFinished + { + add + { + if (_scrollBarPanFinishedEventHandler == null) + { + _scrollBarPanFinishedEventCallbackDelegate = (OnScrollBarPanFinished); + VoidSignal panFinished = PanFinishedSignal(); + panFinished?.Connect(_scrollBarPanFinishedEventCallbackDelegate); + panFinished?.Dispose(); + } + _scrollBarPanFinishedEventHandler += value; + } + remove + { + _scrollBarPanFinishedEventHandler -= value; + VoidSignal panFinished = PanFinishedSignal(); + if (_scrollBarPanFinishedEventHandler == null && panFinished.Empty() == false) + { + panFinished?.Disconnect(_scrollBarPanFinishedEventCallbackDelegate); + } + panFinished?.Dispose(); + } + } + + /// + /// This is the event emitted when the current scroll position of the scrollable content goes above or below the values specified by ScrollPositionIntervals property. + /// + /// Event only emitted when the source of the scroll position properties are set. + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public event EventHandler ScrollInterval + { + add + { + if (_scrollBarScrollPositionIntervalReachedEventHandler == null) + { + _scrollBarScrollPositionIntervalReachedEventCallbackDelegate = (OnScrollBarScrollPositionIntervalReached); + FloatSignal scrollPositionIntervalReached = ScrollPositionIntervalReachedSignal(); + scrollPositionIntervalReached?.Connect(_scrollBarScrollPositionIntervalReachedEventCallbackDelegate); + scrollPositionIntervalReached?.Dispose(); + } + _scrollBarScrollPositionIntervalReachedEventHandler += value; + } + remove + { + _scrollBarScrollPositionIntervalReachedEventHandler -= value; + FloatSignal scrollPositionIntervalReached = ScrollPositionIntervalReachedSignal(); + if (_scrollBarScrollPositionIntervalReachedEventHandler == null && scrollPositionIntervalReached.Empty() == false) + { + scrollPositionIntervalReached?.Disconnect(_scrollBarScrollPositionIntervalReachedEventCallbackDelegate); + } + scrollPositionIntervalReached?.Dispose(); + } + } + + /// + /// The direction of the scrollbar. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public enum Direction + { + /// + /// Scroll in the vertical direction + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + Vertical = 0, + /// + /// Scroll in the horizontal direction + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + Horizontal + } + + /// + /// The indicator height policy. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public enum IndicatorHeightPolicyType + { + /// + /// Variable height changed dynamically according to the length of scroll content + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + Variable = 0, + /// + /// Fixed height regardless of the length of scroll content + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + Fixed + } + + /// + /// The direction of the scrollbar. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public Direction ScrollDirection + { + get + { + + return (Direction)GetValue(ScrollDirectionProperty); + } + set + { + SetValue(ScrollDirectionProperty, value); + } + } + + /// + /// The indicator height policy. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public IndicatorHeightPolicyType IndicatorHeightPolicy + { + get + { + return (IndicatorHeightPolicyType)GetValue(IndicatorHeightPolicyProperty); + } + set + { + SetValue(IndicatorHeightPolicyProperty, value); + } + } + + /// + /// The fixed height of the scroll indicator. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public float IndicatorFixedHeight + { + get + { + return (float)GetValue(IndicatorFixedHeightProperty); + } + set + { + SetValue(IndicatorFixedHeightProperty, value); + } + } + + /// + /// The duration in seconds for the scroll indicator to become fully visible. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public float IndicatorShowDuration + { + get + { + return (float)GetValue(IndicatorShowDurationProperty); + } + set + { + SetValue(IndicatorShowDurationProperty, value); + } + } + + /// + /// The duration in seconds for the scroll indicator to become fully invisible. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public float IndicatorHideDuration + { + get + { + return (float)GetValue(IndicatorHideDurationProperty); + } + set + { + SetValue(IndicatorHideDurationProperty, value); + } + } + + /// + /// The list of values to get the notification when the current scroll position of the scrollable object goes above or below any of these values. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public Tizen.NUI.PropertyArray ScrollPositionIntervals + { + get + { + return (PropertyArray)GetValue(ScrollPositionIntervalsProperty); + } + set + { + SetValue(ScrollPositionIntervalsProperty, value); + } + } + + /// + /// The minimum height for a variable size indicator. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public float IndicatorMinimumHeight + { + get + { + return (float)GetValue(IndicatorMinimumHeightProperty); + } + set + { + SetValue(IndicatorMinimumHeightProperty, value); + } + } + + /// + /// The padding at the start of the indicator. For example, the top if the scrollDirection is vertical. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public float IndicatorStartPadding + { + get + { + return (float)GetValue(IndicatorStartPaddingProperty); + } + set + { + SetValue(IndicatorStartPaddingProperty, value); + } + } + + /// + /// The padding at the end of the indicator. For example, the bottom if the scrollDirection is vertical. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public float IndicatorEndPadding + { + get + { + return (float)GetValue(IndicatorEndPaddingProperty); + } + set + { + SetValue(IndicatorEndPaddingProperty, value); + } + } + + /// + /// Sets the source of the scroll position properties. + /// + /// The handle of the object owing the scroll properties. + /// The index of the scroll position property(The scroll position, type float). + /// The index of the minimum scroll position property(The minimum scroll position, type float). + /// The index of the maximum scroll position property(The maximum scroll position, type float). + /// The index of the scroll content size property(The size of the scrollable content in actor coordinates, type float). + /// The handle to the object owing the scroll properties has been initialised and the property index must be valid. + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public void SetScrollPropertySource(Animatable handle, int propertyScrollPosition, int propertyMinScrollPosition, int propertyMaxScrollPosition, int propertyScrollContentSize) + { + Interop.ScrollBar.SetScrollPropertySource(SwigCPtr, Animatable.getCPtr(handle), propertyScrollPosition, propertyMinScrollPosition, propertyMaxScrollPosition, propertyScrollContentSize); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ScrollBar obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.SwigCPtr; + } + + internal void SetScrollIndicator(View indicator) + { + Interop.ScrollBar.SetScrollIndicator(SwigCPtr, View.getCPtr(indicator)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal View GetScrollIndicator() + { + View ret = new View(Interop.ScrollBar.GetScrollIndicator(SwigCPtr), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal void SetScrollDirection(ScrollBar.Direction direction) + { + Interop.ScrollBar.SetScrollDirection(SwigCPtr, (int)direction); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal ScrollBar.Direction GetScrollDirection() + { + ScrollBar.Direction ret = (ScrollBar.Direction)Interop.ScrollBar.GetScrollDirection(SwigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal void SetIndicatorHeightPolicy(ScrollBar.IndicatorHeightPolicyType policy) + { + Interop.ScrollBar.SetIndicatorHeightPolicy(SwigCPtr, (int)policy); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal ScrollBar.IndicatorHeightPolicyType GetIndicatorHeightPolicy() + { + ScrollBar.IndicatorHeightPolicyType ret = (ScrollBar.IndicatorHeightPolicyType)Interop.ScrollBar.GetIndicatorHeightPolicy(SwigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal void SetIndicatorFixedHeight(float height) + { + Interop.ScrollBar.SetIndicatorFixedHeight(SwigCPtr, height); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal float GetIndicatorFixedHeight() + { + float ret = Interop.ScrollBar.GetIndicatorFixedHeight(SwigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal void SetIndicatorShowDuration(float durationSeconds) + { + Interop.ScrollBar.SetIndicatorShowDuration(SwigCPtr, durationSeconds); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal float GetIndicatorShowDuration() + { + float ret = Interop.ScrollBar.GetIndicatorShowDuration(SwigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal void SetIndicatorHideDuration(float durationSeconds) + { + Interop.ScrollBar.SetIndicatorHideDuration(SwigCPtr, durationSeconds); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal float GetIndicatorHideDuration() + { + float ret = Interop.ScrollBar.GetIndicatorHideDuration(SwigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal void ShowIndicator() + { + Interop.ScrollBar.ShowIndicator(SwigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal void HideIndicator() + { + Interop.ScrollBar.HideIndicator(SwigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal VoidSignal PanFinishedSignal() + { + VoidSignal ret = new VoidSignal(Interop.ScrollBar.PanFinishedSignal(SwigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal FloatSignal ScrollPositionIntervalReachedSignal() + { + FloatSignal ret = new FloatSignal(Interop.ScrollBar.ScrollPositionIntervalReachedSignal(SwigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// To dispose the ScrollBar instance. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + protected override void Dispose(DisposeTypes type) + { + if (disposed) + { + return; + } + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + if (this != null) + { + if (_scrollBarScrollPositionIntervalReachedEventCallbackDelegate != null) + { + FloatSignal scrollPositionIntervalReached = ScrollPositionIntervalReachedSignal(); + scrollPositionIntervalReached?.Disconnect(_scrollBarScrollPositionIntervalReachedEventCallbackDelegate); + scrollPositionIntervalReached?.Dispose(); + } + + if (_scrollBarPanFinishedEventCallbackDelegate != null) + { + VoidSignal panFinished = PanFinishedSignal(); + panFinished?.Disconnect(_scrollBarPanFinishedEventCallbackDelegate); + panFinished?.Dispose(); + } + } + + base.Dispose(type); + } + + /// This will not be public opened. + [EditorBrowsable(EditorBrowsableState.Never)] + protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr) + { + Interop.ScrollBar.DeleteScrollBar(swigCPtr); + } + + // Callback for ScrollBar PanFinishedSignal + private void OnScrollBarPanFinished() + { + PanFinishedEventArgs e = new PanFinishedEventArgs(); + + if (_scrollBarPanFinishedEventHandler != null) + { + //here we send all data to user event handlers + _scrollBarPanFinishedEventHandler(this, e); + } + } + + + // Callback for ScrollBar ScrollPositionIntervalReachedSignal + private void OnScrollBarScrollPositionIntervalReached(float position) + { + ScrollIntervalEventArgs e = new ScrollIntervalEventArgs(); + e.CurrentScrollPosition = position; + + if (_scrollBarScrollPositionIntervalReachedEventHandler != null) + { + //here we send all data to user event handlers + _scrollBarScrollPositionIntervalReachedEventHandler(this, e); + } + } + + + + /// + /// Event arguments that passed via the PanFinished event. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")] + public class PanFinishedEventArgs : EventArgs + { + } + + /// + /// Event arguments that passed via the ScrollPositionIntervalReached event. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")] + public class ScrollIntervalEventArgs : EventArgs + { + private float _currentScrollPosition; + + /// + /// The current scroll position of the scrollable content. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public float CurrentScrollPosition + { + get + { + return _currentScrollPosition; + } + set + { + _currentScrollPosition = value; + } + } + } + + internal new class Property + { + internal static readonly int ScrollDirection = Interop.ScrollBar.ScrollDirectionGet(); + internal static readonly int IndicatorHeightPolicy = Interop.ScrollBar.IndicatorHeightPolicyGet(); + internal static readonly int IndicatorFixedHeight = Interop.ScrollBar.IndicatorFixedHeightGet(); + internal static readonly int IndicatorShowDuration = Interop.ScrollBar.IndicatorShowDurationGet(); + internal static readonly int IndicatorHideDuration = Interop.ScrollBar.IndicatorHideDurationGet(); + internal static readonly int ScrollPositionIntervals = Interop.ScrollBar.ScrollPositionIntervalsGet(); + internal static readonly int IndicatorMinimumHeight = Interop.ScrollBar.IndicatorMinimumHeightGet(); + internal static readonly int IndicatorStartPadding = Interop.ScrollBar.IndicatorStartPaddingGet(); + internal static readonly int IndicatorEndPadding = Interop.ScrollBar.IndicatorEndPaddingGet(); + } + } +} diff --git a/src/Tizen.NUI/src/public/UIComponents/ScrollView.cs b/src/Tizen.NUI/src/public/UIComponents/ScrollView.cs new file mode 100755 index 0000000..39b2a1e --- /dev/null +++ b/src/Tizen.NUI/src/public/UIComponents/ScrollView.cs @@ -0,0 +1,1469 @@ +/* + * Copyright(c) 2019 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +using System; +using System.ComponentModel; +using System.Diagnostics.CodeAnalysis; +using Tizen.NUI.BaseComponents; + +namespace Tizen.NUI +{ + /// + /// ScrollView contains views that can be scrolled manually (via touch). + /// + /// 3 + [EditorBrowsable(EditorBrowsableState.Never)] + public partial class ScrollView : Scrollable + { + + /// + /// Create an instance of ScrollView. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public ScrollView() : this(Interop.ScrollView.New(), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal ScrollView(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn) + { + } + + /// + /// Sets and Gets WrapEnabled property. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool WrapEnabled + { + get + { + return (bool)GetValue(WrapEnabledProperty); + } + set + { + SetValue(WrapEnabledProperty, value); + } + } + + /// + /// Sets and Gets PanningEnabled property. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool PanningEnabled + { + get + { + return (bool)GetValue(PanningEnabledProperty); + } + set + { + SetValue(PanningEnabledProperty, value); + } + } + + /// + /// Sets and Gets AxisAutoLockEnabled property. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool AxisAutoLockEnabled + { + get + { + return (bool)GetValue(AxisAutoLockEnabledProperty); + } + set + { + SetValue(AxisAutoLockEnabledProperty, value); + } + } + + /// + /// Sets and Gets WheelScrollDistanceStep property. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public Vector2 WheelScrollDistanceStep + { + get + { + return (Vector2)GetValue(WheelScrollDistanceStepProperty); + } + set + { + SetValue(WheelScrollDistanceStepProperty, value); + } + } + + /// + /// Sets and Gets ScrollPosition property. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public Vector2 ScrollPosition + { + get + { + return (Vector2)GetValue(ScrollPositionProperty); + } + set + { + SetValue(ScrollPositionProperty, value); + } + } + + /// + /// Sets and Gets ScrollPrePosition property. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public Vector2 ScrollPrePosition + { + get + { + return (Vector2)GetValue(ScrollPrePositionProperty); + } + set + { + SetValue(ScrollPrePositionProperty, value); + } + } + + /// + /// Sets and Gets ScrollPrePositionMax property. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public Vector2 ScrollPrePositionMax + { + get + { + return (Vector2)GetValue(ScrollPrePositionMaxProperty); + } + set + { + SetValue(ScrollPrePositionMaxProperty, value); + } + } + + /// + /// Sets and Gets OvershootX property. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public float OvershootX + { + get + { + return (float)GetValue(OvershootXProperty); + } + set + { + SetValue(OvershootXProperty, value); + } + } + + /// + /// Sets and Gets OvershootY property. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public float OvershootY + { + get + { + return (float)GetValue(OvershootYProperty); + } + set + { + SetValue(OvershootYProperty, value); + } + } + + /// + /// Sets and Gets ScrollFinal property. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public Vector2 ScrollFinal + { + get + { + return (Vector2)GetValue(ScrollFinalProperty); + } + set + { + SetValue(ScrollFinalProperty, value); + } + } + + /// + /// Sets and Gets Wrap property. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool Wrap + { + get + { + return (bool)GetValue(WrapProperty); + } + set + { + SetValue(WrapProperty, value); + } + } + + /// + /// Sets and Gets Panning property. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool Panning + { + get + { + return (bool)GetValue(PanningProperty); + } + set + { + SetValue(PanningProperty, value); + } + } + + /// + /// Sets and Gets Scrolling property. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool Scrolling + { + get + { + return (bool)GetValue(ScrollingProperty); + } + set + { + SetValue(ScrollingProperty, value); + } + } + + /// + /// Sets and Gets ScrollDomainSize property. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public Vector2 ScrollDomainSize + { + get + { + return (Vector2)GetValue(ScrollDomainSizeProperty); + } + set + { + SetValue(ScrollDomainSizeProperty, value); + } + } + + /// + /// Sets and Gets ScrollDomainOffset property. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public Vector2 ScrollDomainOffset + { + get + { + return (Vector2)GetValue(ScrollDomainOffsetProperty); + } + set + { + SetValue(ScrollDomainOffsetProperty, value); + } + } + + /// + /// Sets and Gets ScrollPositionDelta property. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public Vector2 ScrollPositionDelta + { + get + { + return (Vector2)GetValue(ScrollPositionDeltaProperty); + } + set + { + SetValue(ScrollPositionDeltaProperty, value); + } + } + + /// + /// Sets and Gets StartPagePosition property. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public Vector3 StartPagePosition + { + get + { + return (Vector3)GetValue(StartPagePositionProperty); + } + set + { + SetValue(StartPagePositionProperty, value); + } + } + + + /// + /// Sets and Gets ScrollMode property. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public PropertyMap ScrollMode + { + get + { + return (PropertyMap)GetValue(ScrollModeProperty); + } + set + { + SetValue(ScrollModeProperty, value); + } + } + + /// + /// Gets snap-animation's AlphaFunction. + /// + /// Current easing alpha function of the snap animation. + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public AlphaFunction GetScrollSnapAlphaFunction() + { + AlphaFunction ret = new AlphaFunction(Interop.ScrollView.GetScrollSnapAlphaFunction(SwigCPtr), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Sets snap-animation's AlphaFunction. + /// + /// Easing alpha function of the snap animation. + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public void SetScrollSnapAlphaFunction(AlphaFunction alpha) + { + Interop.ScrollView.SetScrollSnapAlphaFunction(SwigCPtr, AlphaFunction.getCPtr(alpha)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Gets flick-animation's AlphaFunction. + /// + /// Current easing alpha function of the flick animation. + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public AlphaFunction GetScrollFlickAlphaFunction() + { + AlphaFunction ret = new AlphaFunction(Interop.ScrollView.GetScrollFlickAlphaFunction(SwigCPtr), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Sets flick-animation's AlphaFunction. + /// + /// Easing alpha function of the flick animation. + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public void SetScrollFlickAlphaFunction(AlphaFunction alpha) + { + Interop.ScrollView.SetScrollFlickAlphaFunction(SwigCPtr, AlphaFunction.getCPtr(alpha)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Gets the time for the scroll snap-animation. + /// + /// The time in seconds for the animation to take. + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public float GetScrollSnapDuration() + { + float ret = Interop.ScrollView.GetScrollSnapDuration(SwigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Sets the time for the scroll snap-animation. + /// + /// The time in seconds for the animation to take. + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public void SetScrollSnapDuration(float time) + { + Interop.ScrollView.SetScrollSnapDuration(SwigCPtr, time); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Gets the time for the scroll flick-animation. + /// + /// The time in seconds for the animation to take. + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public float GetScrollFlickDuration() + { + float ret = Interop.ScrollView.GetScrollFlickDuration(SwigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Sets the time for the scroll snap-animation. + /// + /// The time in seconds for the animation to take. + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public void SetScrollFlickDuration(float time) + { + Interop.ScrollView.SetScrollFlickDuration(SwigCPtr, time); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Sets scroll sensibility of pan gesture. + /// + /// True to enable scroll, false to disable scrolling. + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public void SetScrollSensitive(bool sensitive) + { + Interop.ScrollView.SetScrollSensitive(SwigCPtr, sensitive); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Sets maximum overshoot amount. + /// + /// The maximum number of horizontally scrolled pixels before overshoot X reaches 1.0f. + /// The maximum number of vertically scrolled pixels before overshoot X reaches 1.0f. + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public void SetMaxOvershoot(float overshootX, float overshootY) + { + Interop.ScrollView.SetMaxOvershoot(SwigCPtr, overshootX, overshootY); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Sets Snap Overshoot animation's AlphaFunction. + /// + /// Easing alpha function of the overshoot snap animation. + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public void SetSnapOvershootAlphaFunction(AlphaFunction alpha) + { + Interop.ScrollView.SetSnapOvershootAlphaFunction(SwigCPtr, AlphaFunction.getCPtr(alpha)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Sets Snap Overshoot animation's Duration. + /// + /// duration The duration of the overshoot snap animation. + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public void SetSnapOvershootDuration(float duration) + { + Interop.ScrollView.SetSnapOvershootDuration(SwigCPtr, duration); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Enables or Disables Actor Auto-Snap mode.
+ /// When Actor Auto-Snap mode has been enabled, ScrollView will automatically, + /// snap to the closest actor (The closest actor will appear in the center of the ScrollView). + ///
+ /// Enables (true), or disables (false) Actor AutoSnap. + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public void SetViewAutoSnap(bool enable) + { + Interop.ScrollView.SetActorAutoSnap(SwigCPtr, enable); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Enables or Disables Wrap mode for ScrollView contents.
+ /// When enabled, the ScrollView contents are wrapped over the X/Y Domain. + ///
+ /// Enables (true), or disables (false) Wrap Mode. + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public void SetWrapMode(bool enable) + { + Interop.ScrollView.SetWrapMode(SwigCPtr, enable); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Gets the current distance needed to scroll for ScrollUpdatedSignal to be emitted. + /// + /// Current scroll update distance. + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public int GetScrollUpdateDistance() + { + int ret = Interop.ScrollView.GetScrollUpdateDistance(SwigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Sets the distance needed to scroll for ScrollUpdatedSignal to be emitted.
+ /// The scroll update distance tells ScrollView how far to move before ScrollUpdatedSignal the informs application.
+ /// Each time the ScrollView crosses this distance the signal will be emitted.
+ ///
+ /// The distance for ScrollView to move before emitting update signal. + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public void SetScrollUpdateDistance(int distance) + { + Interop.ScrollView.SetScrollUpdateDistance(SwigCPtr, distance); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Returns state of Axis Auto Lock mode. + /// + /// Whether Axis Auto Lock mode has been enabled or not. + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool GetAxisAutoLock() + { + bool ret = Interop.ScrollView.GetAxisAutoLock(SwigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Enables or Disables Axis Auto Lock mode for panning within the ScrollView.
+ /// When enabled, any pan gesture that appears mostly horizontal or mostly + /// vertical, will be automatically restricted to horizontal only or vertical + /// only panning, until the pan gesture has completed. + ///
+ /// Enables (true), or disables (false) AxisAutoLock mode. + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public void SetAxisAutoLock(bool enable) + { + Interop.ScrollView.SetAxisAutoLock(SwigCPtr, enable); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Gets the gradient threshold at which a panning gesture should be locked to the Horizontal or Vertical axis. + /// + /// The gradient, a value between 0.0 and 1.0f. + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public float GetAxisAutoLockGradient() + { + float ret = Interop.ScrollView.GetAxisAutoLockGradient(SwigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Sets the gradient threshold at which a panning gesture should be locked to the Horizontal or Vertical axis.
+ /// By default, this is 0.36 (0.36:1) which means angles less than 20 degrees to an axis will lock to that axis.
+ ///
+ /// gradient A value between 0.0 and 1.0 (auto-lock for all angles). + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public void SetAxisAutoLockGradient(float gradient) + { + Interop.ScrollView.SetAxisAutoLockGradient(SwigCPtr, gradient); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Gets the friction coefficient setting for ScrollView when flicking in free panning mode. + /// This is a value in stage-diagonals per second^2, stage-diagonal = Length( stage.width, stage.height ) + /// + /// Friction coefficient is returned. + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public float GetFrictionCoefficient() + { + float ret = Interop.ScrollView.GetFrictionCoefficient(SwigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Sets the friction coefficient for ScrollView when flicking.
+ ///
+ /// Friction coefficient must be greater than 0.0 (default = 1.0). + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public void SetFrictionCoefficient(float friction) + { + Interop.ScrollView.SetFrictionCoefficient(SwigCPtr, friction); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Gets the flick speed coefficient for ScrollView when flicking in free panning mode.
+ /// This is a constant which multiplies the input touch flick velocity to determine the actual velocity at which to move the scrolling area. + ///
+ /// The flick speed coefficient is returned. + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public float GetFlickSpeedCoefficient() + { + float ret = Interop.ScrollView.GetFlickSpeedCoefficient(SwigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Sets the flick speed coefficient for ScrollView when flicking in free panning mode.
+ /// This is a constant which multiplies the input touch flick velocity to determine the actual velocity at + /// which to move the scrolling area.
+ ///
+ /// The flick speed coefficient (default = 1.0). + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public void SetFlickSpeedCoefficient(float speed) + { + Interop.ScrollView.SetFlickSpeedCoefficient(SwigCPtr, speed); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Gets the minimum pan distance required for a flick gesture in pixels.
+ ///
+ /// Minimum pan distance vector with separate x and y distance. + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public Vector2 GetMinimumDistanceForFlick() + { + Vector2 ret = new Vector2(Interop.ScrollView.GetMinimumDistanceForFlick(SwigCPtr), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Sets the minimum pan distance required for a flick in pixels.
+ /// Takes a Vector2 containing separate x and y values. As long as the pan distance exceeds one of these axes, a flick will be allowed. + ///
+ /// The flick speed coefficient (default = 1.0). + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public void SetMinimumDistanceForFlick(Vector2 distance) + { + Interop.ScrollView.SetMinimumDistanceForFlick(SwigCPtr, Vector2.getCPtr(distance)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Returns the minimum pan speed required for a flick gesture in pixels per second. + /// + /// Minimum pan speed. + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public float GetMinimumSpeedForFlick() + { + float ret = Interop.ScrollView.GetMinimumSpeedForFlick(SwigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Sets the minimum pan speed required for a flick in pixels per second.
+ ///
+ /// The minimum pan speed for a flick. + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public void SetMinimumSpeedForFlick(float speed) + { + Interop.ScrollView.SetMinimumSpeedForFlick(SwigCPtr, speed); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Gets the maximum flick speed setting for ScrollView when flicking in free panning mode.
+ /// This is a value in stage-diagonals per second. + ///
+ /// Maximum flick speed is returned. + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public float GetMaxFlickSpeed() + { + float ret = Interop.ScrollView.GetMaxFlickSpeed(SwigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Sets the maximum flick speed for the ScrollView when flicking in free panning mode.
+ /// This is a value in stage-diagonals per second. stage-diagonal = Length( stage.width, stage.height ).
+ ///
+ /// Maximum flick speed (default = 3.0). + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public void SetMaxFlickSpeed(float speed) + { + Interop.ScrollView.SetMaxFlickSpeed(SwigCPtr, speed); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Gets the step of scroll distance in actor coordinates for each wheel event received in free panning mode.
+ ///
+ /// The step of scroll distance(pixel) in X and Y axes. + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public Vector2 GetWheelScrollDistanceStep() + { + Vector2 ret = new Vector2(Interop.ScrollView.GetWheelScrollDistanceStep(SwigCPtr), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Sets the step of scroll distance in actor coordinates for each wheel event received in free panning mode.
+ ///
+ /// step The step of scroll distance(pixel) in X and Y axes. + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public void SetWheelScrollDistanceStep(Vector2 step) + { + Interop.ScrollView.SetWheelScrollDistanceStep(SwigCPtr, Vector2.getCPtr(step)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Retrieves current scroll position.
+ ///
+ /// The current scroll position. + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public Vector2 GetCurrentScrollPosition() + { + Vector2 ret = new Vector2(Interop.ScrollView.GetCurrentScrollPosition(SwigCPtr), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Retrieves current scroll page based on ScrollView dimensions being the size of one page, and all pages laid out in
+ /// a grid fashion, increasing from left to right until the end of the X-domain. + ///
+ /// The current scroll position. + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public uint GetCurrentPage() + { + uint ret = Interop.ScrollView.GetCurrentPage(SwigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Scrolls View to position specified (contents will scroll to this position). + /// + /// The position to scroll to. + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public void ScrollTo(Vector2 position) + { + Interop.ScrollView.ScrollToVector2(SwigCPtr, Vector2.getCPtr(position)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Scrolls View to position specified (contents will scroll to this position). + /// + /// The position to scroll to. + /// The duration of the animation in seconds. + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public void ScrollTo(Vector2 position, float duration) + { + Interop.ScrollView.ScrollTo(SwigCPtr, Vector2.getCPtr(position), duration); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Scrolls View to position specified (contents will scroll to this position). + /// + /// The position to scroll to. + /// The duration of the animation in seconds. + /// The alpha function to use. + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public void ScrollTo(Vector2 position, float duration, AlphaFunction alpha) + { + Interop.ScrollView.ScrollTo(SwigCPtr, Vector2.getCPtr(position), duration, AlphaFunction.getCPtr(alpha)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Scrolls View to position specified (contents will scroll to this position). + /// + /// The position to scroll to. + /// The duration of the animation in seconds. + /// Whether to bias scrolling to left or right. + /// Whether to bias scrolling to top or bottom. + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public void ScrollTo(Vector2 position, float duration, DirectionBias horizontalBias, DirectionBias verticalBias) + { + Interop.ScrollView.ScrollTo(SwigCPtr, Vector2.getCPtr(position), duration, (int)horizontalBias, (int)verticalBias); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Scrolls View to position specified (contents will scroll to this position). + /// + /// The position to scroll to. + /// The duration of the animation in seconds. + /// Alpha function to use. + /// Whether to bias scrolling to left or right. + /// Whether to bias scrolling to top or bottom. + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public void ScrollTo(Vector2 position, float duration, AlphaFunction alpha, DirectionBias horizontalBias, DirectionBias verticalBias) + { + Interop.ScrollView.ScrollTo(SwigCPtr, Vector2.getCPtr(position), duration, AlphaFunction.getCPtr(alpha), (int)horizontalBias, (int)verticalBias); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Scrolls View to position specified (contents will scroll to this position). + /// + /// The page to scroll to. + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public void ScrollTo(uint page) + { + Interop.ScrollView.ScrollTo(SwigCPtr, page); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Scrolls View to position specified (contents will scroll to this position). + /// + /// The page to scroll to. + /// The duration of the animation in seconds. + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public void ScrollTo(uint page, float duration) + { + Interop.ScrollView.ScrollTo(SwigCPtr, page, duration); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Scrolls View to position specified (contents will scroll to this position). + /// + /// The page to scroll to. + /// The duration of the animation in seconds. + /// Whether to bias scrolling to left or right. + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public void ScrollTo(uint page, float duration, DirectionBias bias) + { + Interop.ScrollView.ScrollTo(SwigCPtr, page, duration, (int)bias); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Scrolls View to position specified (contents will scroll to this position). + /// + /// The view to center in on (via Scrolling). + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public void ScrollTo(View view) + { + Interop.ScrollView.ScrollToView(SwigCPtr, View.getCPtr(view)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Scrolls View to position specified (contents will scroll to this position). + /// + /// The view to center in on (via Scrolling). + /// The duration of the animation in seconds. + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public void ScrollTo(View view, float duration) + { + Interop.ScrollView.ScrollToViewDuration(SwigCPtr, View.getCPtr(view), duration); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Scrolls View to the nearest snap points as specified by the Rulers.
+ /// If already at snap points, then will return false, and not scroll.
+ ///
+ /// True if Snapping necessary. + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool ScrollToSnapPoint() + { + bool ret = Interop.ScrollView.ScrollToSnapPoint(SwigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Applies Effect to ScrollView. + /// + /// The effect to apply to scroll view. + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public void ApplyEffect(ScrollViewEffect effect) + { + Interop.ScrollView.ApplyEffect(SwigCPtr, ScrollViewEffect.getCPtr(effect)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Removes Effect from ScrollView. + /// + /// The effect to remove. + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public void RemoveEffect(ScrollViewEffect effect) + { + Interop.ScrollView.RemoveEffect(SwigCPtr, ScrollViewEffect.getCPtr(effect)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Remove All Effects from ScrollView. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public void RemoveAllEffects() + { + Interop.ScrollView.RemoveAllEffects(SwigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Binds view to this ScrollView. + /// Once an actor is bound to a ScrollView, it will be subject to that ScrollView's properties. + /// + /// The view to add to this ScrollView. + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public void BindView(View child) + { + Interop.ScrollView.BindActor(SwigCPtr, View.getCPtr(child)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Unbinds view to this ScrollView. + /// Once an actor is bound to a ScrollView, it will be subject to that ScrollView's properties. + /// + /// The view to remove to this ScrollView. + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public void UnbindView(View child) + { + Interop.ScrollView.UnbindActor(SwigCPtr, View.getCPtr(child)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Allows the user to constrain the scroll view in a particular direction. + /// + /// The axis to constrain the scroll-view to. + /// The threshold to apply around the axis. + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public void SetScrollingDirection(Radian direction, Radian threshold) + { + Interop.ScrollView.SetScrollingDirection(SwigCPtr, Radian.getCPtr(direction), Radian.getCPtr(threshold)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Allows the user to constrain the scroll view in a particular direction. + /// + /// The axis to constrain the scroll-view to. + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public void SetScrollingDirection(Radian direction) + { + Interop.ScrollView.SetScrollingDirection(SwigCPtr, Radian.getCPtr(direction)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Removes a direction constraint from the scroll view. + /// + /// The axis to constrain the scroll-view to. + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public void RemoveScrollingDirection(Radian direction) + { + Interop.ScrollView.RemoveScrollingDirection(SwigCPtr, Radian.getCPtr(direction)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Set ruler X + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public void SetRulerX(RulerPtr ruler) + { + Interop.ScrollView.SetRulerX(SwigCPtr, RulerPtr.getCPtr(ruler)); + } + + /// + /// Set ruler Y + /// + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public void SetRulerY(RulerPtr ruler) + { + Interop.ScrollView.SetRulerY(SwigCPtr, RulerPtr.getCPtr(ruler)); + } + + internal void ApplyConstraintToChildren(SWIGTYPE_p_Dali__Constraint constraint) + { + Interop.ScrollView.ApplyConstraintToChildren(SwigCPtr, SWIGTYPE_p_Dali__Constraint.getCPtr(constraint)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Dispose + /// + /// the dispose type + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + protected override void Dispose(DisposeTypes type) + { + if (disposed) + { + return; + } + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + + if (this != null && _scrollViewSnapStartedCallbackDelegate != null) + { + ScrollViewSnapStartedSignal snapStarted = this.SnapStartedSignal(); + snapStarted?.Disconnect(_scrollViewSnapStartedCallbackDelegate); + snapStarted?.Dispose(); + } + + base.Dispose(type); + } + + /// This will not be public opened. + [EditorBrowsable(EditorBrowsableState.Never)] + protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr) + { + Interop.ScrollView.DeleteScrollView(swigCPtr); + } + + /// + /// This should be internal, please do not use. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] +#pragma warning disable CA1716, CA1052, CA1034 // Identifiers should not match keywords + public new class Property +#pragma warning restore CA1716, CA1052, CA1034 // Identifiers should not match keywords + { + /// + /// This should be internal, please do not use. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly int WrapEnabled = Interop.ScrollView.WrapEnabledGet(); + /// + /// This should be internal, please do not use. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly int PanningEnabled = Interop.ScrollView.PanningEnabledGet(); + /// + /// This should be internal, please do not use. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly int AxisAutoLockEnabled = Interop.ScrollView.AxisAutoLockEnabledGet(); + /// + /// This should be internal, please do not use. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly int WheelScrollDistanceStep = Interop.ScrollView.WheelScrollDistanceStepGet(); + /// + /// This should be internal, please do not use. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly int ScrollMode = Interop.ScrollView.ScrollModeGet(); + /// + /// This should be internal, please do not use. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly int ScrollPosition = Interop.ScrollView.ScrollPositionGet(); + /// + /// This should be internal, please do not use. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly int ScrollPrePosition = Interop.ScrollView.ScrollPrePositionGet(); + /// + /// This should be internal, please do not use. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly int ScrollPrePositionX = Interop.ScrollView.ScrollPrePositionXGet(); + /// + /// This should be internal, please do not use. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly int ScrollPrePositionY = Interop.ScrollView.ScrollPrePositionYGet(); + /// + /// This should be internal, please do not use. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly int ScrollPrePositionMax = Interop.ScrollView.ScrollPrePositionMaxGet(); + /// + /// This should be internal, please do not use. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly int ScrollPrePositionMaxX = Interop.ScrollView.ScrollPrePositionMaxXGet(); + /// + /// This should be internal, please do not use. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly int ScrollPrePositionMaxY = Interop.ScrollView.ScrollPrePositionMaxYGet(); + /// + /// This should be internal, please do not use. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly int OvershootX = Interop.ScrollView.OvershootXGet(); + /// + /// This should be internal, please do not use. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly int OvershootY = Interop.ScrollView.OvershootYGet(); + /// + /// This should be internal, please do not use. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly int ScrollFinal = Interop.ScrollView.ScrollFinalGet(); + /// + /// This should be internal, please do not use. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly int ScrollFinalX = Interop.ScrollView.ScrollFinalXGet(); + /// + /// This should be internal, please do not use. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly int ScrollFinalY = Interop.ScrollView.ScrollFinalYGet(); + /// + /// This should be internal, please do not use. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly int WRAP = Interop.ScrollView.WrapGet(); + /// + /// This should be internal, please do not use. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly int PANNING = Interop.ScrollView.PanningGet(); + /// + /// This should be internal, please do not use. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly int SCROLLING = Interop.ScrollView.ScrollingGet(); + /// + /// This should be internal, please do not use. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly int ScrollDomainSize = Interop.ScrollView.ScrollDomainSizeGet(); + /// + /// This should be internal, please do not use. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly int ScrollDomainSizeX = Interop.ScrollView.ScrollDomainSizeXGet(); + /// + /// This should be internal, please do not use. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly int ScrollDomainSizeY = Interop.ScrollView.ScrollDomainSizeYGet(); + /// + /// This should be internal, please do not use. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly int ScrollDomainOffset = Interop.ScrollView.ScrollDomainOffsetGet(); + /// + /// This should be internal, please do not use. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly int ScrollPositionDelta = Interop.ScrollView.ScrollPositionDeltaGet(); + /// + /// This should be internal, please do not use. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly int StartPagePosition = Interop.ScrollView.StartPagePositionGet(); + } + } +} + diff --git a/src/Tizen.NUI/src/public/UIComponents/ScrollViewBindableProperty.cs b/src/Tizen.NUI/src/public/UIComponents/ScrollViewBindableProperty.cs new file mode 100755 index 0000000..f775176 --- /dev/null +++ b/src/Tizen.NUI/src/public/UIComponents/ScrollViewBindableProperty.cs @@ -0,0 +1,356 @@ +/* + * Copyright(c) 2019 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +using System; +using System.ComponentModel; +using Tizen.NUI.Binding; + +namespace Tizen.NUI +{ + /// + /// ScrollView contains views that can be scrolled manually (via touch). + /// + /// 3 + public partial class ScrollView + { + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty WrapEnabledProperty = BindableProperty.Create(nameof(WrapEnabled), typeof(bool), typeof(ScrollView), false, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var scrollView = (ScrollView)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)scrollView.SwigCPtr, ScrollView.Property.WrapEnabled, new Tizen.NUI.PropertyValue((bool)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var scrollView = (ScrollView)bindable; + bool temp = false; + Tizen.NUI.Object.GetProperty((System.Runtime.InteropServices.HandleRef)scrollView.SwigCPtr, ScrollView.Property.WrapEnabled).Get(out temp); + return temp; + })); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty PanningEnabledProperty = BindableProperty.Create(nameof(PanningEnabled), typeof(bool), typeof(ScrollView), false, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var scrollView = (ScrollView)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)scrollView.SwigCPtr, ScrollView.Property.PanningEnabled, new Tizen.NUI.PropertyValue((bool)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var scrollView = (ScrollView)bindable; + bool temp = false; + Tizen.NUI.Object.GetProperty((System.Runtime.InteropServices.HandleRef)scrollView.SwigCPtr, ScrollView.Property.PanningEnabled).Get(out temp); + return temp; + })); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty AxisAutoLockEnabledProperty = BindableProperty.Create(nameof(AxisAutoLockEnabled), typeof(bool), typeof(ScrollView), false, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var scrollView = (ScrollView)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)scrollView.SwigCPtr, ScrollView.Property.AxisAutoLockEnabled, new Tizen.NUI.PropertyValue((bool)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var scrollView = (ScrollView)bindable; + bool temp = false; + Tizen.NUI.Object.GetProperty((System.Runtime.InteropServices.HandleRef)scrollView.SwigCPtr, ScrollView.Property.AxisAutoLockEnabled).Get(out temp); + return temp; + })); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty WheelScrollDistanceStepProperty = BindableProperty.Create(nameof(WheelScrollDistanceStep), typeof(Vector2), typeof(ScrollView), Vector2.Zero, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var scrollView = (ScrollView)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)scrollView.SwigCPtr, ScrollView.Property.WheelScrollDistanceStep, new Tizen.NUI.PropertyValue((Vector2)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var scrollView = (ScrollView)bindable; + Vector2 temp = new Vector2(0.0f, 0.0f); + Tizen.NUI.Object.GetProperty((System.Runtime.InteropServices.HandleRef)scrollView.SwigCPtr, ScrollView.Property.WheelScrollDistanceStep).Get(temp); + return temp; + })); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty ScrollPositionProperty = BindableProperty.Create(nameof(ScrollPosition), typeof(Vector2), typeof(ScrollView), Vector2.Zero, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var scrollView = (ScrollView)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)scrollView.SwigCPtr, ScrollView.Property.ScrollPosition, new Tizen.NUI.PropertyValue((Vector2)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var scrollView = (ScrollView)bindable; + Vector2 temp = new Vector2(0.0f, 0.0f); + Tizen.NUI.Object.GetProperty((System.Runtime.InteropServices.HandleRef)scrollView.SwigCPtr, ScrollView.Property.ScrollPosition).Get(temp); + return temp; + })); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty ScrollPrePositionProperty = BindableProperty.Create(nameof(ScrollPrePosition), typeof(Vector2), typeof(ScrollView), Vector2.Zero, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var scrollView = (ScrollView)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)scrollView.SwigCPtr, ScrollView.Property.ScrollPrePosition, new Tizen.NUI.PropertyValue((Vector2)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var scrollView = (ScrollView)bindable; + Vector2 temp = new Vector2(0.0f, 0.0f); + Tizen.NUI.Object.GetProperty((System.Runtime.InteropServices.HandleRef)scrollView.SwigCPtr, ScrollView.Property.ScrollPrePosition).Get(temp); + return temp; + })); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty ScrollPrePositionMaxProperty = BindableProperty.Create(nameof(ScrollPrePositionMax), typeof(Vector2), typeof(ScrollView), Vector2.Zero, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var scrollView = (ScrollView)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)scrollView.SwigCPtr, ScrollView.Property.ScrollPrePositionMax, new Tizen.NUI.PropertyValue((Vector2)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var scrollView = (ScrollView)bindable; + Vector2 temp = new Vector2(0.0f, 0.0f); + Tizen.NUI.Object.GetProperty((System.Runtime.InteropServices.HandleRef)scrollView.SwigCPtr, ScrollView.Property.ScrollPrePositionMax).Get(temp); + return temp; + })); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty OvershootXProperty = BindableProperty.Create(nameof(OvershootX), typeof(float), typeof(ScrollView), default(float), propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var scrollView = (ScrollView)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)scrollView.SwigCPtr, ScrollView.Property.OvershootX, new Tizen.NUI.PropertyValue((float)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var scrollView = (ScrollView)bindable; + float temp = 0.0f; + Tizen.NUI.Object.GetProperty((System.Runtime.InteropServices.HandleRef)scrollView.SwigCPtr, ScrollView.Property.OvershootX).Get(out temp); + return temp; + })); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty OvershootYProperty = BindableProperty.Create(nameof(OvershootY), typeof(float), typeof(ScrollView), default(float), propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var scrollView = (ScrollView)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)scrollView.SwigCPtr, ScrollView.Property.OvershootY, new Tizen.NUI.PropertyValue((float)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var scrollView = (ScrollView)bindable; + float temp = 0.0f; + Tizen.NUI.Object.GetProperty((System.Runtime.InteropServices.HandleRef)scrollView.SwigCPtr, ScrollView.Property.OvershootY).Get(out temp); + return temp; + })); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty ScrollFinalProperty = BindableProperty.Create(nameof(ScrollFinal), typeof(Vector2), typeof(ScrollView), Vector2.Zero, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var scrollView = (ScrollView)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)scrollView.SwigCPtr, ScrollView.Property.ScrollFinal, new Tizen.NUI.PropertyValue((Vector2)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var scrollView = (ScrollView)bindable; + Vector2 temp = new Vector2(0.0f, 0.0f); + Tizen.NUI.Object.GetProperty((System.Runtime.InteropServices.HandleRef)scrollView.SwigCPtr, ScrollView.Property.ScrollFinal).Get(temp); + return temp; + })); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty WrapProperty = BindableProperty.Create(nameof(Wrap), typeof(bool), typeof(ScrollView), false, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var scrollView = (ScrollView)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)scrollView.SwigCPtr, ScrollView.Property.WRAP, new Tizen.NUI.PropertyValue((bool)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var scrollView = (ScrollView)bindable; + bool temp = false; + Tizen.NUI.Object.GetProperty((System.Runtime.InteropServices.HandleRef)scrollView.SwigCPtr, ScrollView.Property.WRAP).Get(out temp); + return temp; + })); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty PanningProperty = BindableProperty.Create(nameof(Panning), typeof(bool), typeof(ScrollView), false, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var scrollView = (ScrollView)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)scrollView.SwigCPtr, ScrollView.Property.PANNING, new Tizen.NUI.PropertyValue((bool)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var scrollView = (ScrollView)bindable; + bool temp = false; + Tizen.NUI.Object.GetProperty((System.Runtime.InteropServices.HandleRef)scrollView.SwigCPtr, ScrollView.Property.PANNING).Get(out temp); + return temp; + })); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty ScrollingProperty = BindableProperty.Create(nameof(Scrolling), typeof(bool), typeof(ScrollView), false, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var scrollView = (ScrollView)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)scrollView.SwigCPtr, ScrollView.Property.SCROLLING, new Tizen.NUI.PropertyValue((bool)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var scrollView = (ScrollView)bindable; + bool temp = false; + Tizen.NUI.Object.GetProperty((System.Runtime.InteropServices.HandleRef)scrollView.SwigCPtr, ScrollView.Property.SCROLLING).Get(out temp); + return temp; + })); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty ScrollDomainSizeProperty = BindableProperty.Create(nameof(ScrollDomainSize), typeof(Vector2), typeof(ScrollView), Vector2.Zero, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var scrollView = (ScrollView)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)scrollView.SwigCPtr, ScrollView.Property.ScrollDomainSize, new Tizen.NUI.PropertyValue((Vector2)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var scrollView = (ScrollView)bindable; + Vector2 temp = new Vector2(0.0f, 0.0f); + Tizen.NUI.Object.GetProperty((System.Runtime.InteropServices.HandleRef)scrollView.SwigCPtr, ScrollView.Property.ScrollDomainSize).Get(temp); + return temp; + })); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty ScrollDomainOffsetProperty = BindableProperty.Create(nameof(ScrollDomainOffset), typeof(Vector2), typeof(ScrollView), Vector2.Zero, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var scrollView = (ScrollView)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)scrollView.SwigCPtr, ScrollView.Property.ScrollDomainOffset, new Tizen.NUI.PropertyValue((Vector2)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var scrollView = (ScrollView)bindable; + Vector2 temp = new Vector2(0.0f, 0.0f); + Tizen.NUI.Object.GetProperty((System.Runtime.InteropServices.HandleRef)scrollView.SwigCPtr, ScrollView.Property.ScrollDomainOffset).Get(temp); + return temp; + })); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty ScrollPositionDeltaProperty = BindableProperty.Create(nameof(ScrollPositionDelta), typeof(Vector2), typeof(ScrollView), Vector2.Zero, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var scrollView = (ScrollView)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)scrollView.SwigCPtr, ScrollView.Property.ScrollPositionDelta, new Tizen.NUI.PropertyValue((Vector2)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var scrollView = (ScrollView)bindable; + Vector2 temp = new Vector2(0.0f, 0.0f); + Tizen.NUI.Object.GetProperty((System.Runtime.InteropServices.HandleRef)scrollView.SwigCPtr, ScrollView.Property.ScrollPositionDelta).Get(temp); + return temp; + })); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty StartPagePositionProperty = BindableProperty.Create(nameof(StartPagePosition), typeof(Vector3), typeof(ScrollView), Vector3.Zero, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var scrollView = (ScrollView)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)scrollView.SwigCPtr, ScrollView.Property.StartPagePosition, new Tizen.NUI.PropertyValue((Vector3)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var scrollView = (ScrollView)bindable; + Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f); + Tizen.NUI.Object.GetProperty((System.Runtime.InteropServices.HandleRef)scrollView.SwigCPtr, ScrollView.Property.StartPagePosition).Get(temp); + return temp; + })); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty ScrollModeProperty = BindableProperty.Create(nameof(ScrollMode), typeof(PropertyMap), typeof(ScrollView), new PropertyMap(), propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var scrollView = (ScrollView)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)scrollView.SwigCPtr, ScrollView.Property.ScrollMode, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var scrollView = (ScrollView)bindable; + PropertyValue value = Tizen.NUI.Object.GetProperty((System.Runtime.InteropServices.HandleRef)scrollView.SwigCPtr, ScrollView.Property.ScrollMode); + PropertyMap map = new PropertyMap(); + value.Get(map); + return map; + })); + } +} diff --git a/src/Tizen.NUI/src/public/UIComponents/ScrollViewEvent.cs b/src/Tizen.NUI/src/public/UIComponents/ScrollViewEvent.cs new file mode 100755 index 0000000..0aacaa3 --- /dev/null +++ b/src/Tizen.NUI/src/public/UIComponents/ScrollViewEvent.cs @@ -0,0 +1,283 @@ +/* + * Copyright(c) 2019 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +using System; +using System.ComponentModel; +using System.Runtime.InteropServices; + +namespace Tizen.NUI +{ + /// + /// ScrollView contains views that can be scrolled manually (via touch). + /// + /// 3 + public partial class ScrollView + { + private DaliEventHandler _scrollViewSnapStartedEventHandler; + private SnapStartedCallbackDelegate _scrollViewSnapStartedCallbackDelegate; + + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate void SnapStartedCallbackDelegate(IntPtr data); + + /// + /// SnapStarted can be used to subscribe or unsubscribe the event handler + /// The SnapStarted signal is emitted when the ScrollView has started to snap or flick (it tells the target + /// position, scale, rotation for the snap or flick). + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public event DaliEventHandler SnapStarted + { + add + { + // Restricted to only one listener + if (_scrollViewSnapStartedEventHandler == null) + { + _scrollViewSnapStartedEventHandler += value; + + _scrollViewSnapStartedCallbackDelegate = new SnapStartedCallbackDelegate(OnSnapStarted); + ScrollViewSnapStartedSignal snapStarted = this.SnapStartedSignal(); + snapStarted?.Connect(_scrollViewSnapStartedCallbackDelegate); + snapStarted?.Dispose(); + } + } + + remove + { + if (_scrollViewSnapStartedEventHandler != null) + { + ScrollViewSnapStartedSignal snapStarted = this.SnapStartedSignal(); + snapStarted?.Disconnect(_scrollViewSnapStartedCallbackDelegate); + snapStarted?.Dispose(); + } + + _scrollViewSnapStartedEventHandler -= value; + } + } + + internal ScrollViewSnapStartedSignal SnapStartedSignal() + { + ScrollViewSnapStartedSignal ret = new ScrollViewSnapStartedSignal(Interop.ScrollView.SnapStartedSignal(SwigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + // Callback for ScrollView SnapStarted signal + private void OnSnapStarted(IntPtr data) + { + SnapStartedEventArgs e = new SnapStartedEventArgs(); + + // Populate all members of "e" (SnapStartedEventArgs) with real data + e.SnapEventInfo = SnapEvent.GetSnapEventFromPtr(data); + + if (_scrollViewSnapStartedEventHandler != null) + { + //here we send all data to user event handlers + _scrollViewSnapStartedEventHandler(this, e); + } + } + + /// + /// Snaps signal event's data. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")] + public class SnapEvent : Disposable + { + /// + /// swigCMemOwn + /// + /// 3 + /// It will be removed in API9 + // ToDo : will proceed ACR as private bool swigCMemOwn; + [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1051:Do not declare visible instance fields")] + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + protected bool swigCMemOwn; + private global::System.Runtime.InteropServices.HandleRef swigCPtr; + + /// + /// Create an instance of SnapEvent. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public SnapEvent() : this(Interop.ScrollView.NewScrollViewSnapEvent(), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal SnapEvent(global::System.IntPtr cPtr, bool cMemoryOwn) + { + swigCMemOwn = cMemoryOwn; + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + } + + /// + /// Scroll position. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public Vector2 position + { + set + { + Interop.ScrollView.SnapEventPositionSet(swigCPtr, Vector2.getCPtr(value)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + get + { + global::System.IntPtr cPtr = Interop.ScrollView.SnapEventPositionGet(swigCPtr); + Vector2 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector2(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve()); + return ret; + } + } + + /// + /// Scroll duration. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public float duration + { + set + { + Interop.ScrollView.SnapEventDurationSet(swigCPtr, value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + get + { + float ret = Interop.ScrollView.SnapEventDurationGet(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve()); + return ret; + } + } + + internal SnapType type + { + set + { + Interop.ScrollView.SnapEventTypeSet(swigCPtr, (int)value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + get + { + SnapType ret = (SnapType)Interop.ScrollView.SnapEventTypeGet(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } + + /// + /// Get SnapEvent From Ptr + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6, Will be removed in API9, " + + "Please use SnapStarted event instead!" + + "IntPtr(native integer pointer) is supposed to be not used in Application!")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static SnapEvent GetSnapEventFromPtr(global::System.IntPtr cPtr) + { + SnapEvent ret = new SnapEvent(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(SnapEvent obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + + /// + /// Dispose + /// + /// the dispose type + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + protected override void Dispose(DisposeTypes type) + { + if (disposed) + { + return; + } + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + + if (swigCPtr.Handle != global::System.IntPtr.Zero) + { + if (swigCMemOwn) + { + swigCMemOwn = false; + Interop.ScrollView.DeleteScrollViewSnapEvent(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + + base.Dispose(type); + } + + } + + /// + /// Event arguments that passed via the SnapStarted signal. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")] + public class SnapStartedEventArgs : EventArgs + { + private Tizen.NUI.ScrollView.SnapEvent _snapEvent; + + /// + /// SnapEventInfo is the SnapEvent information like snap or flick (it tells the target position, scale, rotation for the snap or flick). + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public Tizen.NUI.ScrollView.SnapEvent SnapEventInfo + { + get + { + return _snapEvent; + } + set + { + _snapEvent = value; + } + } + } + } +} diff --git a/src/Tizen.NUI/src/public/UIComponents/Slider.cs b/src/Tizen.NUI/src/public/UIComponents/Slider.cs new file mode 100755 index 0000000..312269e --- /dev/null +++ b/src/Tizen.NUI/src/public/UIComponents/Slider.cs @@ -0,0 +1,1098 @@ +/* + * Copyright(c) 2018 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +using System; +using System.Runtime.InteropServices; +using System.ComponentModel; +using Tizen.NUI.BaseComponents; +using Tizen.NUI.Binding; +using Tizen.NUI.Binding.Internals; + +namespace Tizen.NUI.UIComponents +{ + /// + /// The slider is a control to enable sliding an indicator between two values. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public class Slider : View + { + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty LowerBoundProperty = BindableProperty.Create(nameof(LowerBound), typeof(float), typeof(Slider), 0.0f, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var slider = (Slider)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((HandleRef)slider.SwigCPtr, Slider.Property.LowerBound, new Tizen.NUI.PropertyValue((float)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var slider = (Slider)bindable; + float temp = 0.0f; + Tizen.NUI.Object.GetProperty((HandleRef)slider.SwigCPtr, Slider.Property.LowerBound).Get(out temp); + return temp; + })); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty UpperBoundProperty = BindableProperty.Create(nameof(UpperBound), typeof(float), typeof(Slider), 1.0f, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var slider = (Slider)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((HandleRef)slider.SwigCPtr, Slider.Property.UpperBound, new Tizen.NUI.PropertyValue((float)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var slider = (Slider)bindable; + float temp = 0.0f; + Tizen.NUI.Object.GetProperty((HandleRef)slider.SwigCPtr, Slider.Property.UpperBound).Get(out temp); + return temp; + })); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty ValueProperty = BindableProperty.Create(nameof(Value), typeof(float), typeof(Slider), default(float), BindingMode.TwoWay, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var slider = (Slider)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((HandleRef)slider.SwigCPtr, Slider.Property.VALUE, new Tizen.NUI.PropertyValue((float)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var slider = (Slider)bindable; + float temp = 0.0f; + Tizen.NUI.Object.GetProperty((HandleRef)slider.SwigCPtr, Slider.Property.VALUE).Get(out temp); + return temp; + })); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty TrackVisualProperty = BindableProperty.Create(nameof(TrackVisual), typeof(PropertyMap), typeof(Slider), new PropertyMap(), propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var slider = (Slider)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((HandleRef)slider.SwigCPtr, Slider.Property.TrackVisual, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var slider = (Slider)bindable; + PropertyMap temp = new PropertyMap(); + Tizen.NUI.Object.GetProperty((HandleRef)slider.SwigCPtr, Slider.Property.TrackVisual).Get(temp); + return temp; + })); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty HandleVisualProperty = BindableProperty.Create(nameof(HandleVisual), typeof(PropertyMap), typeof(Slider), new PropertyMap(), propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var slider = (Slider)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((HandleRef)slider.SwigCPtr, Slider.Property.HandleVisual, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var slider = (Slider)bindable; + PropertyMap temp = new PropertyMap(); + Tizen.NUI.Object.GetProperty((HandleRef)slider.SwigCPtr, Slider.Property.HandleVisual).Get(temp); + return temp; + })); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty ProgressVisualProperty = BindableProperty.Create(nameof(ProgressVisual), typeof(PropertyMap), typeof(Slider), new PropertyMap(), propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var slider = (Slider)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((HandleRef)slider.SwigCPtr, Slider.Property.ProgressVisual, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var slider = (Slider)bindable; + PropertyMap temp = new PropertyMap(); + Tizen.NUI.Object.GetProperty((HandleRef)slider.SwigCPtr, Slider.Property.ProgressVisual).Get(temp); + return temp; + })); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty PopupVisualProperty = BindableProperty.Create(nameof(PopupVisual), typeof(PropertyMap), typeof(Slider), new PropertyMap(), propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var slider = (Slider)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((HandleRef)slider.SwigCPtr, Slider.Property.PopupVisual, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var slider = (Slider)bindable; + PropertyMap temp = new PropertyMap(); + Tizen.NUI.Object.GetProperty((HandleRef)slider.SwigCPtr, Slider.Property.PopupVisual).Get(temp); + return temp; + })); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty PopupArrowVisualProperty = BindableProperty.Create(nameof(PopupArrowVisual), typeof(PropertyMap), typeof(Slider), new PropertyMap(), propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var slider = (Slider)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((HandleRef)slider.SwigCPtr, Slider.Property.PopupArrowVisual, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var slider = (Slider)bindable; + PropertyMap temp = new PropertyMap(); + Tizen.NUI.Object.GetProperty((HandleRef)slider.SwigCPtr, Slider.Property.PopupArrowVisual).Get(temp); + return temp; + })); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty DisabledColorProperty = BindableProperty.Create(nameof(DisabledColor), typeof(Vector4), typeof(Slider), Vector4.Zero, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var slider = (Slider)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((HandleRef)slider.SwigCPtr, Slider.Property.DisabledColor, new Tizen.NUI.PropertyValue((Vector4)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var slider = (Slider)bindable; + Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f); + Tizen.NUI.Object.GetProperty((HandleRef)slider.SwigCPtr, Slider.Property.DisabledColor).Get(temp); + return temp; + })); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty ValuePrecisionProperty = BindableProperty.Create(nameof(ValuePrecision), typeof(int), typeof(Slider), default(int), propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var slider = (Slider)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((HandleRef)slider.SwigCPtr, Slider.Property.ValuePrecision, new Tizen.NUI.PropertyValue((int)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var slider = (Slider)bindable; + int temp = 0; + Tizen.NUI.Object.GetProperty((HandleRef)slider.SwigCPtr, Slider.Property.ValuePrecision).Get(out temp); + return temp; + })); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty ShowPopupProperty = BindableProperty.Create(nameof(ShowPopup), typeof(bool), typeof(Slider), false, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var slider = (Slider)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((HandleRef)slider.SwigCPtr, Slider.Property.ShowPopup, new Tizen.NUI.PropertyValue((bool)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var slider = (Slider)bindable; + bool temp = false; + Tizen.NUI.Object.GetProperty((HandleRef)slider.SwigCPtr, Slider.Property.ShowPopup).Get(out temp); + return temp; + })); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty ShowValueProperty = BindableProperty.Create(nameof(ShowValue), typeof(bool), typeof(Slider), false, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var slider = (Slider)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((HandleRef)slider.SwigCPtr, Slider.Property.ShowValue, new Tizen.NUI.PropertyValue((bool)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var slider = (Slider)bindable; + bool temp = false; + Tizen.NUI.Object.GetProperty((HandleRef)slider.SwigCPtr, Slider.Property.ShowValue).Get(out temp); + return temp; + })); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty MarksProperty = BindableProperty.Create(nameof(Marks), typeof(PropertyArray), typeof(Slider), new PropertyArray(), propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var slider = (Slider)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((HandleRef)slider.SwigCPtr, Slider.Property.MARKS, new Tizen.NUI.PropertyValue((PropertyArray)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var slider = (Slider)bindable; + Tizen.NUI.PropertyArray temp = new Tizen.NUI.PropertyArray(); + Tizen.NUI.Object.GetProperty((HandleRef)slider.SwigCPtr, Slider.Property.MARKS).Get(temp); + return temp; + })); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty MarkToleranceProperty = BindableProperty.Create(nameof(MarkTolerance), typeof(float), typeof(Slider), default(float), propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var slider = (Slider)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((HandleRef)slider.SwigCPtr, Slider.Property.MarkTolerance, new Tizen.NUI.PropertyValue((float)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var slider = (Slider)bindable; + float temp = 0.0f; + Tizen.NUI.Object.GetProperty((HandleRef)slider.SwigCPtr, Slider.Property.MarkTolerance).Get(out temp); + return temp; + })); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty SnapToMarksProperty = BindableProperty.Create(nameof(SnapToMarks), typeof(bool), typeof(Slider), false, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var slider = (Slider)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((HandleRef)slider.SwigCPtr, Slider.Property.SnapToMarks, new Tizen.NUI.PropertyValue((bool)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var slider = (Slider)bindable; + bool temp = false; + Tizen.NUI.Object.GetProperty((HandleRef)slider.SwigCPtr, Slider.Property.SnapToMarks).Get(out temp); + return temp; + })); + + private EventHandlerWithReturnType _sliderValueChangedEventHandler; + private ValueChangedCallbackDelegate _sliderValueChangedCallbackDelegate; + private EventHandlerWithReturnType _sliderSlidingFinishedEventHandler; + private SlidingFinishedCallbackDelegate _sliderSlidingFinishedCallbackDelegate; + private EventHandlerWithReturnType _sliderMarkReachedEventHandler; + private MarkReachedCallbackDelegate _sliderMarkReachedCallbackDelegate; + + /// + /// Creates the slider control. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public Slider() : this(Interop.Slider.New(), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal Slider(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn) + { + } + + internal Slider(Slider handle) : this(Interop.Slider.NewSlider(Slider.getCPtr(handle)), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate bool ValueChangedCallbackDelegate(IntPtr slider, float slideValue); + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate bool SlidingFinishedCallbackDelegate(IntPtr slider, float slideValue); + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate bool MarkReachedCallbackDelegate(IntPtr slider, int slideValue); + + /// + /// An event emitted when the slider value changes. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1710: Rename EventHandlerWithReturnType to end in 'EventHandler'.")] + public event EventHandlerWithReturnType ValueChanged + { + add + { + if (_sliderValueChangedEventHandler == null) + { + _sliderValueChangedCallbackDelegate = (OnValueChanged); + SliderValueChangedSignal valueChanged = ValueChangedSignal(); + valueChanged?.Connect(_sliderValueChangedCallbackDelegate); + valueChanged?.Dispose(); + } + _sliderValueChangedEventHandler += value; + } + remove + { + _sliderValueChangedEventHandler -= value; + SliderValueChangedSignal valueChanged = ValueChangedSignal(); + if (_sliderValueChangedEventHandler == null && valueChanged.Empty() == false) + { + valueChanged?.Disconnect(_sliderValueChangedCallbackDelegate); + } + valueChanged?.Dispose(); + } + } + + /// + /// An event emitted when the sliding is finished. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1710: Rename EventHandlerWithReturnType to end in 'EventHandler'.")] + public event EventHandlerWithReturnType SlidingFinished + { + add + { + if (_sliderSlidingFinishedEventHandler == null) + { + _sliderSlidingFinishedCallbackDelegate = (OnSlidingFinished); + SliderValueChangedSignal slidingFinished = SlidingFinishedSignal(); + slidingFinished?.Connect(_sliderSlidingFinishedCallbackDelegate); + slidingFinished?.Dispose(); + } + _sliderSlidingFinishedEventHandler += value; + } + remove + { + _sliderSlidingFinishedEventHandler -= value; + SliderValueChangedSignal slidingFinished = SlidingFinishedSignal(); + if (_sliderSlidingFinishedEventHandler == null && slidingFinished.Empty() == false) + { + slidingFinished?.Disconnect(_sliderSlidingFinishedCallbackDelegate); + } + slidingFinished?.Dispose(); + } + } + + /// + /// An event emitted when the slider handle reaches a mark. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1710: Rename EventHandlerWithReturnType to end in 'EventHandler'.")] + public event EventHandlerWithReturnType MarkReached + { + add + { + if (_sliderMarkReachedEventHandler == null) + { + _sliderMarkReachedCallbackDelegate = (OnMarkReached); + SliderMarkReachedSignal markReached = MarkReachedSignal(); + markReached?.Connect(_sliderMarkReachedCallbackDelegate); + markReached?.Dispose(); + } + _sliderMarkReachedEventHandler += value; + } + remove + { + _sliderMarkReachedEventHandler -= value; + SliderMarkReachedSignal markReached = MarkReachedSignal(); + if (_sliderMarkReachedEventHandler == null && markReached.Empty() == false) + { + markReached?.Disconnect(_sliderMarkReachedCallbackDelegate); + } + markReached?.Dispose(); + } + } + + /// + /// The lower bound property. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public float LowerBound + { + get + { + return (float)GetValue(LowerBoundProperty); + } + set + { + SetValue(LowerBoundProperty, value); + } + } + + /// + /// The upper bound property. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public float UpperBound + { + get + { + return (float)GetValue(UpperBoundProperty); + } + set + { + SetValue(UpperBoundProperty, value); + } + } + + /// + /// The value property. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public float Value + { + get + { + return (float)GetValue(ValueProperty); + } + set + { + SetValueAndForceSendChangeSignal(ValueProperty, value); + } + } + + /// + /// The track visual property. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public PropertyMap TrackVisual + { + get + { + return (PropertyMap)GetValue(TrackVisualProperty); + } + set + { + SetValue(TrackVisualProperty, value); + } + } + + /// + /// The handle visual property. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public PropertyMap HandleVisual + { + get + { + return (PropertyMap)GetValue(HandleVisualProperty); + } + set + { + SetValue(HandleVisualProperty, value); + } + } + + /// + /// The progress visual property. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public PropertyMap ProgressVisual + { + get + { + return (PropertyMap)GetValue(ProgressVisualProperty); + } + set + { + SetValue(ProgressVisualProperty, value); + } + } + + /// + /// The popup visual property. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public PropertyMap PopupVisual + { + get + { + return (PropertyMap)GetValue(PopupVisualProperty); + } + set + { + SetValue(PopupVisualProperty, value); + } + } + + /// + /// The popup arrow visual property. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public PropertyMap PopupArrowVisual + { + get + { + return (PropertyMap)GetValue(PopupArrowVisualProperty); + } + set + { + SetValue(PopupArrowVisualProperty, value); + } + } + + /// + /// The disable color property. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public Vector4 DisabledColor + { + get + { + return (Vector4)GetValue(DisabledColorProperty); + } + set + { + SetValue(DisabledColorProperty, value); + } + } + + /// + /// The value precision property. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public int ValuePrecision + { + get + { + return (int)GetValue(ValuePrecisionProperty); + } + set + { + SetValue(ValuePrecisionProperty, value); + } + } + + /// + /// The show popup property. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool ShowPopup + { + get + { + return (bool)GetValue(ShowPopupProperty); + } + set + { + SetValue(ShowPopupProperty, value); + } + } + + /// + /// The show value property. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool ShowValue + { + get + { + return (bool)GetValue(ShowValueProperty); + } + set + { + SetValue(ShowValueProperty, value); + } + } + + /// + /// The marks property. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public Tizen.NUI.PropertyArray Marks + { + get + { + return (PropertyArray)GetValue(MarksProperty); + } + set + { + SetValue(MarksProperty, value); + } + } + + /// + /// The snap to marks property. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool SnapToMarks + { + get + { + return (bool)GetValue(SnapToMarksProperty); + } + set + { + SetValue(SnapToMarksProperty, value); + } + } + + /// + /// The mark tolerance property. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public float MarkTolerance + { + get + { + return (float)GetValue(MarkToleranceProperty); + } + set + { + SetValue(MarkToleranceProperty, value); + } + } + + /// Only used by the IL of xaml, will never changed to not hidden. + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool IsCreateByXaml + { + get + { + return base.IsCreateByXaml; + } + set + { + base.IsCreateByXaml = value; + + if (value == true) + { + this.ValueChanged += (obj, e) => + { + this.Value = e.SlideValue; + return true; + }; + } + } + } + + /// + /// Downcasts an object handle to the slider.
+ /// If the handle points to a slider, then the downcast produces a valid handle.
+ /// If not, then the returned handle is left uninitialized.
+ ///
+ /// The handle to an object. + /// The handle to a slider or an uninitialized handle. + /// Thrown when handle is null. + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static Slider DownCast(BaseHandle handle) + { + if (null == handle) + { + throw new ArgumentNullException(nameof(handle)); + } + Slider ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as Slider; + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Slider obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.SwigCPtr; + } + + /// + /// Gets the slider from the pointer. + /// + /// The pointer of the slider. + /// The object of the slider type. + internal static Slider GetSliderFromPtr(global::System.IntPtr cPtr) + { + Slider ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Slider; + if (null == ret) + { + ret = Registry.GetManagedBaseHandleFromRefObject(cPtr) as Slider; + } + + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal Slider Assign(Slider handle) + { + Slider ret = new Slider(Interop.Slider.Assign(SwigCPtr, Slider.getCPtr(handle)), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal SliderValueChangedSignal ValueChangedSignal() + { + SliderValueChangedSignal ret = new SliderValueChangedSignal(Interop.Slider.ValueChangedSignal(SwigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal SliderValueChangedSignal SlidingFinishedSignal() + { + SliderValueChangedSignal ret = new SliderValueChangedSignal(Interop.Slider.SlidingFinishedSignal(SwigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal SliderMarkReachedSignal MarkReachedSignal() + { + SliderMarkReachedSignal ret = new SliderMarkReachedSignal(Interop.Slider.MarkReachedSignal(SwigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Dispose. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + protected override void Dispose(DisposeTypes type) + { + if (disposed) + { + return; + } + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + if (this != null) + { + if (_sliderValueChangedCallbackDelegate != null) + { + SliderValueChangedSignal valueChanged = ValueChangedSignal(); + valueChanged?.Disconnect(_sliderValueChangedCallbackDelegate); + valueChanged?.Dispose(); + } + + if (_sliderSlidingFinishedCallbackDelegate != null) + { + SliderValueChangedSignal slidingFinished = SlidingFinishedSignal(); + slidingFinished?.Disconnect(_sliderSlidingFinishedCallbackDelegate); + slidingFinished?.Dispose(); + } + + if (_sliderMarkReachedCallbackDelegate != null) + { + SliderMarkReachedSignal markReached = MarkReachedSignal(); + markReached?.Disconnect(_sliderMarkReachedCallbackDelegate); + markReached?.Dispose(); + } + } + + base.Dispose(type); + } + + /// This will not be public opened. + [EditorBrowsable(EditorBrowsableState.Never)] + protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr) + { + Interop.Slider.DeleteSlider(swigCPtr); + } + + // Callback for Slider ValueChanged signal + private bool OnValueChanged(IntPtr slider, float slideValue) + { + ValueChangedEventArgs e = new ValueChangedEventArgs(); + + // Populate all members of "e" (ValueChangedEventArgs) with real page + e.Slider = Slider.GetSliderFromPtr(slider); + e.SlideValue = slideValue; + + if (_sliderValueChangedEventHandler != null) + { + //here we send all page to user event handlers + return _sliderValueChangedEventHandler(this, e); + } + return false; + } + + // Callback for Slider SlidingFinished signal + private bool OnSlidingFinished(IntPtr slider, float slideValue) + { + SlidingFinishedEventArgs e = new SlidingFinishedEventArgs(); + + // Populate all members of "e" (SlidingFinishedEventArgs) with real page + e.Slider = Slider.GetSliderFromPtr(slider); + e.SlideValue = slideValue; + + if (_sliderSlidingFinishedEventHandler != null) + { + //here we send all page to user event handlers + return _sliderSlidingFinishedEventHandler(this, e); + } + return false; + } + + // Callback for Slider MarkReached signal + private bool OnMarkReached(IntPtr slider, int slideValue) + { + MarkReachedEventArgs e = new MarkReachedEventArgs(); + + // Populate all members of "e" (MarkReachedEventArgs) with real page + e.Slider = Slider.GetSliderFromPtr(slider); + e.SlideValue = slideValue; + + if (_sliderMarkReachedEventHandler != null) + { + //here we send all page to user event handlers + return _sliderMarkReachedEventHandler(this, e); + } + return false; + } + + /// + /// The ValueChanged event arguments. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")] + public class ValueChangedEventArgs : EventArgs + { + private Slider _slider; + private float _slideValue; + + /// + /// The slider. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public Slider Slider + { + get + { + return _slider; + } + set + { + _slider = value; + } + } + + /// + /// The slider value. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public float SlideValue + { + get + { + return _slideValue; + } + set + { + _slideValue = value; + } + } + } + + /// + /// The SlidingFinished event arguments. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")] + public class SlidingFinishedEventArgs : EventArgs + { + private Slider _slider; + private float _slideValue; + + /// + /// The slider. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public Slider Slider + { + get + { + return _slider; + } + set + { + _slider = value; + } + } + + /// + /// The slider value. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public float SlideValue + { + get + { + return _slideValue; + } + set + { + _slideValue = value; + } + } + } + + /// + /// The MarkReached event arguments. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")] + public class MarkReachedEventArgs : EventArgs + { + private Slider _slider; + private int _slideValue; + + /// + /// The slider. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public Slider Slider + { + get + { + return _slider; + } + set + { + _slider = value; + } + } + + /// + /// The slider value. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public int SlideValue + { + get + { + return _slideValue; + } + set + { + _slideValue = value; + } + } + } + + internal new class Property + { + internal static readonly int LowerBound = Interop.Slider.LowerBoundGet(); + internal static readonly int UpperBound = Interop.Slider.UpperBoundGet(); + internal static readonly int VALUE = Interop.Slider.ValueGet(); + internal static readonly int TrackVisual = Interop.Slider.TrackVisualGet(); + internal static readonly int HandleVisual = Interop.Slider.HandleVisualGet(); + internal static readonly int ProgressVisual = Interop.Slider.ProgressVisualGet(); + internal static readonly int PopupVisual = Interop.Slider.PopupVisualGet(); + internal static readonly int PopupArrowVisual = Interop.Slider.PopupArrowVisualGet(); + internal static readonly int DisabledColor = Interop.Slider.DisabledColorGet(); + internal static readonly int ValuePrecision = Interop.Slider.ValuePrecisionGet(); + internal static readonly int ShowPopup = Interop.Slider.ShowPopupGet(); + internal static readonly int ShowValue = Interop.Slider.ShowValueGet(); + internal static readonly int MARKS = Interop.Slider.MarksGet(); + internal static readonly int SnapToMarks = Interop.Slider.SnapToMarksGet(); + internal static readonly int MarkTolerance = Interop.Slider.MarkToleranceGet(); + } + } +} diff --git a/src/Tizen.NUI/src/public/UIComponents/ToggleButton.cs b/src/Tizen.NUI/src/public/UIComponents/ToggleButton.cs new file mode 100755 index 0000000..0bffca6 --- /dev/null +++ b/src/Tizen.NUI/src/public/UIComponents/ToggleButton.cs @@ -0,0 +1,210 @@ +/* + * Copyright(c) 2018 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +using System; +using System.ComponentModel; +using System.Diagnostics.CodeAnalysis; +using Tizen.NUI.Binding; + +namespace Tizen.NUI +{ + /// + /// A ToggleButton allows the user to change a setting between two or more states. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public class ToggleButton : Tizen.NUI.UIComponents.Button + { + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty StateVisualsProperty = BindableProperty.Create(nameof(StateVisuals), typeof(PropertyArray), typeof(ToggleButton), new PropertyArray(), propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var toggleButton = (ToggleButton)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)toggleButton.SwigCPtr, ToggleButton.Property.StateVisuals, new Tizen.NUI.PropertyValue((PropertyArray)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var toggleButton = (ToggleButton)bindable; + Tizen.NUI.PropertyArray temp = new Tizen.NUI.PropertyArray(); + Tizen.NUI.Object.GetProperty((System.Runtime.InteropServices.HandleRef)toggleButton.SwigCPtr, ToggleButton.Property.StateVisuals).Get(temp); + return temp; + })); + + /// Only for XAML property binding. This will be changed as Inhouse API by ACR later. + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty TooltipsProperty = BindableProperty.Create(nameof(Tooltips), typeof(PropertyArray), typeof(ToggleButton), new PropertyArray(), propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var toggleButton = (ToggleButton)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)toggleButton.SwigCPtr, ToggleButton.Property.TOOLTIPS, new Tizen.NUI.PropertyValue((PropertyArray)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var toggleButton = (ToggleButton)bindable; + Tizen.NUI.PropertyArray temp = new Tizen.NUI.PropertyArray(); + Tizen.NUI.Object.GetProperty((System.Runtime.InteropServices.HandleRef)toggleButton.SwigCPtr, ToggleButton.Property.TOOLTIPS).Get(temp); + return temp; + })); + + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty CurrentStateIndexProperty = BindableProperty.Create(nameof(CurrentStateIndex), typeof(int), typeof(ToggleButton), default(int), propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + { + var toggleButton = (ToggleButton)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)toggleButton.SwigCPtr, ToggleButton.Property.CurrentStateIndex, new Tizen.NUI.PropertyValue((int)newValue)); + } + }), + defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => + { + var toggleButton = (ToggleButton)bindable; + int temp = 0; + Tizen.NUI.Object.GetProperty((System.Runtime.InteropServices.HandleRef)toggleButton.SwigCPtr, ToggleButton.Property.CurrentStateIndex).Get(out temp); + return temp; + })); + + + /// + /// Create an instance for toggleButton. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public ToggleButton() : this(Interop.ToggleButton.New(), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal ToggleButton(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn) + { + } + + /// + /// Gets and Sets the state visual array of toggle button. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public Tizen.NUI.PropertyArray StateVisuals + { + get + { + return (PropertyArray)GetValue(StateVisualsProperty); + } + set + { + SetValue(StateVisualsProperty, value); + } + } + + /// + /// Gets and Sets the tooltips of toggle button. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public Tizen.NUI.PropertyArray Tooltips + { + get + { + return (PropertyArray)GetValue(TooltipsProperty); + } + set + { + SetValue(TooltipsProperty, value); + } + } + + /// + /// Gets and Sets the current state index of toggle button. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public int CurrentStateIndex + { + get + { + return (int)GetValue(CurrentStateIndexProperty); + } + set + { + SetValue(CurrentStateIndexProperty, value); + } + } + + + /// This will not be public opened. + [EditorBrowsable(EditorBrowsableState.Never)] + protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr) + { + Interop.ToggleButton.DeleteToggleButton(swigCPtr); + } + + /// + /// This should be internal, please do not use. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] +#pragma warning disable CA1716, CA1052, CA1034 // Identifiers should not match keywords + public new class Property +#pragma warning restore CA1716, CA1052, CA1034 // Identifiers should not match keywords + { + /// + /// This should be internal, please do not use. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly int StateVisuals = Interop.ToggleButton.StateVisualsGet(); + /// + /// This should be internal, please do not use. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly int TOOLTIPS = Interop.ToggleButton.TooltipsGet(); + /// + /// This should be internal, please do not use. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly int CurrentStateIndex = Interop.ToggleButton.CurrentStateIndexGet(); + } + } +} -- 2.7.4