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>
38 
39 #include <vcl/svapp.hxx>
40 #include <sal/log.hxx>
41 
42 using namespace ::com::sun::star;
43 using namespace ::com::sun::star::uno;
44 using namespace ::com::sun::star::lang;
45 using namespace ::com::sun::star::presentation;
46 using namespace ::com::sun::star::drawing::framework;
47 
48 namespace sdext { namespace presenter {
49 
50 namespace {
51  typedef ::cppu::WeakComponentImplHelper <
52  css::document::XEventListener
53  > PresenterScreenListenerInterfaceBase;
54 
59  class PresenterScreenListener
60  : private ::cppu::BaseMutex,
61  public PresenterScreenListenerInterfaceBase
62  {
63  public:
64  PresenterScreenListener (
65  const css::uno::Reference<css::uno::XComponentContext>& rxContext,
66  const css::uno::Reference<css::frame::XModel2>& rxModel);
67  PresenterScreenListener(const PresenterScreenListener&) = delete;
68  PresenterScreenListener& operator=(const PresenterScreenListener&) = delete;
69 
70  void Initialize();
71  virtual void SAL_CALL disposing() override;
72 
73  // document::XEventListener
74 
75  virtual void SAL_CALL notifyEvent( const css::document::EventObject& Event ) override;
76 
77  // XEventListener
78 
79  virtual void SAL_CALL disposing ( const css::lang::EventObject& rEvent) override;
80 
81  private:
82  css::uno::Reference<css::frame::XModel2 > mxModel;
83  css::uno::Reference<css::uno::XComponentContext> mxComponentContext;
85  };
86 }
87 
88 //----- Service ---------------------------------------------------------------
89 
91 {
92  return "org.libreoffice.comp.PresenterScreenJob";
93 }
94 
96 {
97  return Sequence<OUString>();
98 }
99 
101 {
102  return Reference<XInterface>(static_cast<XWeak*>(new PresenterScreenJob(rxContext)));
103 }
104 
105 //===== PresenterScreenJob ====================================================
106 
109  mxComponentContext(rxContext)
110 {
111 }
112 
114 {
115 }
116 
118 {
119  mxComponentContext = nullptr;
120 }
121 
122 //----- XJob -----------------------------------------------------------
123 
125  const Sequence< beans::NamedValue >& Arguments )
126 {
127  Sequence< beans::NamedValue > lEnv;
128  auto pArg = std::find_if(Arguments.begin(), Arguments.end(),
129  [](const beans::NamedValue& rArg) { return rArg.Name == "Environment"; });
130  if (pArg != Arguments.end())
131  pArg->Value >>= lEnv;
132 
133  Reference<frame::XModel2> xModel;
134  auto pProp = std::find_if(lEnv.begin(), lEnv.end(),
135  [](const beans::NamedValue& rProp) { return rProp.Name == "Model"; });
136  if (pProp != lEnv.end())
137  pProp->Value >>= xModel;
138 
139  Reference< XServiceInfo > xInfo( xModel, UNO_QUERY );
140  if( xInfo.is() && xInfo->supportsService("com.sun.star.presentation.PresentationDocument") )
141  {
142  // Create a new listener that waits for the full screen presentation
143  // to start and to end. It takes care of its own lifetime.
145  new PresenterScreenListener(mxComponentContext, xModel));
146  pListener->Initialize();
147  }
148 
149  return Any();
150 }
151 
152 //===== PresenterScreenListener ===============================================
153 
154 namespace {
155 
156 PresenterScreenListener::PresenterScreenListener (
157  const css::uno::Reference<css::uno::XComponentContext>& rxContext,
158  const css::uno::Reference<css::frame::XModel2>& rxModel)
159  : PresenterScreenListenerInterfaceBase(m_aMutex),
160  mxModel(rxModel),
161  mxComponentContext(rxContext),
163 {
164 }
165 
166 void PresenterScreenListener::Initialize()
167 {
168  Reference< document::XEventListener > xDocListener(
169  static_cast< document::XEventListener* >(this), UNO_QUERY);
170  Reference< document::XEventBroadcaster > xDocBroadcaster( mxModel, UNO_QUERY );
171  if( xDocBroadcaster.is() )
172  xDocBroadcaster->addEventListener(xDocListener);
173 }
174 
175 void SAL_CALL PresenterScreenListener::disposing()
176 {
177  Reference< document::XEventBroadcaster > xDocBroadcaster( mxModel, UNO_QUERY );
178  if( xDocBroadcaster.is() )
179  xDocBroadcaster->removeEventListener(
180  Reference<document::XEventListener>(
181  static_cast<document::XEventListener*>(this), UNO_QUERY));
182 
183  if (mpPresenterScreen.is())
184  {
185  mpPresenterScreen->RequestShutdownPresenterScreen();
186  mpPresenterScreen = nullptr;
187  }
188 }
189 
190 // document::XEventListener
191 
192 void SAL_CALL PresenterScreenListener::notifyEvent( const css::document::EventObject& Event )
193 {
194  if (rBHelper.bDisposed || rBHelper.bInDispose)
195  {
196  throw lang::DisposedException (
197  "PresenterScreenListener object has already been disposed",
198  static_cast<uno::XWeak*>(this));
199  }
200 
201  if ( Event.EventName == "OnStartPresentation" )
202  {
203  mpPresenterScreen = new PresenterScreen(mxComponentContext, mxModel);
205  mpPresenterScreen->InitializePresenterScreen();
206  }
207  else if ( Event.EventName == "OnEndPresentation" )
208  {
209  if (mpPresenterScreen.is())
210  {
211  mpPresenterScreen->RequestShutdownPresenterScreen();
212  mpPresenterScreen = nullptr;
213  }
214  }
215 }
216 
217 // XEventListener
218 
219 void SAL_CALL PresenterScreenListener::disposing (const css::lang::EventObject&)
220 {
221  if (mpPresenterScreen.is())
222  {
223  mpPresenterScreen->RequestShutdownPresenterScreen();
224  mpPresenterScreen = nullptr;
225  }
226 }
227 
228 } // end of anonymous namespace
229 
230 //===== PresenterScreen =======================================================
231 
233  const Reference<XComponentContext>& rxContext,
234  const css::uno::Reference<css::frame::XModel2>& rxModel)
236  mxModel(rxModel),
237  mxController(),
238  mxConfigurationControllerWeak(),
239  mxContextWeak(rxContext),
241  mxSavedConfiguration(),
242  mpPaneContainer(),
243  mxPaneFactory(),
244  mxViewFactory(),
245  maViewDescriptors()
246 {
247 }
248 
250 {
251 }
252 
253 bool PresenterScreen::isPresenterScreenEnabled(const css::uno::Reference<css::uno::XComponentContext>& rxContext)
254 {
255  bool dEnablePresenterScreen=true;
256  PresenterConfigurationAccess aConfiguration (
257  rxContext,
258  "/org.openoffice.Office.Impress/",
260  aConfiguration.GetConfigurationNode("Misc/Start/EnablePresenterScreen")
261  >>= dEnablePresenterScreen;
262  return dEnablePresenterScreen;
263 }
265 {
266  Reference<XConfigurationController> xCC (mxConfigurationControllerWeak);
267  if (xCC.is() && mxSavedConfiguration.is())
268  {
269  xCC->restoreConfiguration(mxSavedConfiguration);
270  }
271  mxConfigurationControllerWeak = Reference<XConfigurationController>(nullptr);
272 
273  Reference<lang::XComponent> xViewFactoryComponent (mxViewFactory, UNO_QUERY);
274  if (xViewFactoryComponent.is())
275  xViewFactoryComponent->dispose();
276  Reference<lang::XComponent> xPaneFactoryComponent (mxPaneFactory, UNO_QUERY);
277  if (xPaneFactoryComponent.is())
278  xPaneFactoryComponent->dispose();
279 
280  mxModel = nullptr;
281 }
282 
283 //----- XEventListener --------------------------------------------------------
284 
285 void SAL_CALL PresenterScreen::disposing (const lang::EventObject& /*rEvent*/)
286 {
288 }
289 
290 
292 {
293  try
294  {
296  mpPaneContainer = new PresenterPaneContainer(xContext);
297 
298  Reference<XPresentationSupplier> xPS ( mxModel, UNO_QUERY_THROW);
299  Reference<XPresentation2> xPresentation(xPS->getPresentation(), UNO_QUERY_THROW);
300  Reference<presentation::XSlideShowController> xSlideShowController( xPresentation->getController() );
301 
302  if( !xSlideShowController.is() || !xSlideShowController->isFullScreen() )
303  return;
304 
305  // find first controller that is not the current controller (the one with the slideshow
306  mxController = mxModel->getCurrentController();
307  Reference< container::XEnumeration > xEnum( mxModel->getControllers() );
308  if( xEnum.is() )
309  {
310  while( xEnum->hasMoreElements() )
311  {
312  Reference< frame::XController > xC( xEnum->nextElement(), UNO_QUERY );
313  if( xC.is() && (xC != mxController) )
314  {
315  mxController = xC;
316  break;
317  }
318  }
319  }
320  // Get the XController from the first argument.
321  Reference<XControllerManager> xCM(mxController, UNO_QUERY_THROW);
322 
323  Reference<XConfigurationController> xCC( xCM->getConfigurationController());
325 
326  Reference<drawing::framework::XResourceId> xMainPaneId(
327  GetMainPaneId(xPresentation));
328  // An empty reference means that the presenter screen can
329  // not or must not be displayed.
330  if ( ! xMainPaneId.is())
331  return;
332 
333  if (xCC.is() && xContext.is())
334  {
335  // Store the current configuration so that we can restore it when
336  // the presenter view is deactivated.
337  mxSavedConfiguration = xCC->getRequestedConfiguration();
338  xCC->lock();
339 
340  try
341  {
342  // At the moment the presenter controller is displayed in its
343  // own full screen window that is controlled by the same
344  // configuration controller as the Impress document from
345  // which the presentation was started. Therefore the main
346  // pane is activated additionally to the already existing
347  // panes and does not replace them.
348  xCC->requestResourceActivation(
349  xMainPaneId,
350  ResourceActivationMode_ADD);
351  SetupConfiguration(xContext, xMainPaneId);
352 
354  css::uno::WeakReference<css::lang::XEventListener>(this),
355  xContext,
356  mxController,
357  xSlideShowController,
359  xMainPaneId);
360 
361  // Create pane and view factories and integrate them into the
362  // drawing framework.
363  SetupPaneFactory(xContext);
364  SetupViewFactory(xContext);
365 
366  mpPresenterController->GetWindowManager()->RestoreViewMode();
367  }
368  catch (const RuntimeException&)
369  {
370  xCC->restoreConfiguration(mxSavedConfiguration);
371  }
372  xCC->unlock();
373  }
374  }
375  catch (const Exception&)
376  {
377  }
378 }
379 
381 {
382  try {
383  Reference<XPresentationSupplier> xPS ( mxModel, UNO_QUERY_THROW);
384  Reference<XPresentation2> xPresentation(xPS->getPresentation(), UNO_QUERY_THROW);
385 
386  // Get the existing presenter console screen, we want to switch the
387  // presentation to use that instead.
388  sal_Int32 nNewScreen = GetPresenterScreenNumber (xPresentation);
389  if (nNewScreen < 0)
390  return;
391 
392  // Adapt that display number to be the 'default' setting of 0 if it matches
393  sal_Int32 nExternalDisplay = Application::GetDisplayExternalScreen();
394 
395  if (nNewScreen == nExternalDisplay)
396  nNewScreen = 0; // screen zero is best == the primary display
397  else
398  nNewScreen++; // otherwise we store screens offset by one.
399 
400  // Set the new presentation display
401  Reference<beans::XPropertySet> xProperties (xPresentation, UNO_QUERY_THROW);
402  xProperties->setPropertyValue("Display", Any(nNewScreen));
403  } catch (const uno::Exception &) {
404  }
405 }
406 
412  const Reference<presentation::XPresentation2>& rxPresentation) const
413 {
414  sal_Int32 nScreenNumber (0);
415  sal_Int32 nScreenCount (1);
416  try
417  {
418  if ( ! rxPresentation.is())
419  return -1;
420 
421  // Determine the screen on which the full screen presentation is being
422  // displayed.
423  sal_Int32 nDisplayNumber (-1);
424  if ( ! (rxPresentation->getPropertyValue("Display") >>= nDisplayNumber))
425  return -1;
426  if (nDisplayNumber == -1)
427  {
428  // The special value -1 indicates that the slide show
429  // spans all available displays. That leaves no room for
430  // the presenter screen.
431  return -1;
432  }
433 
434  SAL_INFO("sdext.presenter", "Display number is " << nDisplayNumber);
435 
436  if (nDisplayNumber > 0)
437  {
438  nScreenNumber = nDisplayNumber - 1;
439  }
440  else if (nDisplayNumber == 0)
441  {
442  // A display number value of 0 indicates the primary screen.
443  // Find out which screen number that is.
444  nScreenNumber = Application::GetDisplayExternalScreen();
445  }
446 
447  // We still have to determine the number of screens to decide
448  // whether the presenter screen may be shown at all.
449  nScreenCount = Application::GetScreenCount();
450 
451  if (nScreenCount < 2 || nDisplayNumber > nScreenCount)
452  {
453  // There is either only one screen or the full screen
454  // presentation spans all available screens. The presenter
455  // screen is shown only when a special flag in the configuration
456  // is set.
458  PresenterConfigurationAccess aConfiguration (
459  xContext,
460  "/org.openoffice.Office.PresenterScreen/",
462  bool bStartAlways (false);
463  if (aConfiguration.GetConfigurationNode(
464  "Presenter/StartAlways") >>= bStartAlways)
465  {
466  if (bStartAlways)
467  return GetPresenterScreenFromScreen(nScreenNumber);
468  }
469  return -1;
470  }
471  }
472  catch (const beans::UnknownPropertyException&)
473  {
474  OSL_ASSERT(false);
475  // For some reason we can not access the screen number. Use
476  // the default instead.
477  }
478  SAL_INFO("sdext.presenter", "Get presenter screen for screen " << nScreenNumber);
479  return GetPresenterScreenFromScreen(nScreenNumber);
480 }
481 
482 sal_Int32 PresenterScreen::GetPresenterScreenFromScreen( sal_Int32 nPresentationScreen )
483 {
484  // Setup the resource id of the full screen background pane so that
485  // it is displayed on another screen than the presentation.
486  sal_Int32 nPresenterScreenNumber (1);
487  switch (nPresentationScreen)
488  {
489  case 0:
490  nPresenterScreenNumber = 1;
491  break;
492 
493  case 1:
494  nPresenterScreenNumber = 0;
495  break;
496 
497  default:
498  SAL_INFO("sdext.presenter", "Warning unexpected, out of bound screen "
499  "mapped to 0" << nPresentationScreen);
500  // When the full screen presentation is displayed on a screen
501  // other than 0 or 1 then place the presenter on the first
502  // available screen.
503  nPresenterScreenNumber = 0;
504  break;
505  }
506  return nPresenterScreenNumber;
507 }
508 
509 Reference<drawing::framework::XResourceId> PresenterScreen::GetMainPaneId (
510  const Reference<presentation::XPresentation2>& rxPresentation) const
511 {
512  // A negative value means that the presentation spans all available
513  // displays. That leaves no room for the presenter.
514  const sal_Int32 nScreen(GetPresenterScreenNumber(rxPresentation));
515  if (nScreen < 0)
516  return nullptr;
517 
518  return ResourceId::create(
521  + "?FullScreen=true&ScreenNumber="
522  + OUString::number(nScreen));
523 }
524 
526 {
527  // Restore the configuration that was active before the presenter screen
528  // has been activated. Now, that the presenter screen is displayed in
529  // its own top level window this probably not necessary, but one never knows.
530  Reference<XConfigurationController> xCC (mxConfigurationControllerWeak);
531  if (xCC.is() && mxSavedConfiguration.is())
532  {
533  xCC->restoreConfiguration(mxSavedConfiguration);
534  mxSavedConfiguration = nullptr;
535  }
536 
537  if (xCC.is())
538  {
539  // The actual restoration of the configuration takes place
540  // asynchronously. The view and pane factories can only by disposed
541  // after that. Therefore, set up a listener and wait for the
542  // restoration.
543  rtl::Reference<PresenterScreen> pSelf (this);
545  xCC,
546  [pSelf](bool){ return pSelf->ShutdownPresenterScreen(); });
547  xCC->update();
548  }
549 }
550 
552 {
553  Reference<lang::XComponent> xViewFactoryComponent (mxViewFactory, UNO_QUERY);
554  if (xViewFactoryComponent.is())
555  xViewFactoryComponent->dispose();
556  mxViewFactory = nullptr;
557 
558  Reference<lang::XComponent> xPaneFactoryComponent (mxPaneFactory, UNO_QUERY);
559  if (xPaneFactoryComponent.is())
560  xPaneFactoryComponent->dispose();
561  mxPaneFactory = nullptr;
562 
563  if (mpPresenterController.get() != nullptr)
564  {
565  mpPresenterController->dispose();
566  mpPresenterController.clear();
567  }
569 }
570 
572 {
573  try
574  {
575  if ( ! mxPaneFactory.is())
577  rxContext,
578  mxController,
580  }
581  catch (const RuntimeException&)
582  {
583  OSL_ASSERT(false);
584  }
585 }
586 
588 {
589  try
590  {
591  if ( ! mxViewFactory.is())
593  rxContext,
594  mxController,
596  }
597  catch (const RuntimeException&)
598  {
599  OSL_ASSERT(false);
600  }
601 }
602 
604  const Reference<XComponentContext>& rxContext,
605  const Reference<XResourceId>& rxAnchorId)
606 {
607  try
608  {
609  PresenterConfigurationAccess aConfiguration (
610  rxContext,
611  "org.openoffice.Office.PresenterScreen",
613  maViewDescriptors.clear();
614  ProcessViewDescriptions(aConfiguration);
615  OUString sLayoutName ("DefaultLayout");
616  aConfiguration.GetConfigurationNode(
617  "Presenter/CurrentLayout") >>= sLayoutName;
618  ProcessLayout(aConfiguration, sLayoutName, rxContext, rxAnchorId);
619  }
620  catch (const RuntimeException&)
621  {
622  }
623 }
624 
626  PresenterConfigurationAccess& rConfiguration,
627  const OUString& rsLayoutName,
628  const Reference<XComponentContext>& rxContext,
629  const Reference<XResourceId>& rxAnchorId)
630 {
631  try
632  {
633  Reference<container::XHierarchicalNameAccess> xLayoutNode (
634  rConfiguration.GetConfigurationNode(
635  "Presenter/Layouts/"+rsLayoutName),
636  UNO_QUERY_THROW);
637 
638  // Read the parent layout first, if one is referenced.
639  OUString sParentLayout;
641  xLayoutNode,
642  "ParentLayout") >>= sParentLayout;
643  if (!sParentLayout.isEmpty())
644  {
645  // Prevent infinite recursion.
646  if (rsLayoutName != sParentLayout)
647  ProcessLayout(rConfiguration, sParentLayout, rxContext, rxAnchorId);
648  }
649 
650  // Process the actual layout list.
653  xLayoutNode,
654  "Layout"),
655  UNO_QUERY_THROW);
656 
657  ::std::vector<OUString> aProperties (6);
658  aProperties[0] = "PaneURL";
659  aProperties[1] = "ViewURL";
660  aProperties[2] = "RelativeX";
661  aProperties[3] = "RelativeY";
662  aProperties[4] = "RelativeWidth";
663  aProperties[5] = "RelativeHeight";
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 (4);
687  aProperties[0] = "ViewURL";
688  aProperties[1] = "Title";
689  aProperties[2] = "AccessibleTitle";
690  aProperties[3] = "IsOpaque";
692  xViewDescriptionsNode,
693  aProperties,
694  [this](std::vector<uno::Any> const& rArgs)
695  {
696  return this->ProcessViewDescription(rArgs);
697  });
698  }
699  catch (const RuntimeException&)
700  {
701  OSL_ASSERT(false);
702  }
703 }
704 
706  const ::std::vector<Any>& rValues,
707  const Reference<XComponentContext>& rxContext,
708  const Reference<XResourceId>& rxAnchorId)
709 {
710  if (rValues.size() != 6)
711  return;
712 
713  try
714  {
715  OUString sPaneURL;
716  OUString sViewURL;
717  double nX = 0;
718  double nY = 0;
719  double nWidth = 0;
720  double nHeight = 0;
721  rValues[0] >>= sPaneURL;
722  rValues[1] >>= sViewURL;
723  rValues[2] >>= nX;
724  rValues[3] >>= nY;
725  rValues[4] >>= nWidth;
726  rValues[5] >>= nHeight;
727 
728  if (nX>=0 && nY>=0 && nWidth>0 && nHeight>0)
729  {
730  SetupView(
731  rxContext,
732  rxAnchorId,
733  sPaneURL,
734  sViewURL,
736  }
737  }
738  catch (const Exception&)
739  {
740  OSL_ASSERT(false);
741  }
742 }
743 
745  const ::std::vector<Any>& rValues)
746 {
747  if (rValues.size() != 4)
748  return;
749 
750  try
751  {
752  ViewDescriptor aViewDescriptor;
753  OUString sViewURL;
754  rValues[0] >>= sViewURL;
755  rValues[1] >>= aViewDescriptor.msTitle;
756  rValues[2] >>= aViewDescriptor.msAccessibleTitle;
757  rValues[3] >>= aViewDescriptor.mbIsOpaque;
758  if (aViewDescriptor.msAccessibleTitle.isEmpty())
759  aViewDescriptor.msAccessibleTitle = aViewDescriptor.msTitle;
760  maViewDescriptors[sViewURL] = aViewDescriptor;
761  }
762  catch (const Exception&)
763  {
764  OSL_ASSERT(false);
765  }
766 }
767 
769  const Reference<XComponentContext>& rxContext,
770  const Reference<XResourceId>& rxAnchorId,
771  const OUString& rsPaneURL,
772  const OUString& rsViewURL,
773  const PresenterPaneContainer::ViewInitializationFunction& rViewInitialization)
774 {
775  Reference<XConfigurationController> xCC (mxConfigurationControllerWeak);
776  if (!xCC.is())
777  return;
778 
779  Reference<XResourceId> xPaneId (ResourceId::createWithAnchor(rxContext,rsPaneURL,rxAnchorId));
780  // Look up the view descriptor.
781  ViewDescriptor aViewDescriptor;
782  ViewDescriptorContainer::const_iterator iDescriptor (maViewDescriptors.find(rsViewURL));
783  if (iDescriptor != maViewDescriptors.end())
784  aViewDescriptor = iDescriptor->second;
785 
786  // Prepare the pane.
787  OSL_ASSERT(mpPaneContainer.get() != nullptr);
788  mpPaneContainer->PreparePane(
789  xPaneId,
790  rsViewURL,
791  aViewDescriptor.msTitle,
792  aViewDescriptor.msAccessibleTitle,
793  aViewDescriptor.mbIsOpaque,
794  rViewInitialization);
795 }
796 
797 } } // end of namespace ::sdext::presenter
798 
799 /* 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.
css::uno::Reference< css::frame::XModel2 > mxModel
static css::uno::Sequence< OUString > getSupportedServiceNames_static()
css::uno::Reference< css::drawing::framework::XResourceFactory > mxViewFactory
::cppu::WeakComponentImplHelper< css::lang::XEventListener > PresenterScreenInterfaceBase
osl::Mutex m_aMutex
css::uno::WeakReference< css::uno::XComponentContext > mxContextWeak
css::uno::Reference< css::frame::XModel2 > mxModel
virtual void SAL_CALL disposing() override
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.
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
::cppu::WeakComponentImplHelper< css::task::XJob > PresenterScreenJobInterfaceBase
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.
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()
virtual css::uno::Any SAL_CALL execute(const css::uno::Sequence< css::beans::NamedValue > &Arguments) override
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 ProcessLayout(PresenterConfigurationAccess &rConfiguration, const OUString &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...
void ProcessViewDescriptions(PresenterConfigurationAccess &rConfiguration)
Read the view descriptions from the configuration.
::rtl::Reference< PresenterPaneContainer > mpPaneContainer
::rtl::Reference< PresenterController > mpPresenterController
This class could also be called PresenterPaneAndViewContainer because it stores not only references t...
rtl::Reference< PresenterController > mpPresenterController
#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
static css::uno::Reference< css::uno::XInterface > Create(const css::uno::Reference< css::uno::XComponentContext > &rxContext)
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.