const char* const PROPERTY_NAME_FONT_SIZE_SCALE = "fontSizeScale";
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 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.
DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_MAX_LENGTH ) == DevelTextEditor::Property::MAX_LENGTH );
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 );
END_TEST;
}
editor.SetProperty( DevelTextEditor::Property::ENABLE_GRAB_HANDLE_POPUP, false );
DALI_TEST_EQUALS( editor.GetProperty<bool>( DevelTextEditor::Property::ENABLE_GRAB_HANDLE_POPUP ), false, TEST_LOCATION);
+ // Check the input method setting
+ Property::Map propertyMap;
+ InputMethod::PanelLayout::Type panelLayout = InputMethod::PanelLayout::NUMBER;
+ InputMethod::AutoCapital::Type autoCapital = InputMethod::AutoCapital::WORD;
+ InputMethod::ButtonAction::Type buttonAction = InputMethod::ButtonAction::GO;
+ int inputVariation = 1;
+ propertyMap["PANEL_LAYOUT"] = panelLayout;
+ propertyMap["AUTO_CAPITALIZE"] = autoCapital;
+ propertyMap["BUTTON_ACTION"] = buttonAction;
+ propertyMap["VARIATION"] = inputVariation;
+ editor.SetProperty( DevelTextEditor::Property::INPUT_METHOD_SETTINGS, propertyMap );
+
+ Property::Value value = editor.GetProperty( DevelTextEditor::Property::INPUT_METHOD_SETTINGS );
+ Property::Map map;
+ DALI_TEST_CHECK( value.Get( map ) );
+
+ int layout = 0;
+ DALI_TEST_CHECK( map[ "PANEL_LAYOUT" ].Get( layout ) );
+ DALI_TEST_EQUALS( static_cast<int>(panelLayout), layout, TEST_LOCATION );
+
+ int capital = 0;
+ DALI_TEST_CHECK( map[ "AUTO_CAPITALIZE" ].Get( capital ) );
+ DALI_TEST_EQUALS( static_cast<int>(autoCapital), capital, TEST_LOCATION );
+
+ int action = 0;
+ DALI_TEST_CHECK( map[ "BUTTON_ACTION" ].Get( action ) );
+ DALI_TEST_EQUALS( static_cast<int>(buttonAction), action, TEST_LOCATION );
+
+ int variation = 0;
+ DALI_TEST_CHECK( map[ "VARIATION" ].Get( variation ) );
+ DALI_TEST_EQUALS( inputVariation, variation, TEST_LOCATION );
+
application.SendNotification();
application.Render();
application.GetGlAbstraction().SetCheckFramebufferStatusResult(GL_FRAMEBUFFER_COMPLETE);
// Create a tap event to touch the text field.
- TestGenerateTap(application, 30.0f, 25.0f);
+ TestGenerateTap(application, 30.0f, 25.0f, 100);
application.SendNotification();
application.Render();
gAnchorClickedCallBackCalled = false;
// Create a tap event to touch the text field.
- TestGenerateTap(application, 30.0f, 25.0f);
+ TestGenerateTap(application, 30.0f, 25.0f, 700);
application.SendNotification();
field.SetKeyInputFocus();
gAnchorClickedCallBackCalled = false;
// Create a tap event to touch the text field.
- TestGenerateTap(application, 30.0f, 25.0f);
+ TestGenerateTap(application, 30.0f, 25.0f, 1300);
application.SendNotification();
field.SetKeyInputFocus();
gAnchorClickedCallBackCalled = false;
// Create a tap event to touch the text field.
- TestGenerateTap(application, 30.0f, 25.0f);
+ TestGenerateTap(application, 30.0f, 25.0f, 1900);
application.SendNotification();
field.SetKeyInputFocus();
gAnchorClickedCallBackCalled = false;
// Create a tap event to touch the text field.
- TestGenerateTap(application, 30.0f, 25.0f);
+ TestGenerateTap(application, 30.0f, 25.0f, 2500);
application.SendNotification();
field.SetKeyInputFocus();
gAnchorClickedCallBackCalled = false;
// Create a tap event to touch the text field.
- TestGenerateTap(application, 30.0f, 25.0f);
+ TestGenerateTap(application, 30.0f, 25.0f, 3100);
application.SendNotification();
application.Render();
gAnchorClickedCallBackCalled = false;
// Create a tap event to touch the text field.
- TestGenerateTap(application, 30.0f, 25.0f);
+ TestGenerateTap(application, 30.0f, 25.0f, 3700);
application.SendNotification();
application.Render();
gAnchorClickedCallBackCalled = false;
// Create a tap event to touch the text field.
- TestGenerateTap(application, 30.0f, 25.0f);
+ TestGenerateTap(application, 30.0f, 25.0f, 4300);
application.SendNotification();
application.Render();
gAnchorClickedCallBackCalled = false;
// Create a tap event to touch the text field.
- TestGenerateTap(application, 30.0f, 25.0f);
+ TestGenerateTap(application, 30.0f, 25.0f, 4900);
application.SendNotification();
application.Render();
gAnchorClickedCallBackCalled = false;
// Create a tap event to touch the text field.
- TestGenerateTap(application, 30.0f, 25.0f);
+ TestGenerateTap(application, 30.0f, 25.0f, 5500);
application.SendNotification();
application.Render();
DALI_TEST_CHECK( !inputStyleChangedSignal );
// Create a tap event to touch the text field.
- TestGenerateTap( application, 63.0f, 25.0f, 300 );
+ TestGenerateTap( application, 63.0f, 25.0f, 700 );
// Render and notify
application.SendNotification();
s[Dali::Accessibility::State::HIGHLIGHTED] = GetCurrentlyHighlightedActor() == self;
s[Dali::Accessibility::State::ENABLED] = true;
s[Dali::Accessibility::State::SENSITIVE] = true;
- s[Dali::Accessibility::State::ANIMATED] = self.GetProperty(Toolkit::DevelControl::Property::ACCESSIBILITY_ANIMATED).Get<bool>();
s[Dali::Accessibility::State::VISIBLE] = true;
if(modal)
{
auto actor = Toolkit::ImageView::New(focusBorderImagePath);
actor.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
DevelControl::AppendAccessibilityAttribute(actor, "highlight", "");
- actor.SetProperty(Toolkit::DevelControl::Property::ACCESSIBILITY_ANIMATED, true);
actor.SetProperty(Toolkit::DevelControl::Property::ACCESSIBILITY_HIGHLIGHTABLE, false);
return actor;
* @brief Set of accessibility attributes describing object in accessibility hierarchy
* @details Name "accessibilityAttributes", type Property::MAP
*/
- ACCESSIBILITY_ATTRIBUTES,
-
- /**
- * @brief Boolean flag describing object as animated
- * @details Name "accessibilityAnimated", type Property::BOOLEAN
- * @note Flag set to true will prevent BoundChanged accessibility signal from emiting
- */
- ACCESSIBILITY_ANIMATED
+ ACCESSIBILITY_ATTRIBUTES
};
} // namespace Property
* @note The default value is true, which means the grab handle popup is enabled by default.
*/
ENABLE_GRAB_HANDLE_POPUP,
+
+ /**
+ * @brief The settings to relating to the System's Input Method, Key and Value.
+ * @details Name "inputMethodSettings", type Property::MAP.
+ *
+ * @note VARIATION key can be changed depending on PANEL_LAYOUT.
+ * For example, when PANEL_LAYOUT key is InputMethod::PanelLayout::NORMAL,
+ * then VARIATION would be among NORMAL, WITH_FILENAME, and WITH_PERSON_NAME in Dali::InputMethod::NormalLayout.
+ * For more information, see Dali::InputMethod::Category.
+ *
+ * Example Usage:
+ * @code
+ * Property::Map propertyMap;
+ * InputMethod::PanelLayout::Type panelLayout = InputMethod::PanelLayout::NUMBER;
+ * InputMethod::AutoCapital::Type autoCapital = InputMethod::AutoCapital::WORD;
+ * InputMethod::ButtonAction::Type buttonAction = InputMethod::ButtonAction::GO;
+ * int inputVariation = 1;
+ * propertyMap["PANEL_LAYOUT"] = panelLayout;
+ * propertyMap["AUTO_CAPITALIZE"] = autoCapital;
+ * propertyMap["BUTTON_ACTION"] = buttonAction;
+ * propertyMap["VARIATION"] = inputVariation;
+ *
+ * editor.SetProperty(DevelTextEditor::Property::INPUT_METHOD_SETTINGS, propertyMap);
+ * @endcode
+ */
+ INPUT_METHOD_SETTINGS,
};
} // namespace Property
const PropertyRegistration Control::Impl::PROPERTY_19(typeRegistration, "accessibilityTranslationDomain", Toolkit::DevelControl::Property::ACCESSIBILITY_TRANSLATION_DOMAIN, Property::STRING, &Control::Impl::SetProperty, &Control::Impl::GetProperty);
const PropertyRegistration Control::Impl::PROPERTY_20(typeRegistration, "accessibilityRole", Toolkit::DevelControl::Property::ACCESSIBILITY_ROLE, Property::INTEGER, &Control::Impl::SetProperty, &Control::Impl::GetProperty);
const PropertyRegistration Control::Impl::PROPERTY_21(typeRegistration, "accessibilityHighlightable", Toolkit::DevelControl::Property::ACCESSIBILITY_HIGHLIGHTABLE, Property::BOOLEAN, &Control::Impl::SetProperty, &Control::Impl::GetProperty);
-const PropertyRegistration Control::Impl::PROPERTY_22(typeRegistration, "accessibilityAnimated", Toolkit::DevelControl::Property::ACCESSIBILITY_ANIMATED, Property::BOOLEAN, &Control::Impl::SetProperty, &Control::Impl::GetProperty);
// clang-format on
Control::Impl::Impl(Control& controlImpl)
}
break;
}
-
- case Toolkit::DevelControl::Property::ACCESSIBILITY_ANIMATED:
- {
- bool animated;
- if(value.Get(animated))
- {
- controlImpl.mImpl->mAccessibilityAnimated = animated;
- }
- break;
- }
}
}
}
value = controlImpl.mImpl->mAccessibilityAttributes;
break;
}
-
- case Toolkit::DevelControl::Property::ACCESSIBILITY_ANIMATED:
- {
- value = controlImpl.mImpl->mAccessibilityAnimated;
- break;
- }
}
}
return nullptr;
}
-void Control::Impl::PositionOrSizeChangedCallback(PropertyNotification& p)
-{
- auto self = Dali::Actor::DownCast(p.GetTarget());
- if(Dali::Accessibility::IsUp() && !self.GetProperty(Toolkit::DevelControl::Property::ACCESSIBILITY_ANIMATED).Get<bool>())
- {
- auto extents = DevelActor::CalculateScreenExtents(self);
- Dali::Accessibility::Accessible::Get(self)->EmitBoundsChanged(extents);
- }
-}
-
-void Control::Impl::CulledChangedCallback(PropertyNotification& p)
-{
- if(Dali::Accessibility::IsUp())
- {
- auto self = Dali::Actor::DownCast(p.GetTarget());
- Dali::Accessibility::Accessible::Get(self)->EmitShowing(!self.GetProperty(DevelActor::Property::CULLED).Get<bool>());
- }
-}
-
-void Control::Impl::AccessibilityRegister()
-{
- if(!accessibilityNotificationSet)
- {
- accessibilityNotificationPosition = mControlImpl.Self().AddPropertyNotification(Actor::Property::POSITION, StepCondition(0.01f));
- accessibilityNotificationPosition.SetNotifyMode(PropertyNotification::NOTIFY_ON_CHANGED);
- accessibilityNotificationPosition.NotifySignal().Connect(&Control::Impl::PositionOrSizeChangedCallback);
-
- accessibilityNotificationSize = mControlImpl.Self().AddPropertyNotification(Actor::Property::SIZE, StepCondition(0.01f));
- accessibilityNotificationSize.SetNotifyMode(PropertyNotification::NOTIFY_ON_CHANGED);
- accessibilityNotificationSize.NotifySignal().Connect(&Control::Impl::PositionOrSizeChangedCallback);
-
- accessibilityNotificationCulled = mControlImpl.Self().AddPropertyNotification(DevelActor::Property::CULLED, LessThanCondition(0.5f));
- accessibilityNotificationCulled.SetNotifyMode(PropertyNotification::NOTIFY_ON_CHANGED);
- accessibilityNotificationCulled.NotifySignal().Connect(&Control::Impl::CulledChangedCallback);
-
- accessibilityNotificationSet = true;
- }
-}
-
-void Control::Impl::AccessibilityDeregister(bool remove)
-{
- if(accessibilityNotificationSet)
- {
- accessibilityNotificationPosition.NotifySignal().Disconnect(&Control::Impl::PositionOrSizeChangedCallback);
- if(remove)
- {
- mControlImpl.Self().RemovePropertyNotification(accessibilityNotificationPosition);
- }
- accessibilityNotificationPosition.Reset();
- accessibilityNotificationPosition = {};
-
- accessibilityNotificationSize.NotifySignal().Disconnect(&Control::Impl::PositionOrSizeChangedCallback);
- if(remove)
- {
- mControlImpl.Self().RemovePropertyNotification(accessibilityNotificationSize);
- }
- accessibilityNotificationSize.Reset();
- accessibilityNotificationSize = {};
-
- accessibilityNotificationCulled.NotifySignal().Disconnect(&Control::Impl::CulledChangedCallback);
- if(remove)
- {
- mControlImpl.Self().RemovePropertyNotification(accessibilityNotificationCulled);
- }
- accessibilityNotificationCulled.Reset();
- accessibilityNotificationCulled = {};
- accessibilityNotificationSet = false;
- }
-}
-
} // namespace Internal
} // namespace Toolkit
Dali::Accessibility::Role mAccessibilityRole = Dali::Accessibility::Role::UNKNOWN;
std::vector<std::vector<Accessibility::Address>> mAccessibilityRelations;
- bool mAccessibilityAnimated = false;
// Gesture Detection
PinchGestureDetector mPinchGestureDetector;
static Dali::Accessibility::Accessible* GetAccessibilityObject(Dali::Actor actor);
Dali::Accessibility::Accessible* GetAccessibilityObject();
- void AccessibilityRegister();
- void AccessibilityDeregister(bool remove);
-
std::function<std::unique_ptr<Dali::Accessibility::Accessible>(Actor)> accessibilityConstructor;
std::unique_ptr<Dali::Accessibility::Accessible> accessibilityObject;
- Dali::PropertyNotification accessibilityNotificationPosition, accessibilityNotificationSize, accessibilityNotificationCulled;
- bool accessibilityNotificationSet = false;
- static void PositionOrSizeChangedCallback(PropertyNotification&);
- static void CulledChangedCallback(PropertyNotification&);
};
} // namespace Internal
DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit, TextEditor, "primaryCursorPosition", INTEGER, PRIMARY_CURSOR_POSITION )
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_SIGNAL_REGISTRATION(Toolkit, TextEditor, "textChanged", SIGNAL_TEXT_CHANGED )
DALI_SIGNAL_REGISTRATION(Toolkit, TextEditor, "inputStyleChanged", SIGNAL_INPUT_STYLE_CHANGED)
impl.mController->SetGrabHandlePopupEnabled(grabHandlePopupEnabled);
break;
}
+ case Toolkit::DevelTextEditor::Property::INPUT_METHOD_SETTINGS:
+ {
+ const Property::Map* map = value.GetMap();
+ if(map)
+ {
+ impl.mInputMethodOptions.ApplyProperty(*map);
+ }
+ impl.mController->SetInputModePassword(impl.mInputMethodOptions.IsPassword());
+
+ Toolkit::Control control = Toolkit::KeyInputFocusManager::Get().GetCurrentFocusControl();
+ if(control == textEditor)
+ {
+ impl.mInputMethodContext.ApplyOptions(impl.mInputMethodOptions);
+ }
+ break;
+ }
} // switch
} // texteditor
}
value = impl.mController->IsGrabHandlePopupEnabled();
break;
}
+ case Toolkit::DevelTextEditor::Property::INPUT_METHOD_SETTINGS:
+ {
+ Property::Map map;
+ impl.mInputMethodOptions.RetrieveProperty(map);
+ value = map;
+ break;
+ }
} //switch
}
if(mInputMethodContext && IsEditable())
{
// All input panel properties, such as layout, return key type, and input hint, should be set before input panel activates (or shows).
+ mInputMethodContext.ApplyOptions(mInputMethodOptions);
mInputMethodContext.NotifyTextInputMultiLine(true);
mInputMethodContext.StatusChangedSignal().Connect(this, &TextEditor::KeyboardStatusChanged);
Dali::Animation mAnimation; ///< Scroll indicator Show/Hide Animation.
Dali::TimePeriod mAnimationPeriod;
std::vector<Actor> mClippingDecorationActors; ///< Decoration actors which need clipping.
+ Dali::InputMethodOptions mInputMethodOptions;
Actor mRenderableActor;
Actor mActiveLayer;
#include <dali-toolkit/internal/controls/text-controls/text-label-impl.h>
// EXTERNAL INCLUDES
+#include <dali/devel-api/actors/actor-devel.h>
#include <dali/devel-api/adaptor-framework/image-loading.h>
#include <dali/devel-api/adaptor-framework/window-devel.h>
#include <dali/devel-api/common/stage.h>
padding = Self().GetProperty<Extents>(Toolkit::Control::Property::PADDING);
const Vector2& localPoint = gesture.GetLocalPoint();
mController->AnchorEvent(localPoint.x - padding.start, localPoint.y - padding.top);
+
+ // parents can also listen for tap gesture events
+ Dali::DevelActor::SetNeedGesturePropagation(Self(), true);
}
void TextLabel::AnchorClicked(const std::string& href)
eventData->mUpdateCursorPosition = false;
eventData->mUpdateGrabHandlePosition = false;
}
- else
+
+ if(eventData->mUpdateHighlightBox ||
+ eventData->mUpdateLeftSelectionPosition ||
+ eventData->mUpdateRightSelectionPosition)
{
CursorInfo leftHandleInfo;
CursorInfo rightHandleInfo;
bool VectorAnimationTask::Rasterize()
{
bool stopped = false;
- uint32_t currentFrame, droppedFrames = 0;
+ uint32_t currentFrame;
{
ConditionalWait::ScopedLock lock(mConditionalWait);
// The task will be destroyed. We don't need rasterization.
return false;
}
- droppedFrames = mDroppedFrames;
}
ApplyAnimationData();
if(mPlayState == PlayState::PLAYING && mUpdateFrameNumber)
{
- mCurrentFrame = mForward ? mCurrentFrame + droppedFrames + 1 : mCurrentFrame - droppedFrames - 1;
+ mCurrentFrame = mForward ? mCurrentFrame + mDroppedFrames + 1 : mCurrentFrame - mDroppedFrames - 1;
Dali::ClampInPlace(mCurrentFrame, mStartFrame, mEndFrame);
}
VectorAnimationTask::TimePoint VectorAnimationTask::CalculateNextFrameTime(bool renderNow)
{
- uint32_t droppedFrames = 0;
-
// std::chrono::time_point template has second parameter duration which defaults to the std::chrono::system_clock supported
// duration. In some C++11 implementations it is a milliseconds duration, so it fails to compile unless mNextFrameStartTime
// is casted to use the default duration.
if(renderNow)
{
mNextFrameStartTime = current;
+ mDroppedFrames = 0;
}
else if(mNextFrameStartTime < current)
{
+ uint32_t droppedFrames = 0;
+
while(current > std::chrono::time_point_cast<TimePoint::duration>(mNextFrameStartTime + std::chrono::microseconds(mFrameDurationMicroSeconds)))
{
droppedFrames++;
mNextFrameStartTime = std::chrono::time_point_cast<TimePoint::duration>(mNextFrameStartTime + std::chrono::microseconds(mFrameDurationMicroSeconds));
}
- {
- ConditionalWait::ScopedLock lock(mConditionalWait);
- mDroppedFrames = droppedFrames;
- }
-
mNextFrameStartTime = current;
+ mDroppedFrames = droppedFrames;
}
return mNextFrameStartTime;
// The clipping renderer is only created if required.
CreateClippingRenderer(*this);
-
- mImpl->AccessibilityRegister();
}
void Control::OnSceneDisconnection()
{
- mImpl->AccessibilityDeregister(true);
mImpl->OnSceneDisconnection();
}