1*3334a7e6SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*3334a7e6SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*3334a7e6SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*3334a7e6SAndrew Rist * distributed with this work for additional information 6*3334a7e6SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*3334a7e6SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*3334a7e6SAndrew Rist * "License"); you may not use this file except in compliance 9*3334a7e6SAndrew Rist * with the License. You may obtain a copy of the License at 10*3334a7e6SAndrew Rist * 11*3334a7e6SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*3334a7e6SAndrew Rist * 13*3334a7e6SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*3334a7e6SAndrew Rist * software distributed under the License is distributed on an 15*3334a7e6SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*3334a7e6SAndrew Rist * KIND, either express or implied. See the License for the 17*3334a7e6SAndrew Rist * specific language governing permissions and limitations 18*3334a7e6SAndrew Rist * under the License. 19*3334a7e6SAndrew Rist * 20*3334a7e6SAndrew Rist *************************************************************/ 21*3334a7e6SAndrew Rist 22*3334a7e6SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef _SVDSNPV_HXX 25cdf0e10cSrcweir #define _SVDSNPV_HXX 26cdf0e10cSrcweir 27cdf0e10cSrcweir #include <svx/svdpntv.hxx> 28cdf0e10cSrcweir #include <svx/svdhlpln.hxx> 29cdf0e10cSrcweir #include "svx/svxdllapi.h" 30cdf0e10cSrcweir 31cdf0e10cSrcweir //************************************************************ 32cdf0e10cSrcweir // Defines 33cdf0e10cSrcweir //************************************************************ 34cdf0e10cSrcweir 35cdf0e10cSrcweir #define SDRSNAP_NOTSNAPPED 0x0000 36cdf0e10cSrcweir #define SDRSNAP_XSNAPPED 0x0001 37cdf0e10cSrcweir #define SDRSNAP_YSNAPPED 0x0002 38cdf0e10cSrcweir #define SDRSNAP_XYSNAPPED 0x0003 39cdf0e10cSrcweir 40cdf0e10cSrcweir // SDRCROOK_STRETCH ist noch nicht implementiert! 41cdf0e10cSrcweir enum SdrCrookMode { 42cdf0e10cSrcweir SDRCROOK_ROTATE, 43cdf0e10cSrcweir SDRCROOK_SLANT, 44cdf0e10cSrcweir SDRCROOK_STRETCH 45cdf0e10cSrcweir }; 46cdf0e10cSrcweir 47cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////////////////////////// 48cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////////////////////////// 49cdf0e10cSrcweir // 50cdf0e10cSrcweir // @@@@ @@ @@ @@@@ @@@@@ @@ @@ @@ @@@@@ @@ @@ 51cdf0e10cSrcweir // @@ @@ @@@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ 52cdf0e10cSrcweir // @@ @@@@@@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @ @@ 53cdf0e10cSrcweir // @@@@ @@@@@@ @@@@@@ @@@@@ @@@@@ @@ @@@@ @@@@@@@ 54cdf0e10cSrcweir // @@ @@ @@@ @@ @@ @@ @@@ @@ @@ @@@@@@@ 55cdf0e10cSrcweir // @@ @@ @@ @@ @@ @@ @@ @@@ @@ @@ @@@ @@@ 56cdf0e10cSrcweir // @@@@ @@ @@ @@ @@ @@ @ @@ @@@@@ @@ @@ 57cdf0e10cSrcweir // 58cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////////////////////////// 59cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////////////////////////// 60cdf0e10cSrcweir 61cdf0e10cSrcweir // #114409#-1 Migrate PageOrigin 62cdf0e10cSrcweir class ImplPageOriginOverlay; 63cdf0e10cSrcweir 64cdf0e10cSrcweir class SVX_DLLPUBLIC SdrSnapView: public SdrPaintView 65cdf0e10cSrcweir { 66cdf0e10cSrcweir protected: 67cdf0e10cSrcweir // #114409#-1 Migrate PageOrigin 68cdf0e10cSrcweir class ImplPageOriginOverlay* mpPageOriginOverlay; 69cdf0e10cSrcweir 70cdf0e10cSrcweir // #114409#-2 Migrate HelpLine 71cdf0e10cSrcweir class ImplHelpLineOverlay* mpHelpLineOverlay; 72cdf0e10cSrcweir 73cdf0e10cSrcweir Size aMagnSiz; 74cdf0e10cSrcweir Fraction aSnapWdtX; 75cdf0e10cSrcweir Fraction aSnapWdtY; 76cdf0e10cSrcweir 77cdf0e10cSrcweir sal_uInt16 nMagnSizPix; 78cdf0e10cSrcweir long nSnapAngle; 79cdf0e10cSrcweir long nEliminatePolyPointLimitAngle; 80cdf0e10cSrcweir 81cdf0e10cSrcweir SdrCrookMode eCrookMode; 82cdf0e10cSrcweir 83cdf0e10cSrcweir unsigned bSnapEnab : 1; 84cdf0e10cSrcweir unsigned bGridSnap : 1; 85cdf0e10cSrcweir unsigned bSnapTo1Pix : 1; // Wenn GridSnap aus, auf ein Pixel fangen um Werte wie 10.01 zu vermeiden 86cdf0e10cSrcweir unsigned bBordSnap : 1; 87cdf0e10cSrcweir unsigned bHlplSnap : 1; 88cdf0e10cSrcweir unsigned bOFrmSnap : 1; 89cdf0e10cSrcweir unsigned bOPntSnap : 1; 90cdf0e10cSrcweir unsigned bOConSnap : 1; 91cdf0e10cSrcweir unsigned bMoveMFrmSnap : 1; 92cdf0e10cSrcweir unsigned bMoveOFrmSnap : 1; 93cdf0e10cSrcweir unsigned bMoveOPntSnap : 1; 94cdf0e10cSrcweir unsigned bMoveOConSnap : 1; 95cdf0e10cSrcweir unsigned bMoveSnapOnlyTopLeft : 1; // Speacial fuer den Dialogeditor 96cdf0e10cSrcweir unsigned bOrtho : 1; 97cdf0e10cSrcweir unsigned bBigOrtho : 1; 98cdf0e10cSrcweir unsigned bAngleSnapEnab : 1; 99cdf0e10cSrcweir unsigned bMoveOnlyDragging : 1; // Objekte nur verschieben bei Resize/Rotate/... 100cdf0e10cSrcweir unsigned bSlantButShear : 1; // Slant anstelle von Shear anwenden 101cdf0e10cSrcweir unsigned bCrookNoContortion : 1; // Objekte bei Crook nicht verzerren 102cdf0e10cSrcweir unsigned bHlplFixed : 1; // sal_True=Hilfslinien fixiert, also nicht verschiebbar 103cdf0e10cSrcweir unsigned bEliminatePolyPoints : 1; 104cdf0e10cSrcweir 105cdf0e10cSrcweir private: 106cdf0e10cSrcweir SVX_DLLPRIVATE void ClearVars(); 107cdf0e10cSrcweir 108cdf0e10cSrcweir protected: 109cdf0e10cSrcweir // #i71538# make constructors of SdrView sub-components protected to avoid incomplete incarnations which may get casted to SdrView 110cdf0e10cSrcweir SdrSnapView(SdrModel* pModel1, OutputDevice* pOut = 0L); 111cdf0e10cSrcweir virtual ~SdrSnapView(); 112cdf0e10cSrcweir 113cdf0e10cSrcweir public: 114cdf0e10cSrcweir virtual sal_Bool IsAction() const; 115cdf0e10cSrcweir virtual void MovAction(const Point& rPnt); 116cdf0e10cSrcweir virtual void EndAction(); 117cdf0e10cSrcweir virtual void BckAction(); 118cdf0e10cSrcweir virtual void BrkAction(); // f.abg.Klassen Actions z,B, Draggen abbrechen. 119cdf0e10cSrcweir virtual void TakeActionRect(Rectangle& rRect) const; 120cdf0e10cSrcweir SetSnapGridWidth(const Fraction & rX,const Fraction & rY)121cdf0e10cSrcweir void SetSnapGridWidth(const Fraction& rX, const Fraction& rY) { aSnapWdtX=rX; aSnapWdtY=rY; } GetSnapGridWidthX() const122cdf0e10cSrcweir const Fraction& GetSnapGridWidthX() const { return aSnapWdtX; } GetSnapGridWidthY() const123cdf0e10cSrcweir const Fraction& GetSnapGridWidthY() const { return aSnapWdtY; } 124cdf0e10cSrcweir SetSnapMagnetic(const Size & rSiz)125cdf0e10cSrcweir void SetSnapMagnetic(const Size& rSiz) { if (rSiz!=aMagnSiz) { aMagnSiz=rSiz; } } GetSnapMagnetic() const126cdf0e10cSrcweir const Size& GetSnapMagnetic() const { return aMagnSiz; } SetSnapMagneticPixel(sal_uInt16 nPix)127cdf0e10cSrcweir void SetSnapMagneticPixel(sal_uInt16 nPix) { nMagnSizPix=nPix; } GetSnapMagneticPixel() const128cdf0e10cSrcweir sal_uInt16 GetSnapMagneticPixel() const { return nMagnSizPix; } 129cdf0e10cSrcweir 130cdf0e10cSrcweir // RecalcLogicSnapMagnetic muss bei jedem Wechsel des OutputDevices 131cdf0e10cSrcweir // sowie bei jedem Wechsel des MapModes gerufen werden! RecalcLogicSnapMagnetic(const OutputDevice & rOut)132cdf0e10cSrcweir void RecalcLogicSnapMagnetic(const OutputDevice& rOut) { SetSnapMagnetic(rOut.PixelToLogic(Size(nMagnSizPix,nMagnSizPix))); } SetActualWin(const OutputDevice * pWin)133cdf0e10cSrcweir void SetActualWin(const OutputDevice* pWin) { SdrPaintView::SetActualWin(pWin); if (pWin!=NULL) RecalcLogicSnapMagnetic(*pWin); } 134cdf0e10cSrcweir 135cdf0e10cSrcweir // Auf die View bezogene Koordinaten! 136cdf0e10cSrcweir // Rueckgabewerte sind SDRSNAP_NOTSNAPPED,SDRSNAP_XSNAPPED, 137cdf0e10cSrcweir // SDRSNAP_YSNAPPED oder SDRSNAP_XYSNAPPED 138cdf0e10cSrcweir sal_uInt16 SnapPos(Point& rPnt, const SdrPageView* pPV) const; 139cdf0e10cSrcweir Point GetSnapPos(const Point& rPnt, const SdrPageView* pPV) const; 140cdf0e10cSrcweir sal_uInt16 SnapRect(const Rectangle& rRect, const SdrPageView* pPV, long& rDX, long& rDY) const; 141cdf0e10cSrcweir void CheckSnap(const Point& rPt, const SdrPageView* pPV, long& nBestXSnap, long& nBestYSnap, bool& bXSnapped, bool& bYSnapped) const; 142cdf0e10cSrcweir 143cdf0e10cSrcweir // Alle Fangeinstellungen sind Persistent. IsSnapEnabled() const144cdf0e10cSrcweir sal_Bool IsSnapEnabled() const { return bSnapEnab; } IsGridSnap() const145cdf0e10cSrcweir sal_Bool IsGridSnap() const { return bGridSnap; } // Fang auf Rastergitter IsBordSnap() const146cdf0e10cSrcweir sal_Bool IsBordSnap() const { return bBordSnap; } // Fang auf Seitenraender IsHlplSnap() const147cdf0e10cSrcweir sal_Bool IsHlplSnap() const { return bHlplSnap; } // Fang auf Hilfslinien IsOFrmSnap() const148cdf0e10cSrcweir sal_Bool IsOFrmSnap() const { return bOFrmSnap; } // Fang auf LogFram von umgebenden Zeichenobjekten IsOPntSnap() const149cdf0e10cSrcweir sal_Bool IsOPntSnap() const { return bOPntSnap; } // Fang auf ausgepraegte Punkte von umgebenden Zeichenobjekten IsOConSnap() const150cdf0e10cSrcweir sal_Bool IsOConSnap() const { return bOConSnap; } // Fang auf Konnektoren der Zeichenobjekte SetSnapEnabled(sal_Bool bOn)151cdf0e10cSrcweir void SetSnapEnabled(sal_Bool bOn) { bSnapEnab=bOn; } SetGridSnap(sal_Bool bOn)152cdf0e10cSrcweir void SetGridSnap(sal_Bool bOn) { bGridSnap=bOn; } SetBordSnap(sal_Bool bOn)153cdf0e10cSrcweir void SetBordSnap(sal_Bool bOn) { bBordSnap=bOn; } SetHlplSnap(sal_Bool bOn)154cdf0e10cSrcweir void SetHlplSnap(sal_Bool bOn) { bHlplSnap=bOn; } SetOFrmSnap(sal_Bool bOn)155cdf0e10cSrcweir void SetOFrmSnap(sal_Bool bOn) { bOFrmSnap=bOn; } SetOPntSnap(sal_Bool bOn)156cdf0e10cSrcweir void SetOPntSnap(sal_Bool bOn) { bOPntSnap=bOn; } SetOConSnap(sal_Bool bOn)157cdf0e10cSrcweir void SetOConSnap(sal_Bool bOn) { bOConSnap=bOn; } 158cdf0e10cSrcweir 159cdf0e10cSrcweir // Normalerweise werden beim Move-Dragging von Zeichenobjekten alle 160cdf0e10cSrcweir // 4 Ecken des Object-SnapRects gefangen. Folgende Einstellmoeglichkeit, 161cdf0e10cSrcweir // wenn man nur auf die linke obere Ecke fangen will (z.B. DialogEditor): 162cdf0e10cSrcweir // Persistent, Default=FALSE. SetMoveSnapOnlyTopLeft(sal_Bool bOn)163cdf0e10cSrcweir void SetMoveSnapOnlyTopLeft(sal_Bool bOn) { bMoveSnapOnlyTopLeft=bOn; } IsMoveSnapOnlyTopLeft() const164cdf0e10cSrcweir sal_Bool IsMoveSnapOnlyTopLeft() const { return bMoveSnapOnlyTopLeft; } 165cdf0e10cSrcweir 166cdf0e10cSrcweir // Hilfslinien fixiert (nicht verschiebbar) 167cdf0e10cSrcweir // Persistent, Default=FALSE. IsHlplFixed() const168cdf0e10cSrcweir sal_Bool IsHlplFixed() const { return bHlplFixed; } SetHlplFixed(sal_Bool bOn)169cdf0e10cSrcweir void SetHlplFixed(sal_Bool bOn) { bHlplFixed=bOn; } 170cdf0e10cSrcweir IsMoveMFrmSnap() const171cdf0e10cSrcweir sal_Bool IsMoveMFrmSnap() const { return bMoveMFrmSnap; } // Fang des LogFram aller markierten Objekte IsMoveOFrmSnap() const172cdf0e10cSrcweir sal_Bool IsMoveOFrmSnap() const { return bMoveOFrmSnap; } // Fang aller LogFram der markierten Objekte IsMoveOPntSnap() const173cdf0e10cSrcweir sal_Bool IsMoveOPntSnap() const { return bMoveOPntSnap; } // Fang ausgepraegter Punkte der markierten Objekte IsMoveOConSnap() const174cdf0e10cSrcweir sal_Bool IsMoveOConSnap() const { return bMoveOConSnap; } // Fang der Konnektoren der markierten Objekte 175cdf0e10cSrcweir SetMoveMFrmSnap(sal_Bool bOn)176cdf0e10cSrcweir void SetMoveMFrmSnap(sal_Bool bOn) { bMoveMFrmSnap=bOn; } SetMoveOFrmSnap(sal_Bool bOn)177cdf0e10cSrcweir void SetMoveOFrmSnap(sal_Bool bOn) { bMoveOFrmSnap=bOn; } SetMoveOPntSnap(sal_Bool bOn)178cdf0e10cSrcweir void SetMoveOPntSnap(sal_Bool bOn) { bMoveOPntSnap=bOn; } SetMoveOConSnap(sal_Bool bOn)179cdf0e10cSrcweir void SetMoveOConSnap(sal_Bool bOn) { bMoveOConSnap=bOn; } 180cdf0e10cSrcweir 181cdf0e10cSrcweir // #114409#-1 Migrate PageOrigin 182cdf0e10cSrcweir sal_Bool BegSetPageOrg(const Point& rPnt); 183cdf0e10cSrcweir void MovSetPageOrg(const Point& rPnt); 184cdf0e10cSrcweir sal_Bool EndSetPageOrg(); 185cdf0e10cSrcweir void BrkSetPageOrg(); IsSetPageOrg() const186cdf0e10cSrcweir sal_Bool IsSetPageOrg() const { return (0L != mpPageOriginOverlay); } 187cdf0e10cSrcweir 188cdf0e10cSrcweir // HitTest. Bei sal_True steht in rnHelpLineNum die Nummer der Hilfslinie und in rpPV 189cdf0e10cSrcweir // die zugehoerige PageView. 190cdf0e10cSrcweir sal_Bool PickHelpLine(const Point& rPnt, short nTol, const OutputDevice& rOut, sal_uInt16& rnHelpLineNum, SdrPageView*& rpPV) const; 191cdf0e10cSrcweir 192cdf0e10cSrcweir // Verschieben einer vorhandenen Hilfslinie. nHelpLineNum und pPV von PickHelpLine verwenden. 193cdf0e10cSrcweir sal_Bool BegDragHelpLine(sal_uInt16 nHelpLineNum, SdrPageView* pPV); 194cdf0e10cSrcweir // Interaktives einfuegen einer neuen Hilfslinie 195cdf0e10cSrcweir sal_Bool BegDragHelpLine(const Point& rPnt, SdrHelpLineKind eNewKind); 196cdf0e10cSrcweir Pointer GetDraggedHelpLinePointer() const; 197cdf0e10cSrcweir 198cdf0e10cSrcweir // Aendern des Hilfslinientyps waerend des draggens 199cdf0e10cSrcweir // void SetDraggedHelpLineKind(SdrHelpLineKind eNewKind); 200cdf0e10cSrcweir void MovDragHelpLine(const Point& rPnt); 201cdf0e10cSrcweir sal_Bool EndDragHelpLine(); 202cdf0e10cSrcweir void BrkDragHelpLine(); IsDragHelpLine() const203cdf0e10cSrcweir sal_Bool IsDragHelpLine() const { return (0L != mpHelpLineOverlay); } 204cdf0e10cSrcweir 205cdf0e10cSrcweir // SnapAngle ist fuer Winkel im Kreis, RotateDragging, ... 206cdf0e10cSrcweir // Der Winkelfang wird unterdrueckt, wenn er mit 207cdf0e10cSrcweir // durch SetAngleSnapEnabled(sal_False) ausgeschaltet ist. 208cdf0e10cSrcweir // Der Winkelfang ist unabhaengig vom Koordinatenfang 209cdf0e10cSrcweir // und somit von der Einstellung IsSnapEnabled() 210cdf0e10cSrcweir // Es sollten nur Werte angegeben werden fuer die gilt: 211cdf0e10cSrcweir // 36000 modulu nWink = 0 212cdf0e10cSrcweir // Implementiert fuer: 213cdf0e10cSrcweir // - Rotate (Dragging) 214cdf0e10cSrcweir // - Shear (Dragging) 215cdf0e10cSrcweir // - Kreisbogen/-sektor/-abschnitt Winkel (Create und Dragging) 216cdf0e10cSrcweir // Persistent. SetAngleSnapEnabled(sal_Bool bOn)217cdf0e10cSrcweir void SetAngleSnapEnabled(sal_Bool bOn) { bAngleSnapEnab=bOn; } IsAngleSnapEnabled() const218cdf0e10cSrcweir sal_Bool IsAngleSnapEnabled() const { return bAngleSnapEnab; } SetSnapAngle(long nWink)219cdf0e10cSrcweir void SetSnapAngle(long nWink) { nSnapAngle=nWink; } GetSnapAngle() const220cdf0e10cSrcweir long GetSnapAngle() const { return nSnapAngle; } 221cdf0e10cSrcweir 222cdf0e10cSrcweir // Ortho hat je nach Kontext verschiedene Effekte: 223cdf0e10cSrcweir // - Create 224cdf0e10cSrcweir // - Linien werden nur im 45deg Raster zugelassen 225cdf0e10cSrcweir // - Statt Rechtecke werden Quadrate erzeugt 226cdf0e10cSrcweir // - Statt Ellipsen werden Kreise erzeugt 227cdf0e10cSrcweir // - Dragging 228cdf0e10cSrcweir // - allgemeines Dragging 229cdf0e10cSrcweir // - Move nur Hor, Vert oder 45deg 230cdf0e10cSrcweir // - Resize proportional 231cdf0e10cSrcweir // - Mirror: nichts 232cdf0e10cSrcweir // - Shear ohne Resize 233cdf0e10cSrcweir // - Crook ohne Resize 234cdf0e10cSrcweir // - verschieben der Handles 235cdf0e10cSrcweir // - Spiegelachse nur 45deg Raster 236cdf0e10cSrcweir // - Objekteigenes Dragging 237cdf0e10cSrcweir // - Rechteck Eckenradius: nichts 238cdf0e10cSrcweir // - Kreisobjekt Winkel: nichts 239cdf0e10cSrcweir // - Linie behaelt beim Draggen ihren Winkel bei und wird nur (ni) 240cdf0e10cSrcweir // verlaengert bzw. verkuerzt. 241cdf0e10cSrcweir // Defaultmaessig ist Ortho ausgeschaltet. Persistent. SetOrtho(sal_Bool bOn)242cdf0e10cSrcweir void SetOrtho(sal_Bool bOn) { bOrtho=bOn; } // unvollstaendig IsOrtho() const243cdf0e10cSrcweir sal_Bool IsOrtho() const { return bOrtho; } 244cdf0e10cSrcweir 245cdf0e10cSrcweir // BigOrtho hat nur Relevanz wenn Ortho eingeschaltet ist. 246cdf0e10cSrcweir // Beispiel: Ein Rechteck wird mit eingeschaltetem Ortho (also ein Quadrat) 247cdf0e10cSrcweir // erzeugt und die Maus wurde dabei vom Nullpunkt zu den Koordinaten 248cdf0e10cSrcweir // (80,30) gedraggt. Dann stuenden nun 2 Alternativen zur Bestimmung der 249cdf0e10cSrcweir // Kantenlaenge des Quadrats zur Wahl: 30 und 80. 250cdf0e10cSrcweir // Die normale Ortho-Funktuionalitaet brachte hierbei ein Quadrat mit 251cdf0e10cSrcweir // Kantenlaenge 30 (also immer die kleinere Groesse). Bei hinzugeschal- 252cdf0e10cSrcweir // tetem BigOrtho bekaeme man dagegen ein Quadrat der Kantenlaenge 80. 253cdf0e10cSrcweir // Gleiches gilt auch fuer Resize. 254cdf0e10cSrcweir // Defaultmaessig ist BigOrtho eingeschaltet. Persistent. SetBigOrtho(sal_Bool bOn)255cdf0e10cSrcweir void SetBigOrtho(sal_Bool bOn) { bBigOrtho=bOn; } IsBigOrtho() const256cdf0e10cSrcweir sal_Bool IsBigOrtho() const { return bBigOrtho; } 257cdf0e10cSrcweir 258cdf0e10cSrcweir // bei MoveOnlyDragging=sal_True wird bei Resize/Rotate/Shear/Mirror/Crook 259cdf0e10cSrcweir // nur das Zentrum der markierten Objekte transformiert. Groesse, Form 260cdf0e10cSrcweir // und Drehwinkel der Objekte bleiben erhalten, nur ihre Positionen 261cdf0e10cSrcweir // aendern sich. Persistent. Default=FALSE. (ni) SetMoveOnlyDragging(sal_Bool bOn)262cdf0e10cSrcweir void SetMoveOnlyDragging(sal_Bool bOn) { bMoveOnlyDragging=bOn; } IsMoveOnlyDragging() const263cdf0e10cSrcweir sal_Bool IsMoveOnlyDragging() const { return bMoveOnlyDragging; } 264cdf0e10cSrcweir 265cdf0e10cSrcweir // Slant anstelle von Shear anwenden. Persistent. Default=FALSE. SetSlantButShear(sal_Bool bOn)266cdf0e10cSrcweir void SetSlantButShear(sal_Bool bOn) { bSlantButShear=bOn; } IsSlantButShear() const267cdf0e10cSrcweir sal_Bool IsSlantButShear() const { return bSlantButShear; } 268cdf0e10cSrcweir 269cdf0e10cSrcweir // Objekte bei Crook nicht verzerren. Persistent. Default=FALSE. (ni) SetCrookNoContortion(sal_Bool bOn)270cdf0e10cSrcweir void SetCrookNoContortion(sal_Bool bOn) { bCrookNoContortion=bOn; } IsCrookNoContortion() const271cdf0e10cSrcweir sal_Bool IsCrookNoContortion() const { return bCrookNoContortion; } 272cdf0e10cSrcweir 273cdf0e10cSrcweir // Crook-Modus. Persistent. Default=SDRCROOK_ROTATE. (ni) SetCrookMode(SdrCrookMode eMode)274cdf0e10cSrcweir void SetCrookMode(SdrCrookMode eMode) { eCrookMode=eMode; } GetCrookMode() const275cdf0e10cSrcweir SdrCrookMode GetCrookMode() const { return eCrookMode; } 276cdf0e10cSrcweir 277cdf0e10cSrcweir // Special fuer IBM: Beim Draggen eines Polygonpunkts wird dieser 278cdf0e10cSrcweir // geloescht, wenn seine beiden angrenzenden Linien eh' fast eine 279cdf0e10cSrcweir // durchgehende Linie sind. SetEliminatePolyPoints(sal_Bool bOn)280cdf0e10cSrcweir void SetEliminatePolyPoints(sal_Bool bOn) { bEliminatePolyPoints=bOn; } IsEliminatePolyPoints() const281cdf0e10cSrcweir sal_Bool IsEliminatePolyPoints() const { return bEliminatePolyPoints; } SetEliminatePolyPointLimitAngle(long nAngle)282cdf0e10cSrcweir void SetEliminatePolyPointLimitAngle(long nAngle) { nEliminatePolyPointLimitAngle=nAngle; } GetEliminatePolyPointLimitAngle() const283cdf0e10cSrcweir long GetEliminatePolyPointLimitAngle() const { return nEliminatePolyPointLimitAngle; } 284cdf0e10cSrcweir }; 285cdf0e10cSrcweir 286cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////////////////////////// 287cdf0e10cSrcweir // 288cdf0e10cSrcweir // Begriffsdefinition: 289cdf0e10cSrcweir // - Etwas fangen=Gefangen werden kann z.B. der Mauszeiger oder die z.Zt. im 290cdf0e10cSrcweir // Drag befindlichen markierten Objekte. 291cdf0e10cSrcweir // - Auf etwas fangen=Man kann z.B. auf das Grid oder auf Hilfslinien fangen. 292cdf0e10cSrcweir // 293cdf0e10cSrcweir // Grundsaetzlich wird nur gefangen auf sichtbare Elemente (-> Border, 294cdf0e10cSrcweir // Hilfslinien, Konnektoren; Ausnahme: Grid). Ebenso koennen nur sichtbare 295cdf0e10cSrcweir // Elemente gefangen werden (->Konnektoren). 296cdf0e10cSrcweir // 297cdf0e10cSrcweir // Auf's Grid wird immer erst dann gefangen, wenn nix Anderes in der Naehe 298cdf0e10cSrcweir // (->Magnetic) ist. 299cdf0e10cSrcweir // 300cdf0e10cSrcweir // Der "Cursor" (also der Mauszeiger) beim Erzeugen von Objekten, beim Draggen 301cdf0e10cSrcweir // von Polygonpunkten, ... wird immer auf allen eingeschalteten Fangalternativen 302cdf0e10cSrcweir // gefangen (max 6). 303cdf0e10cSrcweir // 304cdf0e10cSrcweir // Beim Verschieben markierter Objekte ist das etwas anders. Statt des einen 305cdf0e10cSrcweir // Mauscursors gibt es hier 4 Alternativen an den markierten Objekten, die 306cdf0e10cSrcweir // gefangen werden koennen: 307cdf0e10cSrcweir // 1. die logisch-umschliessenden Rahmen der einzelnen Objekte 308cdf0e10cSrcweir // 2. der logisch-umschliessende Rahmen aller markierten Objekte 309cdf0e10cSrcweir // 3. ausgezeichnete Punkte der markierten Objekte (Polygonpunkte, ...) 310cdf0e10cSrcweir // 4. die Konnektoren der markierten Objekte 311cdf0e10cSrcweir // Da 1. und 2. einander ausschliessen (2. ist eine Verfeinerung von 1.) 312cdf0e10cSrcweir // bleiben 3 voneinander unabhaengige Alternativen. Bei 6. Moeglichkeiten auf 313cdf0e10cSrcweir // die gefangen werden kann kaeme man auf max. 18 Kombinationsmoeglichkeiten! 314cdf0e10cSrcweir // Deshalb werden folgende Vereinfachungen festgelegt: 315cdf0e10cSrcweir // 1. Konnektoren fangen sich nur auf Konnektoren. 316cdf0e10cSrcweir // Verbleiben also nun noch max. 2x5+1=11 Fangkombinationen beim MoveDrag: 317cdf0e10cSrcweir // 1-3. umschliessende(r) Rahmen auf Grid/Border/Hilfslinien 318cdf0e10cSrcweir // 4. umschliessende(r) Rahmen auf ausgezeichnete Objektpunkte 319cdf0e10cSrcweir // 5. umschliessende(r) Rahmen auf umschliessenden Rahmen 320cdf0e10cSrcweir // 6-8. ausgezeichnete Punkte auf Grid/Border/Hilfslinien 321cdf0e10cSrcweir // 7. ausgezeichnete Punkte auf ausgezeichnete Objektpunkte 322cdf0e10cSrcweir // 8-10. ausgezeichnete Punkte auf umschliessenden Rahmen 323cdf0e10cSrcweir // 11. Konnektoren auf Konnektoren 324cdf0e10cSrcweir // Beim MouseMove-Event im DragMove werden also diese bis zu max. 11 moeglichen 325cdf0e10cSrcweir // Alternativen durchgetestet und die mit dem gerigsten Korrekturaufwand 326cdf0e10cSrcweir // vollzogen. 327cdf0e10cSrcweir // 328cdf0e10cSrcweir // Beim Resize, ... wird immer nur der logisch-umschliessende Rahmen der 329cdf0e10cSrcweir // markierten Objekte gefangen. 330cdf0e10cSrcweir // 331cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////////////////////////// 332cdf0e10cSrcweir 333cdf0e10cSrcweir #endif //_SVDSNPV_HXX 334cdf0e10cSrcweir 335