1c142477cSAndrew Rist /**************************************************************
2*aa9633e7Smseidel  *
3c142477cSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4c142477cSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5c142477cSAndrew Rist  * distributed with this work for additional information
6c142477cSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7c142477cSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8c142477cSAndrew Rist  * "License"); you may not use this file except in compliance
9c142477cSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*aa9633e7Smseidel  *
11c142477cSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*aa9633e7Smseidel  *
13c142477cSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14c142477cSAndrew Rist  * software distributed under the License is distributed on an
15c142477cSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16c142477cSAndrew Rist  * KIND, either express or implied.  See the License for the
17c142477cSAndrew Rist  * specific language governing permissions and limitations
18c142477cSAndrew Rist  * under the License.
19*aa9633e7Smseidel  *
20c142477cSAndrew Rist  *************************************************************/
21c142477cSAndrew Rist 
22c142477cSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_sdext.hxx"
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include "PresenterHelper.hxx"
28cdf0e10cSrcweir 
29cdf0e10cSrcweir #include <com/sun/star/graphic/XGraphicProvider.hpp>
30cdf0e10cSrcweir #include <com/sun/star/lang/XMultiServiceFactory.hpp>
31cdf0e10cSrcweir #include <com/sun/star/presentation/XPresentationSupplier.hpp>
32cdf0e10cSrcweir #include <com/sun/star/presentation/XPresentation2.hpp>
33cdf0e10cSrcweir 
34cdf0e10cSrcweir using namespace ::com::sun::star;
35cdf0e10cSrcweir using namespace ::com::sun::star::uno;
36cdf0e10cSrcweir using namespace ::com::sun::star::presentation;
37cdf0e10cSrcweir using ::rtl::OUString;
38cdf0e10cSrcweir 
39cdf0e10cSrcweir namespace sdext { namespace presenter {
40cdf0e10cSrcweir 
41cdf0e10cSrcweir const OUString PresenterHelper::msPaneURLPrefix(
42*aa9633e7Smseidel 	OUString::createFromAscii("private:resource/pane/"));
43cdf0e10cSrcweir const OUString PresenterHelper::msCenterPaneURL(
44*aa9633e7Smseidel 	msPaneURLPrefix + OUString::createFromAscii("CenterPane"));
45cdf0e10cSrcweir const OUString PresenterHelper::msFullScreenPaneURL(
46*aa9633e7Smseidel 	msPaneURLPrefix + OUString::createFromAscii("FullScreenPane"));
47cdf0e10cSrcweir 
48cdf0e10cSrcweir const OUString PresenterHelper::msViewURLPrefix(
49*aa9633e7Smseidel 	OUString::createFromAscii("private:resource/view/"));
50cdf0e10cSrcweir const OUString PresenterHelper::msPresenterScreenURL(
51*aa9633e7Smseidel 	msViewURLPrefix + OUString::createFromAscii("PresenterScreen"));
52cdf0e10cSrcweir const OUString PresenterHelper::msSlideSorterURL(
53*aa9633e7Smseidel 	msViewURLPrefix + OUString::createFromAscii("SlideSorter"));
54cdf0e10cSrcweir 
55cdf0e10cSrcweir const OUString PresenterHelper::msResourceActivationEvent(
56*aa9633e7Smseidel 	OUString::createFromAscii("ResourceActivation"));
57cdf0e10cSrcweir const OUString PresenterHelper::msResourceDeactivationEvent(
58*aa9633e7Smseidel 	OUString::createFromAscii("ResourceDeactivation"));
59cdf0e10cSrcweir 
60cdf0e10cSrcweir const OUString PresenterHelper::msDefaultPaneStyle (
61*aa9633e7Smseidel 	OUString::createFromAscii("DefaultPaneStyle"));
62cdf0e10cSrcweir const OUString PresenterHelper::msDefaultViewStyle (
63*aa9633e7Smseidel 	OUString::createFromAscii("DefaultViewStyle"));
64cdf0e10cSrcweir 
65cdf0e10cSrcweir 
GetSlideShowController(const Reference<frame::XController> & rxController)66cdf0e10cSrcweir Reference<presentation::XSlideShowController> PresenterHelper::GetSlideShowController (
67*aa9633e7Smseidel 	const Reference<frame::XController>& rxController)
68cdf0e10cSrcweir {
69*aa9633e7Smseidel 	Reference<presentation::XSlideShowController> xSlideShowController;
70*aa9633e7Smseidel 
71*aa9633e7Smseidel 	if( rxController.is() ) try
72*aa9633e7Smseidel 	{
73cdf0e10cSrcweir 		Reference<XPresentationSupplier> xPS ( rxController->getModel(), UNO_QUERY_THROW);
74cdf0e10cSrcweir 
75cdf0e10cSrcweir 		Reference<XPresentation2> xPresentation(xPS->getPresentation(), UNO_QUERY_THROW);
76cdf0e10cSrcweir 
77cdf0e10cSrcweir 		xSlideShowController = xPresentation->getController();
78*aa9633e7Smseidel 	}
79*aa9633e7Smseidel 	catch(RuntimeException&)
80*aa9633e7Smseidel 	{
81*aa9633e7Smseidel 	}
82cdf0e10cSrcweir 
83*aa9633e7Smseidel 	return xSlideShowController;
84cdf0e10cSrcweir }
85cdf0e10cSrcweir 
86cdf0e10cSrcweir 
87cdf0e10cSrcweir } } // end of namespace ::sdext::presenter
88