23#include <com/sun/star/awt/PosSize.hpp>
24#include <com/sun/star/awt/XWindow2.hpp>
28using namespace css::uno;
29using namespace css::drawing::framework;
36 const Reference<XComponentContext>& rxContext,
46PresenterPaneBase::~PresenterPaneBase()
50void PresenterPaneBase::disposing()
52 if (mxBorderWindow.is())
54 mxBorderWindow->removeWindowListener(
this);
55 mxBorderWindow->removePaintListener(
this);
59 Reference<XComponent> xComponent (mxContentCanvas, UNO_QUERY);
60 mxContentCanvas =
nullptr;
62 xComponent->dispose();
66 Reference<XComponent> xComponent = mxContentWindow;
67 mxContentWindow =
nullptr;
69 xComponent->dispose();
73 Reference<XComponent> xComponent (mxBorderCanvas, UNO_QUERY);
74 mxBorderCanvas =
nullptr;
76 xComponent->dispose();
80 Reference<XComponent> xComponent = mxBorderWindow;
81 mxBorderWindow =
nullptr;
83 xComponent->dispose();
89void PresenterPaneBase::SetTitle (
const OUString& rsTitle)
99const OUString& PresenterPaneBase::GetTitle()
const
104const Reference<drawing::framework::XPaneBorderPainter>&
105 PresenterPaneBase::GetPaneBorderPainter()
const
107 return mxBorderPainter;
112void SAL_CALL PresenterPaneBase::initialize (
const Sequence<Any>& rArguments)
118 throw RuntimeException(
119 "PresenterSpritePane: missing component context",
120 static_cast<XWeak*
>(
this));
123 if (rArguments.getLength() != 5 && rArguments.getLength() != 6)
125 throw RuntimeException(
126 "PresenterSpritePane: invalid number of arguments",
127 static_cast<XWeak*
>(
this));
133 if ( ! (rArguments[0] >>= mxPaneId))
135 throw lang::IllegalArgumentException(
136 "PresenterPane: invalid pane id",
137 static_cast<XWeak*
>(
this),
141 if ( ! (rArguments[1] >>= mxParentWindow))
143 throw lang::IllegalArgumentException(
144 "PresenterPane: invalid parent window",
145 static_cast<XWeak*
>(
this),
149 Reference<rendering::XSpriteCanvas> xParentCanvas;
150 if ( ! (rArguments[2] >>= xParentCanvas))
152 throw lang::IllegalArgumentException(
153 "PresenterPane: invalid parent canvas",
154 static_cast<XWeak*
>(
this),
158 if ( ! (rArguments[3] >>= msTitle))
160 throw lang::IllegalArgumentException(
161 "PresenterPane: invalid title",
162 static_cast<XWeak*
>(
this),
166 if ( ! (rArguments[4] >>= mxBorderPainter))
168 throw lang::IllegalArgumentException(
169 "PresenterPane: invalid border painter",
170 static_cast<XWeak*
>(
this),
174 bool bIsWindowVisibleOnCreation (
true);
175 if (rArguments.getLength()>5 && ! (rArguments[5] >>= bIsWindowVisibleOnCreation))
177 throw lang::IllegalArgumentException(
178 "PresenterPane: invalid window visibility flag",
179 static_cast<XWeak*
>(
this),
183 CreateWindows(bIsWindowVisibleOnCreation);
185 if (mxBorderWindow.is())
187 mxBorderWindow->addWindowListener(
this);
188 mxBorderWindow->addPaintListener(
this);
191 CreateCanvases(xParentCanvas);
198 mxContentWindow =
nullptr;
206Reference<XResourceId> SAL_CALL PresenterPaneBase::getResourceId()
219void SAL_CALL PresenterPaneBase::windowResized (
const awt::WindowEvent&)
224void SAL_CALL PresenterPaneBase::windowMoved (
const awt::WindowEvent&)
229void SAL_CALL PresenterPaneBase::windowShown (
const lang::EventObject&)
234void SAL_CALL PresenterPaneBase::windowHidden (
const lang::EventObject&)
241void SAL_CALL PresenterPaneBase::disposing (
const lang::EventObject& rEvent)
243 if (rEvent.Source == mxBorderWindow)
245 mxBorderWindow =
nullptr;
250void PresenterPaneBase::CreateWindows (
251 const bool bIsWindowVisibleOnCreation)
259 bIsWindowVisibleOnCreation,
265 bIsWindowVisibleOnCreation,
270const Reference<awt::XWindow>& PresenterPaneBase::GetBorderWindow()
const
272 return mxBorderWindow;
275void PresenterPaneBase::ToTop()
281void PresenterPaneBase::PaintBorder (
const awt::Rectangle& rUpdateBox)
283 OSL_ASSERT(mxPaneId.is());
285 if (!(mxBorderPainter.is() && mxBorderWindow.is() && mxBorderCanvas.is()))
288 awt::Rectangle aBorderBox (mxBorderWindow->getPosSize());
289 awt::Rectangle aLocalBorderBox (0,0, aBorderBox.Width, aBorderBox.Height);
293 mxBorderPainter->paintBorder(
294 mxPaneId->getResourceURL(),
301void PresenterPaneBase::LayoutContextWindow()
303 OSL_ASSERT(mxPaneId.is());
304 OSL_ASSERT(mxBorderWindow.is());
305 OSL_ASSERT(mxContentWindow.is());
306 if (!(mxBorderPainter.is() && mxPaneId.is() && mxBorderWindow.is() && mxContentWindow.is()))
309 const awt::Rectangle aBorderBox (mxBorderWindow->getPosSize());
310 const awt::Rectangle aInnerBox (mxBorderPainter->removeBorder(
311 mxPaneId->getResourceURL(),
313 drawing::framework::BorderType_TOTAL_BORDER));
314 mxContentWindow->setPosSize(
315 aInnerBox.X - aBorderBox.X,
316 aInnerBox.Y - aBorderBox.Y,
319 awt::PosSize::POSSIZE);
322bool PresenterPaneBase::IsVisible()
const
324 Reference<awt::XWindow2> xWindow2 (mxBorderPainter, UNO_QUERY);
326 return xWindow2->isVisible();
331void PresenterPaneBase::ThrowIfDisposed()
333 if (rBHelper.bDisposed || rBHelper.bInDispose)
335 throw lang::DisposedException (
336 "PresenterPane object has already been disposed",
337 static_cast<uno::XWeak*
>(
this));
rtl::Reference< PresenterController > mpPresenterController
css::uno::Reference< css::uno::XComponentContext > mxComponentContext
Reference< drawing::XPresenterHelper > mxPresenterHelper
PresenterPaneBase(const css::uno::Reference< css::uno::XComponentContext > &rxContext, ::rtl::Reference< PresenterController > xPresenterController)
::cppu::WeakComponentImplHelper< css::drawing::framework::XPane, css::lang::XInitialization, css::awt::XWindowListener, css::awt::XPaintListener > PresenterPaneBaseInterfaceBase