LibreOffice Module sdext (master)  1
PresenterScreen.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #include "PresenterScreen.hxx"
22 #include "PresenterController.hxx"
24 #include "PresenterHelper.hxx"
26 #include "PresenterPaneFactory.hxx"
27 #include "PresenterViewFactory.hxx"
29 #include <com/sun/star/frame/XController.hpp>
30 #include <com/sun/star/lang/XServiceInfo.hpp>
31 #include <com/sun/star/drawing/framework/XControllerManager.hpp>
32 #include <com/sun/star/drawing/framework/ResourceId.hpp>
33 #include <com/sun/star/drawing/framework/ResourceActivationMode.hpp>
34 #include <com/sun/star/presentation/XPresentation2.hpp>
35 #include <com/sun/star/presentation/XPresentationSupplier.hpp>
36 #include <com/sun/star/document/XEventBroadcaster.hpp>
37 #include <cppuhelper/compbase.hxx>
39 
40 #include <vcl/svapp.hxx>
41 #include <sal/log.hxx>
42 
43 using namespace ::com::sun::star;
44 using namespace ::com::sun::star::uno;
45 using namespace ::com::sun::star::lang;
46 using namespace ::com::sun::star::presentation;
47 using namespace ::com::sun::star::drawing::framework;
48 
49 namespace sdext::presenter {
50 
51 namespace {
52  typedef ::cppu::WeakComponentImplHelper <
53  css::document::XEventListener
54  > PresenterScreenListenerInterfaceBase;
55 
60  class PresenterScreenListener
61  : private ::cppu::BaseMutex,
62  public PresenterScreenListenerInterfaceBase
63  {
64  public:
65  PresenterScreenListener (
66  const css::uno::Reference<css::uno::XComponentContext>& rxContext,
67  const css::uno::Reference<css::frame::XModel2>& rxModel);
68  PresenterScreenListener(const PresenterScreenListener&) = delete;
69  PresenterScreenListener& operator=(const PresenterScreenListener&) = delete;
70 
71  void Initialize();
72  virtual void SAL_CALL disposing() override;
73 
74  // document::XEventListener
75 
76  virtual void SAL_CALL notifyEvent( const css::document::EventObject& Event ) override;
77 
78  // XEventListener
79 
80  virtual void SAL_CALL disposing ( const css::lang::EventObject& rEvent) override;
81 
82  private:
83  css::uno::Reference<css::frame::XModel2 > mxModel;
84  css::uno::Reference<css::uno::XComponentContext> mxComponentContext;
86  };
87 }
88 
89 //----- XServiceInfo ---------------------------------------------------------------
90 
92 {
93  return { };
94 }
95 
97 {
98  return "org.libreoffice.comp.PresenterScreenJob";
99 }
100 
101 sal_Bool SAL_CALL PresenterScreenJob::supportsService(const OUString& aServiceName)
102 {
103  return cppu::supportsService(this, aServiceName);
104 }
105 
106 
107 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
109  css::uno::XComponentContext* context , css::uno::Sequence<css::uno::Any> const&)
110 {
111  return cppu::acquire(new PresenterScreenJob(context));
112 }
113 
114 
115 //===== PresenterScreenJob ====================================================
116 
119  mxComponentContext(rxContext)
120 {
121 }
122 
123 PresenterScreenJob::~PresenterScreenJob()
124 {
125 }
126 
127 void SAL_CALL PresenterScreenJob::disposing()
128 {
129  mxComponentContext = nullptr;
130 }
131 
132 //----- XJob -----------------------------------------------------------
133 
134 Any SAL_CALL PresenterScreenJob::execute(
135  const Sequence< beans::NamedValue >& Arguments )
136 {
138  auto pArg = std::find_if(Arguments.begin(), Arguments.end(),
139  [](const beans::NamedValue& rArg) { return rArg.Name == "Environment"; });
140  if (pArg != Arguments.end())
141  pArg->Value >>= lEnv;
142 
143  Reference<frame::XModel2> xModel;
144  auto pProp = std::find_if(lEnv.begin(), lEnv.end(),
145  [](const beans::NamedValue& rProp) { return rProp.Name == "Model"; });
146  if (pProp != lEnv.end())
147  pProp->Value >>= xModel;
148 
149  Reference< XServiceInfo > xInfo( xModel, UNO_QUERY );
150  if( xInfo.is() && xInfo->supportsService("com.sun.star.presentation.PresentationDocument") )
151  {
152  // Create a new listener that waits for the full screen presentation
153  // to start and to end. It takes care of its own lifetime.
155  new PresenterScreenListener(mxComponentContext, xModel));
156  pListener->Initialize();
157  }
158 
159  return Any();
160 }
161 
162 //===== PresenterScreenListener ===============================================
163 
164 namespace {
165 
166 PresenterScreenListener::PresenterScreenListener (
167  const css::uno::Reference<css::uno::XComponentContext>& rxContext,
168  const css::uno::Reference<css::frame::XModel2>& rxModel)
169  : PresenterScreenListenerInterfaceBase(m_aMutex),
170  mxModel(rxModel),
171  mxComponentContext(rxContext)
172 {
173 }
174 
175 void PresenterScreenListener::Initialize()
176 {
177  Reference< document::XEventListener > xDocListener(this);
178  Reference< document::XEventBroadcaster > xDocBroadcaster( mxModel, UNO_QUERY );
179  if( xDocBroadcaster.is() )
180  xDocBroadcaster->addEventListener(xDocListener);
181 }
182 
183 void SAL_CALL PresenterScreenListener::disposing()
184 {
185  Reference< document::XEventBroadcaster > xDocBroadcaster( mxModel, UNO_QUERY );
186  if( xDocBroadcaster.is() )
187  xDocBroadcaster->removeEventListener(
188  Reference<document::XEventListener>(this) );
189 
190  if (mpPresenterScreen.is())
191  {
192  mpPresenterScreen->RequestShutdownPresenterScreen();
193  mpPresenterScreen = nullptr;
194  }
195 }
196 
197 // document::XEventListener
198 
199 void SAL_CALL PresenterScreenListener::notifyEvent( const css::document::EventObject& Event )
200 {
201  if (rBHelper.bDisposed || rBHelper.bInDispose)
202  {
203  throw lang::DisposedException (
204  "PresenterScreenListener object has already been disposed",
205  static_cast<uno::XWeak*>(this));
206  }
207 
208  if ( Event.EventName == "OnStartPresentation" )
209  {
210  mpPresenterScreen = new PresenterScreen(mxComponentContext, mxModel);
212  mpPresenterScreen->InitializePresenterScreen();
213  }
214  else if ( Event.EventName == "OnEndPresentation" )
215  {
216  if (mpPresenterScreen.is())
217  {
218  mpPresenterScreen->RequestShutdownPresenterScreen();
219  mpPresenterScreen = nullptr;
220  }
221  }
222 }
223 
224 // XEventListener
225 
226 void SAL_CALL PresenterScreenListener::disposing (const css::lang::EventObject&)
227 {
228  if (mpPresenterScreen.is())
229  {
230  mpPresenterScreen->RequestShutdownPresenterScreen();
231  mpPresenterScreen = nullptr;
232  }
233 }
234 
235 } // end of anonymous namespace
236 
237 //===== PresenterScreen =======================================================
238 
240  const Reference<XComponentContext>& rxContext,
241  const css::uno::Reference<css::frame::XModel2>& rxModel)
243  mxModel(rxModel),
244  mxContextWeak(rxContext)
245 {
246 }
247 
249 {
250 }
251 
252 bool PresenterScreen::isPresenterScreenEnabled(const css::uno::Reference<css::uno::XComponentContext>& rxContext)
253 {
254  bool dEnablePresenterScreen=true;
255  PresenterConfigurationAccess aConfiguration (
256  rxContext,
257  "/org.openoffice.Office.Impress/",
259  aConfiguration.GetConfigurationNode("Misc/Start/EnablePresenterScreen")
260  >>= dEnablePresenterScreen;
261  return dEnablePresenterScreen;
262 }
264 {
265  Reference<XConfigurationController> xCC (mxConfigurationControllerWeak);
266  if (xCC.is() && mxSavedConfiguration.is())
267  {
268  xCC->restoreConfiguration(mxSavedConfiguration);
269  }
270  mxConfigurationControllerWeak = Reference<XConfigurationController>(nullptr);
271 
272  Reference<lang::XComponent> xViewFactoryComponent (mxViewFactory, UNO_QUERY);
273  if (xViewFactoryComponent.is())
274  xViewFactoryComponent->dispose();
275  Reference<lang::XComponent> xPaneFactoryComponent (mxPaneFactory, UNO_QUERY);
276  if (xPaneFactoryComponent.is())
277  xPaneFactoryComponent->dispose();
278 
279  mxModel = nullptr;
280 }
281 
282 //----- XEventListener --------------------------------------------------------
283 
284 void SAL_CALL PresenterScreen::disposing (const lang::EventObject& /*rEvent*/)
285 {
287 }
288 
289 
291 {
292  try
293  {
295  mpPaneContainer = new PresenterPaneContainer(xContext);
296 
297  Reference<XPresentationSupplier> xPS ( mxModel, UNO_QUERY_THROW);
298  Reference<XPresentation2> xPresentation(xPS->getPresentation(), UNO_QUERY_THROW);
299  Reference<presentation::XSlideShowController> xSlideShowController( xPresentation->getController() );
300 
301  if( !xSlideShowController.is() || !xSlideShowController->isFullScreen() )
302  return;
303 
304  // find first controller that is not the current controller (the one with the slideshow
305  mxController = mxModel->getCurrentController();
306  Reference< container::XEnumeration > xEnum( mxModel->getControllers() );
307  if( xEnum.is() )
308  {
309  while( xEnum->hasMoreElements() )
310  {
311  Reference< frame::XController > xC( xEnum->nextElement(), UNO_QUERY );
312  if( xC.is() && (xC != mxController) )
313  {
314  mxController = xC;
315  break;
316  }
317  }
318  }
319  // Get the XController from the first argument.
320  Reference<XControllerManager> xCM(mxController, UNO_QUERY_THROW);
321 
322  Reference<XConfigurationController> xCC( xCM->getConfigurationController());
324 
325  Reference<drawing::framework::XResourceId> xMainPaneId(
326  GetMainPaneId(xPresentation));
327  // An empty reference means that the presenter screen can
328  // not or must not be displayed.
329  if ( ! xMainPaneId.is())
330  return;
331 
332  if (xCC.is() && xContext.is())
333  {
334  // Store the current configuration so that we can restore it when
335  // the presenter view is deactivated.
336  mxSavedConfiguration = xCC->getRequestedConfiguration();
337  xCC->lock();
338 
339  try
340  {
341  // At the moment the presenter controller is displayed in its
342  // own full screen window that is controlled by the same
343  // configuration controller as the Impress document from
344  // which the presentation was started. Therefore the main
345  // pane is activated additionally to the already existing
346  // panes and does not replace them.
347  xCC->requestResourceActivation(
348  xMainPaneId,
349  ResourceActivationMode_ADD);
350  SetupConfiguration(xContext, xMainPaneId);
351 
353  css::uno::WeakReference<css::lang::XEventListener>(this),
354  xContext,
355  mxController,
356  xSlideShowController,
358  xMainPaneId);
359 
360  // Create pane and view factories and integrate them into the
361  // drawing framework.
362  SetupPaneFactory(xContext);
363  SetupViewFactory(xContext);
364 
365  mpPresenterController->GetWindowManager()->RestoreViewMode();
366  }
367  catch (const RuntimeException&)
368  {
369  xCC->restoreConfiguration(mxSavedConfiguration);
370  }
371  xCC->unlock();
372  }
373  }
374  catch (const Exception&)
375  {
376  }
377 }
378 
380 {
381  try {
382  Reference<XPresentationSupplier> xPS ( mxModel, UNO_QUERY_THROW);
383  Reference<XPresentation2> xPresentation(xPS->getPresentation(), UNO_QUERY_THROW);
384 
385  // Get the existing presenter console screen, we want to switch the
386  // presentation to use that instead.
387  sal_Int32 nNewScreen = GetPresenterScreenNumber (xPresentation);
388  if (nNewScreen < 0)
389  return;
390 
391  // Adapt that display number to be the 'default' setting of 0 if it matches
392  sal_Int32 nExternalDisplay = Application::GetDisplayExternalScreen();
393 
394  if (nNewScreen == nExternalDisplay)
395  nNewScreen = 0; // screen zero is best == the primary display
396  else
397  nNewScreen++; // otherwise we store screens offset by one.
398 
399  // Set the new presentation display
400  Reference<beans::XPropertySet> xProperties (xPresentation, UNO_QUERY_THROW);
401  xProperties->setPropertyValue("Display", Any(nNewScreen));
402  } catch (const uno::Exception &) {
403  }
404 }
405 
411  const Reference<presentation::XPresentation2>& rxPresentation) const
412 {
413  sal_Int32 nScreenNumber (0);
414  try
415  {
416  if ( ! rxPresentation.is())
417  return -1;
418 
419  // Determine the screen on which the full screen presentation is being
420  // displayed.
421  sal_Int32 nDisplayNumber (-1);
422  if ( ! (rxPresentation->getPropertyValue("Display") >>= nDisplayNumber))
423  return -1;
424  if (nDisplayNumber == -1)
425  {
426  // The special value -1 indicates that the slide show
427  // spans all available displays. That leaves no room for
428  // the presenter screen.
429  return -1;
430  }
431 
432  SAL_INFO("sdext.presenter", "Display number is " << nDisplayNumber);
433 
434  if (nDisplayNumber > 0)
435  {
436  nScreenNumber = nDisplayNumber - 1;
437  }
438  else if (nDisplayNumber == 0)
439  {
440  // A display number value of 0 indicates the primary screen.
441  // Find out which screen number that is.
442  nScreenNumber = Application::GetDisplayExternalScreen();
443  }
444 
445  // We still have to determine the number of screens to decide
446  // whether the presenter screen may be shown at all.
447  sal_Int32 nScreenCount = Application::GetScreenCount();
448 
449  if (nScreenCount < 2 || nDisplayNumber > nScreenCount)
450  {
451  // There is either only one screen or the full screen
452  // presentation spans all available screens. The presenter
453  // screen is shown only when a special flag in the configuration
454  // is set.
456  PresenterConfigurationAccess aConfiguration (
457  xContext,
458  "/org.openoffice.Office.PresenterScreen/",
460  bool bStartAlways (false);
461  if (aConfiguration.GetConfigurationNode(
462  "Presenter/StartAlways") >>= bStartAlways)
463  {
464  if (bStartAlways)
465  return GetPresenterScreenFromScreen(nScreenNumber);
466  }
467  return -1;
468  }
469  }
470  catch (const beans::UnknownPropertyException&)
471  {
472  OSL_ASSERT(false);
473  // For some reason we can not access the screen number. Use
474  // the default instead.
475  }
476  SAL_INFO("sdext.presenter", "Get presenter screen for screen " << nScreenNumber);
477  return GetPresenterScreenFromScreen(nScreenNumber);
478 }
479 
480 sal_Int32 PresenterScreen::GetPresenterScreenFromScreen( sal_Int32 nPresentationScreen )
481 {
482  // Setup the resource id of the full screen background pane so that
483  // it is displayed on another screen than the presentation.
484  sal_Int32 nPresenterScreenNumber (1);
485  switch (nPresentationScreen)
486  {
487  case 0:
488  nPresenterScreenNumber = 1;
489  break;
490 
491  case 1:
492  nPresenterScreenNumber = 0;
493  break;
494 
495  default:
496  SAL_INFO("sdext.presenter", "Warning unexpected, out of bound screen "
497  "mapped to 0" << nPresentationScreen);
498  // When the full screen presentation is displayed on a screen
499  // other than 0 or 1 then place the presenter on the first
500  // available screen.
501  nPresenterScreenNumber = 0;
502  break;
503  }
504  return nPresenterScreenNumber;
505 }
506 
507 Reference<drawing::framework::XResourceId> PresenterScreen::GetMainPaneId (
508  const Reference<presentation::XPresentation2>& rxPresentation) const
509 {
510  // A negative value means that the presentation spans all available
511  // displays. That leaves no room for the presenter.
512  const sal_Int32 nScreen(GetPresenterScreenNumber(rxPresentation));
513  if (nScreen < 0)
514  return nullptr;
515 
516  return ResourceId::create(
519  + "?FullScreen=true&ScreenNumber="
520  + OUString::number(nScreen));
521 }
522 
524 {
525  // Restore the configuration that was active before the presenter screen
526  // has been activated. Now, that the presenter screen is displayed in
527  // its own top level window this probably not necessary, but one never knows.
528  Reference<XConfigurationController> xCC (mxConfigurationControllerWeak);
529  if (xCC.is() && mxSavedConfiguration.is())
530  {
531  xCC->restoreConfiguration(mxSavedConfiguration);
532  mxSavedConfiguration = nullptr;
533  }
534 
535  if (xCC.is())
536  {
537  // The actual restoration of the configuration takes place
538  // asynchronously. The view and pane factories can only by disposed
539  // after that. Therefore, set up a listener and wait for the
540  // restoration.
541  rtl::Reference<PresenterScreen> pSelf (this);
543  xCC,
544  [pSelf](bool){ return pSelf->ShutdownPresenterScreen(); });
545  xCC->update();
546  }
547 }
548 
550 {
551  Reference<lang::XComponent> xViewFactoryComponent (mxViewFactory, UNO_QUERY);
552  if (xViewFactoryComponent.is())
553  xViewFactoryComponent->dispose();
554  mxViewFactory = nullptr;
555 
556  Reference<lang::XComponent> xPaneFactoryComponent (mxPaneFactory, UNO_QUERY);
557  if (xPaneFactoryComponent.is())
558  xPaneFactoryComponent->dispose();
559  mxPaneFactory = nullptr;
560 
562  {
563  mpPresenterController->dispose();
564  mpPresenterController.clear();
565  }
567 }
568 
570 {
571  try
572  {
573  if ( ! mxPaneFactory.is())
575  rxContext,
576  mxController,
578  }
579  catch (const RuntimeException&)
580  {
581  OSL_ASSERT(false);
582  }
583 }
584 
586 {
587  try
588  {
589  if ( ! mxViewFactory.is())
591  rxContext,
592  mxController,
594  }
595  catch (const RuntimeException&)
596  {
597  OSL_ASSERT(false);
598  }
599 }
600 
602  const Reference<XComponentContext>& rxContext,
603  const Reference<XResourceId>& rxAnchorId)
604 {
605  try
606  {
607  PresenterConfigurationAccess aConfiguration (
608  rxContext,
609  "org.openoffice.Office.PresenterScreen",
611  maViewDescriptors.clear();
612  ProcessViewDescriptions(aConfiguration);
613  OUString sLayoutName ("DefaultLayout");
614  aConfiguration.GetConfigurationNode(
615  "Presenter/CurrentLayout") >>= sLayoutName;
616  ProcessLayout(aConfiguration, sLayoutName, rxContext, rxAnchorId);
617  }
618  catch (const RuntimeException&)
619  {
620  }
621 }
622 
624  PresenterConfigurationAccess& rConfiguration,
625  std::u16string_view rsLayoutName,
626  const Reference<XComponentContext>& rxContext,
627  const Reference<XResourceId>& rxAnchorId)
628 {
629  try
630  {
631  Reference<container::XHierarchicalNameAccess> xLayoutNode (
632  rConfiguration.GetConfigurationNode(
633  OUString::Concat("Presenter/Layouts/")+rsLayoutName),
634  UNO_QUERY_THROW);
635 
636  // Read the parent layout first, if one is referenced.
637  OUString sParentLayout;
639  xLayoutNode,
640  "ParentLayout") >>= sParentLayout;
641  if (!sParentLayout.isEmpty())
642  {
643  // Prevent infinite recursion.
644  if (rsLayoutName != sParentLayout)
645  ProcessLayout(rConfiguration, sParentLayout, rxContext, rxAnchorId);
646  }
647 
648  // Process the actual layout list.
651  xLayoutNode,
652  "Layout"),
653  UNO_QUERY_THROW);
654 
655  ::std::vector<OUString> aProperties
656  {
657  "PaneURL",
658  "ViewURL",
659  "RelativeX",
660  "RelativeY",
661  "RelativeWidth",
662  "RelativeHeight"
663  };
665  xList,
666  aProperties,
667  [this, rxContext, rxAnchorId](std::vector<uno::Any> const& rArgs)
668  {
669  this->ProcessComponent(rArgs, rxContext, rxAnchorId);
670  });
671  }
672  catch (const RuntimeException&)
673  {
674  }
675 }
676 
678  PresenterConfigurationAccess& rConfiguration)
679 {
680  try
681  {
682  Reference<container::XNameAccess> xViewDescriptionsNode (
683  rConfiguration.GetConfigurationNode("Presenter/Views"),
684  UNO_QUERY_THROW);
685 
686  ::std::vector<OUString> aProperties
687  {
688  "ViewURL",
689  "Title",
690  "AccessibleTitle",
691  "IsOpaque"
692  };
694  xViewDescriptionsNode,
695  aProperties,
696  [this](std::vector<uno::Any> const& rArgs)
697  {
698  return this->ProcessViewDescription(rArgs);
699  });
700  }
701  catch (const RuntimeException&)
702  {
703  OSL_ASSERT(false);
704  }
705 }
706 
708  const ::std::vector<Any>& rValues,
709  const Reference<XComponentContext>& rxContext,
710  const Reference<XResourceId>& rxAnchorId)
711 {
712  if (rValues.size() != 6)
713  return;
714 
715  try
716  {
717  OUString sPaneURL;
718  OUString sViewURL;
719  double nX = 0;
720  double nY = 0;
721  double nWidth = 0;
722  double nHeight = 0;
723  rValues[0] >>= sPaneURL;
724  rValues[1] >>= sViewURL;
725  rValues[2] >>= nX;
726  rValues[3] >>= nY;
727  rValues[4] >>= nWidth;
728  rValues[5] >>= nHeight;
729 
730  if (nX>=0 && nY>=0 && nWidth>0 && nHeight>0)
731  {
732  SetupView(
733  rxContext,
734  rxAnchorId,
735  sPaneURL,
736  sViewURL,
738  }
739  }
740  catch (const Exception&)
741  {
742  OSL_ASSERT(false);
743  }
744 }
745 
747  const ::std::vector<Any>& rValues)
748 {
749  if (rValues.size() != 4)
750  return;
751 
752  try
753  {
754  ViewDescriptor aViewDescriptor;
755  OUString sViewURL;
756  rValues[0] >>= sViewURL;
757  rValues[1] >>= aViewDescriptor.msTitle;
758  rValues[2] >>= aViewDescriptor.msAccessibleTitle;
759  rValues[3] >>= aViewDescriptor.mbIsOpaque;
760  if (aViewDescriptor.msAccessibleTitle.isEmpty())
761  aViewDescriptor.msAccessibleTitle = aViewDescriptor.msTitle;
762  maViewDescriptors[sViewURL] = aViewDescriptor;
763  }
764  catch (const Exception&)
765  {
766  OSL_ASSERT(false);
767  }
768 }
769 
771  const Reference<XComponentContext>& rxContext,
772  const Reference<XResourceId>& rxAnchorId,
773  const OUString& rsPaneURL,
774  const OUString& rsViewURL,
775  const PresenterPaneContainer::ViewInitializationFunction& rViewInitialization)
776 {
777  Reference<XConfigurationController> xCC (mxConfigurationControllerWeak);
778  if (!xCC.is())
779  return;
780 
781  Reference<XResourceId> xPaneId (ResourceId::createWithAnchor(rxContext,rsPaneURL,rxAnchorId));
782  // Look up the view descriptor.
783  ViewDescriptor aViewDescriptor;
784  ViewDescriptorContainer::const_iterator iDescriptor (maViewDescriptors.find(rsViewURL));
785  if (iDescriptor != maViewDescriptors.end())
786  aViewDescriptor = iDescriptor->second;
787 
788  // Prepare the pane.
789  OSL_ASSERT(mpPaneContainer);
790  mpPaneContainer->PreparePane(
791  xPaneId,
792  rsViewURL,
793  aViewDescriptor.msTitle,
794  aViewDescriptor.msAccessibleTitle,
795  aViewDescriptor.mbIsOpaque,
796  rViewInitialization);
797 }
798 
799 } // end of namespace ::sdext::presenter
800 
801 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
static void ForAll(const css::uno::Reference< css::container::XNameAccess > &rxContainer, const ::std::vector< OUString > &rArguments, const ItemProcessor &rProcessor)
Execute a functor for all elements of the given container.
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
css::uno::Reference< css::frame::XModel2 > mxModel
css::uno::Reference< css::drawing::framework::XResourceFactory > mxViewFactory
::cppu::WeakComponentImplHelper< css::lang::XEventListener > PresenterScreenInterfaceBase
This is the bootstrap class of the presenter screen.
css::uno::WeakReference< css::uno::XComponentContext > mxContextWeak
::cppu::WeakComponentImplHelper< css::task::XJob, css::lang::XServiceInfo > PresenterScreenJobInterfaceBase
css::uno::Reference< css::frame::XModel2 > mxModel
void ProcessLayout(PresenterConfigurationAccess &rConfiguration, std::u16string_view rsLayoutName, const css::uno::Reference< css::uno::XComponentContext > &rxContext, const css::uno::Reference< css::drawing::framework::XResourceId > &rxAnchorId)
Read one layout from the configuration and make resource activation requests to bring it on to the sc...
static sal_Int32 GetPresenterScreenFromScreen(sal_Int32 nPresentationScreen)
PresenterScreenJob(const PresenterScreenJob &)=delete
PropertiesInfo aProperties
This class gives access to the configuration.
static unsigned int GetDisplayExternalScreen()
void ProcessComponent(const ::std::vector< css::uno::Any > &rValues, const css::uno::Reference< css::uno::XComponentContext > &rxContext, const css::uno::Reference< css::drawing::framework::XResourceId > &rxAnchorId)
Called by ProcessLayout for a single entry of a Layouts configuration list.
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * sdext_PresenterScreenJob_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
std::mutex m_aMutex
rtl::Reference< PresenterScreen > mpPresenterScreen
void SetupView(const css::uno::Reference< css::uno::XComponentContext > &rxContext, const css::uno::Reference< css::drawing::framework::XResourceId > &rxAnchorId, const OUString &rsPaneURL, const OUString &rsViewURL, const PresenterPaneContainer::ViewInitializationFunction &rViewInitialization)
The controller of the presenter screen is responsible for telling the individual views which slides t...
void SwitchMonitors()
Switch / converse monitors between presenter view and slide output.
void SetupConfiguration(const css::uno::Reference< css::uno::XComponentContext > &rxContext, const css::uno::Reference< css::drawing::framework::XResourceId > &rxAnchorId)
Read the current layout from the configuration and call ProcessLayout to bring it on to the screen...
void InitializePresenterScreen()
Make the presenter screen visible.
css::uno::Reference< css::uno::XComponentContext > mxComponentContext
void SetupPaneFactory(const css::uno::Reference< css::uno::XComponentContext > &rxContext)
Create and initialize the factory for presenter view specific panes.
sal_Int32 GetPresenterScreenNumber(const css::uno::Reference< css::presentation::XPresentation2 > &rxPresentation) const
Return the built-in screen number on the presentation will normally display the presenter console...
::std::function< void(const css::uno::Reference< css::drawing::framework::XView > &)> ViewInitializationFunction
css::uno::Any GetConfigurationNode(const OUString &rsPathToNode)
Return a configuration node below the root of the called object.
unsigned char sal_Bool
static void RunOnUpdateEnd(const css::uno::Reference< css::drawing::framework::XConfigurationController > &rxController, const Action &rAction)
css::uno::Reference< css::drawing::framework::XResourceId > GetMainPaneId(const css::uno::Reference< css::presentation::XPresentation2 > &rxPresentation) const
Create a resource id for the full screen background pane so that it is displayed on another screen th...
static unsigned int GetScreenCount()
css::uno::Reference< css::frame::XController > mxController
css::uno::Reference< css::drawing::framework::XResourceFactory > mxPaneFactory
static css::uno::Reference< css::drawing::framework::XResourceFactory > Create(const css::uno::Reference< css::uno::XComponentContext > &rxContext, const css::uno::Reference< css::frame::XController > &rxController, const ::rtl::Reference< PresenterController > &rpPresenterController)
Create a new instance of this class and register it as resource factory in the drawing framework of t...
void ProcessViewDescriptions(PresenterConfigurationAccess &rConfiguration)
Read the view descriptions from the configuration.
::rtl::Reference< PresenterPaneContainer > mpPaneContainer
::rtl::Reference< PresenterController > mpPresenterController
The PresenterScreenJob service is instantiated every time a document is created or loaded...
This class could also be called PresenterPaneAndViewContainer because it stores not only references t...
#define SAL_INFO(area, stream)
css::uno::WeakReference< css::drawing::framework::XConfigurationController > mxConfigurationControllerWeak
ViewDescriptorContainer maViewDescriptors
void SetupViewFactory(const css::uno::Reference< css::uno::XComponentContext > &rxContext)
Create and initialize the factory for presenter view specific views.
css::uno::Reference< css::drawing::framework::XConfiguration > mxSavedConfiguration
Reference< XModel > xModel
void RequestShutdownPresenterScreen()
Do not call ShutdownPresenterScreen() directly.
static bool isPresenterScreenEnabled(const css::uno::Reference< css::uno::XComponentContext > &rxContext)
static css::uno::Reference< css::drawing::framework::XResourceFactory > Create(const css::uno::Reference< css::uno::XComponentContext > &rxContext, const css::uno::Reference< css::frame::XController > &rxController, const ::rtl::Reference< PresenterController > &rpPresenterController)
Create a new instance of this class and register it as resource factory in the drawing framework of t...
PresenterScreen(const css::uno::Reference< css::uno::XComponentContext > &rxContext, const css::uno::Reference< css::frame::XModel2 > &rxModel)
virtual void SAL_CALL disposing() override
void ProcessViewDescription(const ::std::vector< css::uno::Any > &rValues)
Called by ProcessViewDescriptions for a single entry.
virtual OUString SAL_CALL getImplementationName() override
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override