PaneHider.cxx (79aad27f) PaneHider.cxx (61060e70)
1/**************************************************************
1/**************************************************************
2 *
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License. You may obtain a copy of the License at
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License. You may obtain a copy of the License at
10 *
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied. See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied. See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
19 *
20 *************************************************************/
21
22
23
20 *************************************************************/
21
22
23
24
25// MARKER(update_precomp.py): autogen include statement, do not remove
26#include "precompiled_sd.hxx"
27#include "PaneHider.hxx"
28
29#include "ViewShell.hxx"
30#include "ViewShellBase.hxx"
31#include "slideshow.hxx"
32#include "slideshowimpl.hxx"

--- 10 unchanged lines hidden (view full) ---

43using namespace ::com::sun::star::uno;
44using namespace ::com::sun::star::drawing::framework;
45using ::sd::framework::FrameworkHelper;
46using ::com::sun::star::lang::DisposedException;
47
48namespace sd {
49
50PaneHider::PaneHider (const ViewShell& rViewShell, SlideshowImpl* pSlideShow)
24// MARKER(update_precomp.py): autogen include statement, do not remove
25#include "precompiled_sd.hxx"
26#include "PaneHider.hxx"
27
28#include "ViewShell.hxx"
29#include "ViewShellBase.hxx"
30#include "slideshow.hxx"
31#include "slideshowimpl.hxx"

--- 10 unchanged lines hidden (view full) ---

42using namespace ::com::sun::star::uno;
43using namespace ::com::sun::star::drawing::framework;
44using ::sd::framework::FrameworkHelper;
45using ::com::sun::star::lang::DisposedException;
46
47namespace sd {
48
49PaneHider::PaneHider (const ViewShell& rViewShell, SlideshowImpl* pSlideShow)
51 : mrViewShell(rViewShell),
52 mbWindowVisibilitySaved(false),
53 mbOriginalLeftPaneWindowVisibility(false),
54 mbOriginalRightPaneWindowVisibility(false)
50 : mrViewShell(rViewShell),
51 mbWindowVisibilitySaved(false),
52 mbOriginalLeftPaneWindowVisibility(false),
53 mbOriginalRightPaneWindowVisibility(false)
55{
54{
56 // Hide the left and right pane windows when a slideshow exists and is
57 // not full screen.
58 if (pSlideShow!=NULL && !pSlideShow->isFullScreen()) try
59 {
60 Reference<XControllerManager> xControllerManager (
61 mrViewShell.GetViewShellBase().GetController(), UNO_QUERY_THROW);
62 mxConfigurationController = xControllerManager->getConfigurationController();
63 if (mxConfigurationController.is())
64 {
65 // Get and save the current configuration.
66 mxConfiguration = mxConfigurationController->getRequestedConfiguration();
67 if (mxConfiguration.is())
68 {
69 // Iterate over the resources and deactivate the panes.
70 Sequence<Reference<XResourceId> > aResources (
71 mxConfiguration->getResources(
72 NULL,
73 framework::FrameworkHelper::msPaneURLPrefix,
74 AnchorBindingMode_DIRECT));
75 for (sal_Int32 nIndex=0; nIndex<aResources.getLength(); ++nIndex)
76 {
77 Reference<XResourceId> xPaneId (aResources[nIndex]);
78 if ( ! xPaneId->getResourceURL().equals(FrameworkHelper::msCenterPaneURL))
79 {
80 mxConfigurationController->requestResourceDeactivation(xPaneId);
81 }
82 }
83 }
84 }
85 FrameworkHelper::Instance(mrViewShell.GetViewShellBase())->WaitForUpdate();
86 }
87 catch (RuntimeException&)
88 {
89 DBG_UNHANDLED_EXCEPTION();
90 }
55 // Hide the left and right pane windows when a slideshow exists and is
56 // not full screen.
57 if (pSlideShow!=NULL && !pSlideShow->isFullScreen()) try
58 {
59 Reference<XControllerManager> xControllerManager (
60 mrViewShell.GetViewShellBase().GetController(), UNO_QUERY_THROW);
61 mxConfigurationController = xControllerManager->getConfigurationController();
62 if (mxConfigurationController.is())
63 {
64 // Get and save the current configuration.
65 mxConfiguration = mxConfigurationController->getRequestedConfiguration();
66 if (mxConfiguration.is())
67 {
68 // Iterate over the resources and deactivate the panes.
69 Sequence<Reference<XResourceId> > aResources (
70 mxConfiguration->getResources(
71 NULL,
72 framework::FrameworkHelper::msPaneURLPrefix,
73 AnchorBindingMode_DIRECT));
74 for (sal_Int32 nIndex=0; nIndex<aResources.getLength(); ++nIndex)
75 {
76 Reference<XResourceId> xPaneId (aResources[nIndex]);
77 if ( ! xPaneId->getResourceURL().equals(FrameworkHelper::msCenterPaneURL))
78 {
79 mxConfigurationController->requestResourceDeactivation(xPaneId);
80 }
81 }
82 }
83 }
84 FrameworkHelper::Instance(mrViewShell.GetViewShellBase())->WaitForUpdate();
85 }
86 catch (RuntimeException&)
87 {
88 DBG_UNHANDLED_EXCEPTION();
89 }
91}
92
93
90}
91
92
94
95
96PaneHider::~PaneHider (void)
97{
93PaneHider::~PaneHider (void)
94{
98 if (mxConfiguration.is() && mxConfigurationController.is())
99 {
100 try
101 {
102 mxConfigurationController->restoreConfiguration(mxConfiguration);
103 }
104 catch (DisposedException&)
105 {
106 // When the configuration controller is already disposed then
107 // there is no point in restoring the configuration.
108 }
109 }
95 if (mxConfiguration.is() && mxConfigurationController.is())
96 {
97 try
98 {
99 mxConfigurationController->restoreConfiguration(mxConfiguration);
100 }
101 catch (DisposedException&)
102 {
103 // When the configuration controller is already disposed then
104 // there is no point in restoring the configuration.
105 }
106 }
110}
111
112
113} // end of namespace sd
107}
108
109
110} // end of namespace sd
111
112/* vim: set noet sw=4 ts=4: */