24#include <config_features.h>
26#include <com/sun/star/frame/theAutoRecovery.hpp>
27#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
28#include <com/sun/star/document/XEventsSupplier.hpp>
29#include <com/sun/star/drawing/XMasterPageTarget.hpp>
30#include <com/sun/star/beans/PropertyValue.hpp>
31#include <com/sun/star/beans/XPropertySetInfo.hpp>
32#include <com/sun/star/beans/XPropertySet.hpp>
33#include <com/sun/star/awt/SystemPointer.hpp>
34#include <com/sun/star/util/URLTransformer.hpp>
35#include <com/sun/star/util/XURLTransformer.hpp>
36#include <com/sun/star/frame/XDispatch.hpp>
37#include <com/sun/star/frame/XLayoutManager.hpp>
38#include <com/sun/star/presentation/SlideShow.hpp>
39#include <com/sun/star/media/XPlayer.hpp>
40#include <officecfg/Office/Recovery.hxx>
61#include <svx/svxids.hrc>
68#include <bitmaps.hlst>
100using ::com::sun::star::animations::XAnimationNode;
101using ::com::sun::star::animations::XAnimationListener;
102using ::com::sun::star::awt::XWindow;
144 void setPreviewNode(
const Reference< XAnimationNode >& xPreviewNode );
153 const Reference< XDrawPagesSupplier>& xDrawPages,
154 const bool bSkipAllMainSequenceEffects );
168 bool getSlideAPI( sal_Int32 nSlideNumber, Reference< XDrawPage >& xSlide, Reference< XAnimationNode >& xAnimNode );
189 Reference< XDrawPage > xSlide;
190 if(
mxSlides.is() && (nSlideNumber >= 0) && (nSlideNumber < mxSlides->getCount()) )
191 mxSlides->getByIndex( nSlideNumber ) >>= xSlide;
212, mnStartSlideNumber(-1)
214, mnCurrentSlideIndex(0)
215, mnHiddenSlideNumber( -1 )
279 else if( (nNewSlideNumber >= 0) && (nNewSlideNumber <
mnSlideCount) )
314 xSlide.set(
mxSlides->getByIndex(nSlideNumber), UNO_QUERY_THROW );
322 Reference< animations::XAnimationNodeSupplier > xAnimNodeSupplier( xSlide, UNO_QUERY_THROW );
323 xAnimNode = xAnimNodeSupplier->getAnimationNode();
374 return isValidIndex( nNewSlideIndex ) ? nNewSlideIndex : -1;
434 return nNewSlideIndex;
443 const Reference< XDrawPagesSupplier>& xDrawPages,
444 const bool bSkipAllMainSequenceEffects )
448 if( !(xShow.is() && (nCurrentSlideNumber != -1 )) )
451 Reference< XDrawPage > xSlide;
452 Reference< XAnimationNode > xAnimNode;
456 if(
getSlideAPI( nNextSlideNumber, xSlide, xAnimNode ) )
458 Sequence< Any > aValue{
Any(xSlide),
Any(xAnimNode) };
462 PropertyState_DIRECT_VALUE);
464 if (bSkipAllMainSequenceEffects)
470 aProperties.emplace_back(
"SkipAllMainSequenceEffects",
473 PropertyState_DIRECT_VALUE);
477 PropertyState_DIRECT_VALUE);
480 if(
getSlideAPI( nCurrentSlideNumber, xSlide, xAnimNode ) )
486constexpr OUStringLiteral
gsVerb( u
"Verb" );
489:
mxModel(pDoc->getUnoModel(),UNO_QUERY_THROW)
490, maUpdateTimer(
"SlideShowImpl maUpdateTimer")
491, maInputFreezeTimer(
"SlideShowImpl maInputFreezeTimer")
492, maDeactivateTimer(
"SlideShowImpl maDeactivateTimer")
494, mpViewShell(pViewSh)
495, mpDocSh(pDoc->GetDocSh())
497, mpParentWindow(pParentWindow)
498, mpShowWindow(nullptr)
500, maPresSize( -1, -1 )
502, mpOldActiveWindow(nullptr)
505, mbAutoSaveWasOn(false)
506, mbRehearseTimings(false)
509, mbInputFreeze(false)
511, maPresSettings( pDoc->getPresentationSettings() )
512, mnUserPaintColor( 0x80ff0000L )
515, mnEndShowEvent(nullptr)
516, mnContextMenuEvent(nullptr)
517, mxPresentation( xPresentation )
520 mpOldActiveWindow = mpViewShell->GetActiveWindow();
524 maUpdateTimer.SetPriority(TaskPriority::REPAINT);
527 maDeactivateTimer.SetTimeout( 20 );
529 maInputFreezeTimer.SetInvokeHandler(
LINK(
this,
SlideshowImpl, ReadyForNextInputHdl ) );
530 maInputFreezeTimer.SetTimeout( 20 );
533 if (officecfg::Office::Recovery::AutoSave::Enabled::get())
534 mbAutoSaveWasOn =
true;
538 mbUsePen = maPresSettings.mbMouseAsPen;
548SlideshowImpl::~SlideshowImpl()
562 maDeactivateTimer.Stop();
566 OSL_FAIL(
"SlideshowImpl::~SlideshowImpl(), component was not disposed!");
572void SlideshowImpl::disposing(std::unique_lock<std::mutex>&)
574#ifdef ENABLE_SDREMOTE
575 RemoteServer::presentationStopped();
577 if( mxShow.is() && mpDoc )
580 "OnEndPresentation" );
582 if( mbAutoSaveWasOn )
583 setAutoSaveState(
true );
587 if( mnContextMenuEvent )
590 maInputFreezeTimer.Stop();
597 if( mxPresentation.is() )
598 mxPresentation->end();
600 maUpdateTimer.Stop();
604 if( mxListenerProxy.is() )
605 mxListenerProxy->removeAsSlideShowListener();
610 mxShow->removeView(
mxView );
612 Reference< XComponent > xComponent( mxShow, UNO_QUERY );
613 if( xComponent.is() )
614 xComponent->dispose();
626 mxListenerProxy.clear();
627 mpSlideController.reset();
630 if( mpShowWindow &&
mpView )
631 mpView->DeleteDeviceFromPaintView( *mpShowWindow->GetOutDev() );
634 mpView->SetAnimationPause(
false );
638 mpViewShell->SetActiveWindow(mpOldActiveWindow);
640 mpShowWindow->SetViewShell(
nullptr );
644 mpView->InvalidateAllWin();
646 if( maPresSettings.mbFullScreen )
648#if HAVE_FEATURE_SCRIPTING
657 mpShowWindow->Hide();
662 mpDocSh->SetSlotFilter();
663 mpDocSh->ApplySlotFilter();
677 mpViewShell->GetViewShellBase().ShowUIControls (
true);
682 mpViewShell->ShowUIControls(
true);
687 mpShowWindow->Hide();
688 mpShowWindow.disposeAndClear();
700 mpViewShell->VisAreaChanged(aVisAreaWin);
708 if( mpViewShell->IsStartShowWithDialog() &&
getDispatcher() )
710 mpViewShell->SetStartShowWithDialog(
false );
714 mpViewShell->GetViewShellBase().UpdateBorder(
true);
719 mpShowWindow.disposeAndClear();
722 setActiveXToolbarsVisible(
true );
727bool SlideshowImpl::startPreview(
728 const Reference< XDrawPage >& xDrawPage,
729 const Reference< XAnimationNode >& xAnimationNode,
736 const Reference<lang::XServiceInfo> xServiceInfo( xDrawPage, UNO_QUERY );
737 if (xServiceInfo.is()) {
738 const Sequence<OUString> supportedServices(
739 xServiceInfo->getSupportedServiceNames() );
741 OSL_FAIL(
"sd::SlideshowImpl::startPreview() "
742 "not allowed on master page!");
747 mxPreviewDrawPage = xDrawPage;
748 mxPreviewAnimationNode = xAnimationNode;
751 maPresSettings.mbAll =
false;
752 maPresSettings.mbEndless =
false;
753 maPresSettings.mbCustomShow =
false;
754 maPresSettings.mbManual =
false;
755 maPresSettings.mbMouseVisible =
false;
756 maPresSettings.mbMouseAsPen =
false;
757 maPresSettings.mbLockedPages =
false;
758 maPresSettings.mbAlwaysOnTop =
false;
759 maPresSettings.mbUseNavigation =
false;
760 maPresSettings.mbFullScreen =
false;
761 maPresSettings.mbAnimationAllowed =
true;
762 maPresSettings.mnPauseTimeout = 0;
763 maPresSettings.mbShowPauseLogo =
false;
765 Reference< XDrawPagesSupplier > xDrawPages( mpDoc->getUnoModel(), UNO_QUERY_THROW );
766 Reference< XIndexAccess > xSlides( xDrawPages->getDrawPages(), UNO_QUERY_THROW );
767 mpSlideController = std::make_shared<AnimationSlideController>( xSlides, AnimationSlideController::PREVIEW );
769 sal_Int32 nSlideNumber = 0;
770 Reference< XPropertySet > xSet( mxPreviewDrawPage, UNO_QUERY_THROW );
771 xSet->getPropertyValue(
"Number" ) >>= nSlideNumber;
772 mpSlideController->insertSlideNumber( nSlideNumber-1 );
773 mpSlideController->setPreviewNode( xAnimationNode );
778 mpViewShell->SetActiveWindow( mpShowWindow );
779 mpShowWindow->SetViewShell (mpViewShell);
780 mpViewShell->ShowUIControls (
false);
785 mpView->AddDeviceToPaintView( *mpShowWindow->GetOutDev(),
nullptr );
786 mpView->SetAnimationPause(
true );
794 else if( mpViewShell )
796 ::tools::Rectangle aContentRect (mpViewShell->GetViewShellBase().getClientRectangle());
802 maPresSize = aContentRect.
GetSize();
803 mpShowWindow->SetPosPixel( aContentRect.
TopLeft() );
807 OSL_FAIL(
"sd::SlideshowImpl::startPreview(), I need either a parent window or a viewshell!");
809 resize( maPresSize );
811 sal_Int32 nPropertyCount = 1;
812 if( mxPreviewAnimationNode.is() )
815 Sequence< beans::PropertyValue >
aProperties(nPropertyCount);
817 pProperties[0].Name =
"AutomaticAdvancement";
818 pProperties[0].Value <<= 1.0;
820 if( mxPreviewAnimationNode.is() )
822 pProperties[1].Name =
"NoSlideTransitions";
823 pProperties[1].Value <<=
true;
829 mpShowWindow->SetPreviewMode();
845 DBG_ASSERT( !mxShow.is(),
"sd::SlideshowImpl::startShow(), called twice!" );
848 DBG_ASSERT( mpParentWindow!=
nullptr,
"sd::SlideshowImpl::startShow() called without parent window" );
849 if (mpParentWindow ==
nullptr)
853 if (mpViewShell->GetDoc()->IsStartWithPresentation()){
854 mpViewShell->GetDoc()->SetExitAfterPresenting(
true);
863 maPresSettings = *pPresSettings;
867 OUString aPresSlide( maPresSettings.maPresPage );
868 SdPage* pStartPage = mpViewShell->GetActualPage();
869 bool bStartWithActualSlide = pStartPage;
872 if( mbRehearseTimings )
874 maPresSettings.mbEndless =
false;
875 maPresSettings.mbManual =
true;
876 maPresSettings.mbMouseVisible =
true;
877 maPresSettings.mbMouseAsPen =
false;
878 maPresSettings.mnPauseTimeout = 0;
879 maPresSettings.mbShowPauseLogo =
false;
880 maPresSettings.mbUseNavigation =
false;
889 const sal_uInt16 nPgNum = ( pStartPage->
GetPageNum() - 2 ) >> 1;
894 if( bStartWithActualSlide )
896 if ( aPresSlide.isEmpty())
899 aPresSlide = pStartPage->
GetName();
901 maPresSettings.mbAll = !pStartPage->
IsExcluded();
908 maPresSettings.mbAll =
false;
914 createSlideList( maPresSettings.mbAll, aPresSlide );
918 mnRestoreSlide = ( pStartPage->
GetPageNum() - 1 ) / 2;
920 if( mpSlideController->hasSlides() )
926 mpShowWindow->SetMouseAutoHide( !maPresSettings.mbMouseVisible );
927 mpViewShell->SetActiveWindow( mpShowWindow );
928 mpShowWindow->SetViewShell (mpViewShell);
929 mpViewShell->GetViewShellBase().ShowUIControls (
false);
931 if ( ! maPresSettings.mbFullScreen)
932 mpPaneHider.reset(
new PaneHider(*mpViewShell,
this));
937 mpDocSh->SetSlotFilter(
true,
pAllowed );
938 mpDocSh->ApplySlotFilter();
944 if( maPresSettings.mbFullScreen )
946#if HAVE_FEATURE_SCRIPTING
954 maPresSize = mpParentWindow->GetSizePixel();
955 if (!maPresSettings.mbFullScreen)
957 const ::tools::Rectangle& aClientRect = mpViewShell->GetViewShellBase().getClientRectangle();
958 maPresSize = aClientRect.GetSize();
959 mpShowWindow->SetPosPixel( aClientRect.TopLeft() );
960 resize( maPresSize );
972 mpView->AddDeviceToPaintView( *mpShowWindow->GetOutDev(),
nullptr );
973 mpView->SetAnimationPause(
true );
980 pBindings->
Invalidate( SID_REHEARSE_TIMINGS );
990 -1,
Any( !maPresSettings.mbLockedPages ),
991 beans::PropertyState_DIRECT_VALUE );
993 aProperties.emplace_back(
"ImageAnimationsAllowed" ,
994 -1,
Any( maPresSettings.mbAnimationAllowed ),
995 beans::PropertyState_DIRECT_VALUE );
997 const bool bZOrderEnabled(
998 SD_MOD()->GetSdOptions( mpDoc->GetDocumentType() )->IsSlideshowRespectZOrder() );
999 aProperties.emplace_back(
"DisableAnimationZOrder" ,
1000 -1,
Any( !bZOrderEnabled ),
1001 beans::PropertyState_DIRECT_VALUE );
1004 -1,
Any( maPresSettings.mbManual ),
1005 beans::PropertyState_DIRECT_VALUE );
1011 -1,
Any( mnUserPaintColor ),
1012 beans::PropertyState_DIRECT_VALUE );
1014 aProperties.emplace_back(
"UserPaintStrokeWidth" ,
1017 beans::PropertyState_DIRECT_VALUE );
1020 if (mbRehearseTimings) {
1022 -1,
Any(
true), beans::PropertyState_DIRECT_VALUE );
1025 bRet = startShowImpl( Sequence<beans::PropertyValue>(
1030 setActiveXToolbarsVisible(
false );
1041bool SlideshowImpl::startShowImpl(
const Sequence< beans::PropertyValue >& aProperties )
1045 mxShow.set( createSlideShow(), UNO_SET_THROW );
1052 maPresSettings.mbFullScreen);
1055 const Reference<rendering::XSpriteCanvas> xSpriteCanvas(
1057 if (xSpriteCanvas.is())
1059 BitmapEx waitSymbolBitmap(BMP_WAIT_ICON);
1060 const Reference<rendering::XBitmap> xBitmap(
1064 mxShow->setProperty(
1065 beans::PropertyValue(
"WaitSymbolBitmap" ,
1068 beans::PropertyState_DIRECT_VALUE ) );
1071 BitmapEx pointerSymbolBitmap(BMP_POINTER_ICON);
1072 const Reference<rendering::XBitmap> xPointerBitmap(
1074 if (xPointerBitmap.is())
1076 mxShow->setProperty(
1077 beans::PropertyValue(
"PointerSymbolBitmap" ,
1079 Any( xPointerBitmap ),
1080 beans::PropertyState_DIRECT_VALUE ) );
1083 if (maPresSettings.mbUseNavigation)
1085 BitmapEx prevSlideBm(BMP_PREV_SLIDE);
1086 const Reference<rendering::XBitmap> xPrevSBitmap(
1088 if (xPrevSBitmap.is())
1090 mxShow->setProperty(beans::PropertyValue(
"NavigationSlidePrev", -1,
1092 beans::PropertyState_DIRECT_VALUE));
1094 BitmapEx menuSlideBm(BMP_MENU_SLIDE);
1095 const Reference<rendering::XBitmap> xMenuSBitmap(
1097 if (xMenuSBitmap.is())
1099 mxShow->setProperty(beans::PropertyValue(
"NavigationSlideMenu", -1,
1101 beans::PropertyState_DIRECT_VALUE));
1103 BitmapEx nextSlideBm(BMP_NEXT_SLIDE);
1104 const Reference<rendering::XBitmap> xNextSBitmap(
1106 if (xNextSBitmap.is())
1108 mxShow->setProperty(beans::PropertyValue(
"NavigationSlideNext", -1,
1110 beans::PropertyState_DIRECT_VALUE));
1116 mxShow->setProperty( rProp );
1118 mxShow->addView(
mxView );
1121 mxListenerProxy->addAsSlideShowListener();
1125 "OnStartPresentation");
1126 displaySlideIndex( mpSlideController->getStartSlideIndex() );
1139void SlideshowImpl::onFirstPaint()
1151 maUpdateTimer.SetTimeout(
sal_uLong(100) );
1152 maUpdateTimer.Start();
1155void SlideshowImpl::paint()
1159 awt::PaintEvent aEvt;
1169void SAL_CALL SlideshowImpl::addSlideShowListener(
const Reference< XSlideShowListener >& xListener )
1171 if( mxListenerProxy.is() )
1172 mxListenerProxy->addSlideShowListener( xListener );
1175void SAL_CALL SlideshowImpl::removeSlideShowListener(
const Reference< XSlideShowListener >& xListener )
1177 if( mxListenerProxy.is() )
1178 mxListenerProxy->removeSlideShowListener( xListener );
1181void SlideshowImpl::slideEnded(
const bool bReverse)
1184 gotoPreviousSlide(
true);
1191 if (mbUsePen || mnContextMenuEvent)
1195 if (fabs(nVelocityX) < 50)
1199 gotoPreviousSlide();
1207 mxView->ignoreNextMouseReleased();
1213 if (mnContextMenuEvent)
1216 maPopupMousePos =
Point(rLongPressData.
getX(), rLongPressData.
getY());
1222void SlideshowImpl::removeShapeEvents()
1224 if( !(mxShow.is() && mxListenerProxy.is()) )
1231 mxListenerProxy->removeShapeEventListener( rEntry.first );
1232 mxShow->setShapeCursor( rEntry.first, awt::SystemPointer::ARROW );
1243void SlideshowImpl::registerShapeEvents(sal_Int32 nSlideNumber)
1245 if( nSlideNumber < 0 )
1250 Reference< XDrawPagesSupplier > xDrawPages(
mxModel, UNO_QUERY_THROW );
1251 Reference< XIndexAccess > xPages( xDrawPages->getDrawPages(), UNO_QUERY_THROW );
1253 Reference< XShapes > xDrawPage;
1254 xPages->getByIndex(nSlideNumber) >>= xDrawPage;
1256 if( xDrawPage.is() )
1258 Reference< XMasterPageTarget > xMasterPageTarget( xDrawPage, UNO_QUERY );
1259 if( xMasterPageTarget.is() )
1261 Reference< XShapes > xMasterPage = xMasterPageTarget->getMasterPage();
1262 if( xMasterPage.is() )
1263 registerShapeEvents( xMasterPage );
1265 registerShapeEvents( xDrawPage );
1274void SlideshowImpl::registerShapeEvents( Reference< XShapes >
const & xShapes )
1278 const sal_Int32 nShapeCount = xShapes->getCount();
1280 for( nShape = 0; nShape < nShapeCount; nShape++ )
1282 Reference< XShape > xShape;
1283 xShapes->getByIndex( nShape ) >>= xShape;
1285 if( xShape.is() && xShape->getShapeType() ==
"com.sun.star.drawing.GroupShape" )
1287 Reference< XShapes > xSubShapes( xShape, UNO_QUERY );
1288 if( xSubShapes.is() )
1289 registerShapeEvents( xSubShapes );
1292 Reference< XPropertySet > xSet( xShape, UNO_QUERY );
1296 Reference< XPropertySetInfo > xSetInfo( xSet->getPropertySetInfo() );
1297 if( !xSetInfo.is() || !xSetInfo->hasPropertyByName( gsOnClick ) )
1301 xSet->getPropertyValue( gsOnClick ) >>= pEvent->meClickAction;
1303 switch( pEvent->meClickAction )
1305 case ClickAction_PREVPAGE:
1306 case ClickAction_NEXTPAGE:
1307 case ClickAction_FIRSTPAGE:
1308 case ClickAction_LASTPAGE:
1309 case ClickAction_STOPPRESENTATION:
1311 case ClickAction_BOOKMARK:
1312 if( xSetInfo->hasPropertyByName(
gsBookmark ) )
1313 xSet->getPropertyValue(
gsBookmark ) >>= pEvent->maStrBookmark;
1314 if( getSlideNumberForBookmark( pEvent->maStrBookmark ) == -1 )
1317 case ClickAction_DOCUMENT:
1318 case ClickAction_SOUND:
1319 case ClickAction_PROGRAM:
1320 case ClickAction_MACRO:
1321 if( xSetInfo->hasPropertyByName(
gsBookmark ) )
1322 xSet->getPropertyValue(
gsBookmark ) >>= pEvent->maStrBookmark;
1324 case ClickAction_VERB:
1325 if( xSetInfo->hasPropertyByName( gsVerb ) )
1326 xSet->getPropertyValue( gsVerb ) >>= pEvent->mnVerb;
1334 if( mxListenerProxy.is() )
1335 mxListenerProxy->addShapeEventListener( xShape );
1336 mxShow->setShapeCursor( xShape, awt::SystemPointer::REFHAND );
1345void SlideshowImpl::displayCurrentSlide (
const bool bSkipAllMainSequenceEffects)
1348 removeShapeEvents();
1350 if( mpSlideController && mxShow.is() )
1352 Reference< XDrawPagesSupplier > xDrawPages( mpDoc->getUnoModel(),
1354 mpSlideController->displayCurrentSlide( mxShow, xDrawPages, bSkipAllMainSequenceEffects );
1355 registerShapeEvents(mpSlideController->getCurrentSlideNumber());
1362 sal_Int32 currentPageIndex = getCurrentSlideIndex();
1363 mpViewShell->fireSwitchCurrentPage(currentPageIndex);
1364 mpViewShell->NotifyAccUpdate();
1368void SlideshowImpl::endPresentation()
1370 if( maPresSettings.mbMouseAsPen)
1372 Reference< XMultiServiceFactory > xDocFactory(mpDoc->getUnoModel(), UNO_QUERY );
1373 if( xDocFactory.is() )
1374 mxShow->registerUserPaintPolygons(xDocFactory);
1377 if( !mnEndShowEvent )
1383 mnEndShowEvent =
nullptr;
1387 if( mxPresentation.is() )
1388 mxPresentation->end();
1391void SAL_CALL SlideshowImpl::pause()
1403 mxShow->pause(
true);
1405 if( mxListenerProxy.is() )
1406 mxListenerProxy->paused();
1415void SAL_CALL SlideshowImpl::resume()
1419 if( mbIsPaused )
try
1423 mpShowWindow->RestartShow();
1430 mxShow->pause(
false);
1433 if( mxListenerProxy.is() )
1434 mxListenerProxy->resumed();
1442#ifdef ENABLE_SDREMOTE
1443 RemoteServer::presentationStarted(
this );
1453void SAL_CALL SlideshowImpl::blankScreen( sal_Int32 nColor )
1457 if( mpShowWindow && mpSlideController )
1459 if( mpShowWindow->SetBlankMode( mpSlideController->getCurrentSlideIndex(),
Color(
ColorTransparency, nColor) ) )
1468void SlideshowImpl::click(
const Reference< XShape >& xShape )
1476 switch( pEvent->meClickAction )
1478 case ClickAction_PREVPAGE: gotoPreviousSlide();
break;
1479 case ClickAction_NEXTPAGE: gotoNextSlide();
break;
1480 case ClickAction_FIRSTPAGE: gotoFirstSlide();
break;
1481 case ClickAction_LASTPAGE: gotoLastSlide();
break;
1482 case ClickAction_STOPPRESENTATION: endPresentation();
break;
1483 case ClickAction_BOOKMARK:
1485 gotoBookmark( pEvent->maStrBookmark );
1488 case ClickAction_SOUND:
1490#if HAVE_FEATURE_AVMEDIA
1496 catch( uno::Exception& )
1504 case ClickAction_DOCUMENT:
1506 OUString aBookmark( pEvent->maStrBookmark );
1508 sal_Int32
nPos = aBookmark.indexOf(
'#' );
1511 OUString
aURL( aBookmark.copy( 0,
nPos+1 ) );
1512 OUString
aName( aBookmark.copy(
nPos+1 ) );
1517 mpDocSh->OpenBookmark( aBookmark );
1521 case ClickAction_PROGRAM:
1524 ::URIHelper::SmartRel2Abs(
1526 pEvent->maStrBookmark, ::URIHelper::GetMaybeFileHdl(),
true,
1530 if( INetProtocol::File ==
aURL.GetProtocol() )
1537 SfxUnoFrameItem aDocFrame(SID_FILLFRAME, pViewFrm->GetFrame().GetFrameInterface());
1538 pViewFrm->GetDispatcher()->ExecuteList( SID_OPENDOC,
1539 SfxCallMode::ASYNCHRON | SfxCallMode::RECORD,
1540 { &aUrl, &aBrowsing }, { &aDocFrame } );
1546#if HAVE_FEATURE_SCRIPTING
1547 case presentation::ClickAction_MACRO:
1549 const OUString aMacro( pEvent->maStrBookmark );
1554 Sequence< sal_Int16 > aOutArgsIndex;
1555 Sequence< Any > aOutArgs;
1556 Sequence< Any >* pInArgs =
new Sequence< Any >(0);
1557 mpDocSh->CallXScript( aMacro, *pInArgs, aRet, aOutArgsIndex, aOutArgs);
1564 sal_Int32 nIdx{ 0 };
1565 const std::u16string_view aMacroName =
o3tl::getToken(aMacro, 0,
'.', nIdx);
1566 const std::u16string_view aModulName =
o3tl::getToken(aMacro, 0,
'.', nIdx);
1570 OUString aExecMacro = OUString::Concat(aModulName) +
"." + aMacroName;
1571 mpDocSh->GetBasic()->Call(aExecMacro);
1577 case ClickAction_VERB:
1582 if (pOleObject && mpViewShell )
1583 mpViewShell->ActivateObject(pOleObject, pEvent->mnVerb);
1591sal_Int32 SlideshowImpl::getSlideNumberForBookmark(
const OUString& rStrBookmark )
1595 sal_uInt16 nPgNum = mpDoc->GetPageByName( aBookmark, bIsMasterPage );
1600 SdrObject* pObj = mpDoc->GetObj( aBookmark );
1612 return ( nPgNum - 1) >> 1;
1615void SlideshowImpl::contextMenuShow(
const css::awt::Point& point)
1621void SlideshowImpl::hyperLinkClicked( OUString
const& aHyperLink )
1623 OUString aBookmark( aHyperLink );
1625 sal_Int32
nPos = aBookmark.indexOf(
'#' );
1628 OUString
aURL( aBookmark.copy( 0,
nPos+1 ) );
1629 OUString
aName( aBookmark.copy(
nPos+1 ) );
1634 mpDocSh->OpenBookmark( aBookmark );
1637void SlideshowImpl::displaySlideNumber( sal_Int32 nSlideNumber )
1639 if( mpSlideController )
1641 if( mpSlideController->jumpToSlideNumber( nSlideNumber ) )
1643 displayCurrentSlide();
1649void SlideshowImpl::displaySlideIndex( sal_Int32 nSlideIndex )
1651 if( mpSlideController )
1653 if( (nSlideIndex == -1) || mpSlideController->jumpToSlideIndex( nSlideIndex ) )
1655 displayCurrentSlide();
1660void SlideshowImpl::jumpToBookmark(
const OUString& sBookmark )
1662 sal_Int32 nSlideNumber = getSlideNumberForBookmark( sBookmark );
1663 if( nSlideNumber != -1 )
1664 displaySlideNumber( nSlideNumber );
1667sal_Int32 SlideshowImpl::getCurrentSlideNumber()
const
1669 return mpSlideController ? mpSlideController->getCurrentSlideNumber() : -1;
1675 return maPresSettings.mbEndless;
1678void SlideshowImpl::update()
1683void SlideshowImpl::startUpdateTimer()
1686 maUpdateTimer.SetTimeout( 0 );
1687 maUpdateTimer.Start();
1696 mbInputFreeze =
false;
1708void SlideshowImpl::updateSlideShow()
1713 Reference< XSlideShow > xShow( mxShow );
1719 double fUpdate = 0.0;
1720 if( !xShow->update(fUpdate) )
1723 if (mxShow.is() && (fUpdate >= 0.0))
1725 if (::basegfx::fTools::equalZero(fUpdate))
1739 const static sal_Int32 nMaximumFrameCount (60);
1740 const static double nMinimumTimeout (1.0 / nMaximumFrameCount);
1741 const static double nMaximumTimeout (4.0);
1742 fUpdate = std::clamp(fUpdate, nMinimumTimeout, nMaximumTimeout);
1747 OSL_ASSERT(
static_cast<sal_uLong>(fUpdate * 1000.0) > 0);
1751 maUpdateTimer.SetTimeout(
static_cast<sal_uLong>(fUpdate * 1000.0));
1752 maUpdateTimer.Start();
1763 if( !mxShow.is() || mbInputFreeze )
1773 case awt::Key::CONTEXTMENU:
1774 if( !mnContextMenuEvent )
1777 maPopupMousePos = mpShowWindow->GetPointerState().maPos;
1789 if( mpSlideController->getCurrentSlideNumber() != -1 )
1790 mnRestoreSlide = mpSlideController->getCurrentSlideNumber();
1811 if( !maCharBuffer.isEmpty() )
1813 if( mpSlideController )
1815 if( mpSlideController->jumpToSlideNumber( maCharBuffer.toInt32() - 1 ) )
1816 displayCurrentSlide();
1818 maCharBuffer.clear();
1838 maCharBuffer += OUStringChar( rKEvt.
GetCharCode() );
1844 gotoPreviousSlide();
1851 gotoPreviousEffect();
1855 setUsePen( !mbUsePen );
1868 setEraseAllInk(
true );
1885 blankScreen( ((nKeyCode ==
KEY_W ) || (nKeyCode ==
KEY_COMMA)) ? 0x00ffffff : 0x00000000 );
1905 if( !mxShow.is() || mbInputFreeze )
1908 if( !((rSimpleEvent.GetId() == VclEventId::WindowCommand) &&
static_cast<VclWindowEvent*
>(&rSimpleEvent)->
GetData()) )
1913 if( rEvent.
GetCommand() != CommandEventId::Media )
1920#if defined( MACOSX )
1921 case MediaCommand::Menu:
1922 if( !mnContextMenuEvent )
1925 maPopupMousePos = mpShowWindow->GetPointerState().maPos;
1929 case MediaCommand::VolumeDown:
1930 gotoPreviousSlide();
1932 case MediaCommand::VolumeUp:
1936 case MediaCommand::NextTrack:
1939 case MediaCommand::Pause:
1943 case MediaCommand::Play:
1948 case MediaCommand::PlayPause:
1954 case MediaCommand::PreviousTrack:
1955 gotoPreviousSlide();
1957 case MediaCommand::NextTrackHold:
1961 case MediaCommand::Rewind:
1964 case MediaCommand::Stop:
1969 if( mpSlideController->getCurrentSlideNumber() != -1 )
1970 mnRestoreSlide = mpSlideController->getCurrentSlideNumber();
1982 if( rMEvt.
IsRight() && !mnContextMenuEvent )
1991 mnContextMenuEvent =
nullptr;
1993 if (mpSlideController ==
nullptr)
1996 mbWasPaused = mbIsPaused;
2001 std::unique_ptr<weld::Menu> xMenu(xBuilder->weld_menu(
"menu"));
2002 OUString sNextImage(BMP_MENU_NEXT), sPrevImage(BMP_MENU_PREV);
2003 xMenu->insert(0,
"next",
SdResId(RID_SVXSTR_MENU_NEXT), &sNextImage,
nullptr,
nullptr,
TRISTATE_INDET);
2004 xMenu->insert(1,
"prev",
SdResId(RID_SVXSTR_MENU_PREV), &sPrevImage,
nullptr,
nullptr,
TRISTATE_INDET);
2007 xMenu->set_active(
"pen", mbUsePen);
2010 xMenu->set_visible(
"next", mpSlideController->getNextSlideIndex() != -1);
2012 xMenu->set_visible(
"edit", mpViewShell->GetDoc()->IsStartWithPresentation());
2014 std::unique_ptr<weld::Menu> xPageMenu(xBuilder->weld_menu(
"gotomenu"));
2015 OUString sFirstImage(BMP_MENU_FIRST), sLastImage(BMP_MENU_LAST);
2016 xPageMenu->insert(0,
"first",
SdResId(RID_SVXSTR_MENU_FIRST), &sFirstImage,
nullptr,
nullptr,
TRISTATE_INDET);
2017 xPageMenu->insert(1,
"last",
SdResId(RID_SVXSTR_MENU_LAST), &sLastImage,
nullptr,
nullptr,
TRISTATE_INDET);
2020 const sal_Int32 nPageNumberCount = mpSlideController->getSlideNumberCount();
2021 if( nPageNumberCount <= 1 )
2023 xMenu->set_visible(
"goto",
false);
2027 sal_Int32 nCurrentSlideNumber = mpSlideController->getCurrentSlideNumber();
2029 nCurrentSlideNumber = -1;
2031 xPageMenu->set_visible(
"first", mpSlideController->getSlideNumber(0) != nCurrentSlideNumber);
2032 xPageMenu->set_visible(
"last", mpSlideController->getSlideNumber(mpSlideController->getSlideIndexCount() - 1) != nCurrentSlideNumber);
2034 sal_Int32 nPageNumber;
2036 for( nPageNumber = 0; nPageNumber < nPageNumberCount; nPageNumber++ )
2038 if( mpSlideController->isVisibleSlideNumber( nPageNumber ) )
2043 OUString
sId(OUString::number(
CM_SLIDES + nPageNumber));
2044 xPageMenu->append_check(
sId, pPage->
GetName());
2045 if (nPageNumber == nCurrentSlideNumber)
2046 xPageMenu->set_active(
sId,
true);
2052 std::unique_ptr<weld::Menu> xBlankMenu(xBuilder->weld_menu(
"screenmenu"));
2056 xBlankMenu->set_active((mpShowWindow->GetBlankColor() ==
COL_WHITE) ?
"white" :
"black",
true);
2059 std::unique_ptr<weld::Menu> xWidthMenu(xBuilder->weld_menu(
"widthmenu"));
2062 sal_Int32 nIterator;
2066 for( nIterator = 1; nIterator < 6; nIterator++)
2090 xWidthMenu->set_active(OUString::number(nWidth),
true);
2095 ContextMenuSelectHdl(xMenu->popup_at_rect(pParent, aRect));
2098 mxView->ignoreNextMouseReleased();
2104void SlideshowImpl::ContextMenuSelectHdl(std::u16string_view rMenuId)
2106 if (rMenuId ==
u"prev")
2108 gotoPreviousSlide();
2109 mbWasPaused =
false;
2111 else if(rMenuId ==
u"next")
2114 mbWasPaused =
false;
2116 else if (rMenuId ==
u"first")
2119 mbWasPaused =
false;
2121 else if (rMenuId ==
u"last")
2124 mbWasPaused =
false;
2126 else if (rMenuId ==
u"black" || rMenuId ==
u"white")
2133 if( mpShowWindow->GetBlankColor() == aBlankColor )
2135 mbWasPaused =
false;
2136 mpShowWindow->RestartShow();
2140 mpShowWindow->RestartShow();
2142 if( mpShowWindow->SetBlankMode( mpSlideController->getCurrentSlideIndex(), aBlankColor ) )
2148 else if (rMenuId ==
u"color")
2155 if (aColorDlg.
Execute(mpShowWindow->GetFrameWeld()))
2158 setPenColor(sal_Int32(aColor));
2160 mbWasPaused =
false;
2162 else if (rMenuId ==
u"4")
2165 mbWasPaused =
false;
2167 else if (rMenuId ==
u"100")
2170 mbWasPaused =
false;
2172 else if (rMenuId ==
u"150")
2175 mbWasPaused =
false;
2177 else if (rMenuId ==
u"200")
2180 mbWasPaused =
false;
2182 else if (rMenuId ==
u"400")
2185 mbWasPaused =
false;
2187 else if (rMenuId ==
u"erase")
2189 setEraseAllInk(
true);
2190 mbWasPaused =
false;
2192 else if (rMenuId ==
u"pen")
2194 setUsePen(!mbUsePen);
2195 mbWasPaused =
false;
2197 else if (rMenuId ==
u"edit")
2201 mpViewShell->GetDoc()->SetExitAfterPresenting(
false);
2204 if( mpSlideController->getCurrentSlideNumber() != -1 )
2206 mnRestoreSlide = mpSlideController->getCurrentSlideNumber();
2211 else if (rMenuId ==
u"end")
2217 if( mpSlideController->getCurrentSlideNumber() != -1 )
2219 mnRestoreSlide = mpSlideController->getCurrentSlideNumber();
2224 else if (!rMenuId.empty())
2230 mpShowWindow->RestartShow( nPageNumber );
2232 else if( nPageNumber != mpSlideController->getCurrentSlideNumber() )
2234 displaySlideNumber( nPageNumber );
2236 mbWasPaused =
false;
2240Reference< XSlideShow > SlideshowImpl::createSlideShow()
2242 Reference< XSlideShow > xShow;
2246 Reference< uno::XComponentContext > xContext =
2247 ::comphelper::getProcessComponentContext();
2249 xShow.set( presentation::SlideShow::create(xContext), UNO_SET_THROW );
2251 catch( uno::Exception& )
2259void SlideshowImpl::createSlideList(
bool bAll, std::u16string_view rPresSlide )
2268 if( mpDoc->GetCustomShowList() && maPresSettings.mbCustomShow )
2269 pCustomShow = mpDoc->GetCustomShowList()->GetCurObject();
2271 pCustomShow =
nullptr;
2275 ( pCustomShow && !pCustomShow->
PagesVector().empty() ) ? AnimationSlideController::CUSTOM :
2276 (bAll ? AnimationSlideController::ALL : AnimationSlideController::FROM);
2278 Reference< XDrawPagesSupplier > xDrawPages( mpDoc->getUnoModel(), UNO_QUERY_THROW );
2279 Reference< XIndexAccess > xSlides( xDrawPages->getDrawPages(), UNO_QUERY_THROW );
2280 mpSlideController = std::make_shared<AnimationSlideController>( xSlides,
eMode );
2282 if(
eMode != AnimationSlideController::CUSTOM )
2284 sal_Int32 nFirstVisibleSlide = 0;
2287 if( !rPresSlide.empty() )
2290 bool bTakeNextAvailable =
false;
2292 for( nSlide = 0, nFirstVisibleSlide = -1;
2293 ( nSlide < nSlideCount ) && ( -1 == nFirstVisibleSlide ); nSlide++ )
2297 if( pTestSlide->
GetName() == rPresSlide )
2300 bTakeNextAvailable =
true;
2302 nFirstVisibleSlide = nSlide;
2304 else if( bTakeNextAvailable && !pTestSlide->
IsExcluded() )
2305 nFirstVisibleSlide = nSlide;
2308 if( -1 == nFirstVisibleSlide )
2309 nFirstVisibleSlide = 0;
2312 for( sal_Int32
i = 0;
i < nSlideCount;
i++ )
2316 mpSlideController->insertSlideNumber(
i,
bVisible );
2319 mpSlideController->setStartSlideNumber( nFirstVisibleSlide );
2326 for( nSlide = 0; nSlide < nSlideCount; nSlide++ )
2327 if( rPresSlide == mpDoc->GetSdPage(
static_cast<sal_uInt16
>(nSlide),
PageKind::Standard )->GetName() )
2330 if( nSlide < nSlideCount )
2331 mpSlideController->insertSlideNumber(
static_cast<sal_uInt16
>(nSlide) );
2334 for(
const auto& rpPage : pCustomShow->
PagesVector() )
2336 const sal_uInt16 nSdSlide = ( rpPage->GetPageNum() - 1 ) / 2;
2339 mpSlideController->insertSlideNumber( nSdSlide );
2348 &AnimationChildWindow::GetChildWindowId,
2349 &Svx3DChildWindow::GetChildWindowId,
2350 &SvxFontWorkChildWindow::GetChildWindowId,
2351 &SvxColorChildWindow::GetChildWindowId,
2352 &SvxSearchDialogWrapper::GetChildWindowId,
2353 &SvxBmpMaskChildWindow::GetChildWindowId,
2354 &SvxIMapDlgChildWindow::GetChildWindowId,
2355 &SvxHlinkDlgWrapper::GetChildWindowId,
2356 &SfxInfoBarContainerChild::GetChildWindowId
2359void SlideshowImpl::hideChildWindows()
2383void SlideshowImpl::showChildWindows()
2401 return mpViewShell ? mpViewShell->GetViewFrame() :
nullptr;
2406 return (mpViewShell && mpViewShell->GetViewFrame()) ? mpViewShell->GetViewFrame()->GetDispatcher() :
nullptr;
2411 return (mpViewShell && mpViewShell->GetViewFrame()) ? &mpViewShell->GetViewFrame()->GetBindings() :
nullptr;
2414void SlideshowImpl::resize(
const Size& rSize )
2420 mpShowWindow->SetSizePixel( maPresSize );
2421 mpShowWindow->Show();
2426 awt::WindowEvent aEvt;
2427 mxView->windowResized(aEvt);
2435void SlideshowImpl::setActiveXToolbarsVisible(
bool bVisible )
2439 if ( !(!maPresSettings.mbFullScreen && mpDocSh && mpDocSh->GetMedium()) )
2442 const SfxBoolItem* pItem = mpDocSh->GetMedium()->GetItemSet().GetItem(SID_VIEWONLY,
false);
2443 if ( !(pItem && pItem->
GetValue()) )
2454 Reference< frame::XLayoutManager > xLayoutManager;
2456 if ( ( xFrameProps->getPropertyValue(
"LayoutManager" )
2457 >>= xLayoutManager )
2458 && xLayoutManager.is() )
2460 xLayoutManager->setVisible(
bVisible );
2463 catch( uno::Exception& )
2467void SAL_CALL SlideshowImpl::activate()
2471 maDeactivateTimer.Stop();
2480 if( mbAutoSaveWasOn )
2481 setAutoSaveState(
false );
2499 mpShowWindow->GrabFocus();
2506void SAL_CALL SlideshowImpl::deactivate()
2512 maDeactivateTimer.Start();
2527 if( mbAutoSaveWasOn )
2528 setAutoSaveState(
true );
2543void SlideshowImpl::setAutoSaveState(
bool bOn)
2547 uno::Reference<uno::XComponentContext> xContext( ::comphelper::getProcessComponentContext() );
2549 uno::Reference< util::XURLTransformer > xParser(util::URLTransformer::create(xContext));
2551 aURL.Complete =
"vnd.sun.star.autorecovery:/setAutoSaveState";
2552 xParser->parseStrict(
aURL);
2556 uno::Reference< frame::XDispatch > xAutoSave = frame::theAutoRecovery::get(xContext);
2557 xAutoSave->dispatch(
aURL, aArgs);
2565Reference< XDrawPage > SAL_CALL SlideshowImpl::getCurrentSlide()
2569 Reference< XDrawPage > xSlide;
2570 if( mxShow.is() && mpSlideController )
2572 sal_Int32 nSlide = getCurrentSlideNumber();
2573 if( (nSlide >= 0) && (nSlide < mpSlideController->getSlideNumberCount() ) )
2574 xSlide = mpSlideController->getSlideByNumber( nSlide );
2580sal_Int32 SAL_CALL SlideshowImpl::getNextSlideIndex()
2586 return mpSlideController->getNextSlideIndex();
2594sal_Int32 SAL_CALL SlideshowImpl::getCurrentSlideIndex()
2596 return mpSlideController ? mpSlideController->getCurrentSlideIndex() : -1;
2601::sal_Int32 SAL_CALL SlideshowImpl::getSlideCount()
2603 return mpSlideController ? mpSlideController->getSlideIndexCount() : 0;
2606Reference< XDrawPage > SAL_CALL SlideshowImpl::getSlideByIndex(::sal_Int32
Index)
2608 if ((mpSlideController ==
nullptr) || (
Index < 0)
2609 || (
Index >= mpSlideController->getSlideIndexCount()))
2610 throw IndexOutOfBoundsException();
2612 return mpSlideController->getSlideByNumber( mpSlideController->getSlideNumber(
Index ) );
2618 return maPresSettings.mbAlwaysOnTop;
2621void SAL_CALL SlideshowImpl::setAlwaysOnTop(
sal_Bool bAlways )
2624 if( maPresSettings.mbAlwaysOnTop !=
bool(bAlways) )
2626 maPresSettings.mbAlwaysOnTop = bAlways;
2634 return maPresSettings.mbFullScreen;
2640 return maPresSettings.mbMouseVisible;
2643void SAL_CALL SlideshowImpl::setMouseVisible(
sal_Bool bVisible )
2646 if( maPresSettings.mbMouseVisible !=
bool(
bVisible) )
2648 maPresSettings.mbMouseVisible =
bVisible;
2650 mpShowWindow->SetMouseAutoHide( !maPresSettings.mbMouseVisible );
2660void SAL_CALL SlideshowImpl::setUsePen(
sal_Bool bMouseAsPen )
2663 mbUsePen = bMouseAsPen;
2672 aValue <<= mnUserPaintColor;
2673 beans::PropertyValue aPenProp;
2674 aPenProp.Name =
"UserPaintColor";
2675 aPenProp.Value = aValue;
2676 mxShow->setProperty( aPenProp );
2681 beans::PropertyValue aPenPropWidth;
2682 aPenPropWidth.Name =
"UserPaintStrokeWidth";
2684 mxShow->setProperty( aPenPropWidth );
2687 beans::PropertyValue aPenPropSwitchPenMode;
2688 aPenPropSwitchPenMode.Name =
"SwitchPenMode";
2689 aPenPropSwitchPenMode.Value <<=
true;
2690 mxShow->setProperty( aPenPropSwitchPenMode );
2699double SAL_CALL SlideshowImpl::getPenWidth()
2705void SAL_CALL SlideshowImpl::setPenWidth(
double dStrokeWidth )
2712sal_Int32 SAL_CALL SlideshowImpl::getPenColor()
2715 return mnUserPaintColor;
2718void SAL_CALL SlideshowImpl::setPenColor( sal_Int32 nColor )
2721 mnUserPaintColor = nColor;
2725void SAL_CALL SlideshowImpl::setEraseAllInk(
sal_Bool bEraseAllInk)
2736 beans::PropertyValue aPenPropEraseAllInk;
2737 aPenPropEraseAllInk.Name =
"EraseAllInk";
2738 aPenPropEraseAllInk.Value <<= bEraseAllInk;
2739 mxShow->setProperty( aPenPropEraseAllInk );
2754void SAL_CALL SlideshowImpl::gotoNextEffect( )
2758 if( !(mxShow.is() && mpSlideController && mpShowWindow) )
2771 mpShowWindow->RestartShow();
2775 mxShow->nextEffect();
2780void SAL_CALL SlideshowImpl::gotoPreviousEffect( )
2784 if( !(mxShow.is() && mpSlideController && mpShowWindow) )
2794 mxShow->previousEffect();
2799void SAL_CALL SlideshowImpl::gotoFirstSlide( )
2803 if( !(mpShowWindow && mpSlideController) )
2811 if( mpSlideController->getSlideIndexCount() )
2812 mpShowWindow->RestartShow( 0);
2816 displaySlideIndex( 0 );
2820void SAL_CALL SlideshowImpl::gotoNextSlide( )
2830 mpShowWindow->RestartShow();
2839 mbInputFreeze =
true;
2840 maInputFreezeTimer.Start();
2843 if( mpSlideController )
2845 if( mpSlideController->nextSlide() )
2847 displayCurrentSlide();
2857 else if( maPresSettings.mbEndless )
2859 if( maPresSettings.mnPauseTimeout )
2863 if ( maPresSettings.mbShowPauseLogo )
2866 mpShowWindow->SetPauseMode( maPresSettings.mnPauseTimeout, &aGraphic );
2869 mpShowWindow->SetPauseMode( maPresSettings.mnPauseTimeout );
2874 displaySlideIndex( 0 );
2881 mpShowWindow->SetEndMode();
2882 if( !mpViewShell->GetDoc()->IsStartWithPresentation() )
2891void SAL_CALL SlideshowImpl::gotoPreviousSlide( )
2893 gotoPreviousSlide(
false);
2896void SlideshowImpl::gotoPreviousSlide (
const bool bSkipAllMainSequenceEffects)
2900 if( !(mxShow.is() && mpSlideController) )
2911 mpShowWindow->RestartShow( mpSlideController->getCurrentSlideIndex() );
2915 mpShowWindow->RestartShow();
2919 if( mpSlideController->previousSlide())
2920 displayCurrentSlide(bSkipAllMainSequenceEffects);
2921 else if (bSkipAllMainSequenceEffects)
2933 displayCurrentSlide();
2943void SAL_CALL SlideshowImpl::gotoLastSlide()
2947 if( !mpSlideController )
2953 const sal_Int32 nLastSlideIndex = mpSlideController->getSlideIndexCount() - 1;
2954 if( nLastSlideIndex >= 0 )
2958 mpShowWindow->RestartShow( nLastSlideIndex );
2962 displaySlideIndex( nLastSlideIndex );
2967void SAL_CALL SlideshowImpl::gotoBookmark(
const OUString& rBookmark )
2974 sal_Int32 nSlideNumber = getSlideNumberForBookmark( rBookmark );
2975 if( nSlideNumber != -1 )
2976 displaySlideNumber( nSlideNumber );
2979void SAL_CALL SlideshowImpl::gotoSlide(
const Reference< XDrawPage >& xSlide )
2983 if( !(mpSlideController && xSlide.is()) )
2989 const sal_Int32 nSlideCount = mpSlideController->getSlideNumberCount();
2990 for( sal_Int32 nSlide = 0; nSlide < nSlideCount; nSlide++ )
2992 if( mpSlideController->getSlideByNumber( nSlide ) == xSlide )
2994 displaySlideNumber( nSlide );
2999void SAL_CALL SlideshowImpl::gotoSlideIndex( sal_Int32 nIndex )
3006 displaySlideIndex(
nIndex );
3009void SAL_CALL SlideshowImpl::stopSound( )
3029::sal_Int32 SAL_CALL SlideshowImpl::getCount( )
3031 return getSlideCount();
3034css::uno::Any SAL_CALL SlideshowImpl::getByIndex( ::sal_Int32
Index )
3036 return Any( getSlideByIndex(
Index ) );
3039css::uno::Type SAL_CALL SlideshowImpl::getElementType( )
3046 return getSlideCount() != 0;
3049Reference< XSlideShow > SAL_CALL SlideshowImpl::getSlideShow()
3056, mbRehearseTimings(r.mbRehearseTimings)
3057, mbPreview(r.mbPreview)
3058, mpParentWindow( nullptr )
3064, mbRehearseTimings(false)
3066, mpParentWindow(nullptr)
3072 for(
const PropertyValue& rValue : rArguments )
3080 if ( rProperty ==
u"RehearseTimings" )
3085 else if ( rProperty ==
u"Preview" )
3090 else if ( rProperty ==
u"AnimationNode" )
3095 else if ( rProperty ==
u"ParentWindow" )
3097 Reference< XWindow > xWindow;
3098 if( rValue >>= xWindow )
3105 else if ( rProperty ==
u"AllowAnimations" )
3110 else if ( rProperty ==
u"FirstPage" )
3113 if( rValue >>= aPresPage )
3126 else if ( rProperty ==
u"IsAlwaysOnTop" )
3131 else if ( rProperty ==
u"IsAutomatic" )
3136 else if ( rProperty ==
u"IsEndless" )
3141 else if ( rProperty ==
u"IsFullScreen" )
3146 else if ( rProperty ==
u"IsMouseVisible" )
3151 else if ( rProperty ==
u"Pause" )
3153 sal_Int32 nPause = -1;
3154 if( (rValue >>= nPause) && (nPause >= 0) )
3160 else if ( rProperty ==
u"UsePen" )
3165 throw IllegalArgumentException();
3172, mxSlideShow(
std::move( xSlideShow ))
3184 Reference< XSlideShowListener > xSlideShowListener(
this );
3185 mxSlideShow->addSlideShowListener( xSlideShowListener );
3193 Reference< XSlideShowListener > xSlideShowListener(
this );
3194 mxSlideShow->removeSlideShowListener( xSlideShowListener );
3202 Reference< XShapeEventListener > xListener(
this );
3203 mxSlideShow->addShapeEventListener( xListener, xShape );
3211 Reference< XShapeEventListener > xListener(
this );
3212 mxSlideShow->removeShapeEventListener( xListener, xShape );
3230 std::unique_lock aGuard(
m_aMutex );
3235 [&] (Reference<XAnimationListener>
const& xListener) {
3236 return xListener->beginEvent(xNode);
3243 std::unique_lock aGuard(
m_aMutex );
3248 [&] (Reference<XAnimationListener>
const& xListener) {
3249 return xListener->endEvent(xNode);
3256 std::unique_lock aGuard(
m_aMutex );
3261 [&] (Reference<XAnimationListener>
const& xListener) {
3262 return xListener->repeat(xNode, nRepeat);
3271 std::unique_lock aGuard(
m_aMutex );
3274 [](uno::Reference<presentation::XSlideShowListener>
const& xListener)
3276 xListener->paused();
3282 std::unique_lock aGuard(
m_aMutex );
3285 [](uno::Reference<presentation::XSlideShowListener>
const& xListener)
3287 xListener->resumed();
3293 std::unique_lock aGuard(
m_aMutex );
3296 [](uno::Reference<presentation::XSlideShowListener>
const& xListener)
3298 xListener->slideTransitionStarted();
3304 std::unique_lock aGuard(
m_aMutex );
3307 [](uno::Reference<presentation::XSlideShowListener>
const& xListener)
3309 xListener->slideTransitionEnded ();
3315 std::unique_lock aGuard(
m_aMutex );
3318 [](uno::Reference<presentation::XSlideShowListener>
const& xListener)
3320 xListener->slideAnimationsEnded ();
3327 std::unique_lock aGuard(
m_aMutex );
3332 [&] (Reference<XSlideShowListener>
const& xListener) {
3333 return xListener->slideEnded(bReverse);
3348 std::unique_lock aGuard(
m_aMutex );
3353 [&] (Reference<XSlideShowListener>
const& xListener) {
3354 return xListener->hyperLinkClicked(aHyperLink);
css::uno::Reference< css::frame::XModel2 > mxModel
PropertiesInfo aProperties
static bool GetLayoutRTL()
static void AddEventListener(const Link< VclSimpleEvent &, void > &rEventListener)
static ImplSVEvent * PostUserEvent(const Link< void *, void > &rLink, void *pCaller=nullptr, bool bReferenceLink=false)
static std::unique_ptr< weld::Builder > CreateBuilder(weld::Widget *pParent, const OUString &rUIFile, bool bMobile=false, sal_uInt64 nLOKWindowId=0)
static void RemoveUserEvent(ImplSVEvent *nUserEvent)
static bool Reschedule(bool bHandleAllCurrentEvents=false)
static void RemoveEventListener(const Link< VclSimpleEvent &, void > &rEventListener)
CommandEventId GetCommand() const
CommandMediaData * GetMediaData() const
double getVelocityX() const
static void DisableExtHelp()
static void EnableContextHelp()
static void EnableExtHelp()
static void DisableContextHelp()
sal_Unicode GetCharCode() const
const vcl::KeyCode & GetKeyCode() const
const Point & GetPosPixel() const
PageVec & PagesVector()
Provides a direct access to the collection of the SdPage objects.
SdOptions * GetSdOptions(DocumentType eDocType)
Return options.
void SetPresentationPenColor(sal_Int32 nPenColor)
double GetPresentationPenWidth() const
void SetPresentationPenWidth(double nPenWidth)
sal_Int32 GetPresentationPenColor() const
PageKind GetPageKind() const
const OUString & GetName() const
static SdrObject * getSdrObjectFromXShape(const css::uno::Reference< css::uno::XInterface > &xInt)
SdrPage * getSdrPageFromSdrObject() const
sal_uInt16 GetPageNum() const
bool IsMasterPage() const
static bool IsXScriptURL(const OUString &rScriptURL)
static BitmapEx GetApplicationLogo(tools::Long nWidth)
void Invalidate(sal_uInt16 nId)
void InvalidateAll(bool bWithMsg)
const SfxPoolItem * Execute(sal_uInt16 nSlot, SfxCallMode nCall=SfxCallMode::SLOT, const SfxPoolItem **pArgs=nullptr, sal_uInt16 nModi=0, const SfxPoolItem **pInternalArgs=nullptr)
void SetSlotFilter(SfxSlotFilterState nEnable=SfxSlotFilterState::DISABLED, o3tl::span< sal_uInt16 const > pSIDs=o3tl::span< sal_uInt16 const >())
const css::uno::Reference< css::frame::XFrame > & GetFrameInterface() const
static SAL_WARN_UNUSED_RESULT SfxViewFrame * Current()
void SetChildWindow(sal_uInt16 nId, bool bVisible, bool bSetFocus=true)
SfxDispatcher * GetDispatcher()
SfxChildWindow * GetChildWindow(sal_uInt16)
SfxFrame & GetFrame() const
static void SetGlobalErrorHdl(const Link< StarBASIC *, bool > &rNewHdl)
static Link< StarBASIC *, bool > const & GetGlobalErrorHdl()
const Color & GetColor() const
short Execute(weld::Window *pParent)
void SetColor(const Color &rColor)
static vcl::Window * GetWindow(const css::uno::Reference< css::awt::XWindow > &rxWindow)
static VclPtr< reference_type > Create(Arg &&... arg)
void forEach(std::unique_lock< std::mutex > &rGuard, FuncT const &func) const
sal_Int32 addInterface(std::unique_lock< std::mutex > &rGuard, const css::uno::Reference< ListenerT > &rxIFace)
void disposeAndClear(::std::unique_lock<::std::mutex > &rGuard, const css::lang::EventObject &rEvt)
sal_Int32 getLength(std::unique_lock< std::mutex > &rGuard) const
sal_Int32 removeInterface(std::unique_lock< std::mutex > &rGuard, const css::uno::Reference< ListenerT > &rxIFace)
css::uno::Type const & get()
bool isValidIndex(sal_Int32 nIndex) const
sal_Int32 findSlideIndex(sal_Int32 nSlideNumber) const
sal_Int32 getStartSlideIndex() const
bool isVisibleSlideNumber(sal_Int32 nSlideNumber) const
sal_Int32 getCurrentSlideNumber() const
sal_Int32 getSlideNumberCount() const
AnimationSlideController(Reference< XIndexAccess > const &xSlides, Mode eMode)
void insertSlideNumber(sal_Int32 nSlideNumber, bool bVisible=true)
sal_Int32 mnCurrentSlideIndex
std::vector< bool > maSlideVisible
sal_Int32 mnHiddenSlideNumber
bool getSlideAPI(sal_Int32 nSlideNumber, Reference< XDrawPage > &xSlide, Reference< XAnimationNode > &xAnimNode)
bool jumpToSlideNumber(sal_Int32 nNewSlideIndex)
void setStartSlideNumber(sal_Int32 nSlideNumber)
sal_Int32 getCurrentSlideIndex() const
void setPreviewNode(const Reference< XAnimationNode > &xPreviewNode)
sal_Int32 getNextSlideIndex() const
Reference< XAnimationNode > mxPreviewNode
std::vector< sal_Int32 > maSlideNumbers
bool jumpToSlideIndex(sal_Int32 nNewSlideIndex)
bool isValidSlideNumber(sal_Int32 nSlideNumber) const
sal_Int32 getSlideIndexCount() const
void displayCurrentSlide(const Reference< XSlideShow > &xShow, const Reference< XDrawPagesSupplier > &xDrawPages, const bool bSkipAllMainSequenceEffects)
sal_Int32 mnStartSlideNumber
std::vector< bool > maSlideVisited
Reference< XDrawPage > getSlideByNumber(sal_Int32 nSlideNumber) const
sal_Int32 getPreviousSlideIndex() const
Reference< XIndexAccess > mxSlides
sal_Int32 getSlideNumber(sal_Int32 nSlideIndex) const
sal_Int32 getNextSlideNumber() const
Hide the windows of the side panes and restore the original visibility later.
This view shell is responsible for showing the presentation of an Impress document.
void addAsSlideShowListener()
void removeShapeEventListener(const css::uno::Reference< css::drawing::XShape > &xShape)
virtual void SAL_CALL disposing(const css::lang::EventObject &Source) override
virtual void SAL_CALL click(const css::uno::Reference< css::drawing::XShape > &xShape, const css::awt::MouseEvent &aOriginalEvent) override
virtual void SAL_CALL slideAnimationsEnded() override
virtual void SAL_CALL slideTransitionEnded() override
virtual void SAL_CALL slideTransitionStarted() override
virtual void SAL_CALL beginEvent(const css::uno::Reference< css::animations::XAnimationNode > &Node) override
rtl::Reference< SlideshowImpl > mxController
virtual void SAL_CALL paused() override
SlideShowListenerProxy(rtl::Reference< SlideshowImpl > xController, css::uno::Reference< css::presentation::XSlideShow > xSlideShow)
virtual ~SlideShowListenerProxy() override
virtual void SAL_CALL slideEnded(sal_Bool bReverse) override
virtual void SAL_CALL resumed() override
void removeSlideShowListener(const css::uno::Reference< css::presentation::XSlideShowListener > &Listener)
virtual void SAL_CALL contextMenuShow(const css::awt::Point &point) override
void addShapeEventListener(const css::uno::Reference< css::drawing::XShape > &xShape)
css::uno::Reference< css::presentation::XSlideShow > mxSlideShow
virtual void SAL_CALL hyperLinkClicked(const OUString &hyperLink) override
virtual void SAL_CALL endEvent(const css::uno::Reference< css::animations::XAnimationNode > &Node) override
virtual void SAL_CALL repeat(const css::uno::Reference< css::animations::XAnimationNode > &Node, ::sal_Int32 Repeat) override
void addSlideShowListener(const css::uno::Reference< css::presentation::XSlideShowListener > &Listener)
::comphelper::OInterfaceContainerHelper4< css::presentation::XSlideShowListener > maListeners
void removeAsSlideShowListener()
SlideshowImpl(const css::uno::Reference< css::presentation::XPresentation2 > &xPresentation, ViewShell *pViewSh, ::sd::View *pView, SdDrawDocument *pDoc, vcl::Window *pParentWindow)
Base class of the stacked shell hierarchy.
An SdWindow contains the actual working area of ViewShell.
void GrabFocus()
Activate window.
sal_uInt16 GetCode() const
::OutputDevice const * GetOutDev() const
Point PixelToLogic(const Point &rDevicePt) const
virtual Size GetSizePixel() const
Size GetOutputSizePixel() const
constexpr ::Color COL_WHITE(0xFF, 0xFF, 0xFF)
constexpr ::Color COL_BLACK(0x00, 0x00, 0x00)
#define DBG_ASSERT(sCon, aError)
#define TOOLS_WARN_EXCEPTION(area, stream)
constexpr sal_uInt16 KEY_RETURN
constexpr sal_uInt16 KEY_0
constexpr sal_uInt16 KEY_6
constexpr sal_uInt16 KEY_8
constexpr sal_uInt16 KEY_ESCAPE
constexpr sal_uInt16 KEY_HOME
constexpr sal_uInt16 KEY_7
constexpr sal_uInt16 KEY_1
constexpr sal_uInt16 KEY_LEFT
constexpr sal_uInt16 KEY_PAGEDOWN
constexpr sal_uInt16 KEY_COMMA
constexpr sal_uInt16 KEY_B
constexpr sal_uInt16 KEY_4
constexpr sal_uInt16 KEY_POINT
constexpr sal_uInt16 KEY_UP
constexpr sal_uInt16 KEY_5
constexpr sal_uInt16 KEY_9
constexpr sal_uInt16 KEY_3
constexpr sal_uInt16 KEY_A
constexpr sal_uInt16 KEY_RIGHT
constexpr sal_uInt16 KEY_DOWN
constexpr sal_uInt16 KEY_SPACE
constexpr sal_uInt16 KEY_PAGEUP
constexpr sal_uInt16 KEY_E
constexpr sal_uInt16 KEY_2
constexpr sal_uInt16 KEY_W
constexpr sal_uInt16 KEY_P
constexpr sal_uInt16 KEY_SUBTRACT
constexpr sal_uInt16 KEY_BACKSPACE
constexpr sal_uInt16 KEY_END
#define LINK(Instance, Class, Member)
#define SAL_N_ELEMENTS(arr)
sal_Int32 findValue(const css::uno::Sequence< T1 > &_rList, const T2 &_rValue)
css::uno::Sequence< DstElementType > containerToSequence(const SrcType &i_Container)
css::beans::PropertyValue makePropertyValue(const OUString &rName, T &&rValue)
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
sal_Int32 toInt32(std::u16string_view str, sal_Int16 radix=10)
std::basic_string_view< charT, traits > getToken(std::basic_string_view< charT, traits > sv, charT delimiter, std::size_t &position)
SfxViewFrame * getViewFrame(const uno::Reference< frame::XModel > &xModel)
static SfxBindings * getBindings(ViewShellBase const &rBase)
const FncGetChildWindowId aShowChildren[]
static SfxDispatcher * getDispatcher(ViewShellBase const &rBase)
IMPL_LINK(SlideshowImpl, EventListenerHdl, VclSimpleEvent &, rSimpleEvent, void)
sal_uInt16 const pAllowed[]
Slots, which will be disabled in the slide show and are managed by Sfx.
std::shared_ptr< WrappedShapeEventImpl > WrappedShapeEventImplPtr
constexpr OUStringLiteral gsVerb(u"Verb")
constexpr OUStringLiteral gsOnClick(u"OnClick")
sal_uInt16(* FncGetChildWindowId)()
IMPL_LINK_NOARG(SlideshowImpl, deactivateHdl, Timer *, void)
constexpr OUStringLiteral gsBookmark(u"Bookmark")
weld::Window * GetPopupParent(vcl::Window &rOutWin, tools::Rectangle &rRect)
OUString SdResId(TranslateId aId)
double mdUserPaintStrokeWidth
uno::Reference< presentation::XSlideShowView > mxView
void SetArguments(const css::uno::Sequence< css::beans::PropertyValue > &rArguments)
css::uno::Reference< css::animations::XAnimationNode > mxAnimationNode
void SetPropertyValue(std::u16string_view rProperty, const css::uno::Any &rValue)
PresentationSettingsEx(const PresentationSettingsEx &)
css::uno::Reference< css::drawing::XDrawPage > mxStartPage
VclPtr< vcl::Window > mpParentWindow
Reference< XController > xController
void NotifyDocumentEvent(SdDrawDocument const &rDocument, const OUString &rEventName)
OUString getUiNameFromPageApiNameImpl(const OUString &rApiName)
ImpShapeEventMap maShapeEventMap