[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, float heightConstraint);
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_RequestAsyncNaturalSize")]
+ public static extern void RequestAsyncNaturalSize(global::System.Runtime.InteropServices.HandleRef textLabelRef);
+
[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);
+
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_AsyncNaturalSizeComputedSignal")]
+ public static extern global::System.IntPtr AsyncNaturalSizeComputedSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
}
}
}
/// </summary>
public float Height { get; }
}
+
+ /// <summary>
+ /// AsyncTextSizeComputedEventArgs is a class to record async text size computed event arguments which will be sent to user.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public class AsyncTextSizeComputedEventArgs : EventArgs
+ {
+ public AsyncTextSizeComputedEventArgs(float width, float height)
+ {
+ Width = width;
+ Height = height;
+ }
+
+ /// <summary>
+ /// The computed width.
+ /// </summary>
+ public float Width { get; }
+
+ /// <summary>
+ /// The computed height.
+ /// </summary>
+ public float Height { get; }
+ }
}
\ No newline at end of file
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
+ /// <summary>
+ /// Requests asynchronous text natural size computation.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public void RequestAsyncNaturalSize()
+ {
+ Interop.TextLabel.RequestAsyncNaturalSize(SwigCPtr);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+
/// <summary>
/// The TranslatableText property.<br />
/// The text can set the SID value.<br />
private EventHandler<AsyncTextRenderedEventArgs> textLabelAsyncTextRenderedEventHandler;
private AsyncTextRenderedCallbackDelegate textLabelAsyncTextRenderedCallbackDelegate;
+ private EventHandler<AsyncTextSizeComputedEventArgs> textLabelAsyncTextNaturalSizeComputedEventHandler;
+ private AsyncTextNaturalSizeComputedCallbackDelegate textLabelAsyncTextNaturalSizeComputedCallbackDelegate;
+
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
private delegate void AnchorClickedCallbackDelegate(IntPtr textLabel, IntPtr href, uint hrefLength);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
private delegate void AsyncTextRenderedCallbackDelegate(IntPtr textLabel, float width, float height);
+ [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+ private delegate void AsyncTextNaturalSizeComputedCallbackDelegate(IntPtr textLabel, float width, float height);
+
+
+ /// <summary>
+ /// The AsyncNaturalSizeComputed signal is emitted when the async natural size computed.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public event EventHandler<AsyncTextSizeComputedEventArgs> AsyncNaturalSizeComputed
+ {
+ add
+ {
+ if (textLabelAsyncTextNaturalSizeComputedEventHandler == null)
+ {
+ textLabelAsyncTextNaturalSizeComputedCallbackDelegate = (OnAsyncNaturalSizeComputed);
+ AsyncNaturalSizeComputedSignal().Connect(textLabelAsyncTextNaturalSizeComputedCallbackDelegate);
+ }
+ textLabelAsyncTextNaturalSizeComputedEventHandler += value;
+ }
+ remove
+ {
+ textLabelAsyncTextNaturalSizeComputedEventHandler -= value;
+ if (textLabelAsyncTextNaturalSizeComputedEventHandler == null && AsyncNaturalSizeComputedSignal().Empty() == false)
+ {
+ AsyncNaturalSizeComputedSignal().Disconnect(textLabelAsyncTextNaturalSizeComputedCallbackDelegate);
+ }
+ }
+ }
+
+ internal TextLabelSignal AsyncNaturalSizeComputedSignal()
+ {
+ TextLabelSignal ret = new TextLabelSignal(Interop.TextLabel.AsyncNaturalSizeComputedSignal(SwigCPtr), false);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
+ private void OnAsyncNaturalSizeComputed(IntPtr textLabel, float width, float height)
+ {
+ AsyncTextSizeComputedEventArgs e = new AsyncTextSizeComputedEventArgs(width, height);
+
+ //here we send all data to user event handlers
+ textLabelAsyncTextNaturalSizeComputedEventHandler?.Invoke(this, e);
+ }
+
/// <summary>
/// The AsyncTextRendered signal is emitted when the async text rendered.
/// </summary>