[NUI] Add to set Available Orientations (#1257)
authorWonsik Jung <sidein@samsung.com>
Wed, 26 Feb 2020 04:07:43 +0000 (13:07 +0900)
committerGitHub <noreply@github.com>
Wed, 26 Feb 2020 04:07:43 +0000 (13:07 +0900)
Add to set Available Orientations.
This API is for adding serveral orientations one time.

src/Tizen.NUI/src/internal/Interop/Interop.Window.cs
src/Tizen.NUI/src/public/Window.cs

index 65f646e..ecbb5fa 100755 (executable)
@@ -61,6 +61,9 @@ namespace Tizen.NUI
 
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Window_GetCurrentOrientation")]
             public static extern int Window_GetCurrentOrientation(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Window_SetAvailableOrientations")]
+            public static extern void Window_SetAvailableOrientations(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
             
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Window_SetPositionSize")]
             public static extern void Window_SetPositionSize(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
index e27c7aa..6e14478 100755 (executable)
@@ -1087,6 +1087,25 @@ namespace Tizen.NUI
             return ret;
         }
 
+        /// <summary>
+        /// Sets available orientations of the window.
+        /// This API is for setting several orientations one time.
+        /// </summary>
+        /// <param name="orientations">The list of orientations.</param>
+        /// <since_tizen> 6 </since_tizen>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void SetAvailableOrientations( List<Window.WindowOrientation> orientations )
+        {
+            PropertyArray orientationArray = new PropertyArray();
+            for( int i = 0; i < orientations.Count; i++ )
+            {
+              orientationArray.PushBack(new PropertyValue((int)orientations[i]));
+            }
+
+            Interop.Window.Window_SetAvailableOrientations(swigCPtr, PropertyArray.getCPtr(orientationArray));
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
         internal Any GetNativeHandle()
         {
             Any ret = new Any(Interop.WindowInternal.Window_GetNativeHandle(swigCPtr), true);