[NUI] Add align API to InputMethodContext
authorBowon Ryu <bowon.ryu@samsung.com>
Mon, 13 May 2024 06:05:19 +0000 (15:05 +0900)
committerBowon Ryu <wonrst22@naver.com>
Mon, 13 May 2024 10:23:55 +0000 (19:23 +0900)
Signed-off-by: Bowon Ryu <bowon.ryu@samsung.com>
src/Tizen.NUI/src/internal/Interop/Interop.InputMethodContext.cs
src/Tizen.NUI/src/public/Input/InputMethodContext.cs

index 8393263..abc4d77 100755 (executable)
@@ -203,6 +203,10 @@ namespace Tizen.NUI
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_InputMethodContext_SetInputPanelPosition")]
             public static extern void SetInputPanelPosition(global::System.Runtime.InteropServices.HandleRef jarg1, uint jarg2, uint jarg3);
 
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_InputMethodContext_SetInputPanelPositionAlign")]
+            [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)]
+            public static extern bool SetInputPanelPositionAlign(global::System.Runtime.InteropServices.HandleRef inputMethodContext, int x, int y, int align);
+
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_InputMethodContext_ActivatedSignal")]
             public static extern global::System.IntPtr ActivatedSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
 
index 05f825f..c188e30 100755 (executable)
@@ -377,6 +377,50 @@ namespace Tizen.NUI
         }
 
         /// <summary>
+        /// Enumeration for align of the input panel.
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public enum InputPanelAlign
+        {
+            /// <summary>
+            /// The top-left corner.
+            /// </summary>
+            TopLeft,
+            /// <summary>
+            /// The top-center position.
+            /// </summary>
+            TopCenter,
+            /// <summary>
+            /// The top-right corner.
+            /// </summary>
+            TopRight,
+            /// <summary>
+            /// The middle-left position.
+            /// </summary>
+            MiddleLeft,
+            /// <summary>
+            /// The middle-center position.
+            /// </summary>
+            MiddleCenter,
+            /// <summary>
+            /// The middle-right position.
+            /// </summary>
+            MiddleRight,
+            /// <summary>
+            /// The bottom-left corner.
+            /// </summary>
+            BottomLeft,
+            /// <summary>
+            /// The bottom-center position.
+            /// </summary>
+            BottomCenter,
+            /// <summary>
+            /// The bottom-right corner.
+            /// </summary>
+            BottomRight
+        }
+
+        /// <summary>
         /// Gets or sets whether the IM context allows to use the text prediction.
         /// </summary>
         /// <since_tizen> 8 </since_tizen>
@@ -682,6 +726,26 @@ namespace Tizen.NUI
         }
 
         /// <summary>
+        /// Sets the alignment and its x,y coordinates of the input panel.<br/>
+        /// Regardless of the rotation degree, the x, y values of the top-left corner on the screen are based on 0, 0.<br/>
+        /// When the IME size is changed, its size will change according to the set alignment.
+        /// </summary>
+        /// <remarks>
+        /// This API can be used to set the alignment of a floating IME.
+        /// </remarks>
+        /// <param name="x">The x coordinate of the InputPanelAlign value.</param>
+        /// <param name="y">The y coordinate of the InputPanelAlign value.</param>
+        /// <param name="align">one of the InputPanelAlign values specifying the desired alignment.</param>
+        /// <returns>True on success, false otherwise.</returns>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public bool SetInputPanelPositionAlign(int x, int y, InputMethodContext.InputPanelAlign align)
+        {
+            bool ret = Interop.InputMethodContext.SetInputPanelPositionAlign(SwigCPtr, x, y, (int)align);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
+        /// <summary>
         /// Sets the language of the input panel.
         /// </summary>
         /// <param name="language">The language to be set to the input panel</param>