From e8f28638fb58877f20ca6ffdc031066ee760b62f Mon Sep 17 00:00:00 2001 From: Bowon Ryu Date: Mon, 13 May 2024 15:05:19 +0900 Subject: [PATCH] [NUI] Add align API to InputMethodContext Signed-off-by: Bowon Ryu --- .../internal/Interop/Interop.InputMethodContext.cs | 4 ++ .../src/public/Input/InputMethodContext.cs | 64 ++++++++++++++++++++++ 2 files changed, 68 insertions(+) diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.InputMethodContext.cs b/src/Tizen.NUI/src/internal/Interop/Interop.InputMethodContext.cs index 8393263..abc4d77 100755 --- a/src/Tizen.NUI/src/internal/Interop/Interop.InputMethodContext.cs +++ b/src/Tizen.NUI/src/internal/Interop/Interop.InputMethodContext.cs @@ -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); diff --git a/src/Tizen.NUI/src/public/Input/InputMethodContext.cs b/src/Tizen.NUI/src/public/Input/InputMethodContext.cs index 05f825f..c188e30 100755 --- a/src/Tizen.NUI/src/public/Input/InputMethodContext.cs +++ b/src/Tizen.NUI/src/public/Input/InputMethodContext.cs @@ -377,6 +377,50 @@ namespace Tizen.NUI } /// + /// Enumeration for align of the input panel. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public enum InputPanelAlign + { + /// + /// The top-left corner. + /// + TopLeft, + /// + /// The top-center position. + /// + TopCenter, + /// + /// The top-right corner. + /// + TopRight, + /// + /// The middle-left position. + /// + MiddleLeft, + /// + /// The middle-center position. + /// + MiddleCenter, + /// + /// The middle-right position. + /// + MiddleRight, + /// + /// The bottom-left corner. + /// + BottomLeft, + /// + /// The bottom-center position. + /// + BottomCenter, + /// + /// The bottom-right corner. + /// + BottomRight + } + + /// /// Gets or sets whether the IM context allows to use the text prediction. /// /// 8 @@ -682,6 +726,26 @@ namespace Tizen.NUI } /// + /// Sets the alignment and its x,y coordinates of the input panel.
+ /// Regardless of the rotation degree, the x, y values of the top-left corner on the screen are based on 0, 0.
+ /// When the IME size is changed, its size will change according to the set alignment. + ///
+ /// + /// This API can be used to set the alignment of a floating IME. + /// + /// The x coordinate of the InputPanelAlign value. + /// The y coordinate of the InputPanelAlign value. + /// one of the InputPanelAlign values specifying the desired alignment. + /// True on success, false otherwise. + [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; + } + + /// /// Sets the language of the input panel. /// /// The language to be set to the input panel -- 2.7.4