#define DALI_TOOLKIT_TEXT_FIELD_DEVEL_H
/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#include <dali/devel-api/adaptor-framework/input-method-context.h>
// INTERNAL INCLUDES
+#include <dali-toolkit/public-api/controls/text-controls/input-filter-properties.h>
#include <dali-toolkit/public-api/controls/text-controls/text-field.h>
namespace Dali
*/
ENABLE_EDITING,
+ /**
+ * @brief The font size scale.
+ * @details name "fontSizeScale", type Property::FLOAT.
+ * @note The default value is 1.0 which does nothing.
+ * The given font size scale value is used for multiplying the specified font size before querying fonts.
+ *
+ * e.g. The rendering results of both cases are same.
+ * - fontSize: 15pt, fontSizeScale: 1.0
+ * - fontSize: 10pt, fontSizeScale: 1.5
+ */
+ FONT_SIZE_SCALE,
+
+ /**
+ * @brief The position for primary cursor.
+ * @details Name "primaryCursorPosition", type Property::INTEGER.
+ */
+ PRIMARY_CURSOR_POSITION,
+
+ /**
+ * @brief The color of the grab color.
+ * @details Name "grabHandleColor", type Property::VECTOR4.
+ */
+ GRAB_HANDLE_COLOR,
+
+ /**
+ * @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
+ *
+ * field.SetProperty(DevelTextField::Property::INPUT_FILTER, filter); // acceptable inputs are 6, 7, 8, 9
+ * @endcode
+ */
+ INPUT_FILTER,
};
+
} // namespace Property
/**
DALI_TOOLKIT_API InputMethodContext GetInputMethodContext(TextField textField);
/**
+ * @brief Anchor clicked signal type.
+ *
+ * @note Signal
+ * - const char* : href of clicked anchor.
+ * - uint32_t : length of href.
+ */
+using AnchorClickedSignalType = Signal<void(TextField, const char*, uint32_t)>;
+
+/**
+ * @brief This signal is emitted when the anchor is clicked.
+ *
+ * A callback of the following type may be connected:
+ * @code
+ * void YourCallbackName(TextField textField, const char* href, uint32_t hrefLength);
+ * @endcode
+ * @param[in] textField The instance of TextField.
+ * @return The signal to connect to.
+ */
+DALI_TOOLKIT_API AnchorClickedSignalType& AnchorClickedSignal(TextField textField);
+
+/**
+ * @brief Input filtered signal type.
+ */
+using InputFilteredSignalType = Signal<void(TextField, Toolkit::InputFilter::Property::Type)>;
+
+/**
+ * @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(TextField textField, Toolkit::InputFilter::Property::Type type);
+ *
+ * DevelTextField::InputFilteredSignal(textField).Connect(this, &OnInputFiltered);
+ *
+ * void OnInputFiltered(TextField textField, 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] textField The instance of TextField.
+ * @return The signal to connect to.
+ */
+DALI_TOOLKIT_API InputFilteredSignalType& InputFilteredSignal(TextField textField);
+
+/**
* @brief Select the whole text of TextField.
*
* @param[in] textField The instance of TextField.