1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: PresenterHelper.cxx,v $
13 * This file is part of OpenOffice.org.
15 * OpenOffice.org is free software: you can redistribute it and/or modify
16 * it under the terms of the GNU Lesser General Public License version 3
17 * only, as published by the Free Software Foundation.
19 * OpenOffice.org is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU Lesser General Public License version 3 for more details
23 * (a copy is included in the LICENSE file that accompanied this code).
25 * You should have received a copy of the GNU Lesser General Public License
26 * version 3 along with OpenOffice.org. If not, see
27 * <http://www.openoffice.org/license.html>
28 * for a copy of the LGPLv3 License.
30 ************************************************************************/
32 // MARKER(update_precomp.py): autogen include statement, do not remove
33 #include "precompiled_sdext.hxx"
35 #include "PresenterHelper.hxx"
37 #include <com/sun/star/graphic/XGraphicProvider.hpp>
38 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
39 #include <com/sun/star/presentation/XPresentationSupplier.hpp>
40 #include <com/sun/star/presentation/XPresentation2.hpp>
42 using namespace ::com::sun::star
;
43 using namespace ::com::sun::star::uno
;
44 using namespace ::com::sun::star::presentation
;
45 using ::rtl::OUString
;
47 namespace sdext
{ namespace presenter
{
49 const OUString
PresenterHelper::msPaneURLPrefix(
50 OUString::createFromAscii("private:resource/pane/"));
51 const OUString
PresenterHelper::msCenterPaneURL(
52 msPaneURLPrefix
+ OUString::createFromAscii("CenterPane"));
53 const OUString
PresenterHelper::msFullScreenPaneURL(
54 msPaneURLPrefix
+ OUString::createFromAscii("FullScreenPane"));
56 const OUString
PresenterHelper::msViewURLPrefix(
57 OUString::createFromAscii("private:resource/view/"));
58 const OUString
PresenterHelper::msPresenterScreenURL(
59 msViewURLPrefix
+ OUString::createFromAscii("PresenterScreen"));
60 const OUString
PresenterHelper::msSlideSorterURL(
61 msViewURLPrefix
+ OUString::createFromAscii("SlideSorter"));
63 const OUString
PresenterHelper::msResourceActivationEvent(
64 OUString::createFromAscii("ResourceActivation"));
65 const OUString
PresenterHelper::msResourceDeactivationEvent(
66 OUString::createFromAscii("ResourceDeactivation"));
68 const OUString
PresenterHelper::msDefaultPaneStyle (
69 OUString::createFromAscii("DefaultPaneStyle"));
70 const OUString
PresenterHelper::msDefaultViewStyle (
71 OUString::createFromAscii("DefaultViewStyle"));
74 Reference
<presentation::XSlideShowController
> PresenterHelper::GetSlideShowController (
75 const Reference
<frame::XController
>& rxController
)
77 Reference
<presentation::XSlideShowController
> xSlideShowController
;
79 if( rxController
.is() ) try
81 Reference
<XPresentationSupplier
> xPS ( rxController
->getModel(), UNO_QUERY_THROW
);
83 Reference
<XPresentation2
> xPresentation(xPS
->getPresentation(), UNO_QUERY_THROW
);
85 xSlideShowController
= xPresentation
->getController();
87 catch(RuntimeException
&)
91 return xSlideShowController
;
97 } } // end of namespace ::sdext::presenter