/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
#include <dali-toolkit/internal/controls/page-turn-view/page-turn-book-spine-effect.h>
#include <dali-toolkit/internal/visuals/visual-factory-cache.h>
#include <dali-toolkit/internal/visuals/visual-string-constants.h>
+#include <dali-toolkit/internal/controls/control/control-data-impl.h>
using namespace Dali;
mPagePanStartedSignal(),
mPagePanFinishedSignal()
{
+ DevelControl::SetAccessibilityConstructor( Self(), []( Dali::Actor actor ) {
+ return std::unique_ptr< Dali::Accessibility::Accessible >(
+ new Control::Impl::AccessibleImpl( actor, Dali::Accessibility::Role::PAGE_TAB_LIST ) );
+ } );
}
PageTurnView::~PageTurnView()
mPages[0].actor.SetProperty( Actor::Property::VISIBLE,true);
// enable the pan gesture which is attached to the control
- EnableGestureDetection(Gesture::Type(Gesture::Pan));
+ EnableGestureDetection(GestureType::Value(GestureType::PAN));
}
Shader PageTurnView::CreateShader( const Property::Map& shaderMap )
void PageTurnView::OnPan( const PanGesture& gesture )
{
// the pan gesture is attached to control itself instead of each page
- switch( gesture.state )
+ switch( gesture.GetState() )
{
- case Gesture::Started:
+ case GestureState::STARTED:
{
// check whether the undergoing turning page number already reaches the maximum allowed
if( mPageUpdated && mAnimatingCount< MAXIMUM_TURNING_NUM && mSlidingCount < 1 )
{
- SetPanActor( gesture.position ); // determine which page actor is panned
+ const Vector2& position = gesture.GetPosition();
+ SetPanActor( position ); // determine which page actor is panned
if( mTurningPageIndex != -1 && mPages[mTurningPageIndex % NUMBER_OF_CACHED_PAGES].actor.GetParent() != Self()) // if the page is added to turning layer,it is undergoing an animation currently
{
mTurningPageIndex = -1;
}
- PanStarted( SetPanPosition( gesture.position ) ); // pass in the pan position in the local page coordinate
+ PanStarted( SetPanPosition( position ) ); // pass in the pan position in the local page coordinate
}
else
{
}
break;
}
- case Gesture::Continuing:
+ case GestureState::CONTINUING:
{
- PanContinuing( SetPanPosition( gesture.position ) ); // pass in the pan position in the local page coordinate
+ PanContinuing( SetPanPosition( gesture.GetPosition() ) ); // pass in the pan position in the local page coordinate
break;
}
- case Gesture::Finished:
- case Gesture::Cancelled:
+ case GestureState::FINISHED:
+ case GestureState::CANCELLED:
{
- PanFinished( SetPanPosition( gesture.position ), gesture.GetSpeed() );
+ PanFinished( SetPanPosition( gesture.GetPosition() ), gesture.GetSpeed() );
break;
}
- case Gesture::Clear:
- case Gesture::Possible:
+ case GestureState::CLEAR:
+ case GestureState::POSSIBLE:
default:
{
break;