* @param[in] attributes The attributes with which to perfrom this action.
* @return true if action has been accepted by this control
*/
-const char* ACTION_ACCESSIBILITY_ACTIVATED = "accessibilityActivated";
-const char* ACTION_ACCESSIBILITY_READING_SKIPPED = "ReadingSkipped";
+const char* ACTION_ACCESSIBILITY_ACTIVATED = "accessibilityActivated";
const char* ACTION_ACCESSIBILITY_READING_CANCELLED = "ReadingCancelled";
-const char* ACTION_ACCESSIBILITY_READING_STOPPED = "ReadingStopped";
+const char* ACTION_ACCESSIBILITY_READING_PAUSED = "ReadingPaused";
+const char* ACTION_ACCESSIBILITY_READING_RESUMED = "ReadingResumed";
+const char* ACTION_ACCESSIBILITY_READING_SKIPPED = "ReadingSkipped";
+const char* ACTION_ACCESSIBILITY_READING_STOPPED = "ReadingStopped";
static bool DoAction( BaseObject* object, const std::string& actionName, const Property::Map& attributes )
{
- bool ret = false;
+ if (!object)
+ return false;
+
+ Toolkit::Control control = Toolkit::Control::DownCast( BaseHandle( object ) );
+ if ( !control )
+ return false;
- if( object &&
- ( 0 == strcmp( actionName.c_str(), ACTION_ACCESSIBILITY_ACTIVATED ) ||
- actionName == "activate" ) )
+ if( 0 == strcmp( actionName.c_str(), ACTION_ACCESSIBILITY_ACTIVATED ) ||
+ actionName == "activate" )
{
- Toolkit::Control control = Toolkit::Control::DownCast( BaseHandle( object ) );
- if( control )
- {
- // if cast succeeds there is an implementation so no need to check
- if (!DevelControl::AccessibilityActivateSignal( control ).Empty()) {
- DevelControl::AccessibilityActivateSignal( control ).Emit();
- ret = true;
- }
- else
- ret = Internal::GetImplementation( control ).OnAccessibilityActivated();
- }
+ // if cast succeeds there is an implementation so no need to check
+ if (!DevelControl::AccessibilityActivateSignal( control ).Empty())
+ DevelControl::AccessibilityActivateSignal( control ).Emit();
+ else
+ return Internal::GetImplementation( control ).OnAccessibilityActivated();
}
- else if( object && ( 0 == strcmp( actionName.c_str(), ACTION_ACCESSIBILITY_READING_SKIPPED ) ) )
+ else if( 0 == strcmp( actionName.c_str(), ACTION_ACCESSIBILITY_READING_SKIPPED ) )
{
- Toolkit::Control control = Toolkit::Control::DownCast( BaseHandle( object ) );
- if( control )
- {
- // if cast succeeds there is an implementation so no need to check
- if (!DevelControl::AccessibilityReadingSkippedSignal( control ).Empty())
- {
- DevelControl::AccessibilityReadingSkippedSignal( control ).Emit();
- ret = true;
- }
- }
+ // if cast succeeds there is an implementation so no need to check
+ if (!DevelControl::AccessibilityReadingSkippedSignal( control ).Empty())
+ DevelControl::AccessibilityReadingSkippedSignal( control ).Emit();
}
- else if( object && ( 0 == strcmp( actionName.c_str(), ACTION_ACCESSIBILITY_READING_CANCELLED ) ) )
+ else if( 0 == strcmp( actionName.c_str(), ACTION_ACCESSIBILITY_READING_PAUSED) )
{
- Toolkit::Control control = Toolkit::Control::DownCast( BaseHandle( object ) );
- if( control )
- {
- // if cast succeeds there is an implementation so no need to check
- if (!DevelControl::AccessibilityReadingCancelledSignal( control ).Empty())
- {
- DevelControl::AccessibilityReadingCancelledSignal( control ).Emit();
- ret = true;
- }
- }
+ // if cast succeeds there is an implementation so no need to check
+ if (!DevelControl::AccessibilityReadingPausedSignal( control ).Empty())
+ DevelControl::AccessibilityReadingPausedSignal( control ).Emit();
}
- else if( object && ( 0 == strcmp( actionName.c_str(), ACTION_ACCESSIBILITY_READING_STOPPED ) ) )
+ else if( 0 == strcmp( actionName.c_str(), ACTION_ACCESSIBILITY_READING_RESUMED ) )
{
- Toolkit::Control control = Toolkit::Control::DownCast( BaseHandle( object ) );
- if( control )
- {
- // if cast succeeds there is an implementation so no need to check
- if (!DevelControl::AccessibilityReadingStoppedSignal( control ).Empty())
- {
- DevelControl::AccessibilityReadingStoppedSignal( control ).Emit();
- ret = true;
- }
- }
+ // if cast succeeds there is an implementation so no need to check
+ if (!DevelControl::AccessibilityReadingResumedSignal( control ).Empty())
+ DevelControl::AccessibilityReadingResumedSignal( control ).Emit();
+ }
+ else if( 0 == strcmp( actionName.c_str(), ACTION_ACCESSIBILITY_READING_CANCELLED ) )
+ {
+ // if cast succeeds there is an implementation so no need to check
+ if (!DevelControl::AccessibilityReadingCancelledSignal( control ).Empty())
+ DevelControl::AccessibilityReadingCancelledSignal( control ).Emit();
+ }
+ else if( 0 == strcmp( actionName.c_str(), ACTION_ACCESSIBILITY_READING_STOPPED ) )
+ {
+ // if cast succeeds there is an implementation so no need to check
+ if (!DevelControl::AccessibilityReadingStoppedSignal( control ).Empty())
+ DevelControl::AccessibilityReadingStoppedSignal( control ).Emit();
}
- return ret;
+ return true;
}
/**
TypeAction registerAction3( typeRegistration, ACTION_ACCESSIBILITY_READING_SKIPPED, &DoAction );
TypeAction registerAction4( typeRegistration, ACTION_ACCESSIBILITY_READING_CANCELLED, &DoAction );
TypeAction registerAction5( typeRegistration, ACTION_ACCESSIBILITY_READING_STOPPED, &DoAction );
+TypeAction registerAction6( typeRegistration, ACTION_ACCESSIBILITY_READING_PAUSED, &DoAction );
+TypeAction registerAction7( typeRegistration, ACTION_ACCESSIBILITY_READING_RESUMED, &DoAction );
DALI_TYPE_REGISTRATION_END()
Internal::Control::Impl& controlImpl = Internal::Control::Impl::Get( internalControl );
if( controlImpl.mAccessibilityRole == Dali::Accessibility::Role::UNKNOWN )
controlImpl.mAccessibilityRole = role;
+
+ self.PropertySetSignal().Connect(&controlImpl, [this, &controlImpl](Dali::Handle &handle, Dali::Property::Index index, Dali::Property::Value value)
+ {
+ if (this->self != Dali::Accessibility::Accessible::GetCurrentlyHighlightedActor())
+ {
+ return;
+ }
+
+ if (index == DevelControl::Property::ACCESSIBILITY_NAME
+ || (index == GetNamePropertyIndex() && !controlImpl.mAccessibilityNameSet))
+ {
+ if (controlImpl.mAccessibilityGetNameSignal.Empty())
+ {
+ Emit(Dali::Accessibility::ObjectPropertyChangeEvent::NAME);
+ }
+ }
+
+ if (index == DevelControl::Property::ACCESSIBILITY_DESCRIPTION
+ || (index == GetDescriptionPropertyIndex() && !controlImpl.mAccessibilityDescriptionSet))
+ {
+ if (controlImpl.mAccessibilityGetDescriptionSignal.Empty())
+ {
+ Emit(Dali::Accessibility::ObjectPropertyChangeEvent::DESCRIPTION);
+ }
+ }
+ });
}
std::string Control::Impl::AccessibleImpl::GetName()
s[Dali::Accessibility::State::FOCUSABLE] = self.GetProperty< bool >( Actor::Property::KEYBOARD_FOCUSABLE );
s[Dali::Accessibility::State::FOCUSED] = Toolkit::KeyboardFocusManager::Get().GetCurrentFocusActor() == self;
if(self.GetProperty( Toolkit::DevelControl::Property::ACCESSIBILITY_HIGHLIGHTABLE ).GetType() == Property::NONE )
- s[Dali::Accessibility::State::HIGHLIGHTABLE] = true;
+ s[Dali::Accessibility::State::HIGHLIGHTABLE] = false;
else
s[Dali::Accessibility::State::HIGHLIGHTABLE] = self.GetProperty( Toolkit::DevelControl::Property::ACCESSIBILITY_HIGHLIGHTABLE ).Get< bool >();
s[Dali::Accessibility::State::HIGHLIGHTED] = GetCurrentlyHighlightedActor() == self;
highlight.SetProperty( Actor::Property::POSITION_Z, 1.0f );
highlight.SetProperty( Actor::Property::POSITION, Vector2( 0.0f, 0.0f ));
+ EnsureSelfVisible();
self.Add( highlight );
SetCurrentlyHighlightedActor( self );
EmitHighlighted( true );
return ret;
}
+void Control::Impl::AccessibleImpl::EnsureChildVisible(Actor child)
+{
+}
+
+void Control::Impl::AccessibleImpl::EnsureSelfVisible()
+{
+ auto parent = dynamic_cast<Control::Impl::AccessibleImpl*>(GetParent());
+ if (parent)
+ {
+ parent->EnsureChildVisible(self);
+ }
+}
+
+Property::Index Control::Impl::AccessibleImpl::GetNamePropertyIndex()
+{
+ return Actor::Property::NAME;
+}
+
+Property::Index Control::Impl::AccessibleImpl::GetDescriptionPropertyIndex()
+{
+ return Property::INVALID_INDEX;
+}
+
void Control::Impl::PositionOrSizeChangedCallback( PropertyNotification &p )
{
auto self = Dali::Actor::DownCast(p.GetTarget());