Add InputFilter to TextField, TextEditor
authorBowon Ryu <bowon.ryu@samsung.com>
Fri, 21 May 2021 08:58:13 +0000 (17:58 +0900)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Tue, 10 Aug 2021 09:08:13 +0000 (18:08 +0900)
commit182c8d102f471ab288e1fc3adeff72dd5648b3ef
tree1ece527b4260fcd72cb9d29ca355ff285487b631
parente2cb562801f0147b29804802daed6a050f5a5bde
Add InputFilter to TextField, TextEditor

Text input filter based on regular expressions.

Add a InputFilter struct to pass data of DALi InputFilter PropertyMap.
The InputFilter struct can be used as an argument to SetInputFilter and GetInputFilter methods.

// example
InputFilter inputFilter;
inputFilter.Accepted = new Regex(@"[\d]");
inputFilter.Rejected = new Regex("[0-3]");

field.SetInputFilter(inputFilter);

field.InputFiltered += (s, e) =>
{
    if (e.Type == InputFilterType.Accept)
    {
        // If input is filtered by InputFilter of Accept type.
    }
    else if (e.Type == InputFilterType.Reject)
    {
        // If input is filtered by InputFilter of Reject type.
    }
};

Signed-off-by: Bowon Ryu <bowon.ryu@samsung.com>
src/Tizen.NUI/src/internal/Interop/Interop.TextEditor.cs
src/Tizen.NUI/src/internal/Interop/Interop.TextField.cs
src/Tizen.NUI/src/public/BaseComponents/TextEditor.cs
src/Tizen.NUI/src/public/BaseComponents/TextEditorEvent.cs
src/Tizen.NUI/src/public/BaseComponents/TextEvent.cs
src/Tizen.NUI/src/public/BaseComponents/TextField.cs
src/Tizen.NUI/src/public/BaseComponents/TextFieldEvent.cs
src/Tizen.NUI/src/public/Common/NUIConstants.cs