35#include <com/sun/star/drawing/framework/XControllerManager.hpp>
42using ::sd::framework::FrameworkHelper;
52 const sal_Int32 gnConfigurationUpdateStartEvent(0);
53 const sal_Int32 gnConfigurationUpdateEndEvent(1);
78 :
public ::std::vector<PaneDescriptor>
87 const Reference<XComponentContext>& rxContext,
90 mpViewShellBase(nullptr),
98 Reference<XConfigurationController> xCC (rxController->getConfigurationController());
103 if (rxController.is() && xCC.is())
107 aDescriptor.
mePaneId = CenterPaneId;
110 xCC->addResourceFactory(aDescriptor.
msPaneURL,
this);
113 aDescriptor.
mePaneId = FullScreenPaneId;
115 xCC->addResourceFactory(aDescriptor.
msPaneURL,
this);
118 aDescriptor.
mePaneId = LeftImpressPaneId;
120 xCC->addResourceFactory(aDescriptor.
msPaneURL,
this);
123 aDescriptor.
mePaneId = LeftDrawPaneId;
125 xCC->addResourceFactory(aDescriptor.
msPaneURL,
this);
131 xCC->addConfigurationChangeListener(
134 Any(gnConfigurationUpdateStartEvent));
135 xCC->addConfigurationChangeListener(
138 Any(gnConfigurationUpdateEndEvent));
145 xCC->removeResourceFactoryForReference(
this);
158 xCC->removeResourceFactoryForReference(
this);
159 xCC->removeConfigurationChangeListener(
this);
165 if (rDescriptor.mbIsReleased)
167 Reference<XComponent> xComponent (rDescriptor.mxPane, UNO_QUERY);
170 xComponent->removeEventListener(
this);
171 xComponent->dispose();
180 const Reference<XResourceId>& rxPaneId)
184 Reference<XResource> xPane;
188 PaneContainer::iterator iDescriptor (
193 return rPane.CompareURL(rxPaneId->getResourceURL());
200 throw lang::IllegalArgumentException(
"BasicPaneFactory::createPane() called for unknown resource id",
205 if (iDescriptor->mxPane.is())
209 xPane = iDescriptor->mxPane;
214 switch (iDescriptor->mePaneId)
220 case FullScreenPaneId:
224 case LeftImpressPaneId:
231 iDescriptor->mxPane = xPane;
234 Reference<lang::XComponent> xComponent (xPane, UNO_QUERY);
236 xComponent->addEventListener(
this);
238 iDescriptor->mbIsReleased =
false;
245 const Reference<XResource>& rxPane)
251 PaneContainer::iterator iDescriptor (
255 [&] (
PaneDescriptor const& rPane) { return rPane.ComparePane(rxPane); } ));
262 throw lang::IllegalArgumentException(
"BasicPaneFactory::releasePane() called for pane that was not created by same factory.",
273 if (pChildWindowPane !=
nullptr)
275 iDescriptor->mbIsReleased =
true;
276 pChildWindowPane->
Hide();
280 iDescriptor->mxPane =
nullptr;
281 Reference<XComponent> xComponent (rxPane, UNO_QUERY);
286 xComponent->removeEventListener(
this);
287 xComponent->dispose();
296 const ConfigurationChangeEvent& )
304 const lang::EventObject& rEventObject)
314 Reference<XResource> xPane (rEventObject.Source, UNO_QUERY);
315 PaneContainer::iterator iDescriptor (
319 [&] (PaneDescriptor
const& rPane) { return rPane.ComparePane(xPane); } ));
322 iDescriptor->mxPane =
nullptr;
328 const Reference<XResourceId>& rxPaneId)
330 Reference<XResource> xPane;
341 const Reference<XComponentContext>& rxComponentContext,
342 const Reference<XResourceId>& rxPaneId)
344 Reference<XResource> xPane (
354 const Reference<XResourceId>& rxPaneId,
357 Reference<XResource> xPane;
362 sal_uInt16 nChildWindowId = 0;
363 ::std::unique_ptr<SfxShell> pShell;
366 case LeftImpressPaneId:
368 nChildWindowId = ::sd::LeftPaneImpressChildWindow::GetChildWindowId();
373 nChildWindowId = ::sd::LeftPaneDrawChildWindow::GetChildWindowId();
382 if (pShell !=
nullptr)
399 throw lang::DisposedException (
"BasicPaneFactory object has already been disposed",
400 const_cast<uno::XWeak*
>(
static_cast<const uno::XWeak*
>(
this)));
css::uno::Reference< css::uno::XComponentContext > mxComponentContext
Shell that displays the left pane for Draw.
Shell that displays the left pane for Impress.
vcl::Window * GetViewWindow()
Return the window that is used by the main view shell to display its view and other UI elements,...
Store URL, XPane reference and (local) PaneId for every pane factory that is registered at the PaneCo...
Reference< XResource > mxPane
bool CompareURL(std::u16string_view rsPaneURL) const
bool ComparePane(const Reference< XResource > &rxPane) const
bool mbIsReleased
The mbReleased flag is set when the pane has been released.
css::uno::Reference< css::drawing::framework::XResource > CreateFrameWindowPane(const css::uno::Reference< css::drawing::framework::XResourceId > &rxPaneId)
Create a new instance of FrameWindowPane.
css::uno::WeakReference< css::drawing::framework::XConfigurationController > mxConfigurationControllerWeak
std::unique_ptr< PaneContainer > mpPaneContainer
virtual css::uno::Reference< css::drawing::framework::XResource > SAL_CALL createResource(const css::uno::Reference< css::drawing::framework::XResourceId > &rxPaneId) override
css::uno::Reference< css::drawing::framework::XResource > CreateFullScreenPane(const css::uno::Reference< css::uno::XComponentContext > &rxComponentContext, const css::uno::Reference< css::drawing::framework::XResourceId > &rxPaneId)
Create a new pane that represents the center pane in full screen mode.
virtual void SAL_CALL releaseResource(const css::uno::Reference< css::drawing::framework::XResource > &rxPane) override
void ThrowIfDisposed() const
virtual void SAL_CALL notifyConfigurationChange(const css::drawing::framework::ConfigurationChangeEvent &rEvent) override
BasicPaneFactory(const css::uno::Reference< css::uno::XComponentContext > &rxContext, const rtl::Reference<::sd::DrawController > &rxController)
css::uno::Reference< css::drawing::framework::XResource > CreateChildWindowPane(const css::uno::Reference< css::drawing::framework::XResourceId > &rxPaneId, const PaneDescriptor &rDescriptor)
Create a new instance of ChildWindowPane.
virtual void disposing(std::unique_lock< std::mutex > &) override
virtual ~BasicPaneFactory() override
ViewShellBase * mpViewShellBase
css::uno::Reference< css::uno::XComponentContext > mxComponentContext
The ChildWindowPane listens to the child window and disposes itself when the child window becomes ina...
void Hide()
Hide the pane.
This subclass is not necessary anymore.
static const OUString msCenterPaneURL
static const OUString msLeftDrawPaneURL
static constexpr OUStringLiteral msConfigurationUpdateStartEvent
static constexpr OUStringLiteral msConfigurationUpdateEndEvent
static const OUString msLeftImpressPaneURL
static const OUString msFullScreenPaneURL
The full screen pane creates a pane that covers the complete application window, i....