X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Fprogress-bar%2Fprogress-bar-impl.cpp;h=fc398699d8c31375a73cb34d0f3ee96efe3c5ec8;hp=3d18ddb3a0cf77e8a2300288a4ffbbad021c61cc;hb=8a647e87a01c5c78451653c1264a9eea81ac9b20;hpb=dea624eb348a4926d8761c8a1364f03f9f71acf5 diff --git a/dali-toolkit/internal/controls/progress-bar/progress-bar-impl.cpp b/dali-toolkit/internal/controls/progress-bar/progress-bar-impl.cpp old mode 100755 new mode 100644 index 3d18ddb..fc39869 --- a/dali-toolkit/internal/controls/progress-bar/progress-bar-impl.cpp +++ b/dali-toolkit/internal/controls/progress-bar/progress-bar-impl.cpp @@ -158,6 +158,10 @@ ProgressBar::ProgressBar() mSecondaryProgressValue( DEFAULT_VALUE ), mIndeterminate( false ) { + DevelControl::SetAccessibilityConstructor( Self(), []( Dali::Actor actor ) { + return std::unique_ptr< Dali::Accessibility::Accessible >( + new AccessibleImpl( actor, Dali::Accessibility::Role::PROGRESS_BAR ) ); + } ); } ProgressBar::~ProgressBar() @@ -404,7 +408,7 @@ void ProgressBar::CreateVisualsForComponent( Property::Index index, const Proper else // Does this code make text-visual can be accepted as visual? { // if its not a string then get a Property::Map from the property if possible. - Property::Map *map = value.GetMap(); + const Property::Map *map = value.GetMap(); if( map && !map->Empty() ) // Empty map results in current visual removal. { progressVisual = visualFactory.CreateVisual( *map ); @@ -670,6 +674,29 @@ void ProgressBar::OnSceneConnection( int depth ) } } +double ProgressBar::AccessibleImpl::GetMinimum() { return DEFAULT_LOWER_BOUND; } + +double ProgressBar::AccessibleImpl::GetCurrent() +{ + auto p = Toolkit::ProgressBar::DownCast( self ); + return p.GetProperty( Toolkit::ProgressBar::Property::PROGRESS_VALUE ) + .Get< float >(); +} + +double ProgressBar::AccessibleImpl::GetMaximum() { return DEFAULT_UPPER_BOUND; } + +bool ProgressBar::AccessibleImpl::SetCurrent( double current ) +{ + if( current < GetMinimum() || current > GetMaximum() ) + return false; + auto p = Toolkit::ProgressBar::DownCast( self ); + p.SetProperty( Toolkit::ProgressBar::Property::PROGRESS_VALUE, + static_cast< float >( current ) ); + return true; +} + +double ProgressBar::AccessibleImpl::GetMinimumIncrement() { return 0.001; } + } // namespace Internal } // namespace Toolkit