12#include <LibreOfficeKit/LibreOfficeKitEnums.h>
19#include <com/sun/star/awt/PosSize.hpp>
20#include <com/sun/star/awt/XControl.hpp>
21#include <com/sun/star/awt/XWindow.hpp>
22#include <com/sun/star/awt/XWindowPeer.hpp>
23#include <com/sun/star/awt/XGraphics.hpp>
24#include <com/sun/star/awt/XView.hpp>
37 int nButtons,
int nModifier)
39 static std::optional<PointerStyle> eDocPointerStyle;
53 if (aControlRectHMM.
Contains(aPointHmm))
55 css::uno::Reference<css::awt::XControl> xControl
60 css::uno::Reference<css::awt::XWindow> xControlWindow(xControl,
62 if (!xControlWindow.is())
65 css::uno::Reference<css::awt::XWindowPeer> xWindowPeer(xControl->getPeer());
73 pWindow->SetPosPixel(aControlRectPx.
TopLeft());
77 if (!eDocPointerStyle)
83 Point aControlRelativePositionHMM = aPointHmm - aControlRectHMM.
TopLeft();
88 MouseEventModifiers::SIMPLECLICK,
101 eDocPointerStyle.reset();
110 css::uno::Reference<css::awt::XControl> xControl
115 css::uno::Reference<css::awt::XWindow> xControlWindow(xControl, css::uno::UNO_QUERY);
116 if (!xControlWindow.is())
123 css::uno::Reference<css::awt::XView> xControlView(xControl, css::uno::UNO_QUERY);
124 if (!xControlView.is())
134 Point aOffsetFromTile(aObjectRectHMM.
Left() - rTileRectHMM.
Left(),
135 aObjectRectHMM.
Top() - rTileRectHMM.
Top());
140 xControlWindow->setPosSize(aControltRectPx.
Left(), aControltRectPx.
Top(),
142 css::awt::PosSize::POSSIZE);
144 xControlView->setGraphics(xGraphics);
146 xControlView->setZoom(1, 1);
148 xControlView->draw(aRectanglePx.
Left() * scaleX, aRectanglePx.
Top() * scaleY);
175 while (aIterator.
IsMore())
187 if (aObjectRectHMM.
Overlaps(aTileRectHMM))
189 drawUnoControl(pDrawView, pUnoObect, rMainWindow, rDevice, aTileRectHMM,
190 double(scaleX),
double(scaleY));
Fraction conversionFract(o3tl::Length from, o3tl::Length to)
constexpr o3tl::Length MapToO3tlLength(MapUnit eU, o3tl::Length ePixelValue=o3tl::Length::px)
static void paintControlTile(const SdrPage *pPage, const SdrView *pDrawView, vcl::Window const &rMainWindow, VirtualDevice &rDevice, Size aOutputSize, tools::Rectangle const &rTileRect)
static bool postMouseEvent(const SdrPage *pPage, const SdrView *pDrawView, vcl::DocWindow &rMainWindow, int nType, Point aPointHmm, int nCount, int nButtons, int nModifier)
static void drawUnoControl(const SdrView *pDrawView, const SdrUnoObj *pUnoObect, vcl::Window const &rMainWindow, VirtualDevice &rDevice, tools::Rectangle const &rTileRectHMM, double scaleX, double scaleY)
void SetScaleY(const Fraction &rScaleY)
MapUnit GetMapUnit() const
void SetMapUnit(MapUnit eUnit)
void SetScaleX(const Fraction &rScaleX)
css::uno::Reference< css::awt::XGraphics > CreateUnoGraphics()
const MapMode & GetMapMode() const
void Push(vcl::PushFlags nFlags=vcl::PushFlags::ALL)
virtual const tools::Rectangle & GetLogicRect() const override
css::uno::Reference< css::awt::XControl > GetUnoControl(const SdrView &_rView, const OutputDevice &_rOut) const
static void postMouseEventAsync(const VclPtr< vcl::Window > &xWindow, LokMouseEventData const &rLokMouseEventData)
Helper for posting async mouse event.
constexpr tools::Long Height() const
constexpr tools::Long Width() const
static vcl::Window * GetWindow(const css::uno::Reference< css::awt::XWindow > &rxWindow)
bool SetOutputSizePixel(const Size &rNewSize, bool bErase=true, bool bAlphaMaskTransparent=false)
virtual void SetPointer(PointerStyle) override
const MapMode & GetMapMode() const
::OutputDevice const * GetOutDev() const
PointerStyle GetPointer() const
EmbeddedObjectRef * pObject
constexpr Point convert(const Point &rPoint, o3tl::Length eFrom, o3tl::Length eTo)