Merge remote-tracking branch 'origin/API9' into tizen
authorTizenAPI-Bot <tizenapi@samsung.com>
Thu, 14 Oct 2021 07:35:50 +0000 (07:35 +0000)
committerTizenAPI-Bot <tizenapi@samsung.com>
Thu, 14 Oct 2021 07:35:50 +0000 (07:35 +0000)
src/Tizen.NUI.Components/Controls/Navigation/Navigator.cs
src/Tizen.NUI/src/public/BaseComponents/ImageView.cs
src/Tizen.NUI/src/public/BaseComponents/Style/ViewStyle.cs
src/Tizen.NUI/src/public/BaseComponents/VideoView.cs
src/Tizen.NUI/src/public/BaseComponents/VideoViewHandle.cs [new file with mode: 0644]
src/Tizen.NUI/src/public/BaseComponents/View.cs
src/Tizen.NUI/src/public/Common/TimePeriod.cs
src/Tizen.NUI/src/public/Layouting/LinearLayout.cs
src/Tizen.NUI/src/public/Window/Window.cs
src/Tizen.NUI/src/public/Window/WindowEvent.cs
src/Tizen.NUI/src/public/Window/WindowHandle.cs [new file with mode: 0644]

index dd64725..f157867 100755 (executable)
@@ -23,15 +23,15 @@ using Tizen.NUI.BaseComponents;
 namespace Tizen.NUI.Components
 {
     /// <summary>
-    /// PoppedEventArgs is a class to record popped event arguments which will be sent to user.
+    /// PoppedEventArgs is a class to record <see cref="Navigator.Popped"/> event arguments which will be sent to user.
     /// </summary>
-    [EditorBrowsable(EditorBrowsableState.Never)]
+    /// <since_tizen> 9 </since_tizen>
     public class PoppedEventArgs : EventArgs
     {
         /// <summary>
         /// Page popped by Navigator.
         /// </summary>
-        [EditorBrowsable(EditorBrowsableState.Never)]
+        /// <since_tizen> 9 </since_tizen>
         public Page Page { get; internal set; }
     }
 
@@ -115,9 +115,11 @@ namespace Tizen.NUI.Components
 
         /// <summary>
         /// An event fired when Pop of a page has been finished.
-        /// Notice that Popped event handler should be removed when it is called not to call it duplicate.
         /// </summary>
-        [EditorBrowsable(EditorBrowsableState.Never)]
+        /// <remarks>
+        /// When you free resources in the Popped event handler, please make sure if the popped page is the page you find.
+        /// </remarks>
+        /// <since_tizen> 9 </since_tizen>
         public event EventHandler<PoppedEventArgs> Popped;
 
         /// <summary>
index 3d7b397..0172c1e 100755 (executable)
@@ -634,6 +634,7 @@ namespace Tizen.NUI.BaseComponents
         /// Gets or sets whether to synchronous loading the resourceurl of image.<br />
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
+        [Obsolete("Deprecated since API level 9 and will be removed in API level 11. Please use SynchronousLoading instead!")]
         public bool SynchronosLoading
         {
             get
@@ -647,10 +648,14 @@ namespace Tizen.NUI.BaseComponents
         }
 
         /// <summary>
-        /// Gets or sets whether to synchronous loading the resourceurl of image.<br />
+        /// Gets or sets whether the image of the ResourceUrl property will be loaded synchronously.<br />
         /// </summary>
-        /// This will be public opened in tizen_7.0 after ACR done. Before ACR, need to be hidden as inhouse API.
-        [EditorBrowsable(EditorBrowsableState.Never)]
+        /// <remarks>
+        /// Changing this property make this ImageView load image synchronously at the next loading
+        /// by following operation: <see cref="Reload"/>, <see cref="SetImage"/>,
+        /// and by some properties those cause reloading: <see cref="ResourceUrl"/>, <see cref="PreMultipliedAlpha"/> and etc.
+        /// </remarks>
+        /// <since_tizen> 9 </since_tizen>
         public bool SynchronousLoading
         {
             get
@@ -1126,10 +1131,16 @@ namespace Tizen.NUI.BaseComponents
 
         /// <summary>
         /// Gets or sets the mode to adjust view size to preserve the aspect ratio of the image resource.
-        /// If this is set to be true, then the width or height, which is not set by user explicitly, can be adjusted to preserve the aspect ratio of the image resource.
-        /// AdjustViewSize works only if ImageView is added to a View having Layout.
         /// </summary>
-        [EditorBrowsable(EditorBrowsableState.Never)]
+        /// <remarks>
+        /// This is false by default.
+        /// If this is set to be true, then the width or height value, which is not set by user explicitly, can be changed automatically
+        /// to preserve the aspect ratio of the image resource.
+        /// AdjustViewSize works only if ImageView is added to a View having Layout.
+        /// e.g. If the image resource size is (100, 100), then the ImageView requests size (100, 100) to its parent layout by default.
+        ///      If the ImageView's HeightSpecification is 50 and AdjustViewSize is true, then the ImageView requests size (50, 50) instead of (100, 50).
+        /// </remarks>
+        /// <since_tizen> 9 </since_tizen>
         public bool AdjustViewSize { get; set; } = false;
 
         internal Selector<string> ResourceUrlSelector
index ebef207..6ea7ad4 100755 (executable)
@@ -457,7 +457,7 @@ namespace Tizen.NUI.BaseComponents
         /// <summary>
         /// The width for the borderline of the View.
         /// </summary>
-        [EditorBrowsable(EditorBrowsableState.Never)]
+        /// <since_tizen> 9 </since_tizen>
         public float? BorderlineWidth
         {
             get => (float?)GetValue(BorderlineWidthProperty);
@@ -467,7 +467,7 @@ namespace Tizen.NUI.BaseComponents
         /// <summary>
         /// The color for the borderline of the View.
         /// </summary>
-        [EditorBrowsable(EditorBrowsableState.Never)]
+        /// <since_tizen> 9 </since_tizen>
         public Color BorderlineColor
         {
             get => (Color)GetValue(BorderlineColorProperty);
@@ -476,12 +476,12 @@ namespace Tizen.NUI.BaseComponents
 
         /// <summary>
         /// The Relative offset for the borderline of the View.
-        /// recommand [-1.0f to 1.0f] range.
-        /// If -1.0f, borderline draw inside of View.
-        /// If 1.0f, borderline draw outside of View.
-        /// If 0.0f, borderline draw half at inside and half at outside.
+        /// Recommended range : [-1.0f to 1.0f].
+        /// If -1.0f, draw borderline inside of the View.
+        /// If 1.0f, draw borderline outside of the View.
+        /// If 0.0f, draw borderline half inside and half outside.
         /// </summary>
-        [EditorBrowsable(EditorBrowsableState.Never)]
+        /// <since_tizen> 9 </since_tizen>
         public float? BorderlineOffset
         {
             get => (float?)GetValue(BorderlineOffsetProperty);
index a3fa2d1..f64d7e9 100755 (executable)
@@ -383,6 +383,31 @@ namespace Tizen.NUI.BaseComponents
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }
 
+        /// <summary>
+        /// Get native player handle.
+        /// <example>
+        /// How to get native player handle
+        /// <code>
+        /// VideoView videoView = new VideoView();
+        /// videoView.ResourceUrl = "some xxx video path";
+        /// var handle = videoView.NativeHandle;
+        /// if(handle?.IsInvalid == false)
+        /// {
+        ///     IntPtr nativeHandle = handle.DangerousGetHandle();
+        ///     // do something with nativeHandle
+        /// }
+        /// </code>
+        /// </example>
+        /// </summary>
+        /// <since_tizen> 9 </since_tizen>
+        public SafeHandle NativeHandle
+        {
+            get
+            {
+                return new NUI.SafeNativePlayerHandle(this);
+            }
+        }
+
         internal VideoViewSignal FinishedSignal()
         {
             VideoViewSignal ret = new VideoViewSignal(Interop.VideoView.FinishedSignal(SwigCPtr), false);
@@ -481,6 +506,7 @@ namespace Tizen.NUI.BaseComponents
     /// Contains and encapsulates Native Player handle.
     /// </summary>
     [EditorBrowsable(EditorBrowsableState.Never)]
+    [Obsolete("Deprecated in API9, will be removed in API11. Please use VideoView.NativeHandle instead!")]
     public class SafeNativePlayerHandle : SafeHandle
     {
         /// <summary>
diff --git a/src/Tizen.NUI/src/public/BaseComponents/VideoViewHandle.cs b/src/Tizen.NUI/src/public/BaseComponents/VideoViewHandle.cs
new file mode 100644 (file)
index 0000000..5d35420
--- /dev/null
@@ -0,0 +1,62 @@
+/*
+ * 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.ComponentModel;
+using System.Runtime.InteropServices;
+using Tizen.NUI.BaseComponents;
+
+namespace Tizen.NUI
+{
+    /// <summary>
+    /// Contains and encapsulates Native Player handle.
+    /// </summary>
+    internal class SafeNativePlayerHandle : SafeHandle
+    {
+        /// <summary>
+        /// Constructor, Native player handle is set to handle.
+        /// </summary>
+        internal SafeNativePlayerHandle(VideoView videoView) : base(global::System.IntPtr.Zero, false)
+        {
+            if (videoView != null)
+            {
+                SetHandle(videoView.GetNativePlayerHandle());
+            }
+        }
+
+        /// <summary>
+        /// Null check if the handle is valid or not.
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public override bool IsInvalid
+        {
+            get
+            {
+                return handle == global::System.IntPtr.Zero;
+            }
+        }
+        /// <summary>
+        /// Release handle itself.
+        /// </summary>
+        /// <returns>true when released successfully.</returns>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        protected override bool ReleaseHandle()
+        {
+            SetHandle(global::System.IntPtr.Zero);
+            return true;
+        }
+    }
+}
index d00b0c6..f00d363 100755 (executable)
@@ -505,7 +505,6 @@ namespace Tizen.NUI.BaseComponents
 
         /// <summary>
         /// The width for the borderline of the View.
-        /// Note that, an image background may not have borderline if it uses a Border property.
         /// </summary>
         /// <remarks>
         /// <para>
@@ -514,9 +513,9 @@ namespace Tizen.NUI.BaseComponents
         /// animation.AnimateTo(view, "BorderlineWidth", 100.0f);
         /// </code>
         /// </para>
+        /// Note that, an image background may not have borderline if it uses the Border property.
         /// </remarks>
-        /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API.
-        [EditorBrowsable(EditorBrowsableState.Never)]
+        /// <since_tizen> 9 </since_tizen>
         public float BorderlineWidth
         {
             get
@@ -542,8 +541,7 @@ namespace Tizen.NUI.BaseComponents
         /// </code>
         /// </para>
         /// </remarks>
-        /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API.
-        [EditorBrowsable(EditorBrowsableState.Never)]
+        /// <since_tizen> 9 </since_tizen>
         public Color BorderlineColor
         {
             get
@@ -559,10 +557,10 @@ namespace Tizen.NUI.BaseComponents
 
         /// <summary>
         /// The Relative offset for the borderline of the View.
-        /// recommand [-1.0f to 1.0f] range.
-        /// If -1.0f, borderline draw inside of View.
-        /// If 1.0f, borderline draw outside of View.
-        /// If 0.0f, borderline draw half at inside and half at outside.
+        /// Recommended range : [-1.0f to 1.0f].
+        /// If -1.0f, draw borderline inside of the View.
+        /// If 1.0f, draw borderline outside of the View.
+        /// If 0.0f, draw borderline half inside and half outside.
         /// It is 0.0f by default.
         /// </summary>
         /// <remarks>
@@ -573,8 +571,7 @@ namespace Tizen.NUI.BaseComponents
         /// </code>
         /// </para>
         /// </remarks>
-        /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API.
-        [EditorBrowsable(EditorBrowsableState.Never)]
+        /// <since_tizen> 9 </since_tizen>
         public float BorderlineOffset
         {
             get
index fd8057f..028eb92 100755 (executable)
@@ -31,11 +31,6 @@ namespace Tizen.NUI
         {
         }
 
-        protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
-        {
-            Interop.TimePeriod.DeleteTimePeriod(swigCPtr);
-        }
-
         /// <summary>
         /// The constructor.
         /// Creates an time period object with the user-defined alpha function.
@@ -51,7 +46,7 @@ namespace Tizen.NUI
         /// Creates an time period object with the user-defined alpha function.
         /// </summary>
         /// <since_tizen> 9 </since_tizen>
-        public TimePeriod(float delayMilliSeconds, float durationMilliSeconds) : this(Interop.TimePeriod.NewTimePeriod(MilliSecondsToSeconds((int)delayMilliSeconds), MilliSecondsToSeconds((int)durationMilliSeconds)), true)
+        public TimePeriod(int delayMilliSeconds, int durationMilliSeconds) : this(Interop.TimePeriod.NewTimePeriod(MilliSecondsToSeconds(delayMilliSeconds), MilliSecondsToSeconds(durationMilliSeconds)), true)
         {
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }
@@ -103,5 +98,12 @@ namespace Tizen.NUI
         {
             return (int)(sec * 1000);
         }
+
+        /// This will not be public opened.
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
+        {
+            Interop.TimePeriod.DeleteTimePeriod(swigCPtr);
+        }
     }
 }
index 9d15b9c..2283b13 100755 (executable)
@@ -49,6 +49,7 @@ namespace Tizen.NUI
         /// [Draft] Enumeration for the alignment of the linear layout items
         /// </summary>
         /// <since_tizen> 6 </since_tizen>
+        [Obsolete("Deprecated in API9, will be removed in API11. Please use HorizontalAlignment and VerticalAlignment instead!")]
         public enum Alignment
         {
             /// <summary>
@@ -137,6 +138,7 @@ namespace Tizen.NUI
         /// [Draft] Get/Set the alignment in the layout
         /// </summary>
         /// <since_tizen> 6 </since_tizen>
+        [Obsolete("Deprecated in API9, will be removed in API11. Please use HorizontalAlignment and VerticalAlignment properties instead!")]
         public LinearLayout.Alignment LinearAlignment
         {
             get
@@ -186,13 +188,13 @@ namespace Tizen.NUI
         /// <summary>
         /// Get/Set the horizontal alignment in the layout
         /// </summary>
-        [EditorBrowsable(EditorBrowsableState.Never)]
+        /// <since_tizen> 9 </since_tizen>
         public HorizontalAlignment HorizontalAlignment { get; set; } = HorizontalAlignment.Begin;
 
         /// <summary>
         /// Get/Set the vertical alignment in the layout
         /// </summary>
-        [EditorBrowsable(EditorBrowsableState.Never)]
+        /// <since_tizen> 9 </since_tizen>
         public VerticalAlignment VerticalAlignment { get; set; } = VerticalAlignment.Top;
 
         private float totalLength = 0.0f;
index 16122be..8457efb 100644 (file)
@@ -66,7 +66,7 @@ namespace Tizen.NUI
         [EditorBrowsable(EditorBrowsableState.Never)]
         static public Window Get(View view)
         {
-            if(view == null)
+            if (view == null)
             {
                 NUILog.Error("if there is no view, it can not get a window");
                 return null;
@@ -1727,5 +1727,28 @@ namespace Tizen.NUI
             return ret;
         }
 
+        /// <summary>
+        /// Get Native Window handle.
+        /// <example>
+        /// How to get Native Window handle
+        /// <code>
+        /// Window window = NUIApplication.GetDefaultWindow();
+        /// var handle = window.NativeHandle;
+        /// if(handle?.IsInvalid == false)
+        /// {
+        ///     IntPtr nativeHandle = handle.DangerousGetHandle();
+        ///     // do something with nativeHandle
+        /// }
+        /// </code>
+        /// </example>
+        /// </summary>
+        /// <since_tizen> 9 </since_tizen>
+        public SafeHandle NativeHandle
+        {
+            get
+            {
+                return new NUI.SafeNativeWindowHandle(this);
+            }
+        }
     }
 }
index ec6d52b..0c45ab6 100755 (executable)
@@ -902,6 +902,7 @@ namespace Tizen.NUI
         /// Contains and encapsulates Native Window handle.
         /// </summary>
         /// <since_tizen> 4 </since_tizen>
+        [Obsolete("Deprecated in API9, will be removed in API11. Please use Window.NativeHandle instead!")]
         public class SafeNativeWindowHandle : SafeHandle
         {
             /// <summary>
diff --git a/src/Tizen.NUI/src/public/Window/WindowHandle.cs b/src/Tizen.NUI/src/public/Window/WindowHandle.cs
new file mode 100644 (file)
index 0000000..280535f
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+ * 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;
+using System.Runtime.InteropServices;
+
+namespace Tizen.NUI
+{
+    /// <summary>
+    /// Contains and encapsulates Native Window handle.
+    /// </summary>
+    internal class SafeNativeWindowHandle : SafeHandle
+    {
+        /// <summary>
+        ///Constructor, Native window handle is set to handle.
+        /// </summary>
+        internal SafeNativeWindowHandle(Window currentWindow) : base(IntPtr.Zero, false)
+        {
+            SetHandle(currentWindow != null ? currentWindow.GetNativeWindowHandler() : IntPtr.Zero);
+        }
+        /// <summary>
+        /// Null check if the handle is valid or not.
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public override bool IsInvalid
+        {
+            get
+            {
+                return this.handle == IntPtr.Zero;
+            }
+        }
+        /// <summary>
+        /// Release handle itself.
+        /// </summary>
+        /// <returns>true when released successfully.</returns>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        protected override bool ReleaseHandle()
+        {
+            SetHandle(global::System.IntPtr.Zero);
+            return true;
+        }
+    }
+}