From: huiyueun <35286162+huiyueun@users.noreply.github.com> Date: Tue, 27 Mar 2018 09:06:47 +0000 (+0900) Subject: Revert "[NUI] Delete deprecated APIs (#143)" (#188) X-Git-Tag: 5.0.0.14297~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b5961afa8ebc10f97ad3b8f08003ed52547b530f;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git Revert "[NUI] Delete deprecated APIs (#143)" (#188) * Revert "[NUI] Delete deprecated APIs (#143)" This reverts commit 776217fb9d9689f4705b00a0d3ef3c6e6cfb52ed. * [NUI] Fix parent get issue Signed-off-by: huiyu --- diff --git a/src/Tizen.NUI/src/internal/Size.cs b/src/Tizen.NUI/src/internal/Size.cs index 7967419..6218824 100755 --- a/src/Tizen.NUI/src/internal/Size.cs +++ b/src/Tizen.NUI/src/internal/Size.cs @@ -20,11 +20,14 @@ using System.ComponentModel; namespace Tizen.NUI { + // Please do not use! This will be changed to internal class. /// /// A three-dimensional size. /// /// 3 - internal class Size : global::System.IDisposable + [Obsolete("Please do not use! This will be deprecated! Please use Size2D instead!")] + [EditorBrowsable(EditorBrowsableState.Never)] + public class Size : global::System.IDisposable { private global::System.Runtime.InteropServices.HandleRef swigCPtr; /// swigCMemOwn. diff --git a/src/Tizen.NUI/src/public/BaseComponents/ImageView.cs b/src/Tizen.NUI/src/public/BaseComponents/ImageView.cs index 6820922..89ab4c2 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/ImageView.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/ImageView.cs @@ -299,6 +299,38 @@ namespace Tizen.NUI.BaseComponents } /// + /// This will be deprecated, please use Image instead.
+ /// ImageView ImageMap, type PropertyMap: string if it is a URL, map otherwise. + ///
+ /// 3 + [Obsolete("Please do not use! This will be deprecated! Please use Image property instead!")] + [EditorBrowsable(EditorBrowsableState.Never)] + public PropertyMap ImageMap + { + get + { + if (_border == null) + { + PropertyMap temp = new PropertyMap(); + GetProperty(ImageView.Property.IMAGE).Get(temp); + return temp; + } + else + { + return null; + } + } + set + { + if (_border == null) + { + if (_url != null) { value.Add("url", new PropertyValue(_url)); } + SetProperty(ImageView.Property.IMAGE, new Tizen.NUI.PropertyValue(value)); + } + } + } + + /// /// ImageView Image, type PropertyMap /// /// 4 diff --git a/src/Tizen.NUI/src/public/BaseComponents/View.cs b/src/Tizen.NUI/src/public/BaseComponents/View.cs index fb208c5..6c8267b 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/View.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/View.cs @@ -2179,6 +2179,32 @@ namespace Tizen.NUI.BaseComponents } } + /// + /// Please do not use! this will be deprecated. + /// + /// Please do not use! this will be deprecated! + /// Instead please use PositionUsesPivotPoint. + /// 3 + [Obsolete("Please do not use! This will be deprecated! Please use PositionUsesPivotPoint instead! " + + "Like: " + + "View view = new View(); " + + "view.PivotPoint = PivotPoint.Center; " + + "view.PositionUsesPivotPoint = true;")] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool PositionUsesAnchorPoint + { + get + { + bool temp = false; + GetProperty(View.Property.POSITION_USES_ANCHOR_POINT).Get(out temp); + return temp; + } + set + { + SetProperty(View.Property.POSITION_USES_ANCHOR_POINT, new Tizen.NUI.PropertyValue(value)); + } + } + internal bool FocusState { get @@ -2285,6 +2311,31 @@ namespace Tizen.NUI.BaseComponents } /// + /// Returns the natural size of the view. + /// + /// + /// Deriving classes stipulate the natural size and by default a view has a zero natural size. + /// + /// /// Please do not use! this will be deprecated! + /// Instead please use NaturalSize2D. + /// 3 + [Obsolete("Please do not use! This will be deprecated! Please use NaturalSize2D instead! " + + "Like: " + + "TextLabel label = new TextLabel(\"Hello World!\"); " + + "Size2D size = label.NaturalSize2D;")] + [EditorBrowsable(EditorBrowsableState.Never)] + public Vector3 NaturalSize + { + get + { + Vector3 ret = new Vector3(NDalicPINVOKE.Actor_GetNaturalSize(swigCPtr), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } + + /// /// Returns the natural size (Size2D) of the view. /// /// @@ -4192,6 +4243,92 @@ namespace Tizen.NUI.BaseComponents } /// + /// [Obsolete("Please do not use! this will be deprecated")] + /// + /// 3 + /// Please do not use! this will be deprecated! + /// Instead please use PivotPoint. + [Obsolete("Please do not use! This will be deprecated! Please use PivotPoint instead! " + + "Like: " + + "View view = new View(); " + + "view.PivotPoint = PivotPoint.Center; " + + "view.PositionUsesPivotPoint = true;")] + [EditorBrowsable(EditorBrowsableState.Never)] + public Position AnchorPoint + { + get + { + Position temp = new Position(0.0f, 0.0f, 0.0f); + GetProperty(View.Property.ANCHOR_POINT).Get(temp); + return temp; + } + set + { + SetProperty(View.Property.ANCHOR_POINT, new Tizen.NUI.PropertyValue(value)); + } + } + + /// + /// [Obsolete("Please do not use! this will be deprecated")] + /// + /// 3 + [Obsolete("Please do not use! This will be deprecated! Please use Size2D instead! " + + "Like: " + + "View view = new View(); " + + "view.Size2D = new Size2D(100, 100);")] + [EditorBrowsable(EditorBrowsableState.Never)] + public Size Size + { + get + { + Size temp = new Size(0.0f, 0.0f, 0.0f); + GetProperty(View.Property.SIZE).Get(temp); + return temp; + } + set + { + SetProperty(View.Property.SIZE, new Tizen.NUI.PropertyValue(value)); + } + } + + /// + /// "Please DO NOT use! This will be deprecated! Please use 'Container GetParent() for derived class' instead!" + /// + /// 3 + [Obsolete("Please do not use! This will be deprecated! Please use 'Container GetParent() for derived class' instead! " + + "Like: " + + "Container parent = view.GetParent(); " + + "View view = parent as View;")] + [EditorBrowsable(EditorBrowsableState.Never)] + public new View Parent + { + get + { + View ret; + IntPtr cPtr = NDalicPINVOKE.Actor_GetParent(swigCPtr); + HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + BaseHandle basehandle = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle); + + if (basehandle is Layer layer) + { + ret = new View(Layer.getCPtr(layer).Handle, false); + NUILog.Error("This Parent property is deprecated, shoud do not be used"); + } + else + { + ret = basehandle as View; + } + + NDalicPINVOKE.delete_BaseHandle(CPtr); + CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } + + /// /// Gets/Sets whether inherit parent's the layout Direction. /// /// 4 @@ -4249,6 +4386,28 @@ namespace Tizen.NUI.BaseComponents } /// + /// [Obsolete("Please do not use! this will be deprecated")] + /// + /// Please do not use! this will be deprecated! + /// Instead please use Padding. + /// 4 + [Obsolete("Please do not use! this will be deprecated, instead please use Padding.")] + [EditorBrowsable(EditorBrowsableState.Never)] + public Extents PaddingEX + { + get + { + Extents temp = new Extents(0, 0, 0, 0); + GetProperty(View.Property.PADDING).Get(temp); + return temp; + } + set + { + SetProperty(View.Property.PADDING, new Tizen.NUI.PropertyValue(value)); + } + } + + /// /// Perform an action on a visual registered to this view.
/// Visuals will have actions, this API is used to perform one of these actions with the given attributes. ///
diff --git a/src/Tizen.NUI/src/public/FocusManager.cs b/src/Tizen.NUI/src/public/FocusManager.cs index 744f64d..195f6af 100755 --- a/src/Tizen.NUI/src/public/FocusManager.cs +++ b/src/Tizen.NUI/src/public/FocusManager.cs @@ -686,8 +686,95 @@ namespace Tizen.NUI } } + + /// + /// Please do not use! this will be deprecated + /// + /// 3 + /// Please do not use! this will be deprecated. + /// Instead please use FocusedViewActivatedEventArgs. + [Obsolete("Please do not use! This will be deprecated! Please use FocusedViewActivatedEventArgs instead! " + + "Like: " + + "FocusManager.Instance.FocusedViewActivated = OnFocusedViewActivated; " + + "private void OnFocusedViewActivated(object source, FocusManager.FocusedViewActivatedEventArgs arg)" + + "{...}")] + [EditorBrowsable(EditorBrowsableState.Never)] + public class FocusedViewEnterKeyEventArgs : EventArgs + { + private View _view; + + /// + /// View. + /// + /// 3 + public View View + { + get + { + return _view; + } + set + { + _view = value; + } + } + } + + private EventHandler _focusedViewEnterKeyEventHandler2; [UnmanagedFunctionPointer(CallingConvention.StdCall)] private delegate void FocusedViewEnterKeyEventCallback2(IntPtr view); private FocusedViewEnterKeyEventCallback2 _focusedViewEnterKeyEventCallback2; + + /// + /// [Obsolete("Please do not use! this will be deprecated")] + /// + /// 3 + /// Please do not use! this will be deprecated! + /// Instead please use FocusedViewActivated. + [Obsolete("Please do not use! This will be deprecated! Please use FocusManager.FocusedViewActivated instead! " + + "Like: " + + "FocusManager.Instance.FocusedViewActivated = OnFocusedViewActivated; " + + "private void OnFocusedViewActivated(object source, FocusManager.FocusedViewActivatedEventArgs args) {...}")] + [EditorBrowsable(EditorBrowsableState.Never)] + public event EventHandler FocusedViewEnterKeyPressed + { + add + { + if (_focusedViewEnterKeyEventCallback2 == null) + { + _focusedViewEnterKeyEventCallback2 = OnFocusedViewEnterKey2; + FocusedViewEnterKeySignal().Connect(_focusedViewEnterKeyEventCallback2); + } + _focusedViewEnterKeyEventHandler2 += value; + } + remove + { + _focusedViewEnterKeyEventHandler2 -= value; + + if (_focusedViewEnterKeyEventCallback2 != null && FocusedViewEnterKeySignal().Empty() == false) + { + FocusedViewEnterKeySignal().Disconnect(_focusedViewEnterKeyEventCallback2); + } + } + } + + /// + /// Please do not use! this will be deprecated! + /// + /// Please do not use! this will be deprecated! + /// Instead please use OnFocusedViewEnterKey. + [Obsolete("Please do not use! This will be deprecated! Please use FocusManager.OnFocusedViewEnterKey instead!")] + [EditorBrowsable(EditorBrowsableState.Never)] + private void OnFocusedViewEnterKey2(IntPtr view) + { + FocusedViewActivatedEventArgs e = new FocusedViewActivatedEventArgs(); + + e.View = Registry.GetManagedBaseHandleFromNativePtr(view) as View; + + if (_focusedViewEnterKeyEventHandler != null) + { + _focusedViewEnterKeyEventHandler(this, e); + } + } } } \ No newline at end of file diff --git a/src/Tizen.NUI/src/public/Layer.cs b/src/Tizen.NUI/src/public/Layer.cs index f2b9730..566b2f9 100755 --- a/src/Tizen.NUI/src/public/Layer.cs +++ b/src/Tizen.NUI/src/public/Layer.cs @@ -188,6 +188,21 @@ namespace Tizen.NUI } /// + /// Downcasts a handle to layer handle. + /// + /// 3 + /// Please do not use! this will be deprecated! + /// Instead please use as keyword. + [Obsolete("Please do not use! This will be deprecated! Please use as keyword instead!")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static Layer DownCast(BaseHandle handle) + { + Layer ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as Layer; + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// /// Search through this layer's hierarchy for a view with the given unique ID. /// ///
This layer (the parent) has been initialized.
diff --git a/src/Tizen.NUI/src/public/NUIConstants.cs b/src/Tizen.NUI/src/public/NUIConstants.cs index f0fb37b..88920dc 100755 --- a/src/Tizen.NUI/src/public/NUIConstants.cs +++ b/src/Tizen.NUI/src/public/NUIConstants.cs @@ -258,7 +258,14 @@ namespace Tizen.NUI /// /// Use to make style change event disabled. /// - DisableStyleChangeSignals = 1 << 6 + DisableStyleChangeSignals = 1 << 6, + /// + /// Please do not use! This will be deprecated! + /// + /// 3 + [Obsolete("Please do not use! This will be deprecated!")] + [EditorBrowsable(EditorBrowsableState.Never)] + LastViewBehaviourFlag } /// @@ -2168,6 +2175,209 @@ namespace Tizen.NUI Implicit, } + + + /// + /// [Obsolete("Please do not use! this will be deprecated")] + /// + /// 3 + [Obsolete("Please do not use! This will be deprecated! Please use PivotPoint instead!")] + [EditorBrowsable(EditorBrowsableState.Never)] + public struct AnchorPoint + { + /// + /// Top + /// + /// 3 + public static float Top + { + get + { + float ret = NDalicPINVOKE.AnchorPointTop_get(); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } + /// + /// Bottom + /// + /// 3 + public static float Bottom + { + get + { + float ret = NDalicPINVOKE.AnchorPointBottom_get(); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } + /// + /// Left + /// + /// 3 + public static float Left + { + get + { + float ret = NDalicPINVOKE.AnchorPointLeft_get(); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } + /// + /// Right + /// + /// 3 + public static float Right + { + get + { + float ret = NDalicPINVOKE.AnchorPointRight_get(); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } + /// + /// Middle + /// + /// 3 + public static float Middle + { + get + { + float ret = NDalicPINVOKE.AnchorPointMiddle_get(); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } + /// + /// TopLeft + /// + /// 3 + public static Position TopLeft + { + get + { + global::System.IntPtr cPtr = NDalicPINVOKE.AnchorPointTopLeft_get(); + Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } + /// + /// TopCenter + /// + /// 3 + public static Position TopCenter + { + get + { + global::System.IntPtr cPtr = NDalicPINVOKE.AnchorPointTopCenter_get(); + Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } + /// + /// TopRight + /// + /// 3 + public static Position TopRight + { + get + { + global::System.IntPtr cPtr = NDalicPINVOKE.AnchorPointTopRight_get(); + Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } + /// + /// CenterLeft + /// + /// 3 + public static Position CenterLeft + { + get + { + global::System.IntPtr cPtr = NDalicPINVOKE.AnchorPointCenterLeft_get(); + Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } + /// + /// Center + /// + /// 3 + public static Position Center + { + get + { + global::System.IntPtr cPtr = NDalicPINVOKE.AnchorPointCenter_get(); + Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } + /// + /// CenterRight + /// + /// 3 + public static Position CenterRight + { + get + { + global::System.IntPtr cPtr = NDalicPINVOKE.AnchorPointCenterRight_get(); + Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } + /// + /// BottomLeft + /// + /// 3 + public static Position BottomLeft + { + get + { + global::System.IntPtr cPtr = NDalicPINVOKE.AnchorPointBottomLeft_get(); + Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } + /// + /// BottomCenter + /// + /// 3 + public static Position BottomCenter + { + get + { + global::System.IntPtr cPtr = NDalicPINVOKE.AnchorPointBottomCenter_get(); + Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } + /// + /// BottomRight + /// + /// 3 + public static Position BottomRight + { + get + { + global::System.IntPtr cPtr = NDalicPINVOKE.AnchorPointBottomRight_get(); + Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } + } + /// /// An enum of the scroll state of the text eidtor. /// diff --git a/src/Tizen.NUI/src/public/VisualFactory.cs b/src/Tizen.NUI/src/public/VisualFactory.cs index 160e21b..0c1e066 100755 --- a/src/Tizen.NUI/src/public/VisualFactory.cs +++ b/src/Tizen.NUI/src/public/VisualFactory.cs @@ -39,7 +39,16 @@ namespace Tizen.NUI return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; } - internal static VisualFactory Get() + /// + /// Please do not use! this will be deprecated, please use VisualFactory.Instance instead. + /// + /// 3 + [Obsolete("Please do not use! This will be deprecated! Please use VisualFactory.Instance instead! " + + "Like: " + + "VisualFactory visualFactory = VisualFactory.Instance; " + + "visualFactory.CreateVisual(visualMap);")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static VisualFactory Get() { VisualFactory ret = new VisualFactory(NDalicPINVOKE.VisualFactory_Get(), true); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -51,6 +60,7 @@ namespace Tizen.NUI if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } + /// /// Request the visual. /// diff --git a/src/Tizen.NUI/src/public/Window.cs b/src/Tizen.NUI/src/public/Window.cs index 81d4628..c472554 100755 --- a/src/Tizen.NUI/src/public/Window.cs +++ b/src/Tizen.NUI/src/public/Window.cs @@ -1488,6 +1488,79 @@ namespace Tizen.NUI } /// + /// Please do not use! this will be deprecated + /// + /// 3 + [Obsolete("Please do not use! This will be deprecated! Please use FocusChangedEventArgs instead! " + + "Like: " + + "Window.Instance.FocusChanged = OnFocusChanged; " + + "private void OnFocusChanged(object source, Window.FocusChangedEventArgs args) {...}")] + [EditorBrowsable(EditorBrowsableState.Never)] + public class WindowFocusChangedEventArgs : EventArgs + { + /// + /// Please do not use! this will be deprecated + /// + /// 3 + public bool FocusGained + { + get; + set; + } + } + + private WindowFocusChangedEventCallbackType _windowFocusChangedEventCallback2; + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate void WindowFocusChangedEventCallbackType2(bool focusGained); + private event EventHandler _windowFocusChangedEventHandler2; + + /// + /// Please do not use! this will be deprecated. Please use 'FocusChanged' event instead. + /// + /// 3 + /// Please do not use! this will be deprecated! + /// Instead please use FocusChanged. + [Obsolete("Please do not use! This will be deprecated! Please use FocusChanged instead! " + + "Like: " + + "Window.Instance.FocusChanged = OnFocusChanged; " + + "private void OnFocusChanged(object source, Window.FocusChangedEventArgs args) {...}")] + [EditorBrowsable(EditorBrowsableState.Never)] + public event EventHandler WindowFocusChanged + { + add + { + if (_windowFocusChangedEventHandler2 == null) + { + _windowFocusChangedEventCallback2 = OnWindowFocusedChanged2; + WindowFocusChangedSignal().Connect(_windowFocusChangedEventCallback2); + } + + _windowFocusChangedEventHandler2 += value; + } + remove + { + _windowFocusChangedEventHandler2 -= value; + + if (_windowFocusChangedEventHandler2 == null && WindowFocusChangedSignal().Empty() == false && _windowFocusChangedEventCallback2 != null) + { + WindowFocusChangedSignal().Disconnect(_windowFocusChangedEventCallback2); + } + } + } + + private void OnWindowFocusedChanged2(bool focusGained) + { + WindowFocusChangedEventArgs e = new WindowFocusChangedEventArgs(); + + e.FocusGained = focusGained; + + if (_windowFocusChangedEventHandler2 != null) + { + _windowFocusChangedEventHandler2(this, e); + } + } + + /// /// Gets or sets a size of the window. /// /// 4 @@ -1531,6 +1604,18 @@ namespace Tizen.NUI } /// + /// Feed a key-event into the window. + /// + /// The key event to feed. + /// 4 + [Obsolete("Please do not use! This will be deprecated! Please use FeedKey(Key keyEvent) instead!")] + public void FeedKeyEvent(Key keyEvent) + { + NDalicManualPINVOKE.Window_FeedKeyEvent(Key.getCPtr(keyEvent)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// /// Allows at least one more render, even when paused. /// The window should be shown, not minimised. ///