+bool PageTurnView::DoConnectSignal(BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor)
+{
+ Dali::BaseHandle handle(object);
+
+ bool connected(true);
+ Toolkit::PageTurnView pageTurnView = Toolkit::PageTurnView::DownCast(handle);
+
+ if(0 == strcmp(signalName.c_str(), SIGNAL_PAGE_TURN_STARTED))
+ {
+ pageTurnView.PageTurnStartedSignal().Connect(tracker, functor);
+ }
+ else if(0 == strcmp(signalName.c_str(), SIGNAL_PAGE_TURN_FINISHED))
+ {
+ pageTurnView.PageTurnFinishedSignal().Connect(tracker, functor);
+ }
+ else if(0 == strcmp(signalName.c_str(), SIGNAL_PAGE_PAN_STARTED))
+ {
+ pageTurnView.PagePanStartedSignal().Connect(tracker, functor);
+ }
+ else if(0 == strcmp(signalName.c_str(), SIGNAL_PAGE_PAN_FINISHED))
+ {
+ pageTurnView.PagePanFinishedSignal().Connect(tracker, functor);
+ }
+ else
+ {
+ // signalName does not match any signal
+ connected = false;
+ }
+
+ return connected;
+}
+
+void PageTurnView::SetProperty(BaseObject* object, Property::Index index, const Property::Value& value)
+{
+ Toolkit::PageTurnView pageTurnView = Toolkit::PageTurnView::DownCast(Dali::BaseHandle(object));
+
+ if(pageTurnView)
+ {
+ PageTurnView& pageTurnViewImpl(GetImplementation(pageTurnView));
+
+ switch(index)
+ {
+ case Toolkit::PageTurnView::Property::VIEW_PAGE_SIZE:
+ {
+ pageTurnViewImpl.SetPageSize(value.Get<Vector2>());
+ break;
+ }
+ case Toolkit::PageTurnView::Property::CURRENT_PAGE_ID:
+ {
+ pageTurnViewImpl.GoToPage(value.Get<int>());
+ break;
+ }
+ case Toolkit::PageTurnView::Property::SPINE_SHADOW:
+ {
+ pageTurnViewImpl.SetSpineShadowParameter(value.Get<Vector2>());
+ break;
+ }
+ }
+ }
+}
+
+Property::Value PageTurnView::GetProperty(BaseObject* object, Property::Index index)
+{
+ Property::Value value;
+
+ Toolkit::PageTurnView pageTurnView = Toolkit::PageTurnView::DownCast(Dali::BaseHandle(object));
+
+ if(pageTurnView)
+ {
+ PageTurnView& pageTurnViewImpl(GetImplementation(pageTurnView));
+
+ switch(index)
+ {
+ case Toolkit::PageTurnView::Property::VIEW_PAGE_SIZE:
+ {
+ value = pageTurnViewImpl.GetPageSize();
+ break;
+ }
+ case Toolkit::PageTurnView::Property::CURRENT_PAGE_ID:
+ {
+ value = static_cast<int>(pageTurnViewImpl.GetCurrentPage());
+ break;
+ }
+ case Toolkit::PageTurnView::Property::SPINE_SHADOW:
+ {
+ value = pageTurnViewImpl.GetSpineShadowParameter();
+ break;
+ }
+ }
+ }
+ return value;
+}
+