22#include <svx/strings.hrc>
74 mbPrevNextMark(false),
90 if (xTargetOverlay.is())
95 xTargetOverlay->add(*pNew);
147 mbNoExtendedMouseDispatcher(false),
148 mbNoExtendedKeyDispatcher(false),
149 mbMasterPagePaintCaching(false)
186 if (bRet && pWin!=
nullptr) {
262 if (
pOut!=
nullptr) aPnt=
pOut->PixelToLogic(aPnt);
268 aPnt.
setX(-aPnt.
X());
284#define MODKEY_NoSnap bCtrl
285#define MODKEY_Ortho bShift
286#define MODKEY_Center bAlt
287#define MODKEY_AngleSnap bShift
288#define MODKEY_CopyDrag bCtrl
291#define MODKEY_PolyPoly bAlt
292#define MODKEY_MultiMark bShift
293#define MODKEY_Unmark bAlt
294#define MODKEY_ForceMark bCtrl
295#define MODKEY_DeepMark bAlt
296#define MODKEY_DeepBackw bShift
307 const Point aLocalLogicPosition(rLogicPos);
325 bool bHitPassDirect=
true;
326 sal_uInt16 nHlplIdx=0;
327 sal_uInt16 nGlueId=0;
328 if (bTextEditHit || bTextEditSel)
332 else if (pHdl!=
nullptr)
340 else if (bGluePointMode &&
PickGluePoint(aLocalLogicPosition,pObj,nGlueId,pPV))
350 sal_Int32 nX = 0, nY = 0;
351 switch( pTableObj->
CheckTableHit( aLocalLogicPosition, nX, nY ) )
371 sal_Int32 nX = 0, nY = 0;
399 bool bDeep=pObj!=pHitObj && pHitObj->
HasMacro();
405 if (pObjTmp==pObj) pObjTmp=
nullptr;
406 while (pObjTmp!=
nullptr)
414 if (pObjTmp==pObj) pObjTmp=
nullptr;
418 if (bDeep || bMid || bRoot)
421 aHitRec.
aPos=aLocalLogicPosition;
425 if (bDeep) bDeep=pHitObj->
IsMacroHit(aHitRec);
426 if (bMid ) bMid =pMidObj->
IsMacroHit(aHitRec);
428 if (bRoot || bMid || bDeep)
432 if (!bRoot) pObj=pMidObj;
433 if (!bRoot && !bMid) pObj=pHitObj;
442 if (pTextObj!=
nullptr && pTextObj->
HasText())
454 if (bTEHit && !aHitContainer.empty())
462 auto pBasePrimitive = xReference.get();
470 if (
nullptr != pTextHierarchyFieldPrimitive2D)
472 if (drawinglayer::primitive2d::FieldType::FIELD_TYPE_URL == pTextHierarchyFieldPrimitive2D->
getType())
486 aSvxURLField.
SetURL(pTextHierarchyFieldPrimitive2D->
getValue(
"URL"));
489 const OUString aFormat(pTextHierarchyFieldPrimitive2D->
getValue(
"SvxURLFormat"));
491 if (!aFormat.isEmpty())
513 if (bHitPassDirect &&
521 const GeoStat& rGeo = pTextObj->GetGeoStat();
524 pTextObj->TakeTextEditArea(
nullptr,
nullptr, &aBoundRect,
nullptr);
530 if( pTextObj && pTextObj->IsFontwork() )
534 bool bBoundRectHit(
false);
538 nTolerance =
pOut->PixelToLogic(
Size(2, 0)).Width();
541 if( (aLocalLogicPosition.
X() >= aBoundRect.
Left() - nTolerance && aLocalLogicPosition.
X() <= aBoundRect.
Left() + nTolerance)
542 || (aLocalLogicPosition.
X() >= aBoundRect.
Right() - nTolerance && aLocalLogicPosition.
X() <= aBoundRect.
Right() + nTolerance)
543 || (aLocalLogicPosition.
Y() >= aBoundRect.
Top() - nTolerance && aLocalLogicPosition.
Y() <= aBoundRect.
Top() + nTolerance)
544 || (aLocalLogicPosition.
Y() >= aBoundRect.
Bottom() - nTolerance && aLocalLogicPosition.
Y() <= aBoundRect.
Bottom() + nTolerance))
546 bBoundRectHit =
true;
549 if(!bBoundRectHit && aBoundRect.
Contains(aLocalLogicPosition))
620 else if (bMouseDown && bMouseLeft)
646 bool bMarked=bGlue || (bPoly && pHdl->
IsSelected());
755 OSL_FAIL(
"SdrView::PickAnything(): pRootObj->getParentSdrObjListFromSdrObject()!=pPV->GetObjList() !");
776 }
else if (bMouseUp) {
788#ifdef MODKEY_AngleSnap
791#ifdef MODKEY_CopyDrag
867 bUnmark=nCount1<nCount0;
953 if (bLeftDown && bAction)
955 else if (bLeftUp || (rVEvt.
mbIsAction && !bAction))
976 aHitRec.
aPos=
pOut->LogicToPixel(rMousePos);
989 return PointerStyle::TextVertical;
991 return PointerStyle::Text;
994 Point aPos(
pOut->LogicToPixel(rMousePos));
996 if (aPointer==PointerStyle::Arrow)
999 aPointer = PointerStyle::TextVertical;
1001 aPointer = PointerStyle::Text;
1019 return PointerStyle::Move;
1021 return PointerStyle::Arrow;
1024 return PointerStyle::MovePoint;
1027 return PointerStyle::Cross;
1029 return PointerStyle::RefHand;
1045 return PointerStyle::Arrow;
1049 return PointerStyle::MovePoint;
1058 return PointerStyle::TextVertical;
1060 return PointerStyle::Text;
1068 if (pHdl!=
nullptr || bMarkHit) {
1070 bool bCorner=pHdl!=
nullptr && pHdl->
IsCornerHdl();
1071 bool bVertex=pHdl!=
nullptr && pHdl->
IsVertexHdl();
1075 return PointerStyle::Move;
1080 return PointerStyle::NotAllowed;
1083 bool b3DObjSelected =
false;
1087 b3DObjSelected =
true;
1092 return PointerStyle::NotAllowed;
1094 return PointerStyle::Rotate;
1099 else return PointerStyle::RefHand;
1101 if (bVertex && !
IsShearAllowed())
return PointerStyle::NotAllowed;
1104 return PointerStyle::Move;
1108 if (bCorner || bVertex || bMov) {
1113 if (pH1!=
nullptr && pH2!=
nullptr) {
1115 b90=(aDif.
X()==0) || aDif.
Y()==0;
1116 b45=b90 || (std::abs(aDif.
X())==std::abs(aDif.
Y()));
1122 if (bNo)
return PointerStyle::NotAllowed;
1124 return PointerStyle::Mirror;
1126 return PointerStyle::Mirror;
1133 return PointerStyle::NotAllowed;
1135 return PointerStyle::RefHand;
1141 return PointerStyle::NotAllowed;
1143 return PointerStyle::RefHand;
1147 if (bCorner || bVertex || bMov) {
1149 return PointerStyle::Crook;
1156 return PointerStyle::Crop;
1160 if ((bCorner || bVertex) && !
IsResizeAllowed(
true))
return PointerStyle::NotAllowed;
1163 if (pHdl!=
nullptr)
return pHdl->
GetPointer();
1166 return PointerStyle::Move;
1170 return PointerStyle::Arrow;
1243 for (sal_Int32 nParaNum=0; nParaNum<aSel.
nEndPara; nParaNum++) {
1250 sal_uInt16 nParaLine = 0;
1256 bool bLastLine = (nParaLine == nParaLineCount - 1);
1257 if (nCol>nLen || (!bLastLine && nCol == nLen))
1270 aStr =
aStr.replaceFirst(
"%1", OUString::number(nPar + 1));
1271 aStr =
aStr.replaceFirst(
"%2", OUString::number(nLin + 1));
1272 aStr =
aStr.replaceFirst(
"%3", OUString::number(nCol + 1));
1296 else if(!
aName.isEmpty())
1304 aStr =
aStr.replaceAt(0, 1, OUString(
aStr[0]).toAsciiUpperCase());
1319 for(
size_t nMarkNum = 0; nMarkNum < nMarkCount && bPath; ++nMarkNum )
1329 bool bGraf =
true, bMedia =
true, bTable =
true;
1331 for(
size_t nMarkNum = 0; nMarkNum < nMarkCount && ( bGraf || bMedia ); ++nMarkNum )
1334 DBG_ASSERT( pMarkObj,
"SdrView::GetContext(), null pointer in mark list!" );
1339 if(
dynamic_cast<const SdrGrafObj*
>( pMarkObj) ==
nullptr )
1342 if(
dynamic_cast<const SdrMediaObj*
>( pMarkObj) ==
nullptr )
1368 bool bMarkAll =
true;
1447 if (bUnmark) bAddMark=
true;
1470 if (pHdl ==
nullptr)
1479 bool bWasNoSnap = rDragStat.
IsNoSnap();
1488 if (aObjectOrdNum != -1)
1500 if (bWasSnapEnabled)
1534 assert(pPageWindow &&
"SdrView::SetMasterPagePaintCaching: Corrupt SdrPageWindow list (!)");
1548 const char* pDebugName)
const
The transformation of a rectangle into a polygon, by using angle parameters from GeoStat.
Degree100 m_nRotationAngle
const vcl::KeyCode & GetKeyCode() const
MouseEventModifiers GetMode() const
sal_uInt16 GetModifier() const
sal_uInt16 GetClicks() const
sal_uInt16 GetButtons() const
const Point & GetPosPixel() const
bool IsEffectivelyVertical() const
void SetSelection(const ESelection &)
bool MouseButtonUp(const MouseEvent &)
ESelection GetSelection() const
bool MouseButtonDown(const MouseEvent &)
PointerStyle GetPointer(const Point &rPosPixel)
constexpr tools::Long Y() const
void setX(tools::Long nX)
constexpr tools::Long X() const
PointerStyle maCurrentCreatePointer
bool BegCreateObj(const Point &rPnt, OutputDevice *pOut=nullptr, short nMinMov=-3)
void GetAttributes(SfxItemSet &rTargetSet, bool bOnlyHardAttr) const
void SetCreate1stPointAsCenter(bool bOn)
SdrObjKind mnCurrentIdent
bool EndCreateObj(SdrCreateCmd eCmd)
virtual void MovAction(const Point &rPnt) override
virtual void BrkAction() override
SdrInventor mnCurrentInvent
virtual bool IsAction() const override
bool BegCreateCaptionObj(const Point &rPnt, const Size &rObjSiz, OutputDevice *pOut=nullptr, short nMinMov=-3)
rtl::Reference< SdrObject > mpCurrentCreate
virtual void BckAction() override
virtual void EndAction() override
virtual bool MouseMove(const MouseEvent &rMEvt, OutputDevice *pWin) override
handle mouse over effects for handles
void SetMouseDown(bool bDown)
void SetNoSnap(bool bOn=true)
bool EndDragObj(bool bCopy=false)
OUString maInsPointUndoStr
virtual bool BegDragObj(const Point &rPnt, OutputDevice *pOut, SdrHdl *pHdl, short nMinMov=-3, SdrDragMethod *pForcedMeth=nullptr)
bool IsOrthoDesired() const
bool IsDragWithCopy() const
bool IsInsGluePointMode() const
bool BegInsGluePoint(const Point &rPnt)
bool IsInsObjPointPossible() const
void SetDragWithCopy(bool bOn)
bool mbMarkedHitMovesAlways
bool IsInsertGluePoint() const
bool IsInsObjPoint() const
void SetResizeAtCenter(bool bOn)
bool BegInsObjPoint(const Point &rPnt, bool bNewObj)
bool IsInsGluePointPossible() const
void MovDragObj(const Point &rPnt)
bool IsInsObjPointMode() const
void SetCrookAtCenter(bool bOn)
bool EndInsObjPoint(SdrCreateCmd eCmd)
std::unique_ptr< SdrDragMethod > mpCurrentSdrDragMethod
SdrDropMarkerOverlay(const SdrView &rView, const SdrObject &rObject)
void ImplCreateOverlays(const SdrView &rView, const basegfx::B2DPolyPolygon &rLinePolyPolygon)
sdr::overlay::OverlayObjectList maObjects
bool IsResizeAllowed(bool bProp=false) const
bool IsMoveAllowed() const
void ForceMarkedObjToAnotherPage()
bool IsTransparenceAllowed() const
bool IsDistortAllowed(bool bNoContortion=false) const
bool IsCrookAllowed(bool bNoContortion=false) const
bool IsGradientAllowed() const
bool IsShearAllowed() const
bool IsRotateAllowed(bool b90Deg=false) const
bool IsMirrorAllowed(bool b45Deg=false, bool b90Deg=false) const
void DeleteMarkedGluePoints()
This class represents an embedded or linked bitmap graphic object.
SdrHdl * GetHdl(size_t nNum) const
SdrHdlKind GetKind() const
sal_uInt32 GetObjHdlNum() const
virtual PointerStyle GetPointer() const
SdrObject * GetObj() const
const Point & GetPos() const
bool IsSet(SdrLayerID a) const
size_t GetMarkCount() const
SdrMark * GetMark(size_t nNum) const
SdrHdl * PickHandle(const Point &rPnt) const
OUString ImpGetDescriptionString(TranslateId pStrCacheID, ImpGetDescriptionOptions nOpt=ImpGetDescriptionOptions::NONE) const
bool IsObjMarked(SdrObject const *pObj) const
bool IsMarkPoints() const
const SdrMarkList & GetMarkedObjectList() const
bool AreObjectsMarked() const
const tools::Rectangle & GetMarkedGluePointsRect() const
void SortMarkedObjects() const
void BegMarkObj(const Point &rPnt, bool bUnmark=false)
bool BegMarkGluePoints(const Point &rPnt, bool bUnmark=false)
bool BegMarkPoints(const Point &rPnt, bool bUnmark=false)
SdrObject * GetMarkedObjectByIndex(size_t nNum) const
const SdrHdlList & GetHdlList() const
bool HasMarkedGluePoints() const
SdrObject * PickObj(const Point &rPnt, short nTol, SdrPageView *&rpPV, SdrSearchOptions nOptions, SdrObject **ppRootObj, bool *pbHitPassDirect=nullptr) const
virtual bool HasMarkedPoints() const
bool IsMarkGluePoints() const
size_t GetMarkedObjectCount() const
const tools::Rectangle & GetMarkedPointsRect() const
virtual bool MarkPoint(SdrHdl &rHdl, bool bUnmark=false)
bool IsPointMarkable(const SdrHdl &rHdl) const
SdrHdl * GetGluePointHdl(const SdrObject *pObj, sal_uInt16 nId) const
void UnmarkAllObj(SdrPageView const *pPV=nullptr)
virtual bool HasMarkablePoints() const
void MarkAllObj(SdrPageView *pPV=nullptr)
SdrViewEditMode meEditMode
const tools::Rectangle & GetMarkedObjRect() const
bool UnmarkAllGluePoints()
bool IsCreateMode() const
bool IsFrameHandles() const
bool IsGluePointEditMode() const
bool MarkNextObj(bool bPrev=false)
bool MarkGluePoint(const SdrObject *pObj, sal_uInt16 nId, bool bUnmark)
bool MarkObj(const Point &rPnt, short nTol=-2, bool bToggle=false, bool bDeep=false)
bool PickGluePoint(const Point &rPnt, SdrObject *&rpObj, sal_uInt16 &rnId, SdrPageView *&rpPV) const
SdrObject * GetMarkedSdrObj() const
void Repeat(SfxRepeatTarget &)
bool IsTextEditInSelectionMode() const
std::unique_ptr< SdrOutliner > mpTextEditOutliner
VclPtr< vcl::Window > mpTextEditWin
OutlinerView * mpTextEditOutlinerView
virtual SdrEndTextEditKind SdrEndTextEdit(bool bDontDeleteReally=false)
virtual bool KeyInput(const KeyEvent &rKEvt, vcl::Window *pWin) override
const OutlinerView * GetTextEditOutlinerView() const
virtual bool MouseButtonUp(const MouseEvent &rMEvt, OutputDevice *pWin) override
rtl::Reference< sdr::SelectionController > mxLastSelectionController
virtual bool MouseButtonDown(const MouseEvent &rMEvt, OutputDevice *pWin) override
bool IsQuickTextEditMode() const
rtl::Reference< sdr::SelectionController > mxSelectionController
void BegMacroObj(const Point &rPnt, short nTol, SdrObject *pObj, SdrPageView *pPV, vcl::Window *pWin)
virtual bool Command(const CommandEvent &rCEvt, vcl::Window *pWin) override
bool IsTextEditHit(const Point &rHit) const
virtual bool IsTextEdit() const final override
virtual bool SdrBeginTextEdit(SdrObject *pObj, SdrPageView *pPV=nullptr, vcl::Window *pWin=nullptr, bool bIsNewObj=false, SdrOutliner *pGivenOutliner=nullptr, OutlinerView *pGivenOutlinerView=nullptr, bool bDontDeleteOutliner=false, bool bOnlyOneView=false, bool bGrabFocus=true)
const SdrPageView * pPageView
const SdrLayerIDSet * pVisiLayer
const OUString & getHyperlink() const
virtual basegfx::B2DPolyPolygon TakeXorPoly() const
The Xor-Polygon is required by the View to drag the object.
virtual SdrInventor GetObjInventor() const
virtual const tools::Rectangle & GetCurrentBoundRect() const
SdrObjList * getParentSdrObjListFromSdrObject() const
virtual const tools::Rectangle & GetSnapRect() const
virtual bool HasTextEdit() const
virtual SdrObjKind GetObjIdentifier() const
bool IsMacroHit(const SdrObjMacroHitRec &rRec) const
SdrObject * getParentSdrObjectFromSdrObject() const
virtual SdrLayerID GetLayer() const
virtual PointerStyle GetMacroPointer(const SdrObjMacroHitRec &rRec) const
virtual bool HasMacro() const
const SdrLayerIDSet & GetVisibleLayers() const
SdrObjList * GetObjList() const
Return current List.
sal_uInt32 PageWindowCount() const
void InvalidateAllWin()
Invalidates the Page's whole area.
const SdrHelpLineList & GetHelpLines() const
const SdrLayerIDSet & GetLockedLayers() const
SdrPageWindow * GetPageWindow(sal_uInt32 nIndex) const
void ResetObjectContact()
SdrPaintWindow * GetPaintWindow(sal_uInt32 nIndex) const
OutputDevice * GetFirstOutputDevice() const
void ConfigurationChanged(::utl::ConfigurationBroadcaster *, ConfigurationHints) override
VclPtr< OutputDevice > mpActualOutDev
sal_uInt32 PaintWindowCount() const
bool IsHlplVisible() const
Draw Help line of the Page or not.
const SdrDragStat & GetDragStat() const
SdrPageView * GetSdrPageView() const
SdrModel & GetModel() const
bool IsHlplFront() const
Draw Help line in front of the objects or behind them.
rtl::Reference< sdr::overlay::OverlayManager > const & GetOverlayManager() const
void DeleteMarkedPoints() override
PointerStyle GetDraggedHelpLinePointer() const
bool IsSetPageOrg() const
void SetSnapEnabled(bool bOn)
void SetAngleSnapEnabled(bool bOn)
bool IsSnapEnabled() const
bool PickHelpLine(const Point &rPnt, short nTol, const OutputDevice &rOut, sal_uInt16 &rnHelpLineNum, SdrPageView *&rpPV) const
bool BegDragHelpLine(sal_uInt16 nHelpLineNum, SdrPageView *pPV)
bool IsDragHelpLine() const
void SetActualWin(const OutputDevice *pWin)
virtual OutlinerParaObject * GetOutlinerParaObject() const override
virtual bool HasText() const override
virtual ~SdrView() override
virtual SdrViewContext GetContext() const
virtual bool MouseButtonDown(const MouseEvent &rMEvt, OutputDevice *pWin) override
SvtAccessibilityOptions maAccessibilityOptions
bool KeyInput(const KeyEvent &rKEvt, vcl::Window *pWin) override
SdrView(SdrModel &rSdrModel, OutputDevice *pOut=nullptr)
virtual void ConfigurationChanged(utl::ConfigurationBroadcaster *, ConfigurationHints) override
bool mbMasterPagePaintCaching
bool IsExtendedKeyInputDispatcherEnabled() const
virtual void DeleteMarked()
virtual void onAccessibilityOptionsChanged()
method is called whenever the global SvtAccessibilityOptions is changed
void SetMasterPagePaintCaching(bool bOn)
bool BegMark(const Point &rPnt, bool bAddMark, bool bUnmark)
bool IsExtendedMouseEventDispatcherEnabled() const
virtual bool MouseButtonUp(const MouseEvent &rMEvt, OutputDevice *pWin) override
SdrHitKind PickAnything(const MouseEvent &rMEvt, SdrMouseEventKind nMouseDownOrMoveOrUp, SdrViewEvent &rVEvt) const
virtual sdr::contact::ObjectContact * createViewSpecificObjectContact(SdrPageWindow &rPageWindow, const char *pDebugName) const
bool MoveShapeHandle(const sal_uInt32 handleNum, const Point &aEndPoint, const sal_Int32 aObjectOrdNum=-1)
PointerStyle GetPreferredPointer(const Point &rMousePos, const OutputDevice *pOut, sal_uInt16 nModifier=0, bool bLeftDown=false) const
bool DoMouseEvent(const SdrViewEvent &rVEvt)
const tools::Rectangle & GetMarkedRect() const
virtual bool MouseMove(const MouseEvent &rMEvt, OutputDevice *pWin) override
handle mouse over effects for handles
void GetAttributes(SfxItemSet &rTargetSet, bool bOnlyHardAttr=false) const
virtual bool Command(const CommandEvent &rCEvt, vcl::Window *pWin) override
void SetFormat(SvxURLFormat eFmt)
void SetTargetFrame(const OUString &rFrm)
void SetURL(const OUString &rURL)
void SetRepresentation(const OUString &rRep)
void append(const basegfx::B2DPoint &rPoint, sal_uInt32 nCount)
void setClosed(bool bNew)
OUString getValue(const OUString &rName) const
FieldType getType() const
void append(std::unique_ptr< OverlayObject > pOverlayObject)
TableHitKind CheckTableHit(const Point &rPos, sal_Int32 &rnX, sal_Int32 &rnY, const sal_uInt16 aTol=0) const
sal_uInt16 GetModifier() const
KeyFuncType GetFullFunction() const
sal_uInt16 GetFullCode() const
::OutputDevice const * GetOutDev() const
Point PixelToLogic(const Point &rDevicePt) const
Point GetPointerPosPixel()
virtual void SetPointer(PointerStyle)
Point ScreenToOutputPixel(const Point &rPos) const
#define DBG_ASSERT(sCon, aError)
OUString SvxResId(TranslateId aId)
#define PRIMITIVE2D_ID_TEXTHIERARCHYFIELDPRIMITIVE2D
constexpr sal_uInt16 KEY_MOD2
constexpr sal_uInt16 KEY_ESCAPE
constexpr sal_uInt16 KEY_MOD1
constexpr sal_uInt16 KEY_A
constexpr sal_uInt16 KEY_REPEAT
constexpr sal_uInt16 KEY_UNDO
constexpr sal_uInt16 KEY_DELETE
constexpr sal_uInt16 KEY_SHIFT
constexpr sal_uInt16 KEY_BACKSPACE
#define SAL_INFO(area, stream)
rtl::Reference< sdr::SelectionController > CreateTableController(SdrView &rView, const SdrTableObj &rObj, const rtl::Reference< sdr::SelectionController > &xRefController)
SdrObject * SdrObjectPrimitiveHit(const SdrObject &rObject, const Point &rPnt, const basegfx::B2DVector &rHitTolerance, const SdrPageView &rSdrPageView, const SdrLayerIDSet *pVisiLayer, bool bTextOnly, drawinglayer::primitive2d::Primitive2DContainer *pHitContainer)
MouseEventModifiers mnMouseMode
const SvxURLField * mpURLField
E3dObject * DynCastE3dObject(SdrObject *pObj)
SdrTextObj * DynCastSdrTextObj(SdrObject *pObj)
@ Caption
connector object
constexpr OUStringLiteral STR_NOTHING