X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Fdevel-api%2Fcontrols%2Ftext-controls%2Ftext-editor-devel.h;h=695ca1ba1e73e740166178e3b3081254c3c916a6;hp=665af7a1452ccb98ec5b609919b9e2564343995f;hb=5247947358fb8bd9a1b27a6f0f347d6836b6e4f0;hpb=4004536dbf977b14ed8fdb8cb55448beb93c2172 diff --git a/dali-toolkit/devel-api/controls/text-controls/text-editor-devel.h b/dali-toolkit/devel-api/controls/text-controls/text-editor-devel.h index 665af7a..695ca1b 100644 --- a/dali-toolkit/devel-api/controls/text-controls/text-editor-devel.h +++ b/dali-toolkit/devel-api/controls/text-controls/text-editor-devel.h @@ -21,6 +21,7 @@ #include // INTERNAL INCLUDES +#include #include namespace Dali @@ -111,7 +112,7 @@ enum Type /** * @brief Modifies the default text alignment to match the direction of the system language. * @details Name "matchSystemLanguageDirection", type (Property::BOOLEAN), Read/Write - * @note The default value is false + * @note The default value is true */ MATCH_SYSTEM_LANGUAGE_DIRECTION, @@ -220,6 +221,52 @@ enum Type * @endcode */ INPUT_METHOD_SETTINGS, + + /** + * @brief The input filter + * @details Name "inputFilter", type Property::MAP. + * + * The inputFilter map contains the following keys: + * + * | %Property Name | Type | Required | Description | + * |----------------------|----------|----------|---------------------------------------------------------------------------------------------------------------------| + * | accepted | STRING | No | A regular expression in the set of characters to be accepted by the inputFilter (the default value is empty string) | + * | rejected | STRING | No | A regular expression in the set of characters to be rejected by the inputFilter (the default value is empty string) | + * + * @note Optional. + * The character set must follow the regular expression rules. + * Behaviour can not be guaranteed for incorrect grammars. + * Refer the link below for detailed rules. + * The functions in std::regex library use the ECMAScript grammar: + * http://cplusplus.com/reference/regex/ECMAScript/ + * + * You can use enums instead of "accepted" and "rejected" strings. + * @see Dali::Toolkit::InputFilter::Property::Type + * + * Example Usage: + * @code + * Property::Map filter; + * filter[InputFilter::Property::ACCEPTED] = "[\\d]"; // accept whole digits + * filter[InputFilter::Property::REJECTED] = "[0-5]"; // reject 0, 1, 2, 3, 4, 5 + * + * editor.SetProperty(DevelTextEditor::Property::INPUT_FILTER, filter); // acceptable inputs are 6, 7, 8, 9 + * @endcode + */ + INPUT_FILTER, + + /** + * @brief Whether we should show the ellipsis if required. + * @details Name "ellipsis", type Property::BOOLEAN. + */ + ELLIPSIS, + + /** + * @brief The enumerations used to specify whether to position the ellipsis at the END, START or MIDDLE of the text. + * @details Name "EllipsisPosition", type [Type](@ref Dali::Toolkit::DevelText::EllipsisPosition::Type) (Property::INTEGER), or Property::STRING. Read/Write + * @note Default is EllipsisPosition::END. + * @see DevelText::EllipsisPosition + */ + ELLIPSIS_POSITION, }; } // namespace Property @@ -271,6 +318,37 @@ using AnchorClickedSignalType = Signal; DALI_TOOLKIT_API AnchorClickedSignalType& AnchorClickedSignal(TextEditor textEditor); /** + * @brief Input filtered signal type. + */ +using InputFilteredSignalType = Signal; + +/** + * @brief This signal is emitted when the character to be inserted is filtered by the input filter. + * + * A callback of the following type may be connected: + * @code + * void YourCallbackName(TextEditor textEditor, Toolkit::InputFilter::Property::Type type); + * + * DevelTextEditor::InputFilteredSignal(textEditor).Connect(this, &OnInputFiltered); + * + * void OnInputFiltered(TextEditor textEditor, InputFilter::Property::Type type) + * { + * if (type == InputFilter::Property::ACCEPTED) + * { + * // If the input has been filtered with an accepted filter, the type is ACCEPTED. + * } + * else if (type == InputFilter::Property::REJECTED) + * { + * // If the input has been filtered with an rejected filter, the type is REJECTED. + * } + * } + * @endcode + * @param[in] textEditor The instance of TextEditor. + * @return The signal to connect to. + */ +DALI_TOOLKIT_API InputFilteredSignalType& InputFilteredSignal(TextEditor textEditor); + +/** * @brief Select the whole text of TextEditor. * * @param[in] textEditor The instance of TextEditor.