X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Fpublic-api%2Fcontrols%2Fcontrol-impl.cpp;h=684e695f51776ba20e7f05013a85d1978378ffba;hp=b4bb4da58a875321d9dfb5a8020d64bcf10348e2;hb=2d49df397bf377d412321ff978bd90186d55ba6b;hpb=debd4ef5b35507bac4579dfbb8983b743872c70b diff --git a/dali-toolkit/public-api/controls/control-impl.cpp b/dali-toolkit/public-api/controls/control-impl.cpp index b4bb4da..684e695 100644 --- a/dali-toolkit/public-api/controls/control-impl.cpp +++ b/dali-toolkit/public-api/controls/control-impl.cpp @@ -28,6 +28,9 @@ #include #include #include +#include +#include +#include // INTERNAL INCLUDES #include @@ -45,6 +48,9 @@ #include #include #include +#include +#include +#include namespace Dali { @@ -234,6 +240,7 @@ void Control::EnableGestureDetection(GestureType::Value type) if((type & GestureType::PAN) && !mImpl->mPanGestureDetector) { mImpl->mPanGestureDetector = PanGestureDetector::New(); + mImpl->mPanGestureDetector.SetMaximumTouchesRequired(2); mImpl->mPanGestureDetector.DetectedSignal().Connect(mImpl, &Impl::PanDetected); mImpl->mPanGestureDetector.Attach(Self()); } @@ -367,7 +374,11 @@ void Control::KeyboardEnter() bool Control::OnAccessibilityActivated() { - return false; // Accessibility activation is not handled by default + if( Toolkit::KeyboardFocusManager::Get().SetCurrentFocusActor( Self() ) ) + { + return OnKeyboardEnter(); + } + return false; } bool Control::OnKeyboardEnter() @@ -476,6 +487,17 @@ void Control::Initialize() { SetKeyboardNavigationSupport(true); } + + Dali::TypeInfo type; + Self().GetTypeInfo( type ); + if (type) + { + auto typeName = type.GetName(); + DevelControl::AppendAccessibilityAttribute( Self(), "t", typeName ); + } + + if (Accessibility::IsUp()) + mImpl->AccessibilityRegister(); } void Control::OnInitialize() @@ -524,6 +546,17 @@ void Control::EmitKeyInputFocusSignal(bool focusGained) { Dali::Toolkit::Control handle(GetOwner()); + if( Accessibility::IsUp() ) + { + auto self = mImpl->GetAccessibilityObject( Self() ); + self->EmitFocused( focusGained ); + auto parent = self->GetParent(); + if( parent && !self->GetStates()[Dali::Accessibility::State::MANAGES_DESCENDANTS] ) + { + parent->EmitActiveDescendantChanged( parent, self ); + } + } + if(focusGained) { // signals are allocated dynamically when someone connects @@ -563,10 +596,18 @@ void Control::OnSceneConnection(int depth) // Request to be laid out when the control is connected to the Scene. // Signal that a Relayout may be needed + if( Accessibility::IsUp() ) + { + mImpl->AccessibilityRegister(); + } } void Control::OnSceneDisconnection() { + if( Accessibility::IsUp() ) + { + mImpl->AccessibilityDeregister(); + } mImpl->OnSceneDisconnection(); } @@ -592,10 +633,49 @@ void Control::OnPropertySet(Property::Index index, const Property::Value& proper { // If the clipping mode has been set, we may need to create a renderer. // Only do this if we are already on-stage as the OnSceneConnection will handle the off-stage clipping controls. - if((index == Actor::Property::CLIPPING_MODE) && Self().GetProperty(Actor::Property::CONNECTED_TO_SCENE)) + switch( index ) { - // Note: This method will handle whether creation of the renderer is required. - CreateClippingRenderer(*this); + case Actor::Property::CLIPPING_MODE: + { + if( Self().GetProperty< bool >( Actor::Property::CONNECTED_TO_SCENE )) + { + // Note: This method will handle whether creation of the renderer is required. + CreateClippingRenderer( *this ); + } + break; + } + case Actor::Property::VISIBLE: + { + if( Dali::Accessibility::IsUp() ) + { + Dali::Accessibility::Accessible::Get(Self())->EmitVisible( Self().GetProperty( Actor::Property::VISIBLE ).Get() ); + } + break; + } + case Toolkit::DevelControl::Property::ACCESSIBILITY_NAME: + { + if( Dali::Accessibility::IsUp() ) + { + Dali::Accessibility::Accessible::Get(Self())->Emit( Dali::Accessibility::ObjectPropertyChangeEvent::NAME ); + } + break; + } + case Toolkit::DevelControl::Property::ACCESSIBILITY_ROLE: + { + if( Dali::Accessibility::IsUp() ) + { + Dali::Accessibility::Accessible::Get(Self())->Emit( Dali::Accessibility::ObjectPropertyChangeEvent::ROLE ); + } + break; + } + case Toolkit::DevelControl::Property::ACCESSIBILITY_DESCRIPTION: + { + if( Dali::Accessibility::IsUp() ) + { + Dali::Accessibility::Accessible::Get(Self())->Emit( Dali::Accessibility::ObjectPropertyChangeEvent::DESCRIPTION ); + } + break; + } } }