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"
24#include "PresenterHelper.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>
39
40#include <utility>
41#include <vcl/svapp.hxx>
42#include <sal/log.hxx>
43
44using namespace ::com::sun::star;
45using namespace ::com::sun::star::uno;
46using namespace ::com::sun::star::lang;
47using namespace ::com::sun::star::presentation;
49
50namespace sdext::presenter {
51
52namespace {
53 typedef ::cppu::WeakComponentImplHelper <
54 css::document::XEventListener
55 > PresenterScreenListenerInterfaceBase;
56
61 class PresenterScreenListener
62 : private ::cppu::BaseMutex,
63 public PresenterScreenListenerInterfaceBase
64 {
65 public:
66 PresenterScreenListener (
67 css::uno::Reference<css::uno::XComponentContext> xContext,
68 css::uno::Reference<css::frame::XModel2> xModel);
69 PresenterScreenListener(const PresenterScreenListener&) = delete;
70 PresenterScreenListener& operator=(const PresenterScreenListener&) = delete;
71
72 void Initialize();
73 virtual void SAL_CALL disposing() override;
74
75 // document::XEventListener
76
77 virtual void SAL_CALL notifyEvent( const css::document::EventObject& Event ) override;
78
79 // XEventListener
80
81 virtual void SAL_CALL disposing ( const css::lang::EventObject& rEvent) override;
82
83 private:
84 css::uno::Reference<css::frame::XModel2 > mxModel;
85 css::uno::Reference<css::uno::XComponentContext> mxComponentContext;
87 };
88}
89
90//----- XServiceInfo ---------------------------------------------------------------
91
92Sequence< OUString > SAL_CALL PresenterScreenJob::getSupportedServiceNames()
93{
94 return { };
95}
96
98{
99 return "org.libreoffice.comp.PresenterScreenJob";
100}
101
102sal_Bool SAL_CALL PresenterScreenJob::supportsService(const OUString& aServiceName)
103{
104 return cppu::supportsService(this, aServiceName);
105}
106
107
108extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
110 css::uno::XComponentContext* context , css::uno::Sequence<css::uno::Any> const&)
111{
112 return cppu::acquire(new PresenterScreenJob(context));
113}
114
115
116//===== PresenterScreenJob ====================================================
117
118PresenterScreenJob::PresenterScreenJob (const Reference<XComponentContext>& rxContext)
120 mxComponentContext(rxContext)
121{
122}
123
124PresenterScreenJob::~PresenterScreenJob()
125{
126}
127
128void SAL_CALL PresenterScreenJob::disposing()
129{
130 mxComponentContext = nullptr;
131}
132
133//----- XJob -----------------------------------------------------------
134
135Any SAL_CALL PresenterScreenJob::execute(
136 const Sequence< beans::NamedValue >& Arguments )
137{
138 Sequence< beans::NamedValue > lEnv;
139 auto pArg = std::find_if(Arguments.begin(), Arguments.end(),
140 [](const beans::NamedValue& rArg) { return rArg.Name == "Environment"; });
141 if (pArg != Arguments.end())
142 pArg->Value >>= lEnv;
143
144 Reference<frame::XModel2> xModel;
145 auto pProp = std::find_if(std::cbegin(lEnv), std::cend(lEnv),
146 [](const beans::NamedValue& rProp) { return rProp.Name == "Model"; });
147 if (pProp != std::cend(lEnv))
148 pProp->Value >>= xModel;
149
150 Reference< XServiceInfo > xInfo( xModel, UNO_QUERY );
151 if( xInfo.is() && xInfo->supportsService("com.sun.star.presentation.PresentationDocument") )
152 {
153 // Create a new listener that waits for the full screen presentation
154 // to start and to end. It takes care of its own lifetime.
156 new PresenterScreenListener(mxComponentContext, xModel));
157 pListener->Initialize();
158 }
159
160 return Any();
161}
162
163//===== PresenterScreenListener ===============================================
164
165namespace {
166
167PresenterScreenListener::PresenterScreenListener (
168 css::uno::Reference<css::uno::XComponentContext> xContext,
169 css::uno::Reference<css::frame::XModel2> xModel)
170 : PresenterScreenListenerInterfaceBase(m_aMutex),
171 mxModel(std::move(xModel)),
172 mxComponentContext(std::move(xContext))
173{
174}
175
176void PresenterScreenListener::Initialize()
177{
178 Reference< document::XEventListener > xDocListener(this);
179 Reference< document::XEventBroadcaster > xDocBroadcaster( mxModel, UNO_QUERY );
180 if( xDocBroadcaster.is() )
181 xDocBroadcaster->addEventListener(xDocListener);
182}
183
184void SAL_CALL PresenterScreenListener::disposing()
185{
186 Reference< document::XEventBroadcaster > xDocBroadcaster( mxModel, UNO_QUERY );
187 if( xDocBroadcaster.is() )
188 xDocBroadcaster->removeEventListener(
189 Reference<document::XEventListener>(this) );
190
191 if (mpPresenterScreen.is())
192 {
193 mpPresenterScreen->RequestShutdownPresenterScreen();
194 mpPresenterScreen = nullptr;
195 }
196}
197
198// document::XEventListener
199
200void SAL_CALL PresenterScreenListener::notifyEvent( const css::document::EventObject& Event )
201{
202 if (rBHelper.bDisposed || rBHelper.bInDispose)
203 {
204 throw lang::DisposedException (
205 "PresenterScreenListener object has already been disposed",
206 static_cast<uno::XWeak*>(this));
207 }
208
209 if ( Event.EventName == "OnStartPresentation" )
210 {
211 mpPresenterScreen = new PresenterScreen(mxComponentContext, mxModel);
213 mpPresenterScreen->InitializePresenterScreen();
214 }
215 else if ( Event.EventName == "OnEndPresentation" )
216 {
217 if (mpPresenterScreen.is())
218 {
219 mpPresenterScreen->RequestShutdownPresenterScreen();
220 mpPresenterScreen = nullptr;
221 }
222 }
223}
224
225// XEventListener
226
227void SAL_CALL PresenterScreenListener::disposing (const css::lang::EventObject&)
228{
229 if (mpPresenterScreen.is())
230 {
231 mpPresenterScreen->RequestShutdownPresenterScreen();
232 mpPresenterScreen = nullptr;
233 }
234}
235
236} // end of anonymous namespace
237
238//===== PresenterScreen =======================================================
239
241 const Reference<XComponentContext>& rxContext,
242 css::uno::Reference<css::frame::XModel2> xModel)
244 mxModel(std::move(xModel)),
245 mxContextWeak(rxContext)
246{
247}
248
250{
251}
252
253bool 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
285void SAL_CALL PresenterScreen::disposing (const lang::EventObject& /*rEvent*/)
286{
288}
289
290
292{
293 try
294 {
295 Reference<XComponentContext> xContext (mxContextWeak);
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,
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 try
416 {
417 if ( ! rxPresentation.is())
418 return -1;
419
420 // Determine the screen on which the full screen presentation is being
421 // displayed.
422 sal_Int32 nDisplayNumber (-1);
423 if ( ! (rxPresentation->getPropertyValue("Display") >>= nDisplayNumber))
424 return -1;
425 if (nDisplayNumber == -1)
426 {
427 // The special value -1 indicates that the slide show
428 // spans all available displays. That leaves no room for
429 // the presenter screen.
430 return -1;
431 }
432
433 SAL_INFO("sdext.presenter", "Display number is " << nDisplayNumber);
434
435 if (nDisplayNumber > 0)
436 {
437 nScreenNumber = nDisplayNumber - 1;
438 }
439 else if (nDisplayNumber == 0)
440 {
441 // A display number value of 0 indicates the primary screen.
442 // Find out which screen number that is.
444 }
445
446 // We still have to determine the number of screens to decide
447 // whether the presenter screen may be shown at all.
448 sal_Int32 nScreenCount = Application::GetScreenCount();
449
450 if (nScreenCount < 2 || nDisplayNumber > nScreenCount)
451 {
452 // There is either only one screen or the full screen
453 // presentation spans all available screens. The presenter
454 // screen is shown only when a special flag in the configuration
455 // is set.
456 Reference<XComponentContext> xContext (mxContextWeak);
457 PresenterConfigurationAccess aConfiguration (
458 xContext,
459 "/org.openoffice.Office.PresenterScreen/",
461 bool bStartAlways (false);
462 if (aConfiguration.GetConfigurationNode(
463 "Presenter/StartAlways") >>= bStartAlways)
464 {
465 if (bStartAlways)
466 return GetPresenterScreenFromScreen(nScreenNumber);
467 }
468 return -1;
469 }
470 }
471 catch (const beans::UnknownPropertyException&)
472 {
473 OSL_ASSERT(false);
474 // For some reason we can not access the screen number. Use
475 // the default instead.
476 }
477 SAL_INFO("sdext.presenter", "Get presenter screen for screen " << nScreenNumber);
478 return GetPresenterScreenFromScreen(nScreenNumber);
479}
480
481sal_Int32 PresenterScreen::GetPresenterScreenFromScreen( sal_Int32 nPresentationScreen )
482{
483 // Setup the resource id of the full screen background pane so that
484 // it is displayed on another screen than the presentation.
485 sal_Int32 nPresenterScreenNumber (1);
486 switch (nPresentationScreen)
487 {
488 case 0:
489 nPresenterScreenNumber = 1;
490 break;
491
492 case 1:
493 nPresenterScreenNumber = 0;
494 break;
495
496 default:
497 SAL_INFO("sdext.presenter", "Warning unexpected, out of bound screen "
498 "mapped to 0" << nPresentationScreen);
499 // When the full screen presentation is displayed on a screen
500 // other than 0 or 1 then place the presenter on the first
501 // available screen.
502 nPresenterScreenNumber = 0;
503 break;
504 }
505 return nPresenterScreenNumber;
506}
507
508Reference<drawing::framework::XResourceId> PresenterScreen::GetMainPaneId (
509 const Reference<presentation::XPresentation2>& rxPresentation) const
510{
511 // A negative value means that the presentation spans all available
512 // displays. That leaves no room for the presenter.
513 const sal_Int32 nScreen(GetPresenterScreenNumber(rxPresentation));
514 if (nScreen < 0)
515 return nullptr;
516
517 return ResourceId::create(
518 Reference<XComponentContext>(mxContextWeak),
520 + "?FullScreen=true&ScreenNumber="
521 + OUString::number(nScreen));
522}
523
525{
526 // Restore the configuration that was active before the presenter screen
527 // has been activated. Now, that the presenter screen is displayed in
528 // its own top level window this probably not necessary, but one never knows.
529 Reference<XConfigurationController> xCC (mxConfigurationControllerWeak);
530 if (xCC.is() && mxSavedConfiguration.is())
531 {
532 xCC->restoreConfiguration(mxSavedConfiguration);
533 mxSavedConfiguration = nullptr;
534 }
535
536 if (xCC.is())
537 {
538 // The actual restoration of the configuration takes place
539 // asynchronously. The view and pane factories can only by disposed
540 // after that. Therefore, set up a listener and wait for the
541 // restoration.
544 xCC,
545 [pSelf](bool){ return pSelf->ShutdownPresenterScreen(); });
546 xCC->update();
547 }
548}
549
551{
552 Reference<lang::XComponent> xViewFactoryComponent (mxViewFactory, UNO_QUERY);
553 if (xViewFactoryComponent.is())
554 xViewFactoryComponent->dispose();
555 mxViewFactory = nullptr;
556
557 Reference<lang::XComponent> xPaneFactoryComponent (mxPaneFactory, UNO_QUERY);
558 if (xPaneFactoryComponent.is())
559 xPaneFactoryComponent->dispose();
560 mxPaneFactory = nullptr;
561
563 {
564 mpPresenterController->dispose();
565 mpPresenterController.clear();
566 }
567 mpPaneContainer = new PresenterPaneContainer(Reference<XComponentContext>(mxContextWeak));
568}
569
570void PresenterScreen::SetupPaneFactory (const Reference<XComponentContext>& rxContext)
571{
572 try
573 {
574 if ( ! mxPaneFactory.is())
576 rxContext,
579 }
580 catch (const RuntimeException&)
581 {
582 OSL_ASSERT(false);
583 }
584}
585
586void PresenterScreen::SetupViewFactory (const Reference<XComponentContext>& rxContext)
587{
588 try
589 {
590 if ( ! mxViewFactory.is())
592 rxContext,
595 }
596 catch (const RuntimeException&)
597 {
598 OSL_ASSERT(false);
599 }
600}
601
603 const Reference<XComponentContext>& rxContext,
604 const Reference<XResourceId>& rxAnchorId)
605{
606 try
607 {
608 PresenterConfigurationAccess aConfiguration (
609 rxContext,
610 "org.openoffice.Office.PresenterScreen",
612 maViewDescriptors.clear();
613 ProcessViewDescriptions(aConfiguration);
614 OUString sLayoutName ("DefaultLayout");
615 aConfiguration.GetConfigurationNode(
616 "Presenter/CurrentLayout") >>= sLayoutName;
617 ProcessLayout(aConfiguration, sLayoutName, rxContext, rxAnchorId);
618 }
619 catch (const RuntimeException&)
620 {
621 }
622}
623
625 PresenterConfigurationAccess& rConfiguration,
626 std::u16string_view rsLayoutName,
627 const Reference<XComponentContext>& rxContext,
628 const Reference<XResourceId>& rxAnchorId)
629{
630 try
631 {
632 Reference<container::XHierarchicalNameAccess> xLayoutNode (
633 rConfiguration.GetConfigurationNode(
634 OUString::Concat("Presenter/Layouts/")+rsLayoutName),
635 UNO_QUERY_THROW);
636
637 // Read the parent layout first, if one is referenced.
638 OUString sParentLayout;
640 xLayoutNode,
641 "ParentLayout") >>= sParentLayout;
642 if (!sParentLayout.isEmpty())
643 {
644 // Prevent infinite recursion.
645 if (rsLayoutName != sParentLayout)
646 ProcessLayout(rConfiguration, sParentLayout, rxContext, rxAnchorId);
647 }
648
649 // Process the actual layout list.
650 Reference<container::XNameAccess> xList (
652 xLayoutNode,
653 "Layout"),
654 UNO_QUERY_THROW);
655
656 ::std::vector<OUString> aProperties
657 {
658 "PaneURL",
659 "ViewURL",
660 "RelativeX",
661 "RelativeY",
662 "RelativeWidth",
663 "RelativeHeight"
664 };
666 xList,
668 [this, rxContext, rxAnchorId](std::vector<uno::Any> const& rArgs)
669 {
670 this->ProcessComponent(rArgs, rxContext, rxAnchorId);
671 });
672 }
673 catch (const RuntimeException&)
674 {
675 }
676}
677
679 PresenterConfigurationAccess& rConfiguration)
680{
681 try
682 {
683 Reference<container::XNameAccess> xViewDescriptionsNode (
684 rConfiguration.GetConfigurationNode("Presenter/Views"),
685 UNO_QUERY_THROW);
686
687 ::std::vector<OUString> aProperties
688 {
689 "ViewURL",
690 "Title",
691 "AccessibleTitle",
692 "IsOpaque"
693 };
695 xViewDescriptionsNode,
697 [this](std::vector<uno::Any> const& rArgs)
698 {
699 return this->ProcessViewDescription(rArgs);
700 });
701 }
702 catch (const RuntimeException&)
703 {
704 OSL_ASSERT(false);
705 }
706}
707
709 const ::std::vector<Any>& rValues,
710 const Reference<XComponentContext>& rxContext,
711 const Reference<XResourceId>& rxAnchorId)
712{
713 if (rValues.size() != 6)
714 return;
715
716 try
717 {
718 OUString sPaneURL;
719 OUString sViewURL;
720 double nX = 0;
721 double nY = 0;
722 double nWidth = 0;
723 double nHeight = 0;
724 rValues[0] >>= sPaneURL;
725 rValues[1] >>= sViewURL;
726 rValues[2] >>= nX;
727 rValues[3] >>= nY;
728 rValues[4] >>= nWidth;
729 rValues[5] >>= nHeight;
730
731 if (nX>=0 && nY>=0 && nWidth>0 && nHeight>0)
732 {
733 SetupView(
734 rxContext,
735 rxAnchorId,
736 sPaneURL,
737 sViewURL,
739 }
740 }
741 catch (const Exception&)
742 {
743 OSL_ASSERT(false);
744 }
745}
746
748 const ::std::vector<Any>& rValues)
749{
750 if (rValues.size() != 4)
751 return;
752
753 try
754 {
755 ViewDescriptor aViewDescriptor;
756 OUString sViewURL;
757 rValues[0] >>= sViewURL;
758 rValues[1] >>= aViewDescriptor.msTitle;
759 rValues[2] >>= aViewDescriptor.msAccessibleTitle;
760 rValues[3] >>= aViewDescriptor.mbIsOpaque;
761 if (aViewDescriptor.msAccessibleTitle.isEmpty())
762 aViewDescriptor.msAccessibleTitle = aViewDescriptor.msTitle;
763 maViewDescriptors[sViewURL] = aViewDescriptor;
764 }
765 catch (const Exception&)
766 {
767 OSL_ASSERT(false);
768 }
769}
770
772 const Reference<XComponentContext>& rxContext,
773 const Reference<XResourceId>& rxAnchorId,
774 const OUString& rsPaneURL,
775 const OUString& rsViewURL,
777{
778 Reference<XConfigurationController> xCC (mxConfigurationControllerWeak);
779 if (!xCC.is())
780 return;
781
782 Reference<XResourceId> xPaneId (ResourceId::createWithAnchor(rxContext,rsPaneURL,rxAnchorId));
783 // Look up the view descriptor.
784 ViewDescriptor aViewDescriptor;
785 ViewDescriptorContainer::const_iterator iDescriptor (maViewDescriptors.find(rsViewURL));
786 if (iDescriptor != maViewDescriptors.end())
787 aViewDescriptor = iDescriptor->second;
788
789 // Prepare the pane.
790 OSL_ASSERT(mpPaneContainer);
791 mpPaneContainer->PreparePane(
792 xPaneId,
793 rsViewURL,
794 aViewDescriptor.msTitle,
795 aViewDescriptor.msAccessibleTitle,
796 aViewDescriptor.mbIsOpaque,
797 rViewInitialization);
798}
799
800} // end of namespace ::sdext::presenter
801
802/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
css::uno::Reference< css::frame::XModel2 > mxModel
css::uno::Reference< css::uno::XComponentContext > mxComponentContext
rtl::Reference< PresenterScreen > mpPresenterScreen
PropertiesInfo aProperties
static unsigned int GetScreenCount()
static unsigned int GetDisplayExternalScreen()
This class gives access to the configuration.
css::uno::Any GetConfigurationNode(const OUString &rsPathToNode)
Return a configuration node below the root of the called object.
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.
The controller of the presenter screen is responsible for telling the individual views which slides t...
static void RunOnUpdateEnd(const css::uno::Reference< css::drawing::framework::XConfigurationController > &rxController, const Action &rAction)
This class could also be called PresenterPaneAndViewContainer because it stores not only references t...
::std::function< void(const css::uno::Reference< css::drawing::framework::XView > &)> ViewInitializationFunction
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...
The PresenterScreenJob service is instantiated every time a document is created or loaded.
virtual OUString SAL_CALL getImplementationName() override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
PresenterScreenJob(const PresenterScreenJob &)=delete
css::uno::Reference< css::drawing::framework::XConfiguration > mxSavedConfiguration
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.
virtual void SAL_CALL disposing() override
css::uno::Reference< css::frame::XModel2 > mxModel
static bool isPresenterScreenEnabled(const css::uno::Reference< css::uno::XComponentContext > &rxContext)
::rtl::Reference< PresenterController > mpPresenterController
void RequestShutdownPresenterScreen()
Do not call ShutdownPresenterScreen() directly.
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)
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...
ViewDescriptorContainer maViewDescriptors
void InitializePresenterScreen()
Make the presenter screen visible.
css::uno::WeakReference< css::uno::XComponentContext > mxContextWeak
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.
void ProcessViewDescription(const ::std::vector< css::uno::Any > &rValues)
Called by ProcessViewDescriptions for a single entry.
css::uno::Reference< css::drawing::framework::XResourceFactory > mxPaneFactory
void SetupPaneFactory(const css::uno::Reference< css::uno::XComponentContext > &rxContext)
Create and initialize the factory for presenter view specific panes.
void ProcessViewDescriptions(PresenterConfigurationAccess &rConfiguration)
Read the view descriptions from the configuration.
static sal_Int32 GetPresenterScreenFromScreen(sal_Int32 nPresentationScreen)
PresenterScreen(const css::uno::Reference< css::uno::XComponentContext > &rxContext, css::uno::Reference< css::frame::XModel2 > xModel)
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.
void SetupViewFactory(const css::uno::Reference< css::uno::XComponentContext > &rxContext)
Create and initialize the factory for presenter view specific views.
void SwitchMonitors()
Switch / converse monitors between presenter view and slide output.
css::uno::Reference< css::drawing::framework::XResourceFactory > mxViewFactory
css::uno::Reference< css::frame::XController > mxController
::rtl::Reference< PresenterPaneContainer > mpPaneContainer
css::uno::WeakReference< css::drawing::framework::XConfigurationController > mxConfigurationControllerWeak
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 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...
std::mutex m_aMutex
#define SAL_INFO(area, stream)
@ Exception
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * sdext_PresenterScreenJob_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)
::cppu::WeakComponentImplHelper< css::task::XJob, css::lang::XServiceInfo > PresenterScreenJobInterfaceBase
::cppu::WeakComponentImplHelper< css::lang::XEventListener > PresenterScreenInterfaceBase
This is the bootstrap class of the presenter screen.
Reference< XModel > xModel
unsigned char sal_Bool