20#include <com/sun/star/util/XChangesNotifier.hpp>
44#include <svx/svxids.hrc>
79 virtual void createSdrDragEntries()
override;
86 maPathPolyPolygon(std::move(aPathPolyPolygon)),
87 mxTag(std::move( xTag ))
93 mxTag(std::move( xTag ))
96 virtual bool BeginSdrDrag()
override;
97 virtual bool EndSdrDrag(
bool bCopy)
override;
104void PathDragMove::createSdrDragEntries()
109 if(maPathPolyPolygon.count())
115bool PathDragMove::BeginSdrDrag()
129bool PathDragMove::EndSdrDrag(
bool )
133 mxTag->MovePath( DragStat().GetDX(), DragStat().GetDY() );
145 virtual void createSdrDragEntries()
override;
152 maPathPolyPolygon(
std::move(aPathPolyPolygon)),
153 mxTag(
std::move( xTag ))
159 mxTag(
std::move( xTag ))
162 virtual bool EndSdrDrag(
bool bCopy)
override;
168void PathDragResize::createSdrDragEntries()
173 if(maPathPolyPolygon.count())
179bool PathDragResize::EndSdrDrag(
bool )
187 const Point aRef( DragStat().GetRef1() );
189 aTrans.scale(
double(aXFact),
double(aYFact));
190 aTrans.translate(aRef.X(), aRef.Y());
192 aDragPoly.transform(aTrans);
207 virtual void createSdrDragEntries()
override;
213 maPathPolyPolygon(
std::move(aPathPolyPolygon))
220 virtual bool EndSdrDrag(
bool bCopy)
override;
225void PathDragObjOwn::createSdrDragEntries()
230 if(maPathPolyPolygon.count())
236bool PathDragObjOwn::EndSdrDrag(
bool )
256class SdPathHdl :
public SmartHdl
261 virtual void CreateB2dIAObject()
override;
262 virtual bool IsFocusHdl()
const override;
272, mpPathObj( pPathObj )
276void SdPathHdl::CreateB2dIAObject()
301 if (xManager.is() && mpPathObj)
309 insertNewlyCreatedOverlayObjectForSdrHdl(
318bool SdPathHdl::IsFocusHdl()
const
327, mxOrigin( pEffect->getTargetShape() )
328, msLastPath( pEffect->getPath() )
329, mbInUpdatePath( false )
336 XDash aDash( css::drawing::DashStyle_RECT, 1, 80, 1, 80, 80);
337 OUString aEmpty(
"?" );
360 Reference< XChangesNotifier > xNotifier(
mpEffect->getNode(), UNO_QUERY );
363 xNotifier->addChangesListener(
this );
369 DBG_ASSERT(
mpPathObj ==
nullptr,
"sd::MotionPathTag::~MotionPathTag(), dispose me first!" );
379 ::basegfx::utils::checkClosed( aCandidate );
453 const bool bNewObj = rMEvt.
IsMod1();
464 sal_uInt32 nInsPointNum =
mpPathObj->NbcInsPointOld(aPt, bNewObj);
474 if(0xffffffff != nInsPointNum)
519 const sal_uInt16 nDrgLog =
static_cast<sal_uInt16
>(
pOut->PixelToLogic(
Size(
DRGPIX,0)).
Width());
528 if( (pHdl->
GetKind() == SdrHdlKind::Move) || (pHdl->
GetKind() == SdrHdlKind::SmartTag) )
530 pDragMethod =
new PathDragMove(
mrView, xTag, aDragPoly );
533 else if( pHdl->
GetKind() == SdrHdlKind::Poly )
535 pDragMethod =
new PathDragObjOwn(
mrView, aDragPoly );
539 pDragMethod =
new PathDragResize(
mrView, xTag, std::move(aDragPoly) );
602 const_cast<SdrHdlList&
>(rHdlList).TravelFocusHdl(bForward);
629 if(pHdl && pHdl->
GetKind() == SdrHdlKind::Poly )
654 SdrHdl* pNewOne =
nullptr;
665 const_cast<SdrHdlList&
>(rHdlList).SetFocusHdl(pNewOne);
679 case KEY_UP: nY = -1;
break;
690 nX *= aLogicSizeOnePixel.
Width();
691 nY *= aLogicSizeOnePixel.
Height();
715 if( (pHdl->
GetKind() == SdrHdlKind::Move) || (pHdl->
GetKind() == SdrHdlKind::SmartTag) )
717 pDragMethod =
new PathDragMove(
mrView, xTag );
719 else if( pHdl->
GetKind() == SdrHdlKind::Poly )
721 pDragMethod =
new PathDragObjOwn(
mrView );
723 else if( pHdl->
GetKind() != SdrHdlKind::BezierWeight )
725 pDragMethod =
new PathDragResize(
mrView, xTag );
791 if( pSmartHdl && pSmartHdl->
getTag().get() == this )
813 while( --nHdlNum > 0 )
820 if( pRect==
nullptr || pRect->Contains(aPos))
839 rContext = SdrViewContext::PointEdit;
861 bool b1stSmooth(
true);
864 bool bSmoothFuz(
false);
865 bool bSegmFuz(
false);
877 css::awt::Point aPos;
890 std::unique_ptr<SdPathHdl> pHdl(
new SdPathHdl( xThis,
mpPathObj.get() ));
894 rHandlerList.
AddHdl( std::move(pHdl) );
919 rHandlerList.
AddHdl( std::unique_ptr<SmartHdl>(pSmartHdl) );
921 const bool bSelected = rMrkPnts.
find( sal_uInt16(
nHandle) ) != rMrkPnts.
end();
927 mpPathObj->AddToPlusHdlList(plusList, *pSmartHdl);
929 for (sal_uInt32 nPlusNum=0; nPlusNum<nPlusHdlCnt; nPlusNum++)
936 plusList.
MoveTo(rHandlerList);
952 rHandlerList.
AddHdl(std::make_unique<SmartHdl>( xThis,
mpPathObj.get(), aRect.
TopLeft(),SdrHdlKind::UpperLeft));
954 else if (bWdt0 || bHgt0)
956 rHandlerList.
AddHdl(std::make_unique<SmartHdl>( xThis,
mpPathObj.get(), aRect.
TopLeft() ,SdrHdlKind::UpperLeft));
961 rHandlerList.
AddHdl(std::make_unique<SmartHdl>( xThis,
mpPathObj.get(), aRect.
TopLeft() ,SdrHdlKind::UpperLeft));
963 rHandlerList.
AddHdl(std::make_unique<SmartHdl>( xThis,
mpPathObj.get(), aRect.
TopRight() ,SdrHdlKind::UpperRight));
981 Reference< XChangesNotifier > xNotifier(
mpEffect->getNode(), UNO_QUERY );
984 xNotifier->removeChangesListener(
this );
1073 return SdrPathSegmentKind::Line;
1104 return SdrPathSmoothKind::Angular;
1111 if(SdrPathSmoothKind::Angular == eKind)
1115 else if(SdrPathSmoothKind::Asymmetric == eKind)
1119 else if(SdrPathSmoothKind::Symmetric == eKind)
1150 return SdrObjClosedKind::Open;
1176 return Any( Reference< XChangesListener >(
this ) );
1178 return Any( Reference< XEventListener >(
this ) );
1180 return Any( Reference< XInterface >(
this ) );
virtual bool BegDragObj(const Point &rPnt, OutputDevice *pOut, SdrHdl *pHdl, short nMinMov=-3, SdrDragMethod *pForcedMeth=nullptr) override
virtual void MovAction(const Point &rPnt) override
const vcl::KeyCode & GetKeyCode() const
sal_uInt16 GetClicks() const
const Point & GetPosPixel() const
virtual void BrkAction() override
virtual void createSdrDragEntries()
virtual void createSdrDragEntries() override
bool EndDragObj(bool bCopy=false)
void MovDragObj(const Point &rPnt)
bool IsInsObjPointMode() const
void MoveTo(SdrHdlList &rOther)
size_t GetHdlCount() const
SdrMarkView * GetView() const
void AddHdl(std::unique_ptr< SdrHdl > pHdl)
SdrHdl * GetFocusHdl() const
SdrHdl * GetHdl(size_t nNum) const
void SetSelected(bool bJa=true)
SdrHdlKind GetKind() const
sal_uInt32 GetObjHdlNum() const
sal_uInt32 GetSourceHdlNum() const
void SetPos(const Point &rPnt)
sal_uInt32 GetPolyNum() const
void SetPlusHdl(bool bOn)
void SetObj(SdrObject *pNewObj)
const Point & GetPos() const
sal_uInt32 GetPointNum() const
void SetObjHdlNum(sal_uInt32 nNum)
void SetPolyNum(sal_uInt32 nNum)
void SetPointNum(sal_uInt32 nNum)
void SetSourceHdlNum(sal_uInt32 nNum)
void SetPageView(SdrPageView *pNewPV)
bool IsFrameDragSingles() const
SdrHdl * PickHandle(const Point &rPnt) const
const SdrHdlList & GetHdlList() const
bool MarkPointHelper(SdrHdl *pHdl, SdrMark *pMark, bool bUnmark)
bool IsPointMarkable(const SdrHdl &rHdl) const
SdrHdl * GetHdl(size_t nHdlNum) const
bool areMarkHandlesHidden() const
bool UnmarkPoint(SdrHdl &rHdl)
bool IsPointMarked(const SdrHdl &rHdl) const
bool IsPlusHandlesAlwaysVisible() const
void BroadcastObjectChange() const
virtual const tools::Rectangle & GetCurrentBoundRect() const
virtual void SetChanged()
virtual bool applySpecialDrag(SdrDragStat &rDrag)
sal_uInt32 PageWindowCount() const
void SetHasMarkedObj(bool bOn)
SdrPageWindow * GetPageWindow(sal_uInt32 nIndex) const
rtl::Reference< sdr::overlay::OverlayManager > const & GetOverlayManager() const
SdrPaintWindow & GetPaintWindow() const
const sdr::contact::ObjectContact & GetObjectContact() const
virtual void MakeVisible(const tools::Rectangle &rRect, vcl::Window &rWin)
SdrModel & getSdrModelFromSdrView() const
const SdrDragStat & GetDragStat() const
SdrPageView * GetSdrPageView() const
bool OutputToWindow() const
void SetPathPoly(const basegfx::B2DPolyPolygon &rPathPoly)
const basegfx::B2DPolyPolygon & GetPathPoly() const
void CheckPolyPossibilitiesHelper(SdrMark *pM, bool &b1stSmooth, bool &b1stSegm, bool &bCurve, bool &bSmoothFuz, bool &bSegmFuz, basegfx::B2VectorContinuity &eSmooth)
SdrPathSmoothKind GetMarkedPointsSmooth() const override
bool IsSetMarkedPointsSmoothPossible() const override
SdrPathSegmentKind GetMarkedSegmentsKind() const override
bool IsSetMarkedSegmentsKindPossible() const override
void SetSnapEnabled(bool bOn)
bool IsSnapEnabled() const
Point GetSnapPos(const Point &rPnt, const SdrPageView *pPV) const
void InvalidateAll(bool bWithMsg)
const SfxPoolItem * Execute(sal_uInt16 nSlot, SfxCallMode nCall=SfxCallMode::SLOT, const SfxPoolItem **pArgs=nullptr, sal_uInt16 nModi=0, const SfxPoolItem **pInternalArgs=nullptr)
SfxBindings & GetBindings()
SfxDispatcher * GetDispatcher()
constexpr tools::Long Height() const
constexpr tools::Long Width() const
B2DPolygon const & getB2DPolygon(sal_uInt32 nIndex) const
void transform(const basegfx::B2DHomMatrix &rMatrix)
void append(const basegfx::B2DPoint &rPoint, sal_uInt32 nCount)
void setClosed(bool bNew)
const_iterator find(const Value &x) const
const_iterator end() const
void updatePathFromMotionPathTag(const rtl::Reference< MotionPathTag > &xTag)
void remove(CustomAnimationEffectPtr const &pEffect)
virtual bool MarkPoints(const ::tools::Rectangle *pRect, bool bUnmark) override
virtual void DeleteMarkedPoints() override
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
CustomAnimationPane & mrPane
void updatePathAttributes()
virtual bool IsSetMarkedPointsSmoothPossible() const override
virtual bool KeyInput(const KeyEvent &rKEvt) override
returns true if the SmartTag consumes this event.
virtual void RipUpAtMarkedPoints() override
virtual ~MotionPathTag() override
CustomAnimationEffectPtr mpEffect
virtual void SAL_CALL changesOccurred(const css::util::ChangesEvent &Event) override
bool OnTabHandles(const KeyEvent &rKEvt)
::basegfx::B2DPolyPolygon mxPolyPoly
virtual SdrObjClosedKind GetMarkedObjectsClosedState() const override
virtual SdrPathSegmentKind GetMarkedSegmentsKind() const override
virtual void addCustomHandles(SdrHdlList &rHandlerList) override
rtl::Reference< SdrPathObj > mpPathObj
virtual void SetMarkedPointsSmooth(SdrPathSmoothKind eKind) override
virtual bool IsOpenCloseMarkedObjectsPossible() const override
css::uno::Reference< css::drawing::XShape > mxOrigin
bool OnMove(const KeyEvent &rKEvt)
virtual void SAL_CALL release() noexcept override
virtual sal_Int32 GetMarkedPointCount() const override
virtual SdrPathSmoothKind GetMarkedPointsSmooth() const override
css::awt::Point maOriginPos
bool OnMarkHandle(const KeyEvent &rKEvt)
virtual bool IsDeleteMarkedPointsPossible() const override
virtual sal_Int32 GetMarkablePointCount() const override
virtual bool MouseButtonDown(const MouseEvent &, SmartHdl &) override
returns true if the MotionPathTag handled the event.
virtual bool IsRipUpAtMarkedPointsPossible() const override
virtual bool IsSetMarkedSegmentsKindPossible() const override
virtual void SAL_CALL acquire() noexcept override
virtual bool MarkPoint(SdrHdl &rHdl, bool bUnmark) override
virtual void disposing() override
virtual void deselect() override
virtual void CheckPossibilities() override
virtual void SetMarkedSegmentsKind(SdrPathSegmentKind eKind) override
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &aType) override
virtual bool getContext(SdrViewContext &rContext) override
std::unique_ptr< SdrMark > mpMark
void MovePath(int nDX, int nDY)
void acquire()
@ATTENTION The results are undefined if, for any individual instance of SimpleReferenceComponent,...
a derivation from this handle is the visual representation for a smart tag.
const SmartTagReference & getTag() const
a smart tag represents a visual user interface element on the documents edit view that is not part of...
virtual void disposing() override
bool isSelected() const
returns true if this smart tag is currently selected
::sd::Window * GetActiveWindow() const
The active window is usually the mpContentWindow.
SD_DLLPUBLIC SfxViewFrame * GetViewFrame() const
ViewShell * GetViewShell() const
void SetResizeFreeAllowed(bool bSet)
void SetResizePropAllowed(bool bSet)
void SetMoveProtected(bool bSet)
void SetMoveAllowed(bool bSet)
virtual bool MarkPoint(SdrHdl &rHdl, bool bUnmark=false) override
SmartTagSet & getSmartTags()
void SetResizeProtected(bool bSet)
virtual void MarkListHasChanged() override
An SdWindow contains the actual working area of ViewShell.
const basegfx::B2DPolyPolygon & GetPolyPolygon() const
bool SetPointsSmooth(basegfx::B2VectorContinuity eFlags, const o3tl::sorted_vector< sal_uInt16 > &rAbsPoints)
bool DeletePoints(const o3tl::sorted_vector< sal_uInt16 > &rAbsPoints)
bool SetSegmentsKind(SdrPathSegmentKind eKind, const o3tl::sorted_vector< sal_uInt16 > &rAbsPoints)
sal_uInt16 GetCode() const
::OutputDevice const * GetOutDev() const
constexpr ::Color COL_GRAY(0x80, 0x80, 0x80)
#define DBG_ASSERT(sCon, aError)
constexpr sal_uInt16 KEY_ESCAPE
constexpr sal_uInt16 KEY_LEFT
constexpr sal_uInt16 KEY_TAB
constexpr sal_uInt16 KEY_UP
constexpr sal_uInt16 KEY_RIGHT
constexpr sal_uInt16 KEY_DELETE
constexpr sal_uInt16 KEY_DOWN
constexpr sal_uInt16 KEY_SPACE
B2DHomMatrix createTranslateB2DHomMatrix(double fTranslateX, double fTranslateY)
rtl::Reference< SmartTag > SmartTagReference
std::shared_ptr< CustomAnimationEffect > CustomAnimationEffectPtr
const sal_uInt32 SMART_TAG_HDL_NUM