[NUI] Add RequestAsyncRenderWithConstraint to TextLabel
authorBowon Ryu <bowon.ryu@samsung.com>
Wed, 10 Jul 2024 05:40:25 +0000 (14:40 +0900)
committerJiyun Yang <ji.yang@samsung.com>
Wed, 21 Aug 2024 06:10:37 +0000 (15:10 +0900)
Requests asynchronous rendering with the maximum available width using the given widthConstraint.

If the width of the text content is smaller than the widthConstraint, the width will be determined by the width of the text.
If the width of the text content is larger than the widthConstraint, the width will be determined by the widthConstraint.

The height is determined by the content of the text when rendered with the given width.
In this case, the result will be the same as the height returned by GetHeightForWidth.

Signed-off-by: Bowon Ryu <bowon.ryu@samsung.com>
src/Tizen.NUI/src/internal/Interop/Interop.TextLabel.cs
src/Tizen.NUI/src/public/BaseComponents/TextLabel.cs

index b321719fa2347f2c520c4a9bc47599a1deae546c..502eac09d772cfd7d903cd7c7fcbc0578de21a2b 100755 (executable)
@@ -199,6 +199,9 @@ namespace Tizen.NUI
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_RequestAsyncRenderWithFixedWidth")]
             public static extern void RequestAsyncRenderWithFixedWidth(global::System.Runtime.InteropServices.HandleRef textLabelRef, float width);
 
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_RequestAsyncRenderWithConstraint")]
+            public static extern void RequestAsyncRenderWithConstraint(global::System.Runtime.InteropServices.HandleRef textLabelRef, float widthConstraint);
+
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_AsyncTextRenderedSignal")]
             public static extern global::System.IntPtr AsyncTextRenderedSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
         }
index dc2ba066c6f7b65bf272121216adc8e62704b692..25677687834d2d408c7a583b4455489fbef316f1 100755 (executable)
@@ -351,6 +351,23 @@ namespace Tizen.NUI.BaseComponents
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }
 
+        /// <summary>
+        /// Requests asynchronous rendering with the maximum available width using the given widthConstraint.
+        /// </summary>
+        /// <param name="widthConstraint">The maximum available width of text to render.</param>
+        /// <remarks>
+        /// If the width of the text content is smaller than the widthConstraint, the width will be determined by the width of the text.<br />
+        /// If the width of the text content is larger than the widthConstraint, the width will be determined by the widthConstraint.<br />
+        /// The height is determined by the content of the text when rendered with the given width.<br />
+        /// In this case, the result will be the same as the height returned by GetHeightForWidth.
+        /// </remarks>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void RequestAsyncRenderWithConstraint(float widthConstraint)
+        {
+            Interop.TextLabel.RequestAsyncRenderWithConstraint(SwigCPtr, widthConstraint);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
         /// <summary>
         /// The TranslatableText property.<br />
         /// The text can set the SID value.<br />