Add InputFilter to TextField, TextEditor 75/258375/14
authorBowon Ryu <bowon.ryu@samsung.com>
Fri, 14 May 2021 07:50:39 +0000 (16:50 +0900)
committerBowon Ryu <bowon.ryu@samsung.com>
Mon, 28 Jun 2021 07:18:49 +0000 (16:18 +0900)
Text input filter based on regular expressions.

// example
Property::Map filter;
filter[InputFilter::Property::ACCEPTED] = "[\\d]";
filter[InputFilter::Property::REJECTED] = "[0-5]";

field.SetProperty(DevelTextField::Property::INPUT_FILTER, filter);

DevelTextField::InputFilteredSignal(field).Connect(this, &OnInputFiltered);

```

void OnInputFiltered(TextField field, InputFilter::Property::Type type)
{
  Property::Map filter = field.GetProperty<Property::Map>(DevelTextField::Property::INPUT_FILTER);
  if (type == InputFilter::Property::ACCEPTED)
  {
    std::cout << "only follow character set is accepted " << filter[type] << std::endl;
  }
  else if (type == InputFilter::Property::REJECTED)
  {
    std::cout << "follow character set is rejected " << filter[type] << std::endl;
  }
}

Change-Id: Ia512438c9cb8aeb28c81f38e7b0220544a0751f0
Signed-off-by: Bowon Ryu <bowon.ryu@samsung.com>

No differences found