13334a7e6SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 33334a7e6SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 43334a7e6SAndrew Rist * or more contributor license agreements. See the NOTICE file 53334a7e6SAndrew Rist * distributed with this work for additional information 63334a7e6SAndrew Rist * regarding copyright ownership. The ASF licenses this file 73334a7e6SAndrew Rist * to you under the Apache License, Version 2.0 (the 83334a7e6SAndrew Rist * "License"); you may not use this file except in compliance 93334a7e6SAndrew Rist * with the License. You may obtain a copy of the License at 103334a7e6SAndrew Rist * 113334a7e6SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 123334a7e6SAndrew Rist * 133334a7e6SAndrew Rist * Unless required by applicable law or agreed to in writing, 143334a7e6SAndrew Rist * software distributed under the License is distributed on an 153334a7e6SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 163334a7e6SAndrew Rist * KIND, either express or implied. See the License for the 173334a7e6SAndrew Rist * specific language governing permissions and limitations 183334a7e6SAndrew Rist * under the License. 193334a7e6SAndrew Rist * 203334a7e6SAndrew Rist *************************************************************/ 213334a7e6SAndrew Rist 223334a7e6SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef _SVDEDTV_HXX 25cdf0e10cSrcweir #define _SVDEDTV_HXX 26cdf0e10cSrcweir 27cdf0e10cSrcweir #include <svx/svdmrkv.hxx> 28cdf0e10cSrcweir #include <svx/xpoly.hxx> 29cdf0e10cSrcweir #include <svx/svdmodel.hxx> 30cdf0e10cSrcweir #include "svx/svxdllapi.h" 31cdf0e10cSrcweir 32cdf0e10cSrcweir //************************************************************ 33cdf0e10cSrcweir // Vorausdeklarationen 34cdf0e10cSrcweir //************************************************************ 35cdf0e10cSrcweir 36cdf0e10cSrcweir class SfxUndoAction; 37cdf0e10cSrcweir class SdrUndoAction; 38cdf0e10cSrcweir class SdrUndoGroup; 39cdf0e10cSrcweir class SfxStyleSheet; 40cdf0e10cSrcweir class SdrLayer; 41cdf0e10cSrcweir class SvdProgressInfo; 42cdf0e10cSrcweir 43cdf0e10cSrcweir //************************************************************ 44cdf0e10cSrcweir // Defines 45cdf0e10cSrcweir //************************************************************ 46cdf0e10cSrcweir 47cdf0e10cSrcweir enum SdrHorAlign { 48cdf0e10cSrcweir SDRHALIGN_NONE, 49cdf0e10cSrcweir SDRHALIGN_LEFT, 50cdf0e10cSrcweir SDRHALIGN_RIGHT, 51cdf0e10cSrcweir SDRHALIGN_CENTER 52cdf0e10cSrcweir }; 53cdf0e10cSrcweir 54cdf0e10cSrcweir enum SdrVertAlign { 55cdf0e10cSrcweir SDRVALIGN_NONE, 56cdf0e10cSrcweir SDRVALIGN_TOP, 57cdf0e10cSrcweir SDRVALIGN_BOTTOM, 58cdf0e10cSrcweir SDRVALIGN_CENTER 59cdf0e10cSrcweir }; 60cdf0e10cSrcweir 61cdf0e10cSrcweir enum SdrMergeMode { 62cdf0e10cSrcweir SDR_MERGE_MERGE, 63cdf0e10cSrcweir SDR_MERGE_SUBSTRACT, 64cdf0e10cSrcweir SDR_MERGE_INTERSECT 65cdf0e10cSrcweir }; 66cdf0e10cSrcweir 67cdf0e10cSrcweir // Optionen fuer InsertObject() 68cdf0e10cSrcweir #define SDRINSERT_DONTMARK 0x0001 /* Obj wird nicht markiert (aktuelle Markierung bleibt bestehen) */ 69cdf0e10cSrcweir #define SDRINSERT_ADDMARK 0x0002 /* Das Obj wird zu einer ggf. bereits bestehenden Selektion hinzumarkiert */ 70cdf0e10cSrcweir #define SDRINSERT_SETDEFATTR 0x0004 /* Die aktuellen Attribute (+StyleSheet) werden dem Obj zugewiesen */ 71cdf0e10cSrcweir #define SDRINSERT_SETDEFLAYER 0x0008 /* Der aktuelle Layer wird dem Obj zugewiesen */ 72cdf0e10cSrcweir #define SDRINSERT_NOBROADCAST 0x0010 /* Einfuegen mit NbcInsertObject() fuer SolidDragging */ 73cdf0e10cSrcweir 74cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////////////////////////// 75cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////////////////////////// 76cdf0e10cSrcweir // 77cdf0e10cSrcweir // @@@@@ @@@@@ @@ @@@@@@ @@ @@ @@ @@@@@ @@ @@ 78cdf0e10cSrcweir // @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ 79cdf0e10cSrcweir // @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @ @@ 80cdf0e10cSrcweir // @@@@ @@ @@ @@ @@ @@@@@ @@ @@@@ @@@@@@@ 81cdf0e10cSrcweir // @@ @@ @@ @@ @@ @@@ @@ @@ @@@@@@@ 82cdf0e10cSrcweir // @@ @@ @@ @@ @@ @@@ @@ @@ @@@ @@@ 83cdf0e10cSrcweir // @@@@@ @@@@@ @@ @@ @ @@ @@@@@ @@ @@ 84cdf0e10cSrcweir // 85cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////////////////////////// 86cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////////////////////////// 87cdf0e10cSrcweir 88cdf0e10cSrcweir class SVX_DLLPUBLIC SdrEditView: public SdrMarkView 89cdf0e10cSrcweir { 90cdf0e10cSrcweir friend class SdrPageView; 91cdf0e10cSrcweir friend class SdrDragDistort; 92cdf0e10cSrcweir friend class SdrDragCrook; 93cdf0e10cSrcweir 94cdf0e10cSrcweir protected: 95cdf0e10cSrcweir 96cdf0e10cSrcweir // Die Transformationsnachfragen, etc. etwas cachen 97cdf0e10cSrcweir unsigned bPossibilitiesDirty : 1; 98cdf0e10cSrcweir unsigned bReadOnly : 1; 99cdf0e10cSrcweir unsigned bGroupPossible : 1; 100cdf0e10cSrcweir unsigned bUnGroupPossible : 1; 101cdf0e10cSrcweir unsigned bGrpEnterPossible : 1; 102cdf0e10cSrcweir unsigned bDeletePossible : 1; 103cdf0e10cSrcweir unsigned bToTopPossible : 1; 104cdf0e10cSrcweir unsigned bToBtmPossible : 1; 105cdf0e10cSrcweir unsigned bReverseOrderPossible : 1; 106cdf0e10cSrcweir unsigned bImportMtfPossible : 1; 107cdf0e10cSrcweir unsigned bCombinePossible : 1; 108cdf0e10cSrcweir unsigned bDismantlePossible : 1; 109cdf0e10cSrcweir unsigned bCombineNoPolyPolyPossible : 1; 110cdf0e10cSrcweir unsigned bDismantleMakeLinesPossible : 1; 111cdf0e10cSrcweir unsigned bOrthoDesiredOnMarked : 1; 112cdf0e10cSrcweir unsigned bMoreThanOneNotMovable : 1; // Es ist mehr als ein Objekt nicht verschiebbar 113cdf0e10cSrcweir unsigned bOneOrMoreMovable : 1; // Wenigstens 1 Obj verschiebbar 114cdf0e10cSrcweir unsigned bMoreThanOneNoMovRot : 1; // Es ist mehr als ein Objekt nicht verschieb- und drehbar (Crook) 115cdf0e10cSrcweir unsigned bContortionPossible : 1; // Alles Polygone (ggf. gruppiert) 116cdf0e10cSrcweir unsigned bAllPolys : 1; // Alles Polygone (nicht gruppiert) 117cdf0e10cSrcweir unsigned bOneOrMorePolys : 1; // Mindestens 1 Polygon (nicht gruppiert) 118cdf0e10cSrcweir unsigned bMoveAllowed : 1; 119cdf0e10cSrcweir unsigned bResizeFreeAllowed : 1; 120cdf0e10cSrcweir unsigned bResizePropAllowed : 1; 121cdf0e10cSrcweir unsigned bRotateFreeAllowed : 1; 122cdf0e10cSrcweir unsigned bRotate90Allowed : 1; 123cdf0e10cSrcweir unsigned bMirrorFreeAllowed : 1; 124cdf0e10cSrcweir unsigned bMirror45Allowed : 1; 125cdf0e10cSrcweir unsigned bMirror90Allowed : 1; 126cdf0e10cSrcweir unsigned bShearAllowed : 1; 127cdf0e10cSrcweir unsigned bEdgeRadiusAllowed : 1; 128cdf0e10cSrcweir unsigned bTransparenceAllowed : 1; 129cdf0e10cSrcweir unsigned bGradientAllowed : 1; 130cdf0e10cSrcweir unsigned bCanConvToPath : 1; 131cdf0e10cSrcweir unsigned bCanConvToPoly : 1; 132cdf0e10cSrcweir unsigned bCanConvToContour : 1; 133cdf0e10cSrcweir unsigned bCanConvToPathLineToArea : 1; 134cdf0e10cSrcweir unsigned bCanConvToPolyLineToArea : 1; 135cdf0e10cSrcweir unsigned bMoveProtect : 1; 136cdf0e10cSrcweir unsigned bResizeProtect : 1; 137cdf0e10cSrcweir // Z-Order von virtuellen Objekten zusammenhalten (Writer) 138cdf0e10cSrcweir unsigned bBundleVirtObj : 1; 139cdf0e10cSrcweir 140cdf0e10cSrcweir private: 141cdf0e10cSrcweir SVX_DLLPRIVATE void ImpClearVars(); 142cdf0e10cSrcweir SVX_DLLPRIVATE void ImpResetPossibilityFlags(); 143cdf0e10cSrcweir 144cdf0e10cSrcweir protected: 145cdf0e10cSrcweir void ImpBroadcastEdgesOfMarkedNodes(); 146cdf0e10cSrcweir 147cdf0e10cSrcweir // Konvertierung der markierten Objekte in Poly bzw. Bezier. 148cdf0e10cSrcweir void ImpConvertTo(sal_Bool bPath, sal_Bool bLineToArea); 149cdf0e10cSrcweir 150cdf0e10cSrcweir // Konvertiert ein Obj, wirft bei Erfolg das alte as seiner Liste und 151cdf0e10cSrcweir // fuegt das neue an dessen Position ein. Inkl Undo. Es wird weder ein 152cdf0e10cSrcweir // MarkEntry noch ein ModelChgBroadcast generiert. 153cdf0e10cSrcweir SdrObject* ImpConvertOneObj(SdrObject* pObj, sal_Bool bPath, sal_Bool bLineToArea); 154cdf0e10cSrcweir 155cdf0e10cSrcweir // Setzen der beiden Flags bToTopPossible und bToBtmPossible. 156cdf0e10cSrcweir // bToTopPossibleDirty und bToBtmPossibleDirty werden dabei gleichzeitig 157cdf0e10cSrcweir // zurueckgesetzt. 158cdf0e10cSrcweir void ImpCheckToTopBtmPossible(); 159cdf0e10cSrcweir 160cdf0e10cSrcweir // fuer den Writer werden virtuelle Objekte buendig zusammengehalten (Z-Order) 161cdf0e10cSrcweir void ImpBundleVirtObjOfMarkList(); 162cdf0e10cSrcweir 163cdf0e10cSrcweir // fuer CombineMarkedObjects und DismantleMarkedObjects 164cdf0e10cSrcweir void ImpCopyAttributes(const SdrObject* pSource, SdrObject* pDest) const; 165cdf0e10cSrcweir 166cdf0e10cSrcweir // fuer CombineMarkedObjects 167cdf0e10cSrcweir sal_Bool ImpCanConvertForCombine1(const SdrObject* pObj) const; 168cdf0e10cSrcweir sal_Bool ImpCanConvertForCombine(const SdrObject* pObj) const; 169cdf0e10cSrcweir basegfx::B2DPolyPolygon ImpGetPolyPolygon1(const SdrObject* pObj, sal_Bool bCombine) const; 170cdf0e10cSrcweir basegfx::B2DPolyPolygon ImpGetPolyPolygon(const SdrObject* pObj, sal_Bool bCombine) const; 171cdf0e10cSrcweir basegfx::B2DPolygon ImpCombineToSinglePolygon(const basegfx::B2DPolyPolygon& rPolyPolygon) const; 172cdf0e10cSrcweir 173cdf0e10cSrcweir // fuer DismantleMarkedObjects 174cdf0e10cSrcweir sal_Bool ImpCanDismantle(const basegfx::B2DPolyPolygon& rPpolyPpolygon, sal_Bool bMakeLines) const; 175cdf0e10cSrcweir sal_Bool ImpCanDismantle(const SdrObject* pObj, sal_Bool bMakeLines) const; 176cdf0e10cSrcweir void ImpDismantleOneObject(const SdrObject* pObj, SdrObjList& rOL, sal_uIntPtr& rPos, SdrPageView* pPV, sal_Bool bMakeLines); 177cdf0e10cSrcweir void ImpCrookObj(SdrObject* pO, const Point& rRef, const Point& rRad, SdrCrookMode eMode, 178cdf0e10cSrcweir sal_Bool bVertical, sal_Bool bNoContortion, sal_Bool bRotate, const Rectangle& rMarkRect); 179cdf0e10cSrcweir void ImpDistortObj(SdrObject* pO, const Rectangle& rRef, const XPolygon& rDistortedRect, sal_Bool bNoContortion); 180cdf0e10cSrcweir sal_Bool ImpDelLayerCheck(SdrObjList* pOL, SdrLayerID nDelID) const; 181cdf0e10cSrcweir void ImpDelLayerDelObjs(SdrObjList* pOL, SdrLayerID nDelID); 182cdf0e10cSrcweir 183cdf0e10cSrcweir // Entfernt alle Obj der MarkList aus ihren ObjLists inkl Undo. 184cdf0e10cSrcweir // Die Eintraege in rMark bleiben erhalten. 185cdf0e10cSrcweir void DeleteMarkedList(const SdrMarkList& rMark); // DeleteMarked -> DeleteMarkedList 186cdf0e10cSrcweir 187cdf0e10cSrcweir // Die Transformationsnachfragen etwas cachen 188cdf0e10cSrcweir //void ImpCheckMarkTransform() const; veraltet 189cdf0e10cSrcweir // Checken, was man so mit den markierten Objekten alles machen kann 190cdf0e10cSrcweir virtual void CheckPossibilities(); ForcePossibilities() const191cdf0e10cSrcweir void ForcePossibilities() const { if (bPossibilitiesDirty || bSomeObjChgdFlag) ((SdrEditView*)this)->CheckPossibilities(); } 192cdf0e10cSrcweir 193cdf0e10cSrcweir protected: 194cdf0e10cSrcweir // #i71538# make constructors of SdrView sub-components protected to avoid incomplete incarnations which may get casted to SdrView 195cdf0e10cSrcweir SdrEditView(SdrModel* pModel1, OutputDevice* pOut = 0L); 196cdf0e10cSrcweir virtual ~SdrEditView(); 197cdf0e10cSrcweir 198cdf0e10cSrcweir public: 199cdf0e10cSrcweir // Jeder Aufruf einer undofaehigen Methode an der View generiert eine 200cdf0e10cSrcweir // UndoAction. Moechte man mehrere 201cdf0e10cSrcweir // Methodenaufrufe zu einer UndoAction zusammenfassen, so kann man diese 202cdf0e10cSrcweir // mit BegUndo() / EndUndo() klammern (beliebig tief). Als Kommentar der 203cdf0e10cSrcweir // UndoAction wird der des ersten BegUndo(String) aller Klammerungen 204cdf0e10cSrcweir // verwendet. NotifyNewUndoAction() wird in diesem Fall erst beim letzten 205cdf0e10cSrcweir // EndUndo() gerufen. NotifyNewUndoAction() wird nicht gerufen bei einer 206cdf0e10cSrcweir // leeren Klammerung. BegUndo()207cdf0e10cSrcweir void BegUndo() { pMod->BegUndo(); } // Undo-Klammerung auf BegUndo(const String & rComment)208cdf0e10cSrcweir void BegUndo(const String& rComment) { pMod->BegUndo(rComment); } // Undo-Klammerung auf BegUndo(const String & rComment,const String & rObjDescr,SdrRepeatFunc eFunc=SDRREPFUNC_OBJ_NONE)209cdf0e10cSrcweir void BegUndo(const String& rComment, const String& rObjDescr, SdrRepeatFunc eFunc=SDRREPFUNC_OBJ_NONE) { pMod->BegUndo(rComment,rObjDescr,eFunc); } // Undo-Klammerung auf BegUndo(SdrUndoGroup * pUndoGrp)210cdf0e10cSrcweir void BegUndo(SdrUndoGroup* pUndoGrp) { pMod->BegUndo(pUndoGrp); } // Undo-Klammerung auf 211cdf0e10cSrcweir void EndUndo(); // Undo-Klammerung zu (inkl BroadcastEdges) AddUndo(SdrUndoAction * pUndo)212cdf0e10cSrcweir void AddUndo(SdrUndoAction* pUndo) { pMod->AddUndo(pUndo); } // Action hinzufuegen 213cdf0e10cSrcweir // nur nach dem 1. BegUndo oder vor dem letzten EndUndo: SetUndoComment(const String & rComment)214cdf0e10cSrcweir void SetUndoComment(const String& rComment) { pMod->SetUndoComment(rComment); } SetUndoComment(const String & rComment,const String & rObjDescr)215cdf0e10cSrcweir void SetUndoComment(const String& rComment, const String& rObjDescr) { pMod->SetUndoComment(rComment,rObjDescr); } 216cdf0e10cSrcweir bool IsUndoEnabled() const; 217cdf0e10cSrcweir 218cdf0e10cSrcweir std::vector< SdrUndoAction* > CreateConnectorUndo( SdrObject& rO ); 219cdf0e10cSrcweir void AddUndoActions( std::vector< SdrUndoAction* >& ); 220cdf0e10cSrcweir 221cdf0e10cSrcweir // Layerverwaltung. Mit Undo. 222cdf0e10cSrcweir SdrLayer* InsertNewLayer(const String& rName, sal_uInt16 nPos=0xFFFF); 223cdf0e10cSrcweir // Loeschen eines Layer inkl. aller darauf befindlichen Objekte 224cdf0e10cSrcweir void DeleteLayer(const String& rName); 225cdf0e10cSrcweir // Verschieben eines Layer (Layerreihenfolge aendern) 226cdf0e10cSrcweir void MoveLayer(const String& rName, sal_uInt16 nNewPos); 227cdf0e10cSrcweir 228cdf0e10cSrcweir // Markierte Objekte die ausserhalb ihrer Page liegen 229cdf0e10cSrcweir // werden ggf. einer anderen Page zugewiesen 230cdf0e10cSrcweir // z.Zt. noch ohne Undo!!! 231cdf0e10cSrcweir void ForceMarkedObjToAnotherPage(); ForceMarkedToAnotherPage()232cdf0e10cSrcweir void ForceMarkedToAnotherPage() { ForceMarkedObjToAnotherPage(); } 233cdf0e10cSrcweir IsReadOnly() const234cdf0e10cSrcweir sal_Bool IsReadOnly() const { ForcePossibilities(); return bReadOnly; } 235cdf0e10cSrcweir 236cdf0e10cSrcweir // Loeschen aller markierten Objekte 237cdf0e10cSrcweir void DeleteMarkedObj(); IsDeleteMarkedObjPossible() const238cdf0e10cSrcweir sal_Bool IsDeleteMarkedObjPossible() const { ForcePossibilities(); return bDeletePossible; } 239cdf0e10cSrcweir 240cdf0e10cSrcweir // Logisch- umschliessendes Rect aller markierten Objekte setzen. 241cdf0e10cSrcweir // Das das wirklich geschieht ist nicht garantiert, denn eine 242cdf0e10cSrcweir // waagerechte Linie hat z.B. immer eine Hoehe von 0. 243cdf0e10cSrcweir void SetMarkedObjRect(const Rectangle& rRect, sal_Bool bCopy=sal_False); 244cdf0e10cSrcweir void MoveMarkedObj(const Size& rSiz, bool bCopy=false); 245cdf0e10cSrcweir void ResizeMarkedObj(const Point& rRef, const Fraction& xFact, const Fraction& yFact, bool bCopy=false); 246*ee093554SAndre Fischer void ResizeMultMarkedObj(const Point& rRef, const Fraction& xFact, const Fraction& yFact, const bool bCopy, const bool bWdh, const bool bHgt); 247cdf0e10cSrcweir long GetMarkedObjRotate() const; 248cdf0e10cSrcweir void RotateMarkedObj(const Point& rRef, long nWink, bool bCopy=false); 249cdf0e10cSrcweir void MirrorMarkedObj(const Point& rRef1, const Point& rRef2, bool bCopy=false); 250cdf0e10cSrcweir void MirrorMarkedObjHorizontal(sal_Bool bCopy=sal_False); 251cdf0e10cSrcweir void MirrorMarkedObjVertical(sal_Bool bCopy=sal_False); 252cdf0e10cSrcweir long GetMarkedObjShear() const; 253cdf0e10cSrcweir void ShearMarkedObj(const Point& rRef, long nWink, bool bVShear=false, bool bCopy=false); 254cdf0e10cSrcweir void CrookMarkedObj(const Point& rRef, const Point& rRad, SdrCrookMode eMode, bool bVertical=false, bool bNoContortion=false, bool bCopy=false); 255cdf0e10cSrcweir void DistortMarkedObj(const Rectangle& rRef, const XPolygon& rDistortedRect, bool bNoContortion=false, bool bCopy=false); 256cdf0e10cSrcweir 257cdf0e10cSrcweir // Markierte Objekte kopieren und anstelle der alten markieren 258cdf0e10cSrcweir void CopyMarkedObj(); SetAllMarkedRect(const Rectangle & rRect,sal_Bool bCopy=sal_False)259cdf0e10cSrcweir void SetAllMarkedRect(const Rectangle& rRect, sal_Bool bCopy=sal_False) { SetMarkedObjRect(rRect,bCopy); } MoveAllMarked(const Size & rSiz,sal_Bool bCopy=sal_False)260cdf0e10cSrcweir void MoveAllMarked(const Size& rSiz, sal_Bool bCopy=sal_False) { MoveMarkedObj (rSiz,bCopy); } ResizeAllMarked(const Point & rRef,const Fraction & xFact,const Fraction & yFact,sal_Bool bCopy=sal_False)261cdf0e10cSrcweir void ResizeAllMarked(const Point& rRef, const Fraction& xFact, const Fraction& yFact, sal_Bool bCopy=sal_False) { ResizeMarkedObj (rRef,xFact,yFact,bCopy); } GetAllMarkedRotate() const262cdf0e10cSrcweir long GetAllMarkedRotate() const { return GetMarkedObjRotate(); } RotateAllMarked(const Point & rRef,long nWink,sal_Bool bCopy=sal_False)263cdf0e10cSrcweir void RotateAllMarked(const Point& rRef, long nWink, sal_Bool bCopy=sal_False) { RotateMarkedObj(rRef,nWink,bCopy); } MirrorAllMarked(const Point & rRef1,const Point & rRef2,sal_Bool bCopy=sal_False)264cdf0e10cSrcweir void MirrorAllMarked(const Point& rRef1, const Point& rRef2, sal_Bool bCopy=sal_False) { MirrorMarkedObj(rRef1,rRef2,bCopy); } MirrorAllMarkedHorizontal(sal_Bool bCopy=sal_False)265cdf0e10cSrcweir void MirrorAllMarkedHorizontal(sal_Bool bCopy=sal_False) { MirrorMarkedObjHorizontal(bCopy); } MirrorAllMarkedVertical(sal_Bool bCopy=sal_False)266cdf0e10cSrcweir void MirrorAllMarkedVertical(sal_Bool bCopy=sal_False) { MirrorMarkedObjVertical(bCopy); } GetAllMarkedShear() const267cdf0e10cSrcweir long GetAllMarkedShear() const { return GetMarkedObjShear(); } ShearAllMarked(const Point & rRef,long nWink,sal_Bool bVShear=sal_False,sal_Bool bCopy=sal_False)268cdf0e10cSrcweir void ShearAllMarked(const Point& rRef, long nWink, sal_Bool bVShear=sal_False, sal_Bool bCopy=sal_False) { ShearMarkedObj(rRef,nWink,bVShear,bCopy); } CrookAllMarked(const Point & rRef,const Point & rRad,SdrCrookMode eMode,sal_Bool bVertical=sal_False,sal_Bool bNoContortion=sal_False,sal_Bool bCopy=sal_False)269cdf0e10cSrcweir void CrookAllMarked(const Point& rRef, const Point& rRad, SdrCrookMode eMode, sal_Bool bVertical=sal_False, sal_Bool bNoContortion=sal_False, sal_Bool bCopy=sal_False) { CrookMarkedObj(rRef,rRad,eMode,bVertical,bNoContortion,bCopy); } CopyMarked()270cdf0e10cSrcweir void CopyMarked() { CopyMarkedObj(); } IsMoveAllowed() const271cdf0e10cSrcweir sal_Bool IsMoveAllowed() const { ForcePossibilities(); return bMoveAllowed && !bMoveProtect; } 272cdf0e10cSrcweir sal_Bool IsResizeAllowed(sal_Bool bProp=sal_False) const; 273cdf0e10cSrcweir sal_Bool IsRotateAllowed(sal_Bool b90Deg=sal_False) const; 274cdf0e10cSrcweir sal_Bool IsMirrorAllowed(sal_Bool b45Deg=sal_False, sal_Bool b90Deg=sal_False) const; 275cdf0e10cSrcweir sal_Bool IsTransparenceAllowed() const; 276cdf0e10cSrcweir sal_Bool IsGradientAllowed() const; 277cdf0e10cSrcweir sal_Bool IsShearAllowed() const; 278cdf0e10cSrcweir sal_Bool IsEdgeRadiusAllowed() const; 279cdf0e10cSrcweir sal_Bool IsCrookAllowed(sal_Bool bNoContortion=sal_False) const; 280cdf0e10cSrcweir sal_Bool IsDistortAllowed(sal_Bool bNoContortion=sal_False) const; 281cdf0e10cSrcweir 282cdf0e10cSrcweir // Vereinigen mehrerer Objekte zu einem PolyPolygon: 283cdf0e10cSrcweir // - Rechtecke/Kreise/Text... werden implizit gewandelt. 284cdf0e10cSrcweir // - Polylines werden automatisch geschlossen. 285cdf0e10cSrcweir // - Die Attribute und der Layer werden vom Ersten der markierten Objekte 286cdf0e10cSrcweir // uebernommen (also vom untersten der Z-Order). 287cdf0e10cSrcweir // - Gruppenobjekte werden miteinbezogen, wenn alle! Memberobjekte der 288cdf0e10cSrcweir // Gruppe wandelbar sind. Beinhaltet eine Gruppe also beispielsweise 289cdf0e10cSrcweir // eine Bitmap oder ein OLE-Objekt, wird die gesamte Gruppe nicht 290cdf0e10cSrcweir // beruecksichtigt. 291cdf0e10cSrcweir // bNoPolyPoly=TRUE: Alles wird zu einem einzigen Polygon zusammengefasst 292cdf0e10cSrcweir void CombineMarkedObjects(sal_Bool bNoPolyPoly = sal_True); 293cdf0e10cSrcweir 294cdf0e10cSrcweir // for combining multiple polygons, with direct support of the modes 295cdf0e10cSrcweir // SID_POLY_MERGE, SID_POLY_SUBSTRACT, SID_POLY_INTERSECT 296cdf0e10cSrcweir void MergeMarkedObjects(SdrMergeMode eMode); 297cdf0e10cSrcweir 298cdf0e10cSrcweir // for distribution dialog function 299cdf0e10cSrcweir void DistributeMarkedObjects(); 300cdf0e10cSrcweir 301cdf0e10cSrcweir // Markierte Polypolygonobjekte in Polygone zerlegen 302cdf0e10cSrcweir // Gruppenobjekte werden durchsucht und zerlegt, wenn es sich bei allen 303cdf0e10cSrcweir // Memberobjekten um PathObjs handelt. 304cdf0e10cSrcweir // bMakeLines=TRUE: alle Polygone werden in einzelne Linien bzw. 305cdf0e10cSrcweir // Beziersegmente zerlegt 306cdf0e10cSrcweir void DismantleMarkedObjects(sal_Bool bMakeLines=sal_False); 307cdf0e10cSrcweir sal_Bool IsCombinePossible(sal_Bool bNoPolyPoly=sal_False) const; 308cdf0e10cSrcweir sal_Bool IsDismantlePossible(sal_Bool bMakeLines=sal_False) const; 309cdf0e10cSrcweir 310cdf0e10cSrcweir // Ein neues bereits fertig konstruiertes Obj einfuegen. Das Obj gehoert 311cdf0e10cSrcweir // anschliessend dem Model. Nach dem Einfuegen wird das neue Objekt 312cdf0e10cSrcweir // markiert (wenn dies nicht via nOptions unterbunden wird). 313cdf0e10cSrcweir // U.U. wird das Obj jedoch nicht eingefuegt, sondern deleted, naemlich 314cdf0e10cSrcweir // wenn der Ziel-Layer gesperrt oder nicht sichtbar ist. In diesem Fall 315cdf0e10cSrcweir // returniert die Methode mit FALSE. 316cdf0e10cSrcweir // Die Methode generiert u.a. auch eine Undo-Action. 317cdf0e10cSrcweir sal_Bool InsertObjectAtView(SdrObject* pObj, SdrPageView& rPV, sal_uIntPtr nOptions=0); 318cdf0e10cSrcweir 319cdf0e10cSrcweir // Ein Zeichenobjekt durch ein neues ersetzen. *pNewObj gehoert 320cdf0e10cSrcweir // anschliessend mir, *pOldObj wandert ins Undo. 321cdf0e10cSrcweir // Sollte in jedem Fall mit einer Undo-Klammerung versehen werden, z.B.: 322cdf0e10cSrcweir // aStr+=" ersetzen"; 323cdf0e10cSrcweir // BegUndo(aStr); 324cdf0e10cSrcweir // ReplaceObject(...); 325cdf0e10cSrcweir // ... 326cdf0e10cSrcweir // EndUndo(); 327cdf0e10cSrcweir void ReplaceObjectAtView(SdrObject* pOldObj, SdrPageView& rPV, SdrObject* pNewObj, sal_Bool bMark=sal_True); 328cdf0e10cSrcweir 329cdf0e10cSrcweir void SetNotPersistAttrToMarked(const SfxItemSet& rAttr, sal_Bool bReplaceAll); 330cdf0e10cSrcweir void MergeNotPersistAttrFromMarked(SfxItemSet& rAttr, sal_Bool bOnlyHardAttr) const; 331cdf0e10cSrcweir void MergeAttrFromMarked(SfxItemSet& rAttr, sal_Bool bOnlyHardAttr) const; 332cdf0e10cSrcweir SfxItemSet GetAttrFromMarked(sal_Bool bOnlyHardAttr) const; 333cdf0e10cSrcweir void SetAttrToMarked(const SfxItemSet& rAttr, sal_Bool bReplaceAll); 334cdf0e10cSrcweir 335cdf0e10cSrcweir // Geometrische Attribute (Position, Groesse, Drehwinkel) 336cdf0e10cSrcweir // Bei der Position wird ein evtl. gesetzter PageOrigin beruecksichtigt. 337cdf0e10cSrcweir SfxItemSet GetGeoAttrFromMarked() const; 338cdf0e10cSrcweir void SetGeoAttrToMarked(const SfxItemSet& rAttr); 339cdf0e10cSrcweir 340cdf0e10cSrcweir // Returnt NULL wenn: 341cdf0e10cSrcweir // - Nix markiert, 342cdf0e10cSrcweir // - kein StyleSheet an den markierten Objekten gesetzt 343cdf0e10cSrcweir // - Bei Mehrfachselektion die markierten Objekte auf unterschiedliche 344cdf0e10cSrcweir // StyleSheets verweisen. 345cdf0e10cSrcweir SfxStyleSheet* GetStyleSheetFromMarked() const; 346cdf0e10cSrcweir 347cdf0e10cSrcweir // z.Zt. noch ohne Undo :( 348cdf0e10cSrcweir void SetStyleSheetToMarked(SfxStyleSheet* pStyleSheet, sal_Bool bDontRemoveHardAttr); 349cdf0e10cSrcweir 350cdf0e10cSrcweir /* new interface src537 */ 351cdf0e10cSrcweir sal_Bool GetAttributes(SfxItemSet& rTargetSet, sal_Bool bOnlyHardAttr) const; 352cdf0e10cSrcweir 353cdf0e10cSrcweir sal_Bool SetAttributes(const SfxItemSet& rSet, sal_Bool bReplaceAll); 354cdf0e10cSrcweir SfxStyleSheet* GetStyleSheet() const; // SfxStyleSheet* GetStyleSheet(sal_Bool& rOk) const; 355cdf0e10cSrcweir sal_Bool SetStyleSheet(SfxStyleSheet* pStyleSheet, sal_Bool bDontRemoveHardAttr); 356cdf0e10cSrcweir 357cdf0e10cSrcweir // Alle markierten Objekte zu einer Gruppe zusammenfassen. 358cdf0e10cSrcweir // Anschliessend wird die neue Gruppe markiert. Bei einer 359cdf0e10cSrcweir // seitenuebergreifenden Markierung wird eine Gruppe je Seite erzeugt. 360cdf0e10cSrcweir // Alle erzeugten Gruppen sind anschliessend markiert. 361cdf0e10cSrcweir // Ueber pUserGrp kann ein eigenes Gruppenobjekt vorgegeben werden. Dieses 362cdf0e10cSrcweir // wird jedoch nicht direkt verwendet, sondern via Clone kopiert. 363cdf0e10cSrcweir // Wird NULL uebergeben, macht sich die Methode SdrObjGroup-Instanzen. 364cdf0e10cSrcweir void GroupMarked(const SdrObject* pUserGrp=NULL); 365cdf0e10cSrcweir 366cdf0e10cSrcweir // Alle markierten Objektgruppen werden aufgeloesst (1 Level). 367cdf0e10cSrcweir // Anschliessend sind statt der Gruppenobjekte alle ehemaligen 368cdf0e10cSrcweir // Memberobjekte der aufgeloesten Gruppen markiert. Waren zum auch Objekte 369cdf0e10cSrcweir // markiert, die keine Gruppenobjekte sind, so bleiben diese weiterhin 370cdf0e10cSrcweir // zusaetzlich markiert. 371cdf0e10cSrcweir void UnGroupMarked(); 372cdf0e10cSrcweir IsGroupPossible() const373cdf0e10cSrcweir sal_Bool IsGroupPossible() const { ForcePossibilities(); return bGroupPossible; } IsUnGroupPossible() const374cdf0e10cSrcweir sal_Bool IsUnGroupPossible() const { ForcePossibilities(); return bUnGroupPossible; } IsGroupEnterPossible() const375cdf0e10cSrcweir sal_Bool IsGroupEnterPossible() const { ForcePossibilities(); return bGrpEnterPossible; } 376cdf0e10cSrcweir 377cdf0e10cSrcweir // Markierte Objekte in Polygone/Bezierkurven verwandeln. Die sal_Bool- 378cdf0e10cSrcweir // Funktionen returnen sal_True, wenn wenigstens eins der markierten 379cdf0e10cSrcweir // Objekte gewandelt werden kann. Memberobjekte von Gruppenobjekten 380cdf0e10cSrcweir // werden ebenfalls gewandelt. Naehere Beschreibung siehe SdrObj.HXX. IsConvertToPathObjPossible(sal_Bool bLineToArea) const381cdf0e10cSrcweir sal_Bool IsConvertToPathObjPossible(sal_Bool bLineToArea) const { ForcePossibilities(); return sal_Bool(bLineToArea ? bCanConvToPathLineToArea : bCanConvToPath); } IsConvertToPolyObjPossible(sal_Bool bLineToArea) const382cdf0e10cSrcweir sal_Bool IsConvertToPolyObjPossible(sal_Bool bLineToArea) const { ForcePossibilities(); return sal_Bool(bLineToArea ? bCanConvToPolyLineToArea : bCanConvToPoly); } IsConvertToContourPossible() const383cdf0e10cSrcweir sal_Bool IsConvertToContourPossible() const { ForcePossibilities(); return bCanConvToContour; } 384cdf0e10cSrcweir void ConvertMarkedToPathObj(sal_Bool bLineToArea); 385cdf0e10cSrcweir void ConvertMarkedToPolyObj(sal_Bool bLineToArea); 386cdf0e10cSrcweir 387cdf0e10cSrcweir // Alle markierten Objekte untereinander ausrichten. Normalerweise werden 388cdf0e10cSrcweir // das SnapRect der Obj verwendet. Ist bBoundRects=sal_True, werden stattdessen 389cdf0e10cSrcweir // die BoundRects ausgerichtet. 390cdf0e10cSrcweir void AlignMarkedObjects(SdrHorAlign eHor, SdrVertAlign eVert, sal_Bool bBoundRects=sal_False); 391cdf0e10cSrcweir sal_Bool IsAlignPossible() const; 392cdf0e10cSrcweir 393cdf0e10cSrcweir // Markierte Objekte etwas nach "oben" holen 394cdf0e10cSrcweir void MovMarkedToTop(); 395cdf0e10cSrcweir 396cdf0e10cSrcweir // Markierte Objekte etwas nach "unten" holen 397cdf0e10cSrcweir void MovMarkedToBtm(); 398cdf0e10cSrcweir 399cdf0e10cSrcweir // Markierte Objekte ganz nach "oben" stellen 400cdf0e10cSrcweir void PutMarkedToTop(); 401cdf0e10cSrcweir 402cdf0e10cSrcweir // Markierte Objekte ganz nach "unten" stellen 403cdf0e10cSrcweir void PutMarkedToBtm(); 404cdf0e10cSrcweir 405cdf0e10cSrcweir // Markierte direkt vor das uebergebene Objekt stellen 406cdf0e10cSrcweir // NULL -> wie PutMarkedToTop(); 407cdf0e10cSrcweir void PutMarkedInFrontOfObj(const SdrObject* pRefObj); 408cdf0e10cSrcweir 409cdf0e10cSrcweir // Markierte direkt hinter das uebergebene Objekt stellen 410cdf0e10cSrcweir // NULL -> wie PutMarkedToBtm(); 411cdf0e10cSrcweir void PutMarkedBehindObj(const SdrObject* pRefObj); 412cdf0e10cSrcweir 413cdf0e10cSrcweir // Z-Order der markierten Objekte vertauschen 414cdf0e10cSrcweir void ReverseOrderOfMarked(); 415cdf0e10cSrcweir 416cdf0e10cSrcweir // Feststellen, ob nach vorn/hinten stellen moeglich ist 417cdf0e10cSrcweir // GetMaxToTop/BtmObj() wird von diesen Methoden nur begrenzt 418cdf0e10cSrcweir // beruecksichtigt, d.h. es kann vorkommen dass IsToTopPossible() 419cdf0e10cSrcweir // sal_True liefert, MovMarkedToTop() jedoch nichts aendert (z.B. bei 420cdf0e10cSrcweir // Mehrfachselektion), weil eine von der abgeleiteten View ueber 421cdf0e10cSrcweir // GetMaxToTopObj() auferlegte Restriktion dies verhindert. IsToTopPossible() const422cdf0e10cSrcweir sal_Bool IsToTopPossible() const { ForcePossibilities(); return bToTopPossible; } IsToBtmPossible() const423cdf0e10cSrcweir sal_Bool IsToBtmPossible() const { ForcePossibilities(); return bToBtmPossible; } IsReverseOrderPossible() const424cdf0e10cSrcweir sal_Bool IsReverseOrderPossible() const { ForcePossibilities(); return bReverseOrderPossible; } 425cdf0e10cSrcweir 426cdf0e10cSrcweir // Ueber diese Methoden stellt die View fest, wie weit ein Objekt 427cdf0e10cSrcweir // nach vorn bzw. nach hinten gestellt werden darf (Z-Order). Das 428cdf0e10cSrcweir // zurueckgegebene Objekt wird dann nicht "ueberholt". Bei Rueckgabe 429cdf0e10cSrcweir // von NULL (Defaultverhalten) bestehen keine Restriktionen. 430cdf0e10cSrcweir virtual SdrObject* GetMaxToTopObj(SdrObject* pObj) const; 431cdf0e10cSrcweir virtual SdrObject* GetMaxToBtmObj(SdrObject* pObj) const; 432cdf0e10cSrcweir 433cdf0e10cSrcweir // Folgende Methode wird gerufen, wenn z.B. durch ToTop, ToBtm, ... die 434cdf0e10cSrcweir // Reihenfolgen der Objekte geaendert wurde. Der Aufruf erfolgt dann nach 435cdf0e10cSrcweir // jedem SdrObjList::SetObjectOrdNum(nOldPos,nNewPos); 436cdf0e10cSrcweir virtual void ObjOrderChanged(SdrObject* pObj, sal_uIntPtr nOldPos, sal_uIntPtr nNewPos); 437cdf0e10cSrcweir 438cdf0e10cSrcweir // Falls ein oder mehrere Objekte des Types SdrGrafObj oder SdrOle2Obj 439cdf0e10cSrcweir // markiert sind und diese in der Lage sind ein StarView-Metafile zu 440cdf0e10cSrcweir // liefern, konvertiert diese Methode das Metafile in Drawingobjekte. 441cdf0e10cSrcweir // Die SdrGrafObjs/SdrOle2Objs werden dann durch die neue Objekte ersetzt. 442cdf0e10cSrcweir void DoImportMarkedMtf(SvdProgressInfo *pProgrInfo=NULL); IsImportMtfPossible() const443cdf0e10cSrcweir sal_Bool IsImportMtfPossible() const { ForcePossibilities(); return bImportMtfPossible; } 444cdf0e10cSrcweir 445cdf0e10cSrcweir // Wird der Modus VirtualObjectBundling eingeschaltet, werden beim 446cdf0e10cSrcweir // ToTop/ToBtm virtuelle Objekte die dasselbe Objekt referenzieren 447cdf0e10cSrcweir // in ihrer Z-Order buendig zusammengehalten (Writer). 448cdf0e10cSrcweir // Defaulteinstellung ist sal_False=ausgeschaltet. SetVirtualObjectBundling(sal_Bool bOn)449cdf0e10cSrcweir void SetVirtualObjectBundling(sal_Bool bOn) { bBundleVirtObj=bOn; } IsVirtualObjectBundling() const450cdf0e10cSrcweir sal_Bool IsVirtualObjectBundling() const { return bBundleVirtObj; } 451cdf0e10cSrcweir 452cdf0e10cSrcweir // von der SdrMarkView ueberladen fuer den internen gebrauch 453cdf0e10cSrcweir virtual void MarkListHasChanged(); 454cdf0e10cSrcweir virtual void ModelHasChanged(); 455cdf0e10cSrcweir }; 456cdf0e10cSrcweir 457cdf0e10cSrcweir #endif //_SVDEDTV_HXX 458cdf0e10cSrcweir 459