1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #include "PresenterScreen.hxx"
21 #include "PresenterConfigurationAccess.hxx"
22 #include "PresenterController.hxx"
23 #include "PresenterFrameworkObserver.hxx"
24 #include "PresenterHelper.hxx"
25 #include "PresenterPaneContainer.hxx"
26 #include "PresenterPaneFactory.hxx"
27 #include "PresenterViewFactory.hxx"
28 #include "PresenterWindowManager.hxx"
29 #include <com/sun/star/frame/XController.hpp>
30 #include <com/sun/star/lang/XServiceInfo.hpp>
31 #include <com/sun/star/drawing/framework/Configuration.hpp>
32 #include <com/sun/star/drawing/framework/XControllerManager.hpp>
33 #include <com/sun/star/drawing/framework/ResourceId.hpp>
34 #include <com/sun/star/drawing/framework/ResourceActivationMode.hpp>
35 #include <com/sun/star/presentation/XSlideShow.hpp>
36 #include <com/sun/star/presentation/XPresentation2.hpp>
37 #include <com/sun/star/presentation/XPresentationSupplier.hpp>
38 #include <com/sun/star/document/XEventBroadcaster.hpp>
39 #include <boost/bind.hpp>
41 #include <com/sun/star/view/XSelectionSupplier.hpp>
42 #include <vcl/svapp.hxx>
44 using namespace ::com::sun::star
;
45 using namespace ::com::sun::star::uno
;
46 using namespace ::com::sun::star::lang
;
47 using namespace ::com::sun::star::presentation
;
48 using namespace ::com::sun::star::drawing::framework
;
50 namespace sdext
{ namespace presenter
{
53 typedef ::cppu::WeakComponentImplHelper1
<
54 css::document::XEventListener
55 > PresenterScreenListenerInterfaceBase
;
57 /** One instance of a PresenterScreenListener is registered per Impress
58 document and waits for the full screen slide show to start and to
61 class PresenterScreenListener
62 : private ::boost::noncopyable
,
63 private ::cppu::BaseMutex
,
64 public PresenterScreenListenerInterfaceBase
67 PresenterScreenListener (
68 const css::uno::Reference
<css::uno::XComponentContext
>& rxContext
,
69 const css::uno::Reference
<css::frame::XModel2
>& rxModel
);
70 virtual ~PresenterScreenListener();
73 virtual void SAL_CALL
disposing() SAL_OVERRIDE
;
75 // document::XEventListener
77 virtual void SAL_CALL
notifyEvent( const css::document::EventObject
& Event
) throw (css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
81 virtual void SAL_CALL
disposing ( const css::lang::EventObject
& rEvent
) throw (css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
84 css::uno::Reference
<css::frame::XModel2
> mxModel
;
85 css::uno::Reference
<css::uno::XComponentContext
> mxComponentContext
;
86 rtl::Reference
<PresenterScreen
> mpPresenterScreen
;
88 void ThrowIfDisposed() const throw (::com::sun::star::lang::DisposedException
);
92 //----- Service ---------------------------------------------------------------
94 OUString
PresenterScreenJob::getImplementationName_static()
96 return OUString("org.libreoffice.comp.PresenterScreenJob");
99 Sequence
<OUString
> PresenterScreenJob::getSupportedServiceNames_static()
101 return Sequence
<OUString
>();
104 Reference
<XInterface
> PresenterScreenJob::Create (const Reference
<uno::XComponentContext
>& rxContext
)
106 return Reference
<XInterface
>(static_cast<XWeak
*>(new PresenterScreenJob(rxContext
)));
109 //===== PresenterScreenJob ====================================================
111 PresenterScreenJob::PresenterScreenJob (const Reference
<XComponentContext
>& rxContext
)
112 : PresenterScreenJobInterfaceBase(m_aMutex
),
113 mxComponentContext(rxContext
)
117 PresenterScreenJob::~PresenterScreenJob()
121 void SAL_CALL
PresenterScreenJob::disposing()
123 mxComponentContext
= NULL
;
126 //----- XJob -----------------------------------------------------------
128 Any SAL_CALL
PresenterScreenJob::execute(
129 const Sequence
< beans::NamedValue
>& Arguments
)
130 throw (lang::IllegalArgumentException
, Exception
, RuntimeException
, std::exception
)
132 Sequence
< beans::NamedValue
> lEnv
;
135 sal_Int32 c
= Arguments
.getLength();
136 const beans::NamedValue
* p
= Arguments
.getConstArray();
139 if ( p
[i
].Name
== "Environment" )
146 Reference
<frame::XModel2
> xModel
;
147 c
= lEnv
.getLength();
148 p
= lEnv
.getConstArray();
151 if ( p
[i
].Name
== "Model" )
153 p
[i
].Value
>>= xModel
;
158 Reference
< XServiceInfo
> xInfo( xModel
, UNO_QUERY
);
159 if( xInfo
.is() && xInfo
->supportsService("com.sun.star.presentation.PresentationDocument") )
161 // Create a new listener that waits for the full screen presentation
162 // to start and to end. It takes care of its own lifetime.
163 ::rtl::Reference
<PresenterScreenListener
> pListener (
164 new PresenterScreenListener(mxComponentContext
, xModel
));
165 pListener
->Initialize();
171 //===== PresenterScreenListener ===============================================
175 PresenterScreenListener::PresenterScreenListener (
176 const css::uno::Reference
<css::uno::XComponentContext
>& rxContext
,
177 const css::uno::Reference
<css::frame::XModel2
>& rxModel
)
178 : PresenterScreenListenerInterfaceBase(m_aMutex
),
180 mxComponentContext(rxContext
),
185 void PresenterScreenListener::Initialize()
187 Reference
< document::XEventListener
> xDocListener(
188 static_cast< document::XEventListener
* >(this), UNO_QUERY
);
189 Reference
< document::XEventBroadcaster
> xDocBroadcaster( mxModel
, UNO_QUERY
);
190 if( xDocBroadcaster
.is() )
191 xDocBroadcaster
->addEventListener(xDocListener
);
194 PresenterScreenListener::~PresenterScreenListener()
198 void SAL_CALL
PresenterScreenListener::disposing()
200 Reference
< document::XEventBroadcaster
> xDocBroadcaster( mxModel
, UNO_QUERY
);
201 if( xDocBroadcaster
.is() )
202 xDocBroadcaster
->removeEventListener(
203 Reference
<document::XEventListener
>(
204 static_cast<document::XEventListener
*>(this), UNO_QUERY
));
206 if (mpPresenterScreen
.is())
208 mpPresenterScreen
->RequestShutdownPresenterScreen();
209 mpPresenterScreen
= NULL
;
213 // document::XEventListener
215 void SAL_CALL
PresenterScreenListener::notifyEvent( const css::document::EventObject
& Event
) throw (css::uno::RuntimeException
, std::exception
)
219 if ( Event
.EventName
== "OnStartPresentation" )
221 mpPresenterScreen
= new PresenterScreen(mxComponentContext
, mxModel
);
222 if(PresenterScreen::isPresenterScreenEnabled(mxComponentContext
))
223 mpPresenterScreen
->InitializePresenterScreen();
225 else if ( Event
.EventName
== "OnEndPresentation" )
227 if (mpPresenterScreen
.is())
229 mpPresenterScreen
->RequestShutdownPresenterScreen();
230 mpPresenterScreen
= NULL
;
237 void SAL_CALL
PresenterScreenListener::disposing (const css::lang::EventObject
& rEvent
)
238 throw (css::uno::RuntimeException
, std::exception
)
242 if (mpPresenterScreen
.is())
244 mpPresenterScreen
->RequestShutdownPresenterScreen();
245 mpPresenterScreen
= NULL
;
249 void PresenterScreenListener::ThrowIfDisposed() const throw (
250 ::com::sun::star::lang::DisposedException
)
252 if (rBHelper
.bDisposed
|| rBHelper
.bInDispose
)
254 throw lang::DisposedException (
256 "PresenterScreenListener object has already been disposed"),
257 const_cast<uno::XWeak
*>(static_cast<const uno::XWeak
*>(this)));
261 } // end of anonymous namespace
263 //===== PresenterScreen =======================================================
265 PresenterScreen::PresenterScreen (
266 const Reference
<XComponentContext
>& rxContext
,
267 const css::uno::Reference
<css::frame::XModel2
>& rxModel
)
268 : PresenterScreenInterfaceBase(m_aMutex
),
271 mxConfigurationControllerWeak(),
272 mxContextWeak(rxContext
),
273 mxSlideShowControllerWeak(),
274 mpPresenterController(),
276 mxSavedConfiguration(),
285 PresenterScreen::~PresenterScreen()
289 bool PresenterScreen::isPresenterScreenEnabled(const css::uno::Reference
<css::uno::XComponentContext
>& rxContext
)
291 bool dEnablePresenterScreen
=true;
292 PresenterConfigurationAccess
aConfiguration (
294 OUString("/org.openoffice.Office.Impress/"),
295 PresenterConfigurationAccess::READ_ONLY
);
296 aConfiguration
.GetConfigurationNode("Misc/Start/EnablePresenterScreen")
297 >>= dEnablePresenterScreen
;
298 return dEnablePresenterScreen
;
300 void SAL_CALL
PresenterScreen::disposing()
302 Reference
<XConfigurationController
> xCC (mxConfigurationControllerWeak
);
303 if (xCC
.is() && mxSavedConfiguration
.is())
305 xCC
->restoreConfiguration(mxSavedConfiguration
);
307 mxConfigurationControllerWeak
= Reference
<XConfigurationController
>(NULL
);
309 Reference
<lang::XComponent
> xViewFactoryComponent (mxViewFactory
, UNO_QUERY
);
310 if (xViewFactoryComponent
.is())
311 xViewFactoryComponent
->dispose();
312 Reference
<lang::XComponent
> xPaneFactoryComponent (mxPaneFactory
, UNO_QUERY
);
313 if (xPaneFactoryComponent
.is())
314 xPaneFactoryComponent
->dispose();
319 //----- XEventListener --------------------------------------------------------
321 void SAL_CALL
PresenterScreen::disposing (const lang::EventObject
& /*rEvent*/)
322 throw (RuntimeException
, std::exception
)
324 mxSlideShowControllerWeak
= WeakReference
<presentation::XSlideShowController
>();
325 RequestShutdownPresenterScreen();
330 void PresenterScreen::InitializePresenterScreen()
334 Reference
<XComponentContext
> xContext (mxContextWeak
);
336 new PresenterPaneContainer(Reference
<XComponentContext
>(xContext
));
338 Reference
<XPresentationSupplier
> xPS ( mxModel
, UNO_QUERY_THROW
);
339 Reference
<XPresentation2
> xPresentation(xPS
->getPresentation(), UNO_QUERY_THROW
);
340 Reference
<presentation::XSlideShowController
> xSlideShowController( xPresentation
->getController() );
341 mxSlideShowControllerWeak
= xSlideShowController
;
343 if( !xSlideShowController
.is() || !xSlideShowController
->isFullScreen() )
346 // find first controller that is not the current controller (the one with the slideshow
347 mxController
= mxModel
->getCurrentController();
348 Reference
< container::XEnumeration
> xEnum( mxModel
->getControllers() );
351 while( xEnum
->hasMoreElements() )
353 Reference
< frame::XController
> xC( xEnum
->nextElement(), UNO_QUERY
);
354 if( xC
.is() && (xC
!= mxController
) )
361 // Get the XController from the first argument.
362 Reference
<XControllerManager
> xCM(mxController
, UNO_QUERY_THROW
);
364 Reference
<XConfigurationController
> xCC( xCM
->getConfigurationController());
365 mxConfigurationControllerWeak
= xCC
;
367 Reference
<drawing::framework::XResourceId
> xMainPaneId(
368 GetMainPaneId(xPresentation
));
369 // An empty reference means that the presenter screen can
370 // not or must not be displayed.
371 if ( ! xMainPaneId
.is())
374 if (xCC
.is() && xContext
.is())
376 // Store the current configuration so that we can restore it when
377 // the presenter view is deactivated.
378 mxSavedConfiguration
= xCC
->getRequestedConfiguration();
383 // At the moment the presenter controller is displayed in its
384 // own full screen window that is controlled by the same
385 // configuration controller as the Impress document from
386 // which the presentation was started. Therefore the main
387 // pane is activated additionally to the already existing
388 // panes and does not replace them.
389 xCC
->requestResourceActivation(
391 ResourceActivationMode_ADD
);
392 SetupConfiguration(xContext
, xMainPaneId
);
394 mpPresenterController
= new PresenterController(
395 css::uno::WeakReference
<css::lang::XEventListener
>(this),
398 xSlideShowController
,
402 // Create pane and view factories and integrate them into the
403 // drawing framework.
404 SetupPaneFactory(xContext
);
405 SetupViewFactory(xContext
);
407 mpPresenterController
->GetWindowManager()->RestoreViewMode();
409 catch (const RuntimeException
&)
411 xCC
->restoreConfiguration(mxSavedConfiguration
);
416 catch (const Exception
&)
421 void PresenterScreen::SwitchMonitors()
424 Reference
<XPresentationSupplier
> xPS ( mxModel
, UNO_QUERY_THROW
);
425 Reference
<XPresentation2
> xPresentation(xPS
->getPresentation(), UNO_QUERY_THROW
);
427 // Get the existing presenter console screen, we want to switch the
428 // presentation to use that instead.
429 sal_Int32 nNewScreen
= GetPresenterScreenNumber (xPresentation
);
433 // Adapt that display number to be the 'default' setting of 0 if it matches
434 sal_Int32 nExternalDisplay
= Application::GetDisplayExternalScreen();
436 if (nNewScreen
== nExternalDisplay
)
437 nNewScreen
= 0; // screen zero is best == the primary display
439 nNewScreen
++; // otherwise we store screens offset by one.
441 // Set the new presentation display
442 Reference
<beans::XPropertySet
> xProperties (xPresentation
, UNO_QUERY_THROW
);
444 aDisplay
<<= nNewScreen
;
445 xProperties
->setPropertyValue("Display", aDisplay
);
446 } catch (const uno::Exception
&) {
451 * Return the real VCL screen number to show the presenter console
452 * on or -1 to not show anything.
454 sal_Int32
PresenterScreen::GetPresenterScreenNumber (
455 const Reference
<presentation::XPresentation2
>& rxPresentation
) const
457 sal_Int32
nScreenNumber (0);
458 sal_Int32
nScreenCount (1);
461 Reference
<beans::XPropertySet
> xProperties (rxPresentation
, UNO_QUERY
);
462 if ( ! xProperties
.is())
465 // Determine the screen on which the full screen presentation is being
467 sal_Int32
nDisplayNumber (-1);
468 if ( ! (xProperties
->getPropertyValue("Display") >>= nDisplayNumber
))
470 if (nDisplayNumber
== -1)
472 // The special value -1 indicates that the slide show
473 // spans all available displays. That leaves no room for
474 // the presenter screen.
478 SAL_INFO("sdext.presenter", "Display number is " << nDisplayNumber
);
480 if (nDisplayNumber
> 0)
482 nScreenNumber
= nDisplayNumber
- 1;
484 else if (nDisplayNumber
== 0)
486 // A display number value of 0 indicates the primary screen.
487 // Find out which screen number that is.
488 if (nDisplayNumber
<= 0)
489 nScreenNumber
= Application::GetDisplayExternalScreen();
492 // We still have to determine the number of screens to decide
493 // whether the presenter screen may be shown at all.
494 nScreenCount
= Application::GetScreenCount();
496 if (nScreenCount
< 2 || nDisplayNumber
> nScreenCount
)
498 // There is either only one screen or the full screen
499 // presentation spans all available screens. The presenter
500 // screen is shown only when a special flag in the configuration
502 Reference
<XComponentContext
> xContext (mxContextWeak
);
503 PresenterConfigurationAccess
aConfiguration (
505 OUString("/org.openoffice.Office.PresenterScreen/"),
506 PresenterConfigurationAccess::READ_ONLY
);
507 bool bStartAlways (false);
508 if (aConfiguration
.GetConfigurationNode(
509 OUString("Presenter/StartAlways")) >>= bStartAlways
)
512 return GetPresenterScreenFromScreen(nScreenNumber
);
517 catch (const beans::UnknownPropertyException
&)
520 // For some reason we can not access the screen number. Use
521 // the default instead.
523 SAL_INFO("sdext.presenter", "Get presenter screen for screen " << nScreenNumber
);
524 return GetPresenterScreenFromScreen(nScreenNumber
);
527 sal_Int32
PresenterScreen::GetPresenterScreenFromScreen( sal_Int32 nPresentationScreen
)
529 // Setup the resource id of the full screen background pane so that
530 // it is displayed on another screen than the presentation.
531 sal_Int32
nPresenterScreenNumber (1);
532 switch (nPresentationScreen
)
535 nPresenterScreenNumber
= 1;
539 nPresenterScreenNumber
= 0;
543 SAL_INFO("sdext.presenter", "Warning unexpected, out of bound screen "
544 "mapped to 0" << nPresentationScreen
);
545 // When the full screen presentation is displayed on a screen
546 // other than 0 or 1 then place the presenter on the first
548 nPresenterScreenNumber
= 0;
551 return nPresenterScreenNumber
;
554 Reference
<drawing::framework::XResourceId
> PresenterScreen::GetMainPaneId (
555 const Reference
<presentation::XPresentation2
>& rxPresentation
) const
557 // A negative value means that the presentation spans all available
558 // displays. That leaves no room for the presenter.
559 const sal_Int32
nScreen(GetPresenterScreenNumber(rxPresentation
));
563 return ResourceId::create(
564 Reference
<XComponentContext
>(mxContextWeak
),
565 PresenterHelper::msFullScreenPaneURL
566 + "?FullScreen=true&ScreenNumber="
567 + OUString::number(nScreen
));
570 void PresenterScreen::RequestShutdownPresenterScreen()
572 // Restore the configuration that was active before the presenter screen
573 // has been activated. Now, that the presenter screen is displayed in
574 // its own top level window this probably not necessary, but one never knows.
575 Reference
<XConfigurationController
> xCC (mxConfigurationControllerWeak
);
576 if (xCC
.is() && mxSavedConfiguration
.is())
578 xCC
->restoreConfiguration(mxSavedConfiguration
);
579 mxSavedConfiguration
= NULL
;
584 // The actual restoration of the configuration takes place
585 // asynchronously. The view and pane factories can only by disposed
586 // after that. Therefore, set up a listener and wait for the
588 rtl::Reference
<PresenterScreen
> pSelf (this);
589 PresenterFrameworkObserver::RunOnUpdateEnd(
591 ::boost::bind(&PresenterScreen::ShutdownPresenterScreen
, pSelf
));
596 void PresenterScreen::ShutdownPresenterScreen()
598 Reference
<lang::XComponent
> xViewFactoryComponent (mxViewFactory
, UNO_QUERY
);
599 if (xViewFactoryComponent
.is())
600 xViewFactoryComponent
->dispose();
601 mxViewFactory
= NULL
;
603 Reference
<lang::XComponent
> xPaneFactoryComponent (mxPaneFactory
, UNO_QUERY
);
604 if (xPaneFactoryComponent
.is())
605 xPaneFactoryComponent
->dispose();
606 mxPaneFactory
= NULL
;
608 if (mpPresenterController
.get() != NULL
)
610 mpPresenterController
->dispose();
611 mpPresenterController
= rtl::Reference
<PresenterController
>();
613 mpPaneContainer
= new PresenterPaneContainer(Reference
<XComponentContext
>(mxContextWeak
));
616 void PresenterScreen::SetupPaneFactory (const Reference
<XComponentContext
>& rxContext
)
620 if ( ! mxPaneFactory
.is())
621 mxPaneFactory
= PresenterPaneFactory::Create(
624 mpPresenterController
);
626 catch (const RuntimeException
&)
632 void PresenterScreen::SetupViewFactory (const Reference
<XComponentContext
>& rxContext
)
636 if ( ! mxViewFactory
.is())
637 mxViewFactory
= PresenterViewFactory::Create(
640 mpPresenterController
);
642 catch (const RuntimeException
&)
648 void PresenterScreen::SetupConfiguration (
649 const Reference
<XComponentContext
>& rxContext
,
650 const Reference
<XResourceId
>& rxAnchorId
)
654 PresenterConfigurationAccess
aConfiguration (
656 OUString("org.openoffice.Office.PresenterScreen"),
657 PresenterConfigurationAccess::READ_ONLY
);
658 maViewDescriptors
.clear();
659 ProcessViewDescriptions(aConfiguration
);
660 OUString
sLayoutName ("DefaultLayout");
661 aConfiguration
.GetConfigurationNode(
662 OUString("Presenter/CurrentLayout")) >>= sLayoutName
;
663 ProcessLayout(aConfiguration
, sLayoutName
, rxContext
, rxAnchorId
);
665 catch (const RuntimeException
&)
670 void PresenterScreen::ProcessLayout (
671 PresenterConfigurationAccess
& rConfiguration
,
672 const OUString
& rsLayoutName
,
673 const Reference
<XComponentContext
>& rxContext
,
674 const Reference
<XResourceId
>& rxAnchorId
)
678 Reference
<container::XHierarchicalNameAccess
> xLayoutNode (
679 rConfiguration
.GetConfigurationNode(
680 "Presenter/Layouts/"+rsLayoutName
),
683 // Read the parent layout first, if one is referenced.
684 OUString sParentLayout
;
685 PresenterConfigurationAccess::GetConfigurationNode(
687 OUString("ParentLayout")) >>= sParentLayout
;
688 if (!sParentLayout
.isEmpty())
690 // Prevent infinite recursion.
691 if (rsLayoutName
!= sParentLayout
)
692 ProcessLayout(rConfiguration
, sParentLayout
, rxContext
, rxAnchorId
);
695 // Process the actual layout list.
696 Reference
<container::XNameAccess
> xList (
697 PresenterConfigurationAccess::GetConfigurationNode(
702 ::std::vector
<OUString
> aProperties (6);
703 aProperties
[0] = "PaneURL";
704 aProperties
[1] = "ViewURL";
705 aProperties
[2] = "RelativeX";
706 aProperties
[3] = "RelativeY";
707 aProperties
[4] = "RelativeWidth";
708 aProperties
[5] = "RelativeHeight";
709 mnComponentIndex
= 1;
710 PresenterConfigurationAccess::ForAll(
713 ::boost::bind(&PresenterScreen::ProcessComponent
, this,
719 catch (const RuntimeException
&)
724 void PresenterScreen::ProcessViewDescriptions (
725 PresenterConfigurationAccess
& rConfiguration
)
729 Reference
<container::XNameAccess
> xViewDescriptionsNode (
730 rConfiguration
.GetConfigurationNode("Presenter/Views"),
733 ::std::vector
<OUString
> aProperties (4);
734 aProperties
[0] = "ViewURL";
735 aProperties
[1] = "Title";
736 aProperties
[2] = "AccessibleTitle";
737 aProperties
[3] = "IsOpaque";
738 mnComponentIndex
= 1;
739 PresenterConfigurationAccess::ForAll(
740 xViewDescriptionsNode
,
742 ::boost::bind(&PresenterScreen::ProcessViewDescription
, this, _1
, _2
));
744 catch (const RuntimeException
&)
750 void PresenterScreen::ProcessComponent (
751 const OUString
& rsKey
,
752 const ::std::vector
<Any
>& rValues
,
753 const Reference
<XComponentContext
>& rxContext
,
754 const Reference
<XResourceId
>& rxAnchorId
)
758 if (rValues
.size() != 6)
769 rValues
[0] >>= sPaneURL
;
770 rValues
[1] >>= sViewURL
;
773 rValues
[4] >>= nWidth
;
774 rValues
[5] >>= nHeight
;
776 if (nX
>=0 && nY
>=0 && nWidth
>0 && nHeight
>0)
783 PresenterPaneContainer::ViewInitializationFunction(),
790 catch (const Exception
&)
796 void PresenterScreen::ProcessViewDescription (
797 const OUString
& rsKey
,
798 const ::std::vector
<Any
>& rValues
)
802 if (rValues
.size() != 4)
807 ViewDescriptor aViewDescriptor
;
809 rValues
[0] >>= sViewURL
;
810 rValues
[1] >>= aViewDescriptor
.msTitle
;
811 rValues
[2] >>= aViewDescriptor
.msAccessibleTitle
;
812 rValues
[3] >>= aViewDescriptor
.mbIsOpaque
;
813 if (aViewDescriptor
.msAccessibleTitle
.isEmpty())
814 aViewDescriptor
.msAccessibleTitle
= aViewDescriptor
.msTitle
;
815 maViewDescriptors
[sViewURL
] = aViewDescriptor
;
817 catch (const Exception
&)
823 void PresenterScreen::SetupView(
824 const Reference
<XComponentContext
>& rxContext
,
825 const Reference
<XResourceId
>& rxAnchorId
,
826 const OUString
& rsPaneURL
,
827 const OUString
& rsViewURL
,
828 const PresenterPaneContainer::ViewInitializationFunction
& rViewInitialization
,
832 const double nBottom
)
834 Reference
<XConfigurationController
> xCC (mxConfigurationControllerWeak
);
837 Reference
<XResourceId
> xPaneId (ResourceId::createWithAnchor(rxContext
,rsPaneURL
,rxAnchorId
));
838 // Look up the view descriptor.
839 ViewDescriptor aViewDescriptor
;
840 ViewDescriptorContainer::const_iterator
iDescriptor (maViewDescriptors
.find(rsViewURL
));
841 if (iDescriptor
!= maViewDescriptors
.end())
842 aViewDescriptor
= iDescriptor
->second
;
845 OSL_ASSERT(mpPaneContainer
.get() != NULL
);
846 mpPaneContainer
->PreparePane(
849 aViewDescriptor
.msTitle
,
850 aViewDescriptor
.msAccessibleTitle
,
851 aViewDescriptor
.mbIsOpaque
,
860 } } // end of namespace ::sdext::presenter
862 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */