1 #ifndef DALI_INPUT_FILTER_PROPERTIES_H
2 #define DALI_INPUT_FILTER_PROPERTIES_H
5 * Copyright (c) 2021 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
26 * @addtogroup dali_toolkit_controls_text_controls
33 * @brief InputFilter Property.
39 * @brief Enumeration for the type of InputFilter.
41 * An enum that determines the input filter type of the InputFilter map.
42 * Users can set the ACCEPTED or REJECTED character set, or both.
43 * If both are used, REJECTED has higher priority.
44 * The character set must follow the regular expression rules.
45 * Behaviour can not be guaranteed for incorrect grammars.
47 * Useful Meta characters:
49 * | %Meta characters | Description
50 * |-------------------|------------------------------------------------------------------------------------------------------------|
51 * | \\w | Matches an alphanumeric character, including "_"; same as [A-Za-z0-9_]. |
52 * | \\W | Matches a non-alphanumeric character, excluding "_"; same as [^A-Za-z0-9_]. |
53 * | \\s | Matches a whitespace character, which in ASCII are tab, line feed, form feed, carriage return, and space. |
54 * | \\S | Matches anything but a whitespace. |
55 * | \\d | Matches a digit; same as [0-9]. |
56 * | \\D | Matches a non-digit; same as [^0-9]. |
60 * Property::Map filter;
61 * filter[InputFilter::Property::ACCEPTED] = "[\\d]"; // accept whole digits
62 * filter[InputFilter::Property::REJECTED] = "[0-5]"; // reject 0, 1, 2, 3, 4, 5
64 * field.SetProperty(DevelTextField::Property::INPUT_FILTER, filter); // acceptable inputs are 6, 7, 8, 9
71 * @brief The set of characters to be accepted.
72 * @details Name "accepted", type Property::STRING.
74 * @note Available on regex string.
79 * @brief The set of characters to be rejected.
80 * @details Name "rejected", type Property::STRING.
82 * @note Available on regex string.
87 } // namespace Property
89 } // namespace InputFilter
95 } // namespace Toolkit
99 #endif // DALI_INPUT_FILTER_PROPERTIES_H