private EventHandler<AnchorClickedEventArgs> textEditorAnchorClickedEventHandler;
private AnchorClickedCallbackDelegate textEditorAnchorClickedCallbackDelegate;
+ private EventHandler textEditorSelectionClearedEventHandler;
+ private SelectionClearedCallbackDelegate textEditorSelectionClearedCallbackDelegate;
+
+ private EventHandler textEditorSelectionStartedEventHandler;
+ private SelectionStartedCallbackDelegate textEditorSelectionStartedCallbackDelegate;
+
private EventHandler textEditorSelectionChangedEventHandler;
private SelectionChangedCallbackDelegate textEditorSelectionChangedCallbackDelegate;
private EventHandler<InputFilteredEventArgs> textEditorInputFilteredEventHandler;
private InputFilteredCallbackDelegate textEditorInputFilteredCallbackDelegate;
- [UnmanagedFunctionPointer(CallingConvention.StdCall)]
+ [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
private delegate void TextChangedCallbackDelegate(IntPtr textEditor);
- [UnmanagedFunctionPointer(CallingConvention.StdCall)]
+ [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
private delegate void ScrollStateChangedCallbackDelegate(IntPtr textEditor, ScrollState state);
- [UnmanagedFunctionPointer(CallingConvention.StdCall)]
+ [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
private delegate void CursorPositionChangedCallbackDelegate(IntPtr textEditor, uint oldPosition);
- [UnmanagedFunctionPointer(CallingConvention.StdCall)]
+ [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
private delegate void MaxLengthReachedCallbackDelegate(IntPtr textEditor);
- [UnmanagedFunctionPointer(CallingConvention.StdCall)]
+ [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+ private delegate void SelectionClearedCallbackDelegate(IntPtr textEditor);
+
+ [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+ private delegate void SelectionStartedCallbackDelegate(IntPtr textEditor);
+
+ [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
private delegate void AnchorClickedCallbackDelegate(IntPtr textEditor, IntPtr href, uint hrefLength);
- [UnmanagedFunctionPointer(CallingConvention.StdCall)]
+ [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
private delegate void SelectionChangedCallbackDelegate(IntPtr textEditor, uint oldStart, uint oldEnd);
- [UnmanagedFunctionPointer(CallingConvention.StdCall)]
+ [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
private delegate void InputFilteredCallbackDelegate(IntPtr textEditor, InputFilterType type);
+ private bool invokeTextChanged = true;
+
/// <summary>
/// An event for the TextChanged signal which can be used to subscribe or unsubscribe the event handler
/// provided by the user. The TextChanged signal is emitted when the text changes.<br />
}
/// <summary>
- /// The CursorPositionChanged event.
+ /// The CursorPositionChanged event is emitted whenever the primary cursor position changed.
/// </summary>
- /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 9 </since_tizen>
public event EventHandler CursorPositionChanged
{
add
}
/// <summary>
- /// The SelectionChanged event.
+ /// The SelectionStarted event is emitted when the selection has been started.
/// </summary>
- /// This will be public opened after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 10 </since_tizen>
+ public event EventHandler SelectionStarted
+ {
+ add
+ {
+ if (textEditorSelectionStartedEventHandler == null)
+ {
+ textEditorSelectionStartedCallbackDelegate = (OnSelectionStarted);
+ SelectionStartedSignal().Connect(textEditorSelectionStartedCallbackDelegate);
+ }
+ textEditorSelectionStartedEventHandler += value;
+ }
+ remove
+ {
+ if (textEditorSelectionStartedEventHandler == null && SelectionStartedSignal().Empty() == false)
+ {
+ this.SelectionStartedSignal().Disconnect(textEditorSelectionStartedCallbackDelegate);
+ }
+ textEditorSelectionStartedEventHandler -= value;
+ }
+ }
+
+ /// <summary>
+ /// The SelectionCleared signal is emitted when selection is cleared.
+ /// </summary>
+ /// <since_tizen> 9 </since_tizen>
+ public event EventHandler SelectionCleared
+ {
+ add
+ {
+ if (textEditorSelectionClearedEventHandler == null)
+ {
+ textEditorSelectionClearedCallbackDelegate = (OnSelectionCleared);
+ SelectionClearedSignal().Connect(textEditorSelectionClearedCallbackDelegate);
+ }
+ textEditorSelectionClearedEventHandler += value;
+ }
+ remove
+ {
+ if (textEditorSelectionClearedEventHandler == null && SelectionClearedSignal().Empty() == false)
+ {
+ this.SelectionClearedSignal().Disconnect(textEditorSelectionClearedCallbackDelegate);
+ }
+ textEditorSelectionClearedEventHandler -= value;
+ }
+ }
+
+ /// <summary>
+ /// The SelectionChanged event is emitted whenever the selected text is changed.
+ /// </summary>
+ /// <since_tizen> 9 </since_tizen>
public event EventHandler SelectionChanged
{
add
/// };
/// </code>
/// </example>
- [EditorBrowsable(EditorBrowsableState.Never)]
+ /// <since_tizen> 9 </since_tizen>
public event EventHandler<InputFilteredEventArgs> InputFiltered
{
add
}
}
+ internal TextEditorSignal SelectionStartedSignal()
+ {
+ TextEditorSignal ret = new TextEditorSignal(Interop.TextEditor.SelectionStartedSignal(SwigCPtr), false);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
+ internal TextEditorSignal SelectionClearedSignal()
+ {
+ TextEditorSignal ret = new TextEditorSignal(Interop.TextEditor.SelectionClearedSignal(SwigCPtr), false);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
internal TextEditorSignal TextChangedSignal()
{
TextEditorSignal ret = new TextEditorSignal(Interop.TextEditor.TextChangedSignal(SwigCPtr), false);
private void OnTextChanged(IntPtr textEditor)
{
- if (textEditorTextChangedEventHandler != null)
+ if (textEditorTextChangedEventHandler != null && invokeTextChanged)
{
TextChangedEventArgs e = new TextChangedEventArgs();
}
}
+ private void OnSelectionStarted(IntPtr textEditor)
+ {
+ //no data to be sent to the user
+ textEditorSelectionStartedEventHandler?.Invoke(this, EventArgs.Empty);
+ }
+
+ private void OnSelectionCleared(IntPtr textEditor)
+ {
+ //no data to be sent to the user
+ textEditorSelectionClearedEventHandler?.Invoke(this, EventArgs.Empty);
+ }
+
private void OnScrollStateChanged(IntPtr textEditor, ScrollState state)
{
if (textEditorScrollStateChangedEventHandler != null)