/*
- * 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.
END_TEST;
}
+int UtcDaliTextControllerImfPreeditStyleReverse(void)
+{
+ tet_infoline(" UtcDaliTextControllerImfPreeditStyleReverse");
+ ToolkitTestApplication application;
+
+ // Creates a text controller.
+ ControllerPtr controller = Controller::New();
+
+ std::string text;
+ InputMethodContext::EventData imfEvent;
+
+ DALI_TEST_CHECK(controller);
+
+ // Configures the text controller similarly to the text-field.
+ ConfigureTextField(controller);
+
+ InputMethodContext inputMethodContext = InputMethodContext::New();
+
+ // Send PRE_EDIT event
+ imfEvent = InputMethodContext::EventData(InputMethodContext::PRE_EDIT, "Reverse", 0, 7);
+ controller->OnInputMethodContextEvent(inputMethodContext, imfEvent);
+
+ // For coverage, mEditableControlInterface is required.
+ // Creates a temporary text-field to use mEditableControlInterface.
+ TextField field = TextField::New();
+ Toolkit::Internal::TextField& fieldImpl = GetImpl(field);
+ ControllerPtr fieldController = fieldImpl.getController();
+ Controller::Impl& fieldControllerImpl = Controller::Impl::GetImplementation(*fieldController.Get());
+ Controller::Impl& controllerImpl = Controller::Impl::GetImplementation(*controller.Get());
+
+ // For coverage, mEditableControlInterface is required.
+ controllerImpl.mEditableControlInterface = fieldControllerImpl.mEditableControlInterface;
+
+ // Set the preedit style as REVERSE
+ inputMethodContext.SetPreeditStyle(InputMethodContext::PreeditStyle::REVERSE);
+ controller->GetNaturalSize();
+
+ controller->GetText(text);
+ DALI_TEST_EQUALS("Reverse", text, TEST_LOCATION);
+
+ tet_result(TET_PASS);
+ END_TEST;
+}
+
int UtcDaliTextControllerTextPopupButtonTouched(void)
{
tet_infoline(" UtcDaliTextControllerTextPopupButtonTouched");
DALI_TEST_EQUALS( colorIndicesBuffer2[7], 0u, TEST_LOCATION);
END_TEST;
+}
+
+int UtcDaliTextEditorControlBackgroundColor(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline(" UtcDaliTextEditorControlBackgroundColor\n");
+
+ TextEditor editor = TextEditor::New();
+ DALI_TEST_CHECK(editor);
+
+ Vector4 backgroundColor;
+
+ editor.SetProperty(TextEditor::Property::TEXT, "Background Color");
+ application.GetScene().Add(editor);
+ application.SendNotification();
+ application.Render();
+
+ Toolkit::Internal::TextEditor& editorImpl = GetImpl(editor);
+ ControllerPtr controller = editorImpl.getController();
+ Controller::Impl& controllerImpl = Controller::Impl::GetImplementation(*controller.Get());
+
+ // Default color is transparent
+ controllerImpl.mEditableControlInterface->GetControlBackgroundColor(backgroundColor);
+ DALI_TEST_EQUALS(backgroundColor, Color::TRANSPARENT, TEST_LOCATION);
+
+ // Set background color to red
+ editor.SetBackgroundColor(Color::RED);
+ application.SendNotification();
+ application.Render();
+
+ // Should be red
+ controllerImpl.mEditableControlInterface->GetControlBackgroundColor(backgroundColor);
+ DALI_TEST_EQUALS(backgroundColor, Color::RED, TEST_LOCATION);
+
+ END_TEST;
}
\ No newline at end of file
DALI_TEST_EQUALS( colorIndicesBuffer2[7], 0u, TEST_LOCATION);
END_TEST;
+}
+
+int UtcDaliTextFieldControlBackgroundColor(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline(" UtcDaliTextFieldControlBackgroundColor\n");
+
+ TextField field = TextField::New();
+ DALI_TEST_CHECK(field);
+
+ Vector4 backgroundColor;
+
+ field.SetProperty(TextField::Property::TEXT, "Background Color");
+ application.GetScene().Add(field);
+ application.SendNotification();
+ application.Render();
+
+ Toolkit::Internal::TextField& fieldImpl = GetImpl(field);
+ ControllerPtr controller = fieldImpl.getController();
+ Controller::Impl& controllerImpl = Controller::Impl::GetImplementation(*controller.Get());
+
+ // Default color is transparent
+ controllerImpl.mEditableControlInterface->GetControlBackgroundColor(backgroundColor);
+ DALI_TEST_EQUALS(backgroundColor, Color::TRANSPARENT, TEST_LOCATION);
+
+ // Set background color to red
+ field.SetBackgroundColor(Color::RED);
+ application.SendNotification();
+ application.Render();
+
+ // Should be red
+ controllerImpl.mEditableControlInterface->GetControlBackgroundColor(backgroundColor);
+ DALI_TEST_EQUALS(backgroundColor, Color::RED, TEST_LOCATION);
+
+ END_TEST;
}
\ No newline at end of file
mDelayTime(0),
mDroppedFrames(0),
mFrameRate( 60.0f ),
+ mTestFrameDrop(false),
mNeedDroppedFrames(false),
mEventThreadCallback( new EventThreadCallback( MakeCallback( this, &VectorAnimationRenderer::OnTriggered ) ) )
{
{
// Change total frame number for test
mTotalFrameNumber = 200;
+ mTestFrameDrop = true;
}
return true;
}
bool Render( uint32_t frameNumber )
{
- if(mDelayTime != 0)
+ if(mTestFrameDrop)
{
std::this_thread::sleep_for(std::chrono::milliseconds(static_cast<int32_t>(mDelayTime)));
- mDelayTime = 0;
+ mTestFrameDrop = false;
mNeedDroppedFrames = true;
}
else if(mNeedDroppedFrames)
uint32_t mDelayTime;
uint32_t mDroppedFrames;
float mFrameRate;
+ bool mTestFrameDrop;
bool mNeedDroppedFrames;
Dali::VectorAnimationRenderer::UploadCompletedSignalType mUploadCompletedSignal;
std::unique_ptr< EventThreadCallback > mEventThreadCallback;
Property::Map attributes;
DevelControl::DoAction(actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PLAY, attributes);
+ // Make delay to drop frames
+ Test::VectorAnimationRenderer::DelayRendering(170); // longer than 16.6 * 10frames
+
application.SendNotification();
application.Render();
// Trigger count is 1 - render the first frame
DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
- // Make delay to drop frames
- Test::VectorAnimationRenderer::DelayRendering(170); // longer than 16.6 * 10frames
-
- // Check dropped frame
+ // Wait for calculating frame drops
DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
+ // Check dropped frame
uint32_t frames = Test::VectorAnimationRenderer::GetDroppedFrames();
DALI_TEST_CHECK(frames >= 9);
const char* const PROPERTY_NAME_GRAB_HANDLE_COLOR = "grabHandleColor";
const char* const PROPERTY_NAME_ENABLE_GRAB_HANDLE_POPUP = "enableGrabHandlePopup";
const char* const PROPERTY_NAME_INPUT_METHOD_SETTINGS = "inputMethodSettings";
+const char* const PROPERTY_NAME_INPUT_FILTER = "inputFilter";
const Vector4 PLACEHOLDER_TEXT_COLOR( 0.8f, 0.8f, 0.8f, 0.8f );
const Dali::Vector4 LIGHT_BLUE( 0.75f, 0.96f, 1.f, 1.f ); // The text highlight color.
static bool gAnchorClickedCallBackCalled;
static bool gAnchorClickedCallBackNotCalled;
static bool gTextChangedCallBackCalled;
+static bool gInputFilteredAcceptedCallbackCalled;
+static bool gInputFilteredRejectedCallbackCalled;
static bool gInputStyleChangedCallbackCalled;
static bool gMaxCharactersCallBackCalled;
static Dali::Toolkit::TextEditor::InputStyle::Mask gInputStyleMask;
gMaxCharactersCallBackCalled = true;
}
+static void TestInputFilteredCallback(TextEditor control, Toolkit::InputFilter::Property::Type type)
+{
+ tet_infoline(" TestInputFilteredCallback");
+
+ if(type == Toolkit::InputFilter::Property::ACCEPTED)
+ {
+ gInputFilteredAcceptedCallbackCalled = true;
+ }
+ else if(type == Toolkit::InputFilter::Property::REJECTED)
+ {
+ gInputFilteredRejectedCallbackCalled = true;
+ }
+}
+
// Generate a KeyEvent to send to Core.
Integration::KeyEvent GenerateKey( const std::string& keyName,
const std::string& logicalKey,
DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_GRAB_HANDLE_COLOR ) == DevelTextEditor::Property::GRAB_HANDLE_COLOR );
DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_ENABLE_GRAB_HANDLE_POPUP ) == DevelTextEditor::Property::ENABLE_GRAB_HANDLE_POPUP );
DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_INPUT_METHOD_SETTINGS ) == DevelTextEditor::Property::INPUT_METHOD_SETTINGS );
+ DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_INPUT_FILTER ) == DevelTextEditor::Property::INPUT_FILTER );
END_TEST;
}
DALI_TEST_CHECK( map[ "VARIATION" ].Get( variation ) );
DALI_TEST_EQUALS( inputVariation, variation, TEST_LOCATION );
+ // Check the input filter property
+ Property::Map inputFilterMapSet;
+ Property::Map inputFilterMapGet;
+ inputFilterMapSet[InputFilter::Property::ACCEPTED] = "[\\w]";
+ inputFilterMapSet[InputFilter::Property::REJECTED] = "[\\d]";
+
+ editor.SetProperty(DevelTextEditor::Property::INPUT_FILTER, inputFilterMapSet);
+
+ inputFilterMapGet = editor.GetProperty<Property::Map>(DevelTextEditor::Property::INPUT_FILTER);
+ DALI_TEST_EQUALS(inputFilterMapGet.Count(), inputFilterMapSet.Count(), TEST_LOCATION);
+
+ // Clear
+ inputFilterMapSet.Clear();
+ editor.SetProperty(DevelTextEditor::Property::INPUT_FILTER, inputFilterMapSet);
+
application.SendNotification();
application.Render();
END_TEST;
}
+int utcDaliTextEditorInputFiltered(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline(" utcDaliTextEditorInputFiltered");
+ TextEditor editor = TextEditor::New();
+ DALI_TEST_CHECK(editor);
+
+ application.GetScene().Add(editor);
+
+ Property::Map inputFilter;
+
+ // Only digit is accepted.
+ inputFilter[InputFilter::Property::ACCEPTED] = "[\\d]";
+
+ // Set input filter to TextEditor.
+ editor.SetProperty(DevelTextEditor::Property::INPUT_FILTER, inputFilter);
+
+ editor.SetKeyInputFocus();
+
+ // connect to the input filtered signal.
+ ConnectionTracker* testTracker = new ConnectionTracker();
+ DevelTextEditor::InputFilteredSignal(editor).Connect(&TestInputFilteredCallback);
+ bool inputFilteredSignal = false;
+ editor.ConnectSignal(testTracker, "inputFiltered", CallbackFunctor(&inputFilteredSignal));
+
+ gInputFilteredAcceptedCallbackCalled = false;
+
+ application.ProcessEvent(GenerateKey( "a", "", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::DOWN, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ));
+
+ DALI_TEST_CHECK(gInputFilteredAcceptedCallbackCalled);
+ DALI_TEST_CHECK(inputFilteredSignal);
+
+ // Word is rejected.
+ inputFilter[InputFilter::Property::ACCEPTED] = "";
+ inputFilter[InputFilter::Property::REJECTED] = "[\\w]";
+
+ // Set input filter to TextEditor.
+ editor.SetProperty(DevelTextEditor::Property::INPUT_FILTER, inputFilter);
+
+ editor.SetKeyInputFocus();
+
+ inputFilteredSignal = false;
+ gInputFilteredRejectedCallbackCalled = false;
+
+ application.ProcessEvent(GenerateKey( "a", "", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::DOWN, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE));
+
+ DALI_TEST_CHECK(gInputFilteredAcceptedCallbackCalled);
+ DALI_TEST_CHECK(inputFilteredSignal);
+
+ END_TEST;
+}
+
int UtcDaliTextEditorSelectWholeText(void)
{
ToolkitTestApplication application;
const char* const PROPERTY_NAME_BACKGROUND = "textBackground";
const char* const PROPERTY_NAME_FONT_SIZE_SCALE = "fontSizeScale";
const char* const PROPERTY_NAME_GRAB_HANDLE_COLOR = "grabHandleColor";
+const char* const PROPERTY_NAME_INPUT_FILTER = "inputFilter";
const Vector4 PLACEHOLDER_TEXT_COLOR( 0.8f, 0.8f, 0.8f, 0.8f );
const Dali::Vector4 LIGHT_BLUE( 0.75f, 0.96f, 1.f, 1.f ); // The text highlight color.
static bool gAnchorClickedCallBackNotCalled;
static bool gTextChangedCallBackCalled;
static bool gMaxCharactersCallBackCalled;
+static bool gInputFilteredAcceptedCallbackCalled;
+static bool gInputFilteredRejectedCallbackCalled;
static bool gInputStyleChangedCallbackCalled;
static Dali::Toolkit::TextField::InputStyle::Mask gInputStyleMask;
gMaxCharactersCallBackCalled = true;
}
+static void TestInputFilteredCallback(TextField control, Toolkit::InputFilter::Property::Type type)
+{
+ tet_infoline(" TestInputFilteredCallback");
+
+ if(type == Toolkit::InputFilter::Property::ACCEPTED)
+ {
+ gInputFilteredAcceptedCallbackCalled = true;
+ }
+ else if(type == Toolkit::InputFilter::Property::REJECTED)
+ {
+ gInputFilteredRejectedCallbackCalled = true;
+ }
+}
+
static void TestInputStyleChangedCallback( TextField control, TextField::InputStyle::Mask mask )
{
tet_infoline(" TestInputStyleChangedCallback");
DALI_TEST_CHECK( field.GetPropertyIndex( PROPERTY_NAME_ENABLE_GRAB_HANDLE_POPUP ) == DevelTextField::Property::ENABLE_GRAB_HANDLE_POPUP );
DALI_TEST_CHECK( field.GetPropertyIndex( PROPERTY_NAME_BACKGROUND ) == DevelTextField::Property::BACKGROUND );
DALI_TEST_CHECK( field.GetPropertyIndex( PROPERTY_NAME_GRAB_HANDLE_COLOR ) == DevelTextField::Property::GRAB_HANDLE_COLOR );
+ DALI_TEST_CHECK( field.GetPropertyIndex( PROPERTY_NAME_INPUT_FILTER ) == DevelTextField::Property::INPUT_FILTER );
END_TEST;
}
field.SetProperty( DevelTextField::Property::GRAB_HANDLE_COLOR, Color::GREEN );
DALI_TEST_EQUALS( field.GetProperty<Vector4>( DevelTextField::Property::GRAB_HANDLE_COLOR ), Color::GREEN, TEST_LOCATION );
+ // Check the input filter property
+ Property::Map inputFilterMapSet;
+ Property::Map inputFilterMapGet;
+ inputFilterMapSet[InputFilter::Property::ACCEPTED] = "[\\w]";
+ inputFilterMapSet[InputFilter::Property::REJECTED] = "[\\d]";
+
+ field.SetProperty(DevelTextField::Property::INPUT_FILTER, inputFilterMapSet);
+
+ inputFilterMapGet = field.GetProperty<Property::Map>(DevelTextField::Property::INPUT_FILTER);
+ DALI_TEST_EQUALS(inputFilterMapGet.Count(), inputFilterMapSet.Count(), TEST_LOCATION);
+
+ // Clear
+ inputFilterMapSet.Clear();
+ field.SetProperty(DevelTextField::Property::INPUT_FILTER, inputFilterMapSet);
+
application.SendNotification();
application.Render();
END_TEST;
}
+// Positive test for Input Filtered signal.
+int utcDaliTextFieldInputFilteredP(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline(" utcDaliTextFieldInputFilteredP");
+ TextField field = TextField::New();
+ DALI_TEST_CHECK(field);
+
+ application.GetScene().Add(field);
+
+ Property::Map inputFilter;
+
+ // Only digit is accepted.
+ inputFilter[InputFilter::Property::ACCEPTED] = "[\\d]";
+
+ // Set input filter to TextField.
+ field.SetProperty(DevelTextField::Property::INPUT_FILTER, inputFilter);
+
+ field.SetKeyInputFocus();
+
+ // connect to the input filtered signal.
+ ConnectionTracker* testTracker = new ConnectionTracker();
+ DevelTextField::InputFilteredSignal(field).Connect(&TestInputFilteredCallback);
+ bool inputFilteredSignal = false;
+ field.ConnectSignal(testTracker, "inputFiltered", CallbackFunctor(&inputFilteredSignal));
+
+ gInputFilteredAcceptedCallbackCalled = false;
+
+ application.ProcessEvent(GenerateKey( "a", "", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::DOWN, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ));
+
+ DALI_TEST_CHECK(gInputFilteredAcceptedCallbackCalled);
+ DALI_TEST_CHECK(inputFilteredSignal);
+
+ // Word is rejected.
+ inputFilter[InputFilter::Property::ACCEPTED] = "";
+ inputFilter[InputFilter::Property::REJECTED] = "[\\w]";
+
+ // Set input filter to TextField.
+ field.SetProperty(DevelTextField::Property::INPUT_FILTER, inputFilter);
+
+ field.SetKeyInputFocus();
+
+ inputFilteredSignal = false;
+ gInputFilteredRejectedCallbackCalled = false;
+
+ application.ProcessEvent(GenerateKey( "a", "", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::DOWN, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE));
+
+ DALI_TEST_CHECK(gInputFilteredAcceptedCallbackCalled);
+ DALI_TEST_CHECK(inputFilteredSignal);
+
+ END_TEST;
+}
+
+// Negative test for Input Filtered signal.
+int utcDaliTextFieldInputFilteredN(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline(" utcDaliTextFieldInputFilteredP");
+ TextField field = TextField::New();
+ DALI_TEST_CHECK(field);
+
+ application.GetScene().Add(field);
+
+ Property::Map inputFilter;
+
+ // Only word is accepted.
+ inputFilter[InputFilter::Property::ACCEPTED] = "[\\w]";
+
+ // Set input filter to TextField.
+ field.SetProperty(DevelTextField::Property::INPUT_FILTER, inputFilter);
+
+ field.SetKeyInputFocus();
+
+ // connect to the input filtered signal.
+ ConnectionTracker* testTracker = new ConnectionTracker();
+ DevelTextField::InputFilteredSignal(field).Connect(&TestInputFilteredCallback);
+ bool inputFilteredSignal = false;
+ field.ConnectSignal(testTracker, "inputFiltered", CallbackFunctor(&inputFilteredSignal));
+
+ gInputFilteredAcceptedCallbackCalled = false;
+
+ // Key a, d should not be filtered.
+ application.ProcessEvent(GenerateKey("a", "", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::DOWN, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE));
+ application.ProcessEvent(GenerateKey("a", "", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::UP, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE));
+ application.ProcessEvent(GenerateKey("d", "", "d", KEY_D_CODE, 0, 0, Integration::KeyEvent::DOWN, "d", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE));
+ application.ProcessEvent(GenerateKey("d", "", "d", KEY_D_CODE, 0, 0, Integration::KeyEvent::UP, "d", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE));
+
+ // Backspace, Delete should not be filtered.
+ application.ProcessEvent(GenerateKey( "", "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::DOWN, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE));
+ application.ProcessEvent(GenerateKey( "Delete", "", "Delete", Dali::DevelKey::DALI_KEY_DELETE, 0, 0, Integration::KeyEvent::DOWN, "Delete", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE));
+
+ // Render and notify
+ application.SendNotification();
+ application.Render();
+
+ DALI_TEST_CHECK(!gInputFilteredAcceptedCallbackCalled);
+ DALI_TEST_CHECK(!inputFilteredSignal);
+
+ // Digit is rejected.
+ inputFilter[InputFilter::Property::ACCEPTED] = "";
+ inputFilter[InputFilter::Property::REJECTED] = "[\\d]";
+
+ field.SetProperty(DevelTextField::Property::INPUT_FILTER, inputFilter);
+
+ field.SetKeyInputFocus();
+
+ inputFilteredSignal = false;
+ gInputFilteredRejectedCallbackCalled = false;
+
+ // Key a, d should not be filtered.
+ application.ProcessEvent(GenerateKey("a", "", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::DOWN, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE));
+ application.ProcessEvent(GenerateKey("a", "", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::UP, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE));
+ application.ProcessEvent(GenerateKey("d", "", "d", KEY_D_CODE, 0, 0, Integration::KeyEvent::DOWN, "d", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE));
+ application.ProcessEvent(GenerateKey("d", "", "d", KEY_D_CODE, 0, 0, Integration::KeyEvent::UP, "d", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE));
+
+ // Backspace, Delete should not be filtered.
+ application.ProcessEvent(GenerateKey( "", "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::DOWN, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE));
+ application.ProcessEvent(GenerateKey( "Delete", "", "Delete", Dali::DevelKey::DALI_KEY_DELETE, 0, 0, Integration::KeyEvent::DOWN, "Delete", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE));
+
+ // Render and notify
+ application.SendNotification();
+ application.Render();
+
+ DALI_TEST_CHECK(!gInputFilteredAcceptedCallbackCalled);
+ DALI_TEST_CHECK(!inputFilteredSignal);
+
+ END_TEST;
+}
+
int utcDaliTextFieldInputStyleChanged01(void)
{
// The text-field emits signals when the input style changes. These changes of style are
#include <dali-toolkit/public-api/controls/scrollable/scrollable.h>
#include <dali-toolkit/public-api/controls/slider/slider.h>
#include <dali-toolkit/public-api/controls/text-controls/hidden-input-properties.h>
+#include <dali-toolkit/public-api/controls/text-controls/input-filter-properties.h>
#include <dali-toolkit/public-api/controls/text-controls/placeholder-properties.h>
#include <dali-toolkit/public-api/controls/text-controls/text-editor.h>
#include <dali-toolkit/public-api/controls/text-controls/text-field.h>
#include "accessible-impl.h"
// EXTERNAL INCLUDES
+#ifdef DGETTEXT_ENABLED
+#include <libintl.h>
+#endif
+
#include <dali/devel-api/actors/actor-devel.h>
// INTERNAL INCLUDES
namespace Dali::Toolkit::DevelControl {
+static std::string GetLocaleText(std::string string, const char *domain = "dali-toolkit")
+{
+#ifdef DGETTEXT_ENABLED
+ /*TODO: currently non-localized string is used as a key for translation lookup. In case the lookup key formatting is forced
+ consider calling utility function for converting non-localized string into well-formatted key before lookup. */
+ return dgettext(domain, string.c_str());
+#else
+ return string;
+#endif
+}
+
AccessibleImpl::AccessibleImpl(Dali::Actor self, Dali::Accessibility::Role role, bool modal)
: self(self),
modal(modal)
Internal::Control& internalControl = Toolkit::Internal::GetImplementation(control);
Internal::Control::Impl& controlImpl = Internal::Control::Impl::Get(internalControl);
+ std::string name;
if(!controlImpl.mAccessibilityGetNameSignal.Empty())
{
- std::string ret;
- controlImpl.mAccessibilityGetNameSignal.Emit(ret);
- return ret;
+ controlImpl.mAccessibilityGetNameSignal.Emit(name);
+ }
+ else if(controlImpl.mAccessibilityNameSet)
+ {
+ name = controlImpl.mAccessibilityName;
+ }
+ else if(auto raw = GetNameRaw(); !raw.empty())
+ {
+ name = raw;
+ }
+ else
+ {
+ name = Self().GetProperty<std::string>(Actor::Property::NAME);
}
- if(controlImpl.mAccessibilityNameSet)
- return controlImpl.mAccessibilityName;
-
- if(auto raw = GetNameRaw(); !raw.empty())
- return raw;
+ if(controlImpl.mAccessibilityTranslationDomainSet)
+ {
+ return GetLocaleText(name, controlImpl.mAccessibilityTranslationDomain.c_str());
+ }
- return Self().GetProperty<std::string>(Actor::Property::NAME);
+ return GetLocaleText(name);
}
std::string AccessibleImpl::GetNameRaw()
Internal::Control& internalControl = Toolkit::Internal::GetImplementation(control);
Internal::Control::Impl& controlImpl = Internal::Control::Impl::Get(internalControl);
+ std::string description;
if(!controlImpl.mAccessibilityGetDescriptionSignal.Empty())
{
- std::string ret;
- controlImpl.mAccessibilityGetDescriptionSignal.Emit(ret);
- return ret;
+ controlImpl.mAccessibilityGetDescriptionSignal.Emit(description);
+ }
+ else if(controlImpl.mAccessibilityDescriptionSet)
+ {
+ description = controlImpl.mAccessibilityDescription;
+ }
+ else
+ {
+ description = GetDescriptionRaw();
+ }
+ if(controlImpl.mAccessibilityTranslationDomainSet)
+ {
+ return GetLocaleText(description, controlImpl.mAccessibilityTranslationDomain.c_str());
}
- if(controlImpl.mAccessibilityDescriptionSet)
- return controlImpl.mAccessibilityDescription;
-
- return GetDescriptionRaw();
+ return GetLocaleText(description);
}
std::string AccessibleImpl::GetDescriptionRaw()
{
- return "";
+ return {};
}
Dali::Accessibility::Accessible* AccessibleImpl::GetParent()
return Self().GetProperty<Dali::Accessibility::Role>(Toolkit::DevelControl::Property::ACCESSIBILITY_ROLE);
}
+std::string AccessibleImpl::GetLocalizedRoleName()
+{
+ return GetLocaleText(GetRoleName());
+}
+
Dali::Accessibility::States AccessibleImpl::CalculateStates()
{
Dali::Actor self = Self();
// keyboard focusable actors
auto actor = Toolkit::ImageView::New(focusBorderImagePath);
actor.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
- DevelControl::AppendAccessibilityAttribute(actor, "highlight", "");
+ DevelControl::AppendAccessibilityAttribute(actor, "highlight", std::string());
actor.SetProperty(Toolkit::DevelControl::Property::ACCESSIBILITY_HIGHLIGHTABLE, false);
return actor;
std::string AccessibleImpl::GetActionName(size_t index)
{
- if(index >= GetActionCount()) return "";
+ if(index >= GetActionCount()) return {};
Dali::TypeInfo type;
Self().GetTypeInfo(type);
DALI_ASSERT_ALWAYS(type && "no TypeInfo object");
std::string AccessibleImpl::GetLocalizedActionName(size_t index)
{
- // TODO: add localization
- return GetActionName(index);
+ return GetLocaleText(GetActionName(index));
}
std::string AccessibleImpl::GetActionDescription(size_t index)
{
- return "";
+ return {};
}
size_t AccessibleImpl::GetActionCount()
std::string AccessibleImpl::GetActionKeyBinding(size_t index)
{
- return "";
+ return {};
}
bool AccessibleImpl::DoAction(size_t index)
Dali::Accessibility::Role GetRole() override;
/**
+ * @copydoc Dali::Accessibility::Accessible::GetLocalizedRoleName()
+ */
+ std::string GetLocalizedRoleName() override;
+
+ /**
* @copydoc Dali::Accessibility::Accessible::GetStates()
*/
Dali::Accessibility::States GetStates() override;
return GetImpl(textEditor).AnchorClickedSignal();
}
+InputFilteredSignalType& InputFilteredSignal(TextEditor textEditor)
+{
+ return GetImpl(textEditor).InputFilteredSignal();
+}
+
void SelectWholeText(TextEditor textEditor)
{
GetImpl(textEditor).SelectWholeText();
#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-editor.h>
namespace Dali
* @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,
};
} // namespace Property
DALI_TOOLKIT_API AnchorClickedSignalType& AnchorClickedSignal(TextEditor textEditor);
/**
+ * @brief Input filtered signal type.
+ */
+using InputFilteredSignalType = Signal<void(TextEditor, 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(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.
return GetImpl(textField).AnchorClickedSignal();
}
+InputFilteredSignalType& InputFilteredSignal(TextField textField)
+{
+ return GetImpl(textField).InputFilteredSignal();
+}
+
void SelectWholeText(TextField textField)
{
GetImpl(textField).SelectWholeText();
#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
* @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 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.
new DevelControl::AccessibleImpl(actor, Dali::Accessibility::Role::IMAGE));
});
- Self().SetProperty(Toolkit::DevelControl::Property::ACCESSIBILITY_HIGHLIGHTABLE, true);
-
Adaptor::Get().RegisterProcessor(*this);
}
return std::unique_ptr<Dali::Accessibility::Accessible>(
new DevelControl::AccessibleImpl(actor, Dali::Accessibility::Role::IMAGE));
});
-
- //Enable highightability
- Self().SetProperty(Toolkit::DevelControl::Property::ACCESSIBILITY_HIGHLIGHTABLE, true);
}
void ImageView::SetImage(const Property::Map& map)
DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit, TextEditor, "grabHandleColor", VECTOR4, GRAB_HANDLE_COLOR )
DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit, TextEditor, "enableGrabHandlePopup", BOOLEAN, ENABLE_GRAB_HANDLE_POPUP )
DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit, TextEditor, "inputMethodSettings", MAP, INPUT_METHOD_SETTINGS )
+DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit, TextEditor, "inputFilter", MAP, INPUT_FILTER )
DALI_SIGNAL_REGISTRATION(Toolkit, TextEditor, "textChanged", SIGNAL_TEXT_CHANGED )
DALI_SIGNAL_REGISTRATION(Toolkit, TextEditor, "inputStyleChanged", SIGNAL_INPUT_STYLE_CHANGED)
DALI_SIGNAL_REGISTRATION(Toolkit, TextEditor, "maxLengthReached", SIGNAL_MAX_LENGTH_REACHED )
DALI_SIGNAL_REGISTRATION(Toolkit, TextEditor, "anchorClicked", SIGNAL_ANCHOR_CLICKED )
+DALI_SIGNAL_REGISTRATION(Toolkit, TextEditor, "inputFiltered", SIGNAL_INPUT_FILTERED )
+
DALI_TYPE_REGISTRATION_END()
// clang-format on
}
break;
}
+ case Toolkit::DevelTextEditor::Property::INPUT_FILTER:
+ {
+ const Property::Map* map = value.GetMap();
+ if(map)
+ {
+ impl.mController->SetInputFilterOption(*map);
+ }
+ break;
+ }
} // switch
} // texteditor
}
value = map;
break;
}
+ case Toolkit::DevelTextEditor::Property::INPUT_FILTER:
+ {
+ Property::Map map;
+ impl.mController->GetInputFilterOption(map);
+ value = map;
+ break;
+ }
} //switch
}
return mAnchorClickedSignal;
}
+DevelTextEditor::InputFilteredSignalType& TextEditor::InputFilteredSignal()
+{
+ return mInputFilteredSignal;
+}
+
Text::ControllerPtr TextEditor::getController()
{
return mController;
editorImpl.AnchorClickedSignal().Connect(tracker, functor);
}
}
+ else if(0 == strcmp(signalName.c_str(), SIGNAL_INPUT_FILTERED))
+ {
+ if(editor)
+ {
+ Internal::TextEditor& editorImpl(GetImpl(editor));
+ editorImpl.InputFilteredSignal().Connect(tracker, functor);
+ }
+ }
else
{
// signalName does not match any signal
mAnchorClickedSignal.Emit(handle, href.c_str(), href.length());
}
+void TextEditor::InputFiltered(Toolkit::InputFilter::Property::Type type)
+{
+ Dali::Toolkit::TextEditor handle(GetOwner());
+ mInputFilteredSignal.Emit(handle, type);
+}
+
void TextEditor::AddDecoration(Actor& actor, bool needsClipping)
{
if(actor)
return range;
}
+void TextEditor::GetControlBackgroundColor(Vector4& color) const
+{
+ Property::Value propValue = Self().GetProperty(Toolkit::Control::Property::BACKGROUND);
+ Property::Map* resultMap = propValue.GetMap();
+
+ Property::Value* colorValue = nullptr;
+ if(resultMap && (colorValue = resultMap->Find(ColorVisual::Property::MIX_COLOR)))
+ {
+ colorValue->Get(color);
+ }
+}
+
void TextEditor::UpdateScrollBar()
{
using namespace Dali;
DevelTextEditor::AnchorClickedSignalType& AnchorClickedSignal();
/**
+ * @copydoc Dali::Toollkit::TextEditor::InputFilteredSignal()
+ */
+ DevelTextEditor::InputFilteredSignalType& InputFilteredSignal();
+
+ /**
* Connects a callback function with the object's signals.
* @param[in] object The object providing the signal.
* @param[in] tracker Used to disconnect the signal.
*/
void AddDecoration(Actor& actor, bool needsClipping) override;
+ /**
+ * @copydoc Text::EditableControlInterface::InputFiltered()
+ */
+ void InputFiltered(Toolkit::InputFilter::Property::Type type) override;
+
+ /**
+ * @copydoc Text::EditableControlInterface::GetControlBackgroundColor()
+ */
+ void GetControlBackgroundColor(Vector4& color) const override;
+
// From SelectableControlInterface
public:
/**
Toolkit::TextEditor::ScrollStateChangedSignalType mScrollStateChangedSignal;
Toolkit::DevelTextEditor::MaxLengthReachedSignalType mMaxLengthReachedSignal;
Toolkit::DevelTextEditor::AnchorClickedSignalType mAnchorClickedSignal;
+ Toolkit::DevelTextEditor::InputFilteredSignalType mInputFilteredSignal;
InputMethodContext mInputMethodContext;
Text::ControllerPtr mController;
DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit, TextField, "fontSizeScale", FLOAT, FONT_SIZE_SCALE )
DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit, TextField, "primaryCursorPosition", INTEGER, PRIMARY_CURSOR_POSITION )
DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit, TextField, "grabHandleColor", VECTOR4, GRAB_HANDLE_COLOR )
+DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit, TextField, "inputFilter", MAP, INPUT_FILTER )
DALI_SIGNAL_REGISTRATION(Toolkit, TextField, "textChanged", SIGNAL_TEXT_CHANGED )
DALI_SIGNAL_REGISTRATION(Toolkit, TextField, "maxLengthReached", SIGNAL_MAX_LENGTH_REACHED )
DALI_SIGNAL_REGISTRATION(Toolkit, TextField, "inputStyleChanged", SIGNAL_INPUT_STYLE_CHANGED)
DALI_SIGNAL_REGISTRATION(Toolkit, TextField, "anchorClicked", SIGNAL_ANCHOR_CLICKED )
+DALI_SIGNAL_REGISTRATION(Toolkit, TextField, "inputFiltered", SIGNAL_INPUT_FILTERED )
DALI_TYPE_REGISTRATION_END()
// clang-format on
impl.RequestTextRelayout();
break;
}
+ case Toolkit::DevelTextField::Property::INPUT_FILTER:
+ {
+ const Property::Map* map = value.GetMap();
+ if(map)
+ {
+ impl.mController->SetInputFilterOption(*map);
+ }
+ break;
+ }
} // switch
} // textfield
}
value = impl.mDecorator->GetHandleColor();
break;
}
+ case Toolkit::DevelTextField::Property::INPUT_FILTER:
+ {
+ Property::Map map;
+ impl.mController->GetInputFilterOption(map);
+ value = map;
+ break;
+ }
} //switch
}
fieldImpl.AnchorClickedSignal().Connect(tracker, functor);
}
}
+ else if(0 == strcmp(signalName.c_str(), SIGNAL_INPUT_FILTERED))
+ {
+ if(field)
+ {
+ Internal::TextField& fieldImpl(GetImpl(field));
+ fieldImpl.InputFilteredSignal().Connect(tracker, functor);
+ }
+ }
else
{
// signalName does not match any signal
return mAnchorClickedSignal;
}
+DevelTextField::InputFilteredSignalType& TextField::InputFilteredSignal()
+{
+ return mInputFilteredSignal;
+}
+
void TextField::OnInitialize()
{
Actor self = Self();
mAnchorClickedSignal.Emit(handle, href.c_str(), href.length());
}
+void TextField::InputFiltered(Toolkit::InputFilter::Property::Type type)
+{
+ Dali::Toolkit::TextField handle(GetOwner());
+ mInputFilteredSignal.Emit(handle, type);
+}
+
void TextField::AddDecoration(Actor& actor, bool needsClipping)
{
if(actor)
}
}
+void TextField::GetControlBackgroundColor(Vector4& color) const
+{
+ Property::Value propValue = Self().GetProperty(Toolkit::Control::Property::BACKGROUND);
+ Property::Map* resultMap = propValue.GetMap();
+
+ Property::Value* colorValue = nullptr;
+ if(resultMap && (colorValue = resultMap->Find(ColorVisual::Property::MIX_COLOR)))
+ {
+ colorValue->Get(color);
+ }
+}
+
void TextField::OnSceneConnect(Dali::Actor actor)
{
if(mHasBeenStaged)
return states;
}
-bool TextField::AccessibleImpl::InsertText(size_t startPosition,
- std::string text)
+bool TextField::AccessibleImpl::InsertText(size_t startPosition,
+ std::string text)
{
auto slf = Toolkit::TextField::DownCast(Self());
auto txt = slf.GetProperty(Toolkit::TextField::Property::TEXT).Get<std::string>();
*/
DevelTextField::AnchorClickedSignalType& AnchorClickedSignal();
+ /**
+ * @copydoc TextField::InputFilteredSignal()
+ */
+ DevelTextField::InputFilteredSignalType& InputFilteredSignal();
+
Text::ControllerPtr getController();
private: // From Control
*/
void AddDecoration(Actor& actor, bool needsClipping) override;
+ /**
+ * @copydoc Text::EditableControlInterface::InputFiltered()
+ */
+ void InputFiltered(Toolkit::InputFilter::Property::Type type) override;
+
+ /**
+ * @copydoc Text::EditableControlInterface::GetControlBackgroundColor()
+ */
+ void GetControlBackgroundColor(Vector4& color) const override;
+
// From SelectableControlInterface
public:
/**
Toolkit::TextField::MaxLengthReachedSignalType mMaxLengthReachedSignal;
Toolkit::TextField::InputStyleChangedSignalType mInputStyleChangedSignal;
Toolkit::DevelTextField::AnchorClickedSignalType mAnchorClickedSignal;
+ Toolkit::DevelTextField::InputFilteredSignalType mInputFilteredSignal;
InputMethodContext mInputMethodContext;
Text::ControllerPtr mController;
mUrl = url;
if(mWebEngine)
{
- Texture texture = Dali::Texture::New(*mWebEngine.GetNativeImageSource());
- const std::string nativeImageUrl = Dali::Toolkit::TextureManager::AddTexture(texture);
- mVisual = Toolkit::VisualFactory::Get().CreateVisual(
- {{Toolkit::Visual::Property::TYPE, Toolkit::Visual::IMAGE},
- {Toolkit::ImageVisual::Property::URL, nativeImageUrl}});
-
- if(mVisual)
+ if(!mVisual)
{
- // Clean up previously registered visual and add new one.
- DevelControl::RegisterVisual(*this, Toolkit::WebView::Property::URL, mVisual);
- mWebEngine.LoadUrl(url);
+ mWebEngine.FrameRenderedSignal().Connect(this, &WebView::OnInitialFrameRendered);
}
- if(mVideoHoleEnabled)
- {
- EnableBlendMode(false);
- }
+ mWebEngine.LoadUrl(url);
}
}
{
if(mWebEngine)
{
- Texture texture = Dali::Texture::New(*mWebEngine.GetNativeImageSource());
- const std::string nativeImageUrl = Dali::Toolkit::TextureManager::AddTexture(texture);
- mVisual = Toolkit::VisualFactory::Get().CreateVisual(
- {{Toolkit::Visual::Property::TYPE, Toolkit::Visual::IMAGE},
- {Toolkit::ImageVisual::Property::URL, nativeImageUrl}});
-
- if(mVisual)
+ if(!mVisual)
{
- DevelControl::RegisterVisual(*this, Toolkit::WebView::Property::URL, mVisual);
- mWebEngine.LoadHtmlString(htmlString);
+ mWebEngine.FrameRenderedSignal().Connect(this, &WebView::OnInitialFrameRendered);
}
- if(mVideoHoleEnabled)
- {
- EnableBlendMode(false);
- }
+ mWebEngine.LoadHtmlString(htmlString);
}
}
if(!mWebEngine)
return false;
- Texture texture = Dali::Texture::New(*mWebEngine.GetNativeImageSource());
- const std::string nativeImageUrl = Dali::Toolkit::TextureManager::AddTexture(texture);
- mVisual = Toolkit::VisualFactory::Get().CreateVisual(
- {{Toolkit::Visual::Property::TYPE, Toolkit::Visual::IMAGE},
- {Toolkit::ImageVisual::Property::URL, nativeImageUrl}});
-
- bool result = false;
- if(mVisual)
+ if(!mVisual)
{
- DevelControl::RegisterVisual(*this, Toolkit::WebView::Property::URL, mVisual);
- result = mWebEngine.LoadHtmlStringOverrideCurrentEntry(html, basicUri, unreachableUrl);
+ mWebEngine.FrameRenderedSignal().Connect(this, &WebView::OnInitialFrameRendered);
}
- if(mVideoHoleEnabled)
- {
- EnableBlendMode(false);
- }
- return result;
+ return mWebEngine.LoadHtmlStringOverrideCurrentEntry(html, basicUri, unreachableUrl);
}
bool WebView::LoadContents(const std::string& contents, uint32_t contentSize, const std::string& mimeType, const std::string& encoding, const std::string& baseUri)
if(!mWebEngine)
return false;
- Texture texture = Dali::Texture::New(*mWebEngine.GetNativeImageSource());
- const std::string nativeImageUrl = Dali::Toolkit::TextureManager::AddTexture(texture);
- mVisual = Toolkit::VisualFactory::Get().CreateVisual(
- {{Toolkit::Visual::Property::TYPE, Toolkit::Visual::IMAGE},
- {Toolkit::ImageVisual::Property::URL, nativeImageUrl}});
-
- bool result = false;
- if(mVisual)
+ if(!mVisual)
{
- DevelControl::RegisterVisual(*this, Toolkit::WebView::Property::URL, mVisual);
- result = mWebEngine.LoadContents(contents, contentSize, mimeType, encoding, baseUri);
+ mWebEngine.FrameRenderedSignal().Connect(this, &WebView::OnInitialFrameRendered);
}
- if(mVideoHoleEnabled)
- {
- EnableBlendMode(false);
- }
- return result;
+ return mWebEngine.LoadContents(contents, contentSize, mimeType, encoding, baseUri);
}
void WebView::Reload()
}
}
+void WebView::OnInitialFrameRendered()
+{
+ mWebEngine.FrameRenderedSignal().Disconnect(this, &WebView::OnInitialFrameRendered);
+
+ Texture texture = Dali::Texture::New(*mWebEngine.GetNativeImageSource());
+ const std::string nativeImageUrl = Dali::Toolkit::TextureManager::AddTexture(texture);
+ mVisual = Toolkit::VisualFactory::Get().CreateVisual({{Toolkit::Visual::Property::TYPE, Toolkit::Visual::IMAGE}, {Toolkit::ImageVisual::Property::URL, nativeImageUrl}});
+
+ if(mVisual)
+ {
+ DevelControl::RegisterVisual(*this, Toolkit::WebView::Property::URL, mVisual);
+ EnableBlendMode(!mVideoHoleEnabled);
+ }
+}
+
void WebView::OnVisibilityChanged(Actor actor, bool isVisible, Dali::DevelActor::VisibilityChange::Type type)
{
if(type == Dali::DevelActor::VisibilityChange::Type::SELF)
void OnFrameRendered();
/**
+ * @brief Callback function to be called when frame is rendered. This is to check initial buffer is ready.
+ */
+ void OnInitialFrameRendered();
+
+ /**
* @brief Callback function to be called when visibility is changed.
* @param[in] actor The actor, or child of actor, whose visibility has changed
* @param[in] isVisible Whether the actor is now visible or not
${toolkit_src_dir}/text/markup-processor-helper-functions.cpp
${toolkit_src_dir}/text/multi-language-support.cpp
${toolkit_src_dir}/text/hidden-text.cpp
+ ${toolkit_src_dir}/text/input-filter.cpp
${toolkit_src_dir}/text/property-string-parser.cpp
${toolkit_src_dir}/text/segmentation.cpp
${toolkit_src_dir}/text/shaper.cpp
--- /dev/null
+/*
+ * 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// CLASS HEADER
+#include <dali-toolkit/internal/text/hidden-text.h>
+#include <dali-toolkit/internal/text/input-filter.h>
+
+// INTERNAL INCLUDES
+
+using namespace Dali::Toolkit;
+
+namespace Dali
+{
+namespace Toolkit
+{
+namespace Text
+{
+const char* const PROPERTY_ACCEPTED = "accepted";
+const char* const PROPERTY_REJECTED = "rejected";
+
+InputFilter::InputFilter()
+: mAccepted(""),
+ mRejected("")
+{
+}
+
+void InputFilter::SetProperties(const Property::Map& map)
+{
+ const Property::Map::SizeType count = map.Count();
+
+ for(Property::Map::SizeType position = 0; position < count; ++position)
+ {
+ KeyValuePair keyValue = map.GetKeyValue(position);
+ Property::Key& key = keyValue.first;
+ Property::Value& value = keyValue.second;
+
+ if(key == Toolkit::InputFilter::Property::ACCEPTED || key == PROPERTY_ACCEPTED)
+ {
+ value.Get(mAccepted);
+ }
+ else if(key == Toolkit::InputFilter::Property::REJECTED || key == PROPERTY_REJECTED)
+ {
+ value.Get(mRejected);
+ }
+ }
+}
+
+void InputFilter::GetProperties(Property::Map& map)
+{
+ map[Toolkit::InputFilter::Property::ACCEPTED] = mAccepted.c_str();
+ map[Toolkit::InputFilter::Property::REJECTED] = mRejected.c_str();
+}
+
+bool InputFilter::Contains(Toolkit::InputFilter::Property::Type type, std::string source)
+{
+ bool match = false;
+ std::regex pattern;
+
+ if(type == Toolkit::InputFilter::Property::ACCEPTED)
+ {
+ if(mAccepted.empty())
+ {
+ return true;
+ }
+ pattern = mAccepted;
+ }
+ else if(type == Toolkit::InputFilter::Property::REJECTED)
+ {
+ if(mRejected.empty())
+ {
+ return false;
+ }
+ pattern = mRejected;
+ }
+
+ match = std::regex_match(source, pattern);
+
+ return match;
+}
+
+} // namespace Text
+
+} // namespace Toolkit
+
+} // namespace Dali
--- /dev/null
+#ifndef DALI_INPUT_FILTER_H
+#define DALI_INPUT_FILTER_H
+
+/*
+ * 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// EXTERNAL INCLUDES
+#include <dali/public-api/object/property-map.h>
+
+// INTERNAL INCLUDES
+#include <dali-toolkit/public-api/controls/text-controls/input-filter-properties.h>
+#include <regex>
+
+namespace Dali
+{
+namespace Toolkit
+{
+namespace Text
+{
+/**
+ * Class to handle the input text filtering
+ */
+class InputFilter : public ConnectionTracker
+{
+public:
+ /**
+ * @brief Constructor
+ */
+ InputFilter();
+
+public: // Intended for internal use
+ /**
+ * @brief Used to set options of input filter.
+ * @param[in] map The property map describing the option.
+ */
+ void SetProperties(const Property::Map& map);
+
+ /**
+ * @brief Retrieve property map of input filter options.
+ * @param[out] map The input filter option.
+ */
+ void GetProperties(Property::Map& map);
+
+ /**
+ * @brief Check if the source is contained in regex.
+ * @param[in] type ACCEPTED or REJECTED
+ * @param[in] source The original text.
+ * @return @e true if the source is contained in regex, otherwise returns @e false.
+ */
+ bool Contains(Toolkit::InputFilter::Property::Type type, std::string source);
+
+private:
+ std::string mAccepted;
+ std::string mRejected;
+};
+
+} // namespace Text
+
+} // namespace Toolkit
+
+} // namespace Dali
+
+#endif // DALI_INPUT_FILTER_H
DALI_LOG_INFO(gLogFilter, Debug::Verbose, "Controller::KeyEvent %p keyString %s\n", &controller, keyString.c_str());
if(!controller.IsEditable()) return false;
- if(!keyString.empty())
+ std::string refinedKey = keyString;
+ if(controller.mImpl->mInputFilter != NULL && !refinedKey.empty())
+ {
+ bool accepted = false;
+ bool rejected = false;
+ accepted = controller.mImpl->mInputFilter->Contains(Toolkit::InputFilter::Property::ACCEPTED, keyString);
+ rejected = controller.mImpl->mInputFilter->Contains(Toolkit::InputFilter::Property::REJECTED, keyString);
+
+ if(!accepted)
+ {
+ // The filtered key is set to empty.
+ refinedKey = "";
+ // Signal emits when the character to be inserted is filtered by the accepted filter.
+ controller.mImpl->mEditableControlInterface->InputFiltered(Toolkit::InputFilter::Property::ACCEPTED);
+ }
+ if(rejected)
+ {
+ // The filtered key is set to empty.
+ refinedKey = "";
+ // Signal emits when the character to be inserted is filtered by the rejected filter.
+ controller.mImpl->mEditableControlInterface->InputFiltered(Toolkit::InputFilter::Property::REJECTED);
+ }
+ }
+
+ if(!refinedKey.empty())
{
// InputMethodContext is no longer handling key-events
controller.mImpl->ClearPreEditFlag();
- controller.InsertText(keyString, COMMIT);
+ controller.InsertText(refinedKey, COMMIT);
textChanged = true;
#include <dali-toolkit/internal/text/shaper.h>
#include <dali-toolkit/internal/text/text-control-interface.h>
#include <dali-toolkit/internal/text/text-controller-impl-event-handler.h>
+#include <dali-toolkit/internal/text/text-editable-control-interface.h>
+#include <dali-toolkit/internal/text/text-enumerations-impl.h>
#include <dali-toolkit/internal/text/text-run-container.h>
#include <dali-toolkit/internal/text/text-selection-handle-controller.h>
-#include <dali-toolkit/internal/text/text-enumerations-impl.h>
-
using namespace Dali;
namespace
Vector<unsigned short> mIndices; ///< container of indices
};
+// The relative luminance of a color is defined as (L = 0.2126 * R + 0.7152 * G + 0.0722 * B)
+// based on W3C Recommendations (https://www.w3.org/TR/WCAG20/)
+const float BRIGHTNESS_THRESHOLD = 0.179f;
+const float CONSTANT_R = 0.2126f;
+const float CONSTANT_G = 0.7152f;
+const float CONSTANT_B = 0.0722f;
+const Dali::Vector4 BLACK(0.f, 0.f, 0.f, 1.f);
+const Dali::Vector4 WHITE(1.f, 1.f, 1.f, 1.f);
const Dali::Vector4 LIGHT_BLUE(0.75f, 0.96f, 1.f, 1.f);
const Dali::Vector4 BACKGROUND_SUB4(0.58f, 0.87f, 0.96f, 1.f);
const Dali::Vector4 BACKGROUND_SUB5(0.83f, 0.94f, 0.98f, 1.f);
backgroundColorRun.color = textColor;
mModel->mLogicalModel->mBackgroundColorRuns.PushBack(backgroundColorRun);
- Vector4 backgroundColor = mModel->mVisualModel->GetBackgroundColor();
+ Vector4 backgroundColor = mModel->mVisualModel->GetBackgroundColor();
+ if(backgroundColor.a == 0) // There is no text background color.
+ {
+ // Try use the control's background color.
+ if(nullptr != mEditableControlInterface)
+ {
+ mEditableControlInterface->GetControlBackgroundColor(backgroundColor);
+ if(backgroundColor.a == 0) // There is no control background color.
+ {
+ // Determines black or white color according to text color.
+ // Based on W3C Recommendations (https://www.w3.org/TR/WCAG20/)
+ float L = CONSTANT_R * textColor.r + CONSTANT_G * textColor.g + CONSTANT_B * textColor.b;
+ backgroundColor = L > BRIGHTNESS_THRESHOLD ? BLACK : WHITE;
+ }
+ }
+ }
+
Vector<ColorRun> colorRuns;
colorRuns.Resize(1u);
ColorRun& colorRun = *(colorRuns.Begin());
mOperationsPending(NO_OPERATION),
mMaximumNumberOfCharacters(50u),
mHiddenInput(NULL),
+ mInputFilter(nullptr),
mRecalculateNaturalSize(true),
mMarkupProcessorEnabled(false),
mClipboardHideEnabled(true),
~Impl()
{
delete mHiddenInput;
-
delete mFontDefaults;
delete mUnderlineDefaults;
delete mShadowDefaults;
void CopyUnderlinedFromLogicalToVisualModels(bool shouldClearPreUnderlineRuns);
public:
- ControlInterface* mControlInterface; ///< Reference to the text controller.
- EditableControlInterface* mEditableControlInterface; ///< Reference to the editable text controller.
- SelectableControlInterface* mSelectableControlInterface; ///< Reference to the selectable text controller.
- AnchorControlInterface* mAnchorControlInterface; ///< Reference to the anchor controller.
- ModelPtr mModel; ///< Pointer to the text's model.
- FontDefaults* mFontDefaults; ///< Avoid allocating this when the user does not specify a font.
- UnderlineDefaults* mUnderlineDefaults; ///< Avoid allocating this when the user does not specify underline parameters.
- ShadowDefaults* mShadowDefaults; ///< Avoid allocating this when the user does not specify shadow parameters.
- EmbossDefaults* mEmbossDefaults; ///< Avoid allocating this when the user does not specify emboss parameters.
- OutlineDefaults* mOutlineDefaults; ///< Avoid allocating this when the user does not specify outline parameters.
- EventData* mEventData; ///< Avoid allocating everything for text input until EnableTextInput().
- TextAbstraction::FontClient mFontClient; ///< Handle to the font client.
- Clipboard mClipboard; ///< Handle to the system clipboard
- View mView; ///< The view interface to the rendering back-end.
- MetricsPtr mMetrics; ///< A wrapper around FontClient used to get metrics & potentially down-scaled Emoji metrics.
- Layout::Engine mLayoutEngine; ///< The layout engine.
- Vector<ModifyEvent> mModifyEvents; ///< Temporary stores the text set until the next relayout.
- Vector4 mTextColor; ///< The regular text color
- TextUpdateInfo mTextUpdateInfo; ///< Info of the characters updated.
- OperationsMask mOperationsPending; ///< Operations pending to be done to layout the text.
- Length mMaximumNumberOfCharacters; ///< Maximum number of characters that can be inserted.
- HiddenText* mHiddenInput; ///< Avoid allocating this when the user does not specify hidden input mode.
- Vector2 mTextFitContentSize; ///< Size of Text fit content
+ ControlInterface* mControlInterface; ///< Reference to the text controller.
+ EditableControlInterface* mEditableControlInterface; ///< Reference to the editable text controller.
+ SelectableControlInterface* mSelectableControlInterface; ///< Reference to the selectable text controller.
+ AnchorControlInterface* mAnchorControlInterface; ///< Reference to the anchor controller.
+ ModelPtr mModel; ///< Pointer to the text's model.
+ FontDefaults* mFontDefaults; ///< Avoid allocating this when the user does not specify a font.
+ UnderlineDefaults* mUnderlineDefaults; ///< Avoid allocating this when the user does not specify underline parameters.
+ ShadowDefaults* mShadowDefaults; ///< Avoid allocating this when the user does not specify shadow parameters.
+ EmbossDefaults* mEmbossDefaults; ///< Avoid allocating this when the user does not specify emboss parameters.
+ OutlineDefaults* mOutlineDefaults; ///< Avoid allocating this when the user does not specify outline parameters.
+ EventData* mEventData; ///< Avoid allocating everything for text input until EnableTextInput().
+ TextAbstraction::FontClient mFontClient; ///< Handle to the font client.
+ Clipboard mClipboard; ///< Handle to the system clipboard
+ View mView; ///< The view interface to the rendering back-end.
+ MetricsPtr mMetrics; ///< A wrapper around FontClient used to get metrics & potentially down-scaled Emoji metrics.
+ Layout::Engine mLayoutEngine; ///< The layout engine.
+ Vector<ModifyEvent> mModifyEvents; ///< Temporary stores the text set until the next relayout.
+ Vector4 mTextColor; ///< The regular text color
+ TextUpdateInfo mTextUpdateInfo; ///< Info of the characters updated.
+ OperationsMask mOperationsPending; ///< Operations pending to be done to layout the text.
+ Length mMaximumNumberOfCharacters; ///< Maximum number of characters that can be inserted.
+ HiddenText* mHiddenInput; ///< Avoid allocating this when the user does not specify hidden input mode.
+ std::unique_ptr<InputFilter> mInputFilter; ///< Avoid allocating this when the user does not specify input filter mode.
+ Vector2 mTextFitContentSize; ///< Size of Text fit content
bool mRecalculateNaturalSize : 1; ///< Whether the natural size needs to be recalculated.
bool mMarkupProcessorEnabled : 1; ///< Whether the mark-up procesor is enabled.
}
}
+void Controller::SetInputFilterOption(const Property::Map& options)
+{
+ if(!mImpl->mInputFilter)
+ {
+ mImpl->mInputFilter = std::unique_ptr<InputFilter>(new InputFilter());
+ }
+ mImpl->mInputFilter->SetProperties(options);
+}
+
+void Controller::GetInputFilterOption(Property::Map& options)
+{
+ if(NULL != mImpl->mInputFilter)
+ {
+ mImpl->mInputFilter->GetProperties(options);
+ }
+}
+
void Controller::SetPlaceholderProperty(const Property::Map& map)
{
PlaceholderHandler::SetPlaceholderProperty(*this, map);
#include <dali-toolkit/devel-api/text/text-enumerations-devel.h>
#include <dali-toolkit/internal/text/decorator/text-decorator.h>
#include <dali-toolkit/internal/text/hidden-text.h>
+#include <dali-toolkit/internal/text/input-filter.h>
#include <dali-toolkit/internal/text/layouts/layout-engine.h>
#include <dali-toolkit/internal/text/text-anchor-control-interface.h>
#include <dali-toolkit/internal/text/text-model-interface.h>
void GetHiddenInputOption(Property::Map& options);
/**
+ * @brief Used to set the input filter option
+ */
+ void SetInputFilterOption(const Property::Map& options);
+
+ /**
+ * @brief Used to get the input filter option
+ */
+ void GetInputFilterOption(Property::Map& options);
+
+ /**
* @brief Sets the Placeholder Properties.
*
* @param[in] map The placeholder property map
// INTERNAL INCLUDES
#include <dali-toolkit/internal/text/input-style.h>
+#include <dali-toolkit/public-api/controls/text-controls/input-filter-properties.h>
namespace Dali
{
virtual void InputStyleChanged(InputStyle::Mask inputStyleMask) = 0;
/**
+ * @brief Called when the character to be inserted is filtered by the input filter.
+ *
+ * @param[in] type The filter type is ACCEPTED or REJECTED.
+ */
+ virtual void InputFiltered(Toolkit::InputFilter::Property::Type type) = 0;
+
+ /**
* @brief Add a decoration.
*
* @param[in] decoration The actor displaying a decoration.
virtual void AddDecoration(Actor& actor, bool needsClipping) = 0;
/**
+ * @brief Gets the color of the control.
+ *
+ * @param[out] The color of the control.
+ */
+ virtual void GetControlBackgroundColor(Vector4& color) const = 0;
+
+ /**
* @brief Editable status (on/off).
*
* @return true if it can be edit, else false.
Property::Map startPropertyMap;
Property::Map finishPropertyMap;
+ float targetOpacity = GetWorldColor(targetControl).a;
+ targetControl[Dali::Actor::Property::COLOR_MODE] = Dali::ColorMode::USE_OWN_COLOR;
+
if(IsAppearingTransition())
{
initialPropertyMap.Insert(Dali::Actor::Property::OPACITY, 0.0f);
- startPropertyMap.Insert(Dali::Actor::Property::OPACITY, mOpacity);
- finishPropertyMap.Insert(Dali::Actor::Property::OPACITY, targetControl[Dali::Actor::Property::OPACITY]);
+ startPropertyMap.Insert(Dali::Actor::Property::OPACITY, mOpacity * targetOpacity);
+ finishPropertyMap.Insert(Dali::Actor::Property::OPACITY, targetOpacity);
}
else
{
- initialPropertyMap.Insert(Dali::Actor::Property::OPACITY, targetControl[Dali::Actor::Property::OPACITY]);
- startPropertyMap.Insert(Dali::Actor::Property::OPACITY, targetControl[Dali::Actor::Property::OPACITY]);
- finishPropertyMap.Insert(Dali::Actor::Property::OPACITY, mOpacity);
+ initialPropertyMap.Insert(Dali::Actor::Property::OPACITY, targetOpacity);
+ startPropertyMap.Insert(Dali::Actor::Property::OPACITY, targetOpacity);
+ finishPropertyMap.Insert(Dali::Actor::Property::OPACITY, mOpacity * targetOpacity);
}
SetInitialPropertyMap(initialPropertyMap);
msgid "IDS_COM_BODY_CLIPBOARD"
msgstr "الحافظة"
+msgid "slider"
+msgstr ""
msgid "IDS_COM_BODY_CLIPBOARD"
msgstr "Mübadilə buferi"
+msgid "icon"
+msgstr "Piktoqram"
+
+msgid "slider"
+msgstr "Sürüngəc"
msgid "IDS_COM_BODY_CLIPBOARD"
msgstr "Системен буфер"
+msgid "icon"
+msgstr "Икона"
+
+msgid "slider"
+msgstr "Плъзгач"
msgid "IDS_COM_BODY_CLIPBOARD"
msgstr "ক্লিপবোর্ড"
+msgid "icon"
+msgstr "Icon"
+
+msgid "slider"
+msgstr "স্লাইডার"
msgid "IDS_COM_BODY_CLIPBOARD"
msgstr "Porta-retalls"
+msgid "slider"
+msgstr "control lliscant"
msgid "IDS_COM_BODY_CLIPBOARD"
msgstr "Schránka"
+msgid "slider"
+msgstr "šoupátko"
msgid "IDS_COM_BODY_CLIPBOARD"
msgstr "Udklipsholder"
+msgid "icon"
+msgstr "Ikon"
+
+msgid "slider"
+msgstr "skyder"
msgid "IDS_COM_BODY_CLIPBOARD"
msgstr "Zwischenablage"
+msgid "slider"
+msgstr ""
msgid "IDS_COM_BODY_CLIPBOARD"
msgstr "Πρόχειρο"
+msgid "icon"
+msgstr "Εικονίδιο"
+
+msgid "slider"
+msgstr "Ρυθμιστικό"
msgid "IDS_COM_BODY_CLIPBOARD"
msgstr "Clipboard"
+msgid "icon"
+msgstr "Icon"
+
+msgid "slider"
+msgstr "Slider"
msgid "IDS_COM_BODY_CLIPBOARD"
msgstr "Clipboard"
+msgid "icon"
+msgstr "Icon"
+
+msgid "slider"
+msgstr "Slider"
msgid "IDS_COM_BODY_CLIPBOARD"
msgstr "Portapapeles"
+msgid "icon"
+msgstr "Icono"
+
+msgid "slider"
+msgstr "Controlador deslizante"
msgid "IDS_COM_BODY_CLIPBOARD"
msgstr "Portapapeles"
+msgid "icon"
+msgstr "Icono"
+
+msgid "slider"
+msgstr "Controlador deslizante"
msgid "IDS_COM_BODY_CLIPBOARD"
msgstr "Lõikelaud"
+msgid "icon"
+msgstr "Ikoon"
+
+msgid "slider"
+msgstr "Liugur"
msgid "IDS_COM_BODY_CLIPBOARD"
msgstr "Arbela"
+msgid "icon"
+msgstr "Ikonoa"
+
+msgid "slider"
+msgstr "Irristagailua"
msgid "IDS_COM_BODY_CLIPBOARD"
msgstr "کلیپ بورد"
+msgid "slider"
+msgstr ""
msgid "IDS_COM_BODY_CLIPBOARD"
msgstr "Leikepöytä"
+msgid "slider"
+msgstr "liukusäädin"
msgid "IDS_COM_BODY_CLIPBOARD"
msgstr "Presse-papier"
+msgid "slider"
+msgstr "curseur"
msgid "IDS_COM_BODY_CLIPBOARD"
msgstr "Presse-papier"
+msgid "icon"
+msgstr "Icône"
+
+msgid "slider"
+msgstr "Curseur"
msgid "IDS_COM_BODY_CLIPBOARD"
msgstr "Portapapeis"
+msgid "slider"
+msgstr "Barra de desprazamento"
msgid "IDS_COM_BODY_CLIPBOARD"
msgstr "Međuspremnik"
+msgid "icon"
+msgstr "Ikona"
+
+msgid "slider"
+msgstr "Klizač"
msgid "IDS_COM_BODY_CLIPBOARD"
msgstr "Vágólap"
+msgid "slider"
+msgstr "csúszka"
msgid "IDS_COM_BODY_CLIPBOARD"
msgstr "Գզրոց"
+msgid "icon"
+msgstr "Պատկերակ"
+
+msgid "slider"
+msgstr "Սողանիկ"
msgid "IDS_COM_BODY_CLIPBOARD"
msgstr "Klippiborð"
+msgid "icon"
+msgstr "Tákn"
+
+msgid "slider"
+msgstr "Skyggna"
msgid "IDS_COM_BODY_CLIPBOARD"
msgstr "Appunti"
+msgid "icon"
+msgstr "Icona"
+
+msgid "slider"
+msgstr "Dispositivo di scorrimento"
msgid "IDS_COM_BODY_CLIPBOARD"
msgstr "ბუფერული მეხს."
+msgid "icon"
+msgstr "ნიშანი"
+
+msgid "slider"
+msgstr "სლაიდერი"
msgid "IDS_COM_BODY_CLIPBOARD"
msgstr "Буфер"
+msgid "icon"
+msgstr "Белгіше"
+
+msgid "slider"
+msgstr "Сырғытпа"
msgid "IDS_COM_BODY_CLIPBOARD"
msgstr "클립보드"
+msgid "slider"
+msgstr "슬라이더"
msgid "IDS_COM_BODY_CLIPBOARD"
msgstr "Iškarpinė"
+msgid "slider"
+msgstr "šliaužiklis"
msgid "IDS_COM_BODY_CLIPBOARD"
msgstr "Starpliktuve"
+msgid "icon"
+msgstr "Ikona"
+
+msgid "slider"
+msgstr "Slīdnis"
msgid "IDS_COM_BODY_CLIPBOARD"
msgstr "Түр санах ой"
+msgid "icon"
+msgstr "Дүрс"
+
+msgid "slider"
+msgstr "Slider"
msgid "IDS_COM_BODY_CLIPBOARD"
msgstr "Utklippstavle"
+msgid "icon"
+msgstr "Ikon"
+
+msgid "slider"
+msgstr "Glidebryter"
msgid "IDS_COM_BODY_CLIPBOARD"
msgstr "Klembord"
+msgid "slider"
+msgstr ""
msgid "IDS_COM_BODY_CLIPBOARD"
msgstr "Schowek"
+msgid "slider"
+msgstr "slajder"
msgid "IDS_COM_BODY_CLIPBOARD"
msgstr "Área de transferência"
+msgid "icon"
+msgstr "Ícone"
+
+msgid "slider"
+msgstr "Controle deslizante"
msgid "IDS_COM_BODY_CLIPBOARD"
msgstr "Área transferência"
+msgid "icon"
+msgstr "Ícone"
+
+msgid "slider"
+msgstr "Cursor de deslocamento"
msgid "IDS_COM_BODY_CLIPBOARD"
msgstr "Clipboard"
+msgid "icon"
+msgstr "Pictogr."
+
+msgid "slider"
+msgstr "Cursor"
msgid "IDS_COM_BODY_CLIPBOARD"
msgstr "Буфер обмена"
+msgid "icon"
+msgstr "Значок"
+
+msgid "slider"
+msgstr "Ползунок"
msgid "IDS_COM_BODY_CLIPBOARD"
msgstr "Schránka"
+msgid "icon"
+msgstr "Ikona"
+
+msgid "slider"
+msgstr "Posuvný ovládač"
msgid "IDS_COM_BODY_CLIPBOARD"
msgstr "Odložišče"
+msgid "slider"
+msgstr "drsnik"
msgid "IDS_COM_BODY_CLIPBOARD"
msgstr "Privremena memorija"
+msgid "slider"
+msgstr "клизач"
msgid "IDS_COM_BODY_CLIPBOARD"
msgstr "Urklipp"
+msgid "icon"
+msgstr "Ikon"
+
+msgid "slider"
+msgstr "Slider"
msgid "IDS_COM_BODY_CLIPBOARD"
msgstr "Pano"
+msgid "icon"
+msgstr "Simge"
+
+msgid "slider"
+msgstr "Kaydırıcı"
msgid "IDS_COM_BODY_CLIPBOARD"
msgstr "Буфер обміну"
+msgid "icon"
+msgstr "Значок"
+
+msgid "slider"
+msgstr "Слайдер"
msgid "IDS_COM_BODY_CLIPBOARD"
msgstr "کلپ بورڈ"
+msgid "slider"
+msgstr ""
msgid "IDS_COM_BODY_CLIPBOARD"
msgstr "Bufer"
+msgid "icon"
+msgstr "Ikoncha"
+
+msgid "slider"
+msgstr "Slider"
msgid "IDS_COM_BODY_CLIPBOARD"
msgstr "Bộ nhớ tạm"
+msgid "slider"
+msgstr "Thanh Trượt"
msgid "IDS_COM_BODY_CLIPBOARD"
msgstr "剪贴板"
+msgid "slider"
+msgstr "滑块"
--- /dev/null
+#ifndef DALI_INPUT_FILTER_PROPERTIES_H
+#define DALI_INPUT_FILTER_PROPERTIES_H
+
+/*
+ * 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+namespace Dali
+{
+namespace Toolkit
+{
+/**
+ * @addtogroup dali_toolkit_controls_text_controls
+ * @{
+ */
+
+namespace InputFilter
+{
+/**
+ * @brief InputFilter Property.
+ * @SINCE_2_0.33
+ */
+namespace Property
+{
+/**
+ * @brief Enumeration for the type of InputFilter.
+ *
+ * An enum that determines the input filter type of the InputFilter map.
+ * Users can set the ACCEPTED or REJECTED character set, or both.
+ * If both are used, REJECTED has higher priority.
+ * The character set must follow the regular expression rules.
+ * Behaviour can not be guaranteed for incorrect grammars.
+ *
+ * Useful Meta characters:
+ *
+ * | %Meta characters | Description
+ * |-------------------|------------------------------------------------------------------------------------------------------------|
+ * | \\w | Matches an alphanumeric character, including "_"; same as [A-Za-z0-9_]. |
+ * | \\W | Matches a non-alphanumeric character, excluding "_"; same as [^A-Za-z0-9_]. |
+ * | \\s | Matches a whitespace character, which in ASCII are tab, line feed, form feed, carriage return, and space. |
+ * | \\S | Matches anything but a whitespace. |
+ * | \\d | Matches a digit; same as [0-9]. |
+ * | \\D | Matches a non-digit; same as [^0-9]. |
+ *
+ * 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
+ * @SINCE_2_0.33
+ */
+enum Type
+{
+ /**
+ * @brief The set of characters to be accepted.
+ * @details Name "accepted", type Property::STRING.
+ * @SINCE_2_0.33
+ * @note Available on regex string.
+ */
+ ACCEPTED,
+
+ /**
+ * @brief The set of characters to be rejected.
+ * @details Name "rejected", type Property::STRING.
+ * @SINCE_2_0.33
+ * @note Available on regex string.
+ */
+ REJECTED
+};
+
+} // namespace Property
+
+} // namespace InputFilter
+
+/**
+ * @}
+ */
+
+} // namespace Toolkit
+
+} // namespace Dali
+
+#endif // DALI_INPUT_FILTER_PROPERTIES_H
{
const unsigned int TOOLKIT_MAJOR_VERSION = 2;
const unsigned int TOOLKIT_MINOR_VERSION = 0;
-const unsigned int TOOLKIT_MICRO_VERSION = 32;
+const unsigned int TOOLKIT_MICRO_VERSION = 33;
const char* const TOOLKIT_BUILD_DATE = __DATE__ " " __TIME__;
#ifdef DEBUG_ENABLED
SET( public_api_text_controls_header_files
${public_api_src_dir}/controls/text-controls/hidden-input-properties.h
+ ${public_api_src_dir}/controls/text-controls/input-filter-properties.h
${public_api_src_dir}/controls/text-controls/placeholder-properties.h
${public_api_src_dir}/controls/text-controls/text-editor.h
${public_api_src_dir}/controls/text-controls/text-label.h
Name: dali2-toolkit
Summary: Dali 3D engine Toolkit
-Version: 2.0.32
+Version: 2.0.33
Release: 1
Group: System/Libraries
License: Apache-2.0 and BSD-3-Clause and MIT