27#include <svx/svxids.hrc>
60#include <LibreOfficeKit/LibreOfficeKitEnums.h>
73 :
FuDraw(pViewSh, pWin, pView, pDoc, rReq),
75 bSelectionChanged(false),
77 bSuppressChangesOfSelection(false),
79 nEditMode(SID_BEZIER_MOVE),
80 pWaterCanCandidate(nullptr)
83 ,bBeginInsertPoint(false),
85 ,bMovedToCenterPoint(false)
92 xFunc->DoExecute(rReq);
116 bool lcl_followHyperlinkAllowed(
const MouseEvent& rMEvt) {
129 bool bWaterCan =
SD_MOD()->GetWaterCan();
134 const bool bSelectionOnly = rMEvt.
IsRight();
173 nAngle0 -= 27000_deg100;
191 bool bTextEdit =
false;
201 if (!bTextEdit && eHit == SdrHitKind::UrlField && !rMEvt.
IsMod2() && !lcl_followHyperlinkAllowed(rMEvt))
208 bPreventModify =
false;
249 else if ( bTextEdit )
254 (nSdrObjKind == SdrObjKind::Text ||
255 nSdrObjKind == SdrObjKind::TitleText ||
256 nSdrObjKind == SdrObjKind::OutlineText ||
265 ExecuteList(SID_TEXTEDIT,
266 SfxCallMode::SYNCHRON | SfxCallMode::RECORD,
272 aVEvt.
meEvent == SdrEventKind::ExecuteUrl )
287 if (!lcl_followHyperlinkAllowed(rMEvt))
300 SfxCallMode::ASYNCHRON | SfxCallMode::RECORD,
301 { &aStrItem, &aBrowseItem, &aReferer });
308 SfxCallMode::ASYNCHRON | SfxCallMode::RECORD,
309 { &aStrItem, &aFrameItem, &aBrowseItem, &aReferer });
324 if (lcl_followHyperlinkAllowed(rMEvt))
329 && (
dynamic_cast<const SdrObjGroup*
>(pObj) !=
nullptr
336 SdrSearchOptions::ALSOONMASTER
337 | SdrSearchOptions::DEEP);
338 if (pObj && lcl_followHyperlinkAllowed(rMEvt))
380 bool bDeactivateOLE =
false;
391 bDeactivateOLE =
true;
397 bool bMarked =
false;
399 if ( !rMEvt.
IsMod1() && !bDeactivateOLE)
407 bool bToggle =
false;
419 if( !bDeactivateOLE )
464 if (eHit == SdrHitKind::Handle && aVEvt.
mpHdl->
GetKind() == SdrHdlKind::BezierWeight)
472 else if (eHit == SdrHitKind::MarkedObject &&
nEditMode == SID_BEZIER_INSERT)
479 else if (eHit == SdrHitKind::MarkedObject && rMEvt.
IsMod1())
490 else if (eHit == SdrHitKind::MarkedObject && !rMEvt.
IsShift() && !rMEvt.
IsMod2())
498 else if (eHit == SdrHitKind::Handle)
545 if (!rMEvt.
IsShift() && !rMEvt.
IsMod2() && eHit == SdrHitKind::UnmarkedObject)
550 bool bMarked =
false;
565 (!rMEvt.
IsShift() || eHit == SdrHitKind::MarkedObject))
643 bool bReturn =
false;
647 const bool bSelectionOnly = rMEvt.
IsRight();
687 std::abs(aPnt.
X() -
aMDPos.
X()) < nDrgLog &&
688 std::abs(aPnt.
Y() -
aMDPos.
Y()) < nDrgLog)
716 if(
pHdl && !bWasDragged &&
nullptr != pSingleObj && pSingleObj->
isDiagram())
719 if(
nullptr != pDiagramFrameHdl)
729 if (
nSlotId == SID_OBJECT_SELECT
744 else if (
nSlotId == SID_OBJECT_ROTATE)
750 else if (
nSlotId == SID_CONVERT_TO_3D_LATHE)
758 else if (
pHdl->
GetKind() != SdrHdlKind::MirrorAxis &&
767 nAngle1 -= 27000_deg100;
769 bool bMirrorSide1 = nAngle1 < 18000_deg100;
786 && std::abs(aPnt.
X() -
aMDPos.
X()) < nDrgLog
787 && std::abs(aPnt.
Y() -
aMDPos.
Y()) < nDrgLog)
798 if(
SD_MOD()->GetWaterCan() )
812 if (pPool !=
nullptr)
858 if ( (
nSlotId != SID_OBJECT_SELECT && nMarkCount==0) ||
863 (
nSlotId==SID_CONVERT_TO_3D_LATHE && pSingleObj &&
909 if (std::abs(
aMDPos.
X() - aPos.
X()) < nDrgLog2 &&
910 std::abs(
aMDPos.
Y() - aPos.
Y()) < nDrgLog2 &&
916 if (eHit == SdrHitKind::NONE)
925 std::abs(aPnt.
X() -
aMDPos.
X()) < nDrgLog &&
926 std::abs(aPnt.
Y() -
aMDPos.
Y()) < nDrgLog)
948 bool bReturn =
false;
997 mpWindow->SetPointerPosPixel(ePoint);
1014 MouseEventModifiers::SIMPLEMOVE | MouseEventModifiers::DRAGMOVE,
1024 MouseEventModifiers::SIMPLEMOVE | MouseEventModifiers::ENTERWINDOW,
1057 case SID_OBJECT_ROTATE:
1059 eMode = SdrDragMode::Rotate;
1066 case SID_OBJECT_MIRROR:
1068 eMode = SdrDragMode::Mirror;
1075 case SID_OBJECT_CROP:
1077 eMode = SdrDragMode::Crop;
1084 case SID_OBJECT_TRANSPARENCE:
1086 eMode = SdrDragMode::Transparence;
1093 case SID_OBJECT_GRADIENT:
1095 eMode = SdrDragMode::Gradient;
1102 case SID_OBJECT_SHEAR:
1104 eMode = SdrDragMode::Shear;
1111 case SID_OBJECT_CROOK_ROTATE:
1113 eMode = SdrDragMode::Crook;
1123 case SID_OBJECT_CROOK_SLANT:
1125 eMode = SdrDragMode::Crook;
1135 case SID_OBJECT_CROOK_STRETCH:
1137 eMode = SdrDragMode::Crook;
1147 case SID_CONVERT_TO_3D_LATHE:
1149 eMode = SdrDragMode::Mirror;
1164 eMode = SdrDragMode::Move;
1172 if (
nSlotId != SID_OBJECT_ROTATE)
1227 bool bFilled =
false;
1236 bFilled = rFillStyle.GetValue() != drawing::FillStyle_NONE;
1241 const ::tools::Long n2HitLog = fHitLog * 2;
1242 Point aHitPosR(rPos);
1243 Point aHitPosL(rPos);
1244 Point aHitPosT(rPos);
1245 Point aHitPosB(rPos);
1252 if (!bClosed || !bFilled
1260 pVisiLayer,
false)))
1266 if (pIMapObj && !pIMapObj->
GetURL().isEmpty())
1277 SID_OPENDOC, SfxCallMode::ASYNCHRON | SfxCallMode::RECORD,
1278 { &aStrItem, &aFrameItem, &aBrowseItem, &aReferer });
1312 return mpView->
PickObj(rTestPoint, nHitLog, pPageView, SdrSearchOptions::PICKMARKABLE);
void End3DCreation(bool bUseDefaultValuesForMirrorAxes=false)
virtual bool BegDragObj(const Point &rPnt, OutputDevice *pOut, SdrHdl *pHdl, short nMinMov=-3, SdrDragMethod *pForcedMeth=nullptr) override
bool Is3DRotationCreationActive() const
void ResetCreationActive()
virtual void MovAction(const Point &rPnt) override
const OUString & GetURL() const
const vcl::KeyCode & GetKeyCode() const
MouseEventModifiers GetMode() const
sal_uInt16 GetModifier() const
sal_uInt16 GetClicks() const
sal_uInt16 GetButtons() const
const Point & GetPosPixel() const
constexpr tools::Long Y() const
tools::Long AdjustY(tools::Long nVertMove)
tools::Long AdjustX(tools::Long nHorzMove)
constexpr tools::Long X() const
SAL_DLLPRIVATE SfxItemPool & GetPool()
SfxStyleSheetBase * GetActualStyleSheet()
void SetEditMode(SdrViewEditMode eMode)
virtual bool IsAction() const override
virtual void BckAction() override
virtual void EndAction() override
void SetShiftPressed(bool bShiftPressed)
SdrDragMethod * GetDragMethod() const
bool EndDragObj(bool bCopy=false)
sal_Int32 GetDragThresholdPixels() const
bool IsDragWithCopy() const
void SetDragWithCopy(bool bOn)
bool IsInsObjPoint() const
void SetInsObjPointMode(bool bOn)
void MovInsObjPoint(const Point &rPnt)
bool BegInsObjPoint(const Point &rPnt, bool bNewObj)
bool EndInsObjPoint(SdrCreateCmd eCmd)
bool IsUndoEnabled() const
void AddUndo(std::unique_ptr< SdrUndoAction > pUndo)
bool IsDistortAllowed(bool bNoContortion=false) const
bool IsCrookAllowed(bool bNoContortion=false) const
void ForceMarkedToAnotherPage()
bool IsShearAllowed() const
bool IsRotateAllowed(bool b90Deg=false) const
SdrHdlKind GetKind() const
size_t GetMarkCount() const
SdrMark * GetMark(size_t nNum) const
void SetDragMode(SdrDragMode eMode)
bool IsFrameDragSingles() const
SdrHdl * PickHandle(const Point &rPnt) const
const Point & GetRef1() const
const SdrMarkList & GetMarkedObjectList() const
bool AreObjectsMarked() const
void BegMarkObj(const Point &rPnt, bool bUnmark=false)
bool BegMarkPoints(const Point &rPnt, bool bUnmark=false)
SdrObject * PickObj(const Point &rPnt, short nTol, SdrPageView *&rpPV, SdrSearchOptions nOptions, SdrObject **ppRootObj, bool *pbHitPassDirect=nullptr) const
SdrDragMode GetDragMode() const
void UnmarkAllObj(SdrPageView const *pPV=nullptr)
const tools::Rectangle & GetMarkedObjRect() const
bool IsMarkedHit(const Point &rPnt, short nTol=-2) const
bool MarkNextObj(bool bPrev=false)
bool UnmarkPoint(SdrHdl &rHdl)
bool MarkObj(const Point &rPnt, short nTol=-2, bool bToggle=false, bool bDeep=false)
bool IsPointMarked(const SdrHdl &rHdl) const
SdrObject * GetMarkedSdrObj() const
SdrUndoFactory & GetSdrUndoFactory() const
void BegMacroObj(const Point &rPnt, short nTol, SdrObject *pObj, SdrPageView *pPV, vcl::Window *pWin)
void SetStyleSheet(SfxStyleSheet *pNewStyleSheet, bool bDontRemoveHardAttr)
virtual SdrInventor GetObjInventor() const
bool IsEmptyPresObj() const
virtual SdrObjKind GetObjIdentifier() const
SdrPage * getSdrPageFromSdrObject() const
const SfxItemSet & GetMergedItemSet() const
const SdrLayerIDSet & GetVisibleLayers() const
bool IsObjMarkable(SdrObject const *pObj) const
SdrPage * GetPage() const
bool EnterGroup(SdrObject *pObj)
bool IsMasterPage() const
bool IsGroupEntered() const
SdrPageView * GetSdrPageView() const
sal_uInt16 getHitTolLog() const
bool IsCrookNoContortion() const
void SetCrookMode(SdrCrookMode eMode)
virtual std::unique_ptr< SdrUndoAction > CreateUndoAttrObject(SdrObject &rObject, bool bStyleSheet1=false, bool bSaveText=false)
virtual std::unique_ptr< SdrUndoAction > CreateUndoGeoObject(SdrObject &rObject)
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 SfxPoolItem * ExecuteList(sal_uInt16 nSlot, SfxCallMode nCall, std::initializer_list< SfxPoolItem const * > args, std::initializer_list< SfxPoolItem const * > internalargs=std::initializer_list< SfxPoolItem const * >())
bool IsObjectInPlaceActive() const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
const OUString & GetName() const
SfxMedium * GetMedium() const
css::uno::Reference< css::security::XCertificate > GetSignPDFCertificate() const
SfxViewShell * GetViewShell() const
SfxBindings & GetBindings()
SfxDispatcher * GetDispatcher()
virtual void libreOfficeKitViewCallback(int nType, const OString &pPayload) const override
SfxInPlaceClient * GetIPClient() const
static SvxIMapInfo * GetIMapInfo(const SdrObject *pObject)
static IMapObject * GetHitIMapObject(const SdrObject *pObj, const Point &rWinPoint, const OutputDevice *pCmpWnd=nullptr)
const OUString & GetURL() const
virtual void Start(bool bStartTimer=true) override
virtual SfxStyleSheetBasePool * GetStyleSheetPool() override
Base class of the stacked shells that provide graphical views to Draw and Impress documents and editi...
bool IsClickChangeRotation() const
Base class for all Draw specific functions.
virtual bool KeyInput(const KeyEvent &rKEvt) override
Process keyboard input.
virtual void Activate() override
activates the function
virtual bool MouseMove(const MouseEvent &rMEvt) override
virtual void DoubleClick(const MouseEvent &rMEvt)
Response of doubleclick.
virtual void ForcePointer(const MouseEvent *pMEvt=nullptr)
Toggle mouse-pointer.
virtual bool MouseButtonUp(const MouseEvent &rMEvt) override
virtual bool MouseButtonDown(const MouseEvent &rMEvt) override
VclPtr< ::sd::Window > mpWindow
Point aMDPos
position of MouseButtonDown
virtual void SelectionHasChanged()
void ForceScroll(const Point &aPixPos)
scroll when approached the border of the window; is called by MouseMove
Timer aDragTimer
for Drag&Drop
virtual void DoExecute(SfxRequest &rReq)
SdrObject * pWaterCanCandidate
This pointer stores a candidate for assigning a style in the water can mode between mouse button down...
virtual bool MouseButtonUp(const MouseEvent &rMEvt) override
virtual bool MouseMove(const MouseEvent &rMEvt) override
virtual void DoExecute(SfxRequest &rReq) override
SdrObject * pickObject(const Point &rTestPoint)
Find the object under the given test point without selecting it.
virtual void SelectionHasChanged() override
virtual ~FuSelection() override
virtual bool KeyInput(const KeyEvent &rKEvt) override
Process keyboard input.
virtual bool cancel() override
is called when the current function should be aborted.
virtual void ForcePointer(const MouseEvent *pMEvt=nullptr) override
Toggle mouse-pointer.
virtual bool MouseButtonDown(const MouseEvent &rMEvt) override
void SetEditMode(sal_uInt16 nMode)
Set current bezier edit mode.
FuSelection(ViewShell *pViewSh, ::sd::Window *pWin, ::sd::View *pView, SdDrawDocument *pDoc, SfxRequest &rReq)
bool HandleImageMapClick(const SdrObject *pObj, const Point &rPos)
Execute ImageMap interaction.
bool bSuppressChangesOfSelection
virtual void Activate() override
activates the function
static rtl::Reference< FuPoor > Create(ViewShell *pViewSh, ::sd::Window *pWin, ::sd::View *pView, SdDrawDocument *pDoc, SfxRequest &rReq)
std::shared_ptr< ToolBarManager > const & GetToolBarManager() const
Base class of the stacked shell hierarchy.
FrameView * GetFrameView()
SD_DLLPUBLIC ViewShellBase & GetViewShellBase() const
SD_DLLPUBLIC SfxViewFrame * GetViewFrame() const
bool IsPresObjSelected(bool bOnPage=true, bool bOnMasterPage=true, bool bCheckPresObjListOnly=false, bool bCheckLayoutOnly=false) const
Is a presentation object selected?
virtual bool HasMarkablePoints() const override
virtual bool MarkPoint(SdrHdl &rHdl, bool bUnmark=false) override
An SdWindow contains the actual working area of ViewShell.
static void clicked(const Point &rPnt)
sal_uInt16 GetCode() const
constexpr sal_uInt16 KEY_RETURN
constexpr sal_uInt16 KEY_ESCAPE
constexpr sal_uInt16 KEY_LEFT
constexpr sal_uInt16 KEY_UP
constexpr sal_uInt16 KEY_RIGHT
constexpr sal_uInt16 KEY_DOWN
constexpr sal_uInt16 KEY_SHIFT
bool IsOptionSet(EOption eOption)
SVXCORE_DLLPUBLIC SdrObject * SdrObjectPrimitiveHit(const SdrObject &rObject, const Point &rPnt, const basegfx::B2DVector &rHitTolerance, const SdrPageView &rSdrPageView, const SdrLayerIDSet *pVisiLayer, bool bTextOnly, drawinglayer::primitive2d::Primitive2DContainer *pHitContainer=nullptr)
const SvxURLField * mpURLField
SVXCORE_DLLPUBLIC E3dScene * DynCastE3dScene(SdrObject *)
SVXCORE_DLLPUBLIC Degree100 GetAngle(const Point &rPnt)
SVXCORE_DLLPUBLIC Degree100 NormAngle36000(Degree100 a)
constexpr TypedWhichId< XFillStyleItem > XATTR_FILLSTYLE(XATTR_FILL_FIRST)