20#include <com/sun/star/presentation/EffectNodeType.hpp>
30#include <osl/diagnose.h>
32#include <svx/svxids.hrc>
68 nEditMode(SID_BEZIER_MOVE),
84 if (pIsSticky && pIsSticky->
GetValue())
97 xFunc->DoExecute(rReq);
115 if (
nSlotId != SID_DRAW_FREELINE_NOFILL)
123 if (pTransparence && pTransparence->
GetValue() > 0)
127 if (pColor && !pColor->GetValue().isEmpty())
131 if (pWidth && pWidth->GetValue() > 0)
135 if (pShapeName && !pShapeName->GetValue().isEmpty())
148 if (eHit == SdrHitKind::Handle || rMEvt.
IsMod1())
157 if (aVEvt.
meEvent == SdrEventKind::BeginTextEdit)
160 aVEvt.
meEvent = SdrEventKind::BeginDragObj;
168 if (eHit == SdrHitKind::MarkedObject &&
nEditMode == SID_BEZIER_INSERT)
196 bool bReturn =
false;
197 bool bCreated =
false;
213 if (aVEvt.
meEvent == SdrEventKind::EndCreate)
229 bool bDeleted =
false;
236 std::shared_ptr< sd::MainSequence > pMainSequence( pPage->
getMainSequence() );
239 Sequence< Any > aTargets;
242 sal_Int32 nTCount = aTargets.getLength();
245 const Any* pTarget = aTargets.getConstArray();
246 double fDuration = 0.0;
247 *pTarget++ >>= fDuration;
253 case SID_DRAW_BEZIER_NOFILL:
254 sPresetId =
"libo-motionpath-curve";
256 case SID_DRAW_POLYGON_NOFILL:
257 sPresetId =
"libo-motionpath-polygon";
259 case SID_DRAW_FREELINE_NOFILL:
260 sPresetId =
"libo-motionpath-freeform-line";
270 pCreated->setNodeType( css::presentation::EffectNodeType::WITH_PREVIOUS );
295 case SID_DRAW_POLYGON_NOFILL:
296 case SID_DRAW_XPOLYGON_NOFILL:
298 eKind = SdrObjKind::PolyLine;
302 case SID_DRAW_POLYGON:
303 case SID_DRAW_XPOLYGON:
305 eKind = SdrObjKind::Polygon;
309 case SID_DRAW_BEZIER_NOFILL:
311 eKind = SdrObjKind::PathLine;
315 case SID_DRAW_BEZIER_FILL:
317 eKind = SdrObjKind::PathFill;
321 case SID_DRAW_FREELINE_NOFILL:
323 eKind = SdrObjKind::FreehandLine;
327 case SID_DRAW_FREELINE:
329 eKind = SdrObjKind::FreehandFill;
335 eKind = SdrObjKind::PathLine;
364Color strToColor(std::u16string_view sColor)
368 if (sColor == u
"COL_GRAY")
370 else if (sColor == u
"COL_GRAY3")
372 else if (sColor == u
"COL_GRAY7")
381 if (
nSlotId == SID_DRAW_FREELINE_NOFILL)
425 if(
auto pPathObj =
dynamic_cast< SdrPathObj *
>( pObj.get() ) )
431 case SID_DRAW_BEZIER_FILL:
433 const sal_Int32 nWdt(rRectangle.GetWidth() / 2);
434 const sal_Int32 nHgt(rRectangle.GetHeight() / 2);
440 case SID_DRAW_BEZIER_NOFILL:
446 const basegfx::B2DPoint aCenterBottom(rRectangle.Center().X(), rRectangle.Bottom());
461 case SID_DRAW_FREELINE:
462 case SID_DRAW_FREELINE_NOFILL:
478 if(SID_DRAW_FREELINE == nID)
490 case SID_DRAW_XPOLYGON:
491 case SID_DRAW_XPOLYGON_NOFILL:
502 if(SID_DRAW_XPOLYGON_NOFILL == nID)
514 case SID_DRAW_POLYGON:
515 case SID_DRAW_POLYGON_NOFILL:
518 const sal_Int32 nWdt(rRectangle.GetWidth());
519 const sal_Int32 nHgt(rRectangle.GetHeight());
522 aInnerPoly.
append(
basegfx::B2DPoint(rRectangle.Left() + (nWdt * 30) / 100, rRectangle.Top() + (nHgt * 70) / 100));
526 aInnerPoly.
append(
basegfx::B2DPoint(rRectangle.Left() + (nWdt * 80) / 100, rRectangle.Top() + (nHgt * 50) / 100));
527 aInnerPoly.
append(
basegfx::B2DPoint(rRectangle.Left() + (nWdt * 80) / 100, rRectangle.Top() + (nHgt * 75) / 100));
530 if(SID_DRAW_POLYGON_NOFILL == nID)
544 pPathObj->SetPathPoly(aPoly);
548 OSL_FAIL(
"Object is NO path object");
551 pObj->SetLogicRect(rRectangle);
sal_uInt16 GetValue() const
SAL_DLLPRIVATE SfxItemPool & GetPool()
std::shared_ptr< sd::MainSequence > const & getMainSequence()
returns a helper class to manipulate effects inside the main sequence
void SetEditMode(SdrViewEditMode eMode)
SdrInventor GetCurrentObjInventor() const
SdrObjKind GetCurrentObjIdentifier() const
void SetCurrentObj(SdrObjKind nIdent, SdrInventor nInvent=SdrInventor::Default)
SdrObject * GetCreateObj() const
bool IsInsObjPoint() const
bool BegInsObjPoint(const Point &rPnt, bool bNewObj)
bool EndInsObjPoint(SdrCreateCmd eCmd)
static rtl::Reference< SdrObject > MakeNewObject(SdrModel &rSdrModel, SdrInventor nInventor, SdrObjKind nObjIdentifier, const tools::Rectangle *pSnapRect=nullptr)
SdrObject * GetObj(size_t nNum) const
size_t GetObjCount() const
void SetMergedItemSet(const SfxItemSet &rSet, bool bClearAllItems=false)
SdrPage * getSdrPageFromSdrObject() const
virtual void SetName(const OUString &rStr, const bool bSetChanged=true)
SdrObjList * GetObjList() const
SdrModel & getSdrModelFromSdrView() const
SdrPageView * GetSdrPageView() const
void EnableExtendedMouseEventDispatcher(bool bOn)
virtual void DeleteMarked()
virtual bool MouseButtonUp(const MouseEvent &rMEvt, OutputDevice *pWin) override
SdrHitKind PickAnything(const MouseEvent &rMEvt, SdrMouseEventKind nMouseDownOrMoveOrUp, SdrViewEvent &rVEvt) const
void Invalidate(sal_uInt16 nId)
const SfxPoolItem * Execute(sal_uInt16 nSlot, SfxCallMode nCall=SfxCallMode::SLOT, const SfxPoolItem **pArgs=nullptr, sal_uInt16 nModi=0, const SfxPoolItem **pInternalArgs=nullptr)
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxItemSet * GetArgs() const
const T * GetArg(sal_uInt16 nSlotId) const
const css::uno::Any & GetValue() const
SfxBindings & GetBindings()
SfxDispatcher * GetDispatcher()
void append(const B2DPolygon &rPolygon, sal_uInt32 nCount=1)
void append(const basegfx::B2DPoint &rPoint, sal_uInt32 nCount)
void setClosed(bool bNew)
void appendBezierSegment(const basegfx::B2DPoint &rNextControlPoint, const basegfx::B2DPoint &rPrevControlPoint, const basegfx::B2DPoint &rPoint)
FuConstructBezierPolygon(ViewShell *pViewSh, ::sd::Window *pWin, ::sd::View *pView, SdDrawDocument *pDoc, SfxRequest &rReq)
virtual rtl::Reference< SdrObject > CreateDefaultObject(const sal_uInt16 nID, const ::tools::Rectangle &rRectangle) override
virtual void Deactivate() override
deactivates the function
virtual void Activate() override
activates the function
void DoExecute(SfxRequest &rReq) override
virtual void SelectionHasChanged() override
virtual bool MouseButtonUp(const MouseEvent &rMEvt) override
void SetAttributes(SfxItemSet &rAttr, SdrObject *pObj)
set attribute for the object to be created
sal_uInt16 mnTransparence
static rtl::Reference< FuPoor > Create(ViewShell *pViewSh, ::sd::Window *pWin, ::sd::View *pView, SdDrawDocument *pDoc, SfxRequest &rReq, bool bPermanent)
virtual bool MouseButtonDown(const MouseEvent &rMEvt) override
void SetEditMode(sal_uInt16 nMode)
Set current bezier edit mode.
virtual bool MouseButtonUp(const MouseEvent &rMEvt) override
virtual bool MouseButtonDown(const MouseEvent &rMEvt) override
virtual void Deactivate() override
deactivates the function
virtual void Activate() override
activates the function
void SetStyleSheet(SfxItemSet &rAttr, SdrObject *pObj)
set style sheet for the object to be created
bool IsIgnoreUnexpectedMouseButtonUp()
void SetPermanent(bool bSet)
virtual void ForcePointer(const MouseEvent *pMEvt=nullptr)
Toggle mouse-pointer.
VclPtr< ::sd::Window > mpWindow
Point aMDPos
position of MouseButtonDown
virtual void SelectionHasChanged()
virtual void DoExecute(SfxRequest &rReq)
std::shared_ptr< ToolBarManager > const & GetToolBarManager() const
Base class of the stacked shell hierarchy.
SD_DLLPUBLIC ViewShellBase & GetViewShellBase() const
SD_DLLPUBLIC SfxViewFrame * GetViewFrame() const
An SdWindow contains the actual working area of ViewShell.
constexpr ::Color COL_GRAY(0x80, 0x80, 0x80)
constexpr ::Color COL_GRAY3(0xCC, 0xCC, 0xCC)
constexpr ::Color COL_GRAY7(0x66, 0x66, 0x66)
constexpr ::Color COL_AUTO(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
B2DPolygon createPolygonFromEllipse(const B2DPoint &rCenter, double fRadiusX, double fRadiusY, sal_uInt32 nStartQuadrant=0)
std::shared_ptr< CustomAnimationEffect > CustomAnimationEffectPtr