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 10cdf0e10cSrcweir * 113334a7e6SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12cdf0e10cSrcweir * 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. 19cdf0e10cSrcweir * 203334a7e6SAndrew Rist *************************************************************/ 213334a7e6SAndrew Rist 223334a7e6SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef _SVDHDL_HXX 25cdf0e10cSrcweir #define _SVDHDL_HXX 26cdf0e10cSrcweir 27cdf0e10cSrcweir #include <tools/gen.hxx> 28cdf0e10cSrcweir 29cdf0e10cSrcweir #ifndef _POINTR_HXX //autogen 30cdf0e10cSrcweir #include <vcl/pointr.hxx> 31cdf0e10cSrcweir #endif 32cdf0e10cSrcweir #include <tools/contnr.hxx> 33cdf0e10cSrcweir 34cdf0e10cSrcweir #ifndef _SOLAR_HRC 35cdf0e10cSrcweir #include <svl/solar.hrc> 36cdf0e10cSrcweir #endif 37cdf0e10cSrcweir 38cdf0e10cSrcweir #include <svx/xpoly.hxx> 39cdf0e10cSrcweir #include <svx/svdoedge.hxx> 40cdf0e10cSrcweir #include <svx/sdr/overlay/overlayobjectlist.hxx> 41cdf0e10cSrcweir #include "svx/svxdllapi.h" 42cdf0e10cSrcweir 43cdf0e10cSrcweir #include <svx/xpoly.hxx> 44cdf0e10cSrcweir #include <svx/svdoedge.hxx> 452376739dSArmin Le Grand #include <basegfx/matrix/b2dhommatrix.hxx> 462376739dSArmin Le Grand #include <svx/sdgcpitm.hxx> 47cdf0e10cSrcweir 48cdf0e10cSrcweir class VirtualDevice; 49cdf0e10cSrcweir class OutputDevice; 50cdf0e10cSrcweir class Region; 51cdf0e10cSrcweir class Window; 52cdf0e10cSrcweir class SdrHdlList; 53cdf0e10cSrcweir class SdrMarkView; 54cdf0e10cSrcweir class SdrObject; 55cdf0e10cSrcweir class SdrPageView; 56cdf0e10cSrcweir class MouseEvent; 57cdf0e10cSrcweir 58cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////////////////////////// 59cdf0e10cSrcweir 60cdf0e10cSrcweir // Jedes Objekt muss in der Lage seine Handles zu erzeugen. Diese werden dann 61cdf0e10cSrcweir // bei einer Selektion abgeholt, bei der View angemeldet und sichtbar gemacht. 62cdf0e10cSrcweir // Wird ein Handle von der Maus beruehrt (IsHit()), so wird von der View der 63cdf0e10cSrcweir // entsprechende Mauszeiger vom Handle abgeholt und der App auf Anfrage zum 64cdf0e10cSrcweir // reinschalten uebergeben. 65cdf0e10cSrcweir // Handles wie z.B. der Rotationsmittelpunkt oder die Spiegelachse werden von 66cdf0e10cSrcweir // der View generiert, wenn vom Controller der entsprechende Transformations- 67cdf0e10cSrcweir // Modus selektiert wird. 68cdf0e10cSrcweir // HDL_MOVE...HDL_LWRGT muessen im enum immer zusammen stehen bleiben! 69cdf0e10cSrcweir 70cdf0e10cSrcweir enum SdrHdlKind 71cdf0e10cSrcweir { 72cdf0e10cSrcweir HDL_MOVE, // Handle zum Verschieben des Objekts 73cdf0e10cSrcweir HDL_UPLFT, // Oben links 74cdf0e10cSrcweir HDL_UPPER, // Oben 75cdf0e10cSrcweir HDL_UPRGT, // Oben rechts 76cdf0e10cSrcweir HDL_LEFT, // Links 77cdf0e10cSrcweir HDL_RIGHT, // Rechts 78cdf0e10cSrcweir HDL_LWLFT, // Unten links 79cdf0e10cSrcweir HDL_LOWER, // Unten 80cdf0e10cSrcweir HDL_LWRGT, // Unten rechts 81cdf0e10cSrcweir HDL_POLY, // Punktselektion an Polygon oder Bezierkurve 82cdf0e10cSrcweir HDL_BWGT, // Gewicht an einer Bezierkurve 83cdf0e10cSrcweir HDL_CIRC, // Winkel an Kreissegmenten, Eckenradius am Rect 84cdf0e10cSrcweir HDL_REF1, // Referenzpunkt 1, z.B. Rotationsmitte 85cdf0e10cSrcweir HDL_REF2, // Referenzpunkt 2, z.B. Endpunkt der Spiegelachse 86cdf0e10cSrcweir HDL_MIRX, // Die Spiegelachse selbst 87cdf0e10cSrcweir HDL_GLUE, // GluePoint 88cdf0e10cSrcweir HDL_ANCHOR, // anchor symbol (SD, SW) 89cdf0e10cSrcweir HDL_TRNS, // interactive transparence 90cdf0e10cSrcweir HDL_GRAD, // interactive gradient 91cdf0e10cSrcweir HDL_COLR, // interactive color 92cdf0e10cSrcweir HDL_USER, 93cdf0e10cSrcweir HDL_ANCHOR_TR, // #101688# Anchor handle with (0,0) at top right for SW 94cdf0e10cSrcweir 95cdf0e10cSrcweir // for SJ and the CustomShapeHandles: 96cdf0e10cSrcweir HDL_CUSTOMSHAPE1, 97cdf0e10cSrcweir 98cdf0e10cSrcweir HDL_SMARTTAG 99cdf0e10cSrcweir }; 100cdf0e10cSrcweir 101cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////////////////////////// 102cdf0e10cSrcweir 103cdf0e10cSrcweir enum BitmapColorIndex 104cdf0e10cSrcweir { 105cdf0e10cSrcweir LightGreen, 106cdf0e10cSrcweir Cyan, 107cdf0e10cSrcweir LightCyan, 108cdf0e10cSrcweir Red, 109cdf0e10cSrcweir LightRed, 110cdf0e10cSrcweir Yellow 111cdf0e10cSrcweir }; 112cdf0e10cSrcweir 113cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////////////////////////// 114cdf0e10cSrcweir 115cdf0e10cSrcweir enum BitmapMarkerKind 116cdf0e10cSrcweir { 117cdf0e10cSrcweir Rect_7x7, 118cdf0e10cSrcweir Rect_9x9, 119cdf0e10cSrcweir Rect_11x11, 120cdf0e10cSrcweir Rect_13x13, 121cdf0e10cSrcweir Circ_7x7, 122cdf0e10cSrcweir Circ_9x9, 123cdf0e10cSrcweir Circ_11x11, 124cdf0e10cSrcweir Elli_7x9, 125cdf0e10cSrcweir Elli_9x11, 126cdf0e10cSrcweir Elli_9x7, 127cdf0e10cSrcweir Elli_11x9, 128cdf0e10cSrcweir RectPlus_7x7, 129cdf0e10cSrcweir RectPlus_9x9, 130cdf0e10cSrcweir RectPlus_11x11, 131cdf0e10cSrcweir Crosshair, 132cdf0e10cSrcweir Glue, 133cdf0e10cSrcweir Anchor, 134cdf0e10cSrcweir 135cdf0e10cSrcweir // #98388# add AnchorPressed to be able to aninate anchor control, too. 136cdf0e10cSrcweir AnchorPressed, 137cdf0e10cSrcweir 138cdf0e10cSrcweir // #101688# AnchorTR for SW 139cdf0e10cSrcweir AnchorTR, 140cdf0e10cSrcweir AnchorPressedTR, 141cdf0e10cSrcweir 142cdf0e10cSrcweir // for SJ and the CustomShapeHandles: 1434772d9afSArmin Le Grand Customshape_7x7, 1444772d9afSArmin Le Grand Customshape_9x9, 1454772d9afSArmin Le Grand Customshape_11x11 146cdf0e10cSrcweir }; 147cdf0e10cSrcweir 148cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////////////////////////// 149cdf0e10cSrcweir 150cdf0e10cSrcweir class SVX_DLLPUBLIC SdrHdl 151cdf0e10cSrcweir { 152cdf0e10cSrcweir friend class SdrMarkView; // fuer den Zugriff auf nObjHdlNum 153cdf0e10cSrcweir friend class SdrHdlList; 154cdf0e10cSrcweir 155cdf0e10cSrcweir // #101928# 156cdf0e10cSrcweir BitmapEx ImpGetBitmapEx(BitmapMarkerKind eKindOfMarker, sal_uInt16 nInd, sal_Bool bFine, sal_Bool bIsHighContrast); 157cdf0e10cSrcweir 158cdf0e10cSrcweir protected: 159cdf0e10cSrcweir SdrObject* pObj; // Gehoert das Handle zu einem Objekt? 160cdf0e10cSrcweir SdrPageView* pPV; // Gehoert das Handle zu einem Objekt in einer bestimmten PageView? 161cdf0e10cSrcweir SdrHdlList* pHdlList; // Zum Feststelen der Handlegroesse 162cdf0e10cSrcweir 163cdf0e10cSrcweir // OVERLAYMANAGER 164cdf0e10cSrcweir ::sdr::overlay::OverlayObjectList maOverlayGroup; 165cdf0e10cSrcweir 166cdf0e10cSrcweir Point aPos; 167cdf0e10cSrcweir 168cdf0e10cSrcweir SdrHdlKind eKind; 169cdf0e10cSrcweir 170cdf0e10cSrcweir long nDrehWink; // Handles bzw. Mauszeiger drehen 171cdf0e10cSrcweir sal_uInt32 nObjHdlNum; // wird von der MarkView benoetigt 172cdf0e10cSrcweir sal_uInt32 nPolyNum; // Polygonpunktes 173cdf0e10cSrcweir sal_uInt32 nPPntNum; // Punktnummer des Polygons 174cdf0e10cSrcweir sal_uInt32 nSourceHdlNum; // ist noch vollstaendig zu implementieren 175cdf0e10cSrcweir 176cdf0e10cSrcweir unsigned bSelect : 1; // Ein selektierter Polygonpunkt? 177cdf0e10cSrcweir unsigned b1PixMore : 1; // True=Handle wird 1 Pixel groesser dargestellt 178cdf0e10cSrcweir unsigned bPlusHdl : 1; // u.a. fuer Hld-Paint Optimierung bei MarkPoint/UnmarkPoint, ... 179cdf0e10cSrcweir 180cdf0e10cSrcweir bool mbMoveOutside; // forces this handle to be moved outside of the selection rectangle 181cdf0e10cSrcweir 182cdf0e10cSrcweir // create marker for this kind 183cdf0e10cSrcweir virtual void CreateB2dIAObject(); 184cdf0e10cSrcweir 185cdf0e10cSrcweir // cleanup marker if one exists 186cdf0e10cSrcweir void GetRidOfIAObject(); 187cdf0e10cSrcweir 188cdf0e10cSrcweir private: 189cdf0e10cSrcweir bool mbMouseOver; // is true if the mouse is over this handle 190cdf0e10cSrcweir 191cdf0e10cSrcweir protected: 192cdf0e10cSrcweir ::sdr::overlay::OverlayObject* CreateOverlayObject( 193cdf0e10cSrcweir const basegfx::B2DPoint& rPos, 194cdf0e10cSrcweir BitmapColorIndex eColIndex, BitmapMarkerKind eKindOfMarker, Point aMoveOutsideOffset = Point()); 195cdf0e10cSrcweir BitmapMarkerKind GetNextBigger(BitmapMarkerKind eKnd) const; 196cdf0e10cSrcweir 197cdf0e10cSrcweir public: 198cdf0e10cSrcweir SdrHdl(); 199cdf0e10cSrcweir SdrHdl(const Point& rPnt, SdrHdlKind eNewKind=HDL_MOVE); 200cdf0e10cSrcweir virtual ~SdrHdl(); 201cdf0e10cSrcweir 202cdf0e10cSrcweir const ::sdr::overlay::OverlayObjectList& getOverlayObjectList() const { return maOverlayGroup; } 203cdf0e10cSrcweir 204cdf0e10cSrcweir void SetHdlList(SdrHdlList* pList); 205cdf0e10cSrcweir SdrHdlKind GetKind() const { return eKind; } 206cdf0e10cSrcweir void Touch(); 207cdf0e10cSrcweir 208cdf0e10cSrcweir const Point& GetPos() const { return aPos; } 209cdf0e10cSrcweir void SetPos(const Point& rPnt); 210cdf0e10cSrcweir 211cdf0e10cSrcweir SdrPageView* GetPageView() const { return pPV; } 212cdf0e10cSrcweir void SetPageView(SdrPageView* pNewPV) { pPV=pNewPV; } 213cdf0e10cSrcweir 214cdf0e10cSrcweir SdrObject* GetObj() const { return pObj; } 215cdf0e10cSrcweir void SetObj(SdrObject* pNewObj); 216cdf0e10cSrcweir 217cdf0e10cSrcweir sal_Bool IsSelected() const { return bSelect; } 218cdf0e10cSrcweir void SetSelected(sal_Bool bJa=sal_True); 219cdf0e10cSrcweir 220cdf0e10cSrcweir void Set1PixMore(sal_Bool bJa=sal_True); 221cdf0e10cSrcweir void SetDrehWink(long n); 222cdf0e10cSrcweir 223cdf0e10cSrcweir sal_Bool IsCornerHdl() const { return eKind==HDL_UPLFT || eKind==HDL_UPRGT || eKind==HDL_LWLFT || eKind==HDL_LWRGT; } 224cdf0e10cSrcweir sal_Bool IsVertexHdl() const { return eKind==HDL_UPPER || eKind==HDL_LOWER || eKind==HDL_LEFT || eKind==HDL_RIGHT; } 225cdf0e10cSrcweir 226cdf0e10cSrcweir void SetObjHdlNum(sal_uInt32 nNum) { nObjHdlNum=nNum; } 227cdf0e10cSrcweir sal_uInt32 GetObjHdlNum() const { return nObjHdlNum; } 228cdf0e10cSrcweir 229cdf0e10cSrcweir void SetPolyNum(sal_uInt32 nNum) { nPolyNum=nNum; } 230cdf0e10cSrcweir sal_uInt32 GetPolyNum() const { return nPolyNum; } 231cdf0e10cSrcweir 232cdf0e10cSrcweir void SetPointNum(sal_uInt32 nNum) { nPPntNum=nNum; } 233cdf0e10cSrcweir sal_uInt32 GetPointNum() const { return nPPntNum; } 234cdf0e10cSrcweir 235cdf0e10cSrcweir void SetPlusHdl(sal_Bool bOn) { bPlusHdl=bOn; } 236cdf0e10cSrcweir sal_Bool IsPlusHdl() const { return bPlusHdl; } 237cdf0e10cSrcweir 238cdf0e10cSrcweir void SetSourceHdlNum(sal_uInt32 nNum) { nSourceHdlNum=nNum; } 239cdf0e10cSrcweir sal_uInt32 GetSourceHdlNum() const { return nSourceHdlNum; } 240cdf0e10cSrcweir 241cdf0e10cSrcweir virtual Pointer GetPointer() const; 242cdf0e10cSrcweir bool IsHdlHit(const Point& rPnt) const; 243cdf0e10cSrcweir 244cdf0e10cSrcweir // #97016# II 245cdf0e10cSrcweir virtual sal_Bool IsFocusHdl() const; 246cdf0e10cSrcweir 247cdf0e10cSrcweir void SetMoveOutside( bool bMoveOutside ); 248cdf0e10cSrcweir 249cdf0e10cSrcweir /** is called when the mouse enters the area of this handle. If the handle changes his 250cdf0e10cSrcweir visualisation during mouse over it must override this method and call Touch(). */ 251cdf0e10cSrcweir virtual void onMouseEnter(const MouseEvent& rMEvt); 252cdf0e10cSrcweir 253cdf0e10cSrcweir /** is called when the mouse leaves the area of this handle. If the handle changes his 254cdf0e10cSrcweir visualisation during mouse over it must override this method and call Touch(). */ 255cdf0e10cSrcweir virtual void onMouseLeave(); 256cdf0e10cSrcweir 257cdf0e10cSrcweir bool isMouseOver() const; 258cdf0e10cSrcweir }; 259cdf0e10cSrcweir 260cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////////////////////////// 261cdf0e10cSrcweir 262cdf0e10cSrcweir #define SDR_HANDLE_COLOR_SIZE_NORMAL Size(13, 13) 263cdf0e10cSrcweir #define SDR_HANDLE_COLOR_SIZE_SELECTED Size(17, 17) 264cdf0e10cSrcweir 265cdf0e10cSrcweir class SVX_DLLPUBLIC SdrHdlColor : public SdrHdl 266cdf0e10cSrcweir { 267cdf0e10cSrcweir private: 268cdf0e10cSrcweir // size of colr markers 269cdf0e10cSrcweir Size aMarkerSize; 270cdf0e10cSrcweir 271cdf0e10cSrcweir // color 272cdf0e10cSrcweir Color aMarkerColor; 273cdf0e10cSrcweir 274cdf0e10cSrcweir // callback link when value changed 275cdf0e10cSrcweir Link aColorChangeHdl; 276cdf0e10cSrcweir 277cdf0e10cSrcweir // use luminance values only 278cdf0e10cSrcweir unsigned bUseLuminance : 1; 279cdf0e10cSrcweir 280cdf0e10cSrcweir // create marker for this kind 281cdf0e10cSrcweir SVX_DLLPRIVATE virtual void CreateB2dIAObject(); 282cdf0e10cSrcweir 283cdf0e10cSrcweir // help functions 284cdf0e10cSrcweir SVX_DLLPRIVATE Bitmap CreateColorDropper(Color aCol); 285cdf0e10cSrcweir SVX_DLLPRIVATE Color GetLuminance(const Color& rCol); 286cdf0e10cSrcweir SVX_DLLPRIVATE void CallColorChangeLink(); 287cdf0e10cSrcweir 288cdf0e10cSrcweir public: 289cdf0e10cSrcweir SdrHdlColor(const Point& rRef, Color aCol = Color(COL_BLACK), const Size& rSize = Size(11, 11), sal_Bool bLum = sal_False); 290cdf0e10cSrcweir virtual ~SdrHdlColor(); 291cdf0e10cSrcweir 292cdf0e10cSrcweir sal_Bool IsUseLuminance() const { return bUseLuminance; } 293cdf0e10cSrcweir 294cdf0e10cSrcweir Color GetColor() const { return aMarkerColor; } 295cdf0e10cSrcweir void SetColor(Color aNew, sal_Bool bCallLink = sal_False); 296cdf0e10cSrcweir 297cdf0e10cSrcweir const Size& GetSize() const { return aMarkerSize; } 298cdf0e10cSrcweir void SetSize(const Size& rNew); 299cdf0e10cSrcweir 300cdf0e10cSrcweir void SetColorChangeHdl(const Link& rLink) { aColorChangeHdl = rLink; } 301cdf0e10cSrcweir const Link& GetColorChangeHdl() const { return aColorChangeHdl; } 302cdf0e10cSrcweir }; 303cdf0e10cSrcweir 304cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////////////////////////// 305cdf0e10cSrcweir 306cdf0e10cSrcweir class SdrHdlGradient : public SdrHdl 307cdf0e10cSrcweir { 308cdf0e10cSrcweir private: 309cdf0e10cSrcweir // pointer to used color handles 310cdf0e10cSrcweir SdrHdlColor* pColHdl1; 311cdf0e10cSrcweir SdrHdlColor* pColHdl2; 312cdf0e10cSrcweir 313cdf0e10cSrcweir // 2nd position 314cdf0e10cSrcweir Point a2ndPos; 315cdf0e10cSrcweir 316cdf0e10cSrcweir // is this a gradient or a transparence 317cdf0e10cSrcweir unsigned bGradient : 1; 318cdf0e10cSrcweir 319cdf0e10cSrcweir // select which handle to move 320cdf0e10cSrcweir unsigned bMoveSingleHandle : 1; 321cdf0e10cSrcweir unsigned bMoveFirstHandle : 1; 322cdf0e10cSrcweir 323cdf0e10cSrcweir // create marker for this kind 324cdf0e10cSrcweir virtual void CreateB2dIAObject(); 325cdf0e10cSrcweir 326cdf0e10cSrcweir public: 327cdf0e10cSrcweir SdrHdlGradient(const Point& rRef1, const Point& rRef2, sal_Bool bGrad = sal_True); 328cdf0e10cSrcweir virtual ~SdrHdlGradient(); 329cdf0e10cSrcweir 330cdf0e10cSrcweir sal_Bool IsGradient() const { return bGradient; } 331cdf0e10cSrcweir 332cdf0e10cSrcweir // set the associated color handles 333cdf0e10cSrcweir void SetColorHandles(SdrHdlColor* pL1, SdrHdlColor* pL2) { pColHdl1 = pL1; pColHdl2 = pL2; } 334cdf0e10cSrcweir SdrHdlColor* GetColorHdl1() const { return pColHdl1; } 335cdf0e10cSrcweir SdrHdlColor* GetColorHdl2() const { return pColHdl2; } 336cdf0e10cSrcweir 337cdf0e10cSrcweir const Point& Get2ndPos() const { return a2ndPos; } 338cdf0e10cSrcweir void Set2ndPos(const Point& rPnt); 339cdf0e10cSrcweir 340cdf0e10cSrcweir // the link called by the color handles 341cdf0e10cSrcweir DECL_LINK(ColorChangeHdl, SdrHdl*); 342cdf0e10cSrcweir 343cdf0e10cSrcweir // transformation call, create gradient from this handle 344cdf0e10cSrcweir void FromIAOToItem(SdrObject* pObj, sal_Bool bSetItemOnObject, sal_Bool bUndo); 345cdf0e10cSrcweir 346cdf0e10cSrcweir // selection flags for interaction 347cdf0e10cSrcweir sal_Bool IsMoveSingleHandle() const { return bMoveSingleHandle; } 348cdf0e10cSrcweir void SetMoveSingleHandle(sal_Bool bNew) { bMoveSingleHandle = bNew; } 349cdf0e10cSrcweir sal_Bool IsMoveFirstHandle() const { return bMoveFirstHandle; } 350cdf0e10cSrcweir void SetMoveFirstHandle(sal_Bool bNew) { bMoveFirstHandle = bNew; } 351cdf0e10cSrcweir }; 352cdf0e10cSrcweir 353cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////////////////////////// 354cdf0e10cSrcweir 355cdf0e10cSrcweir // Spiegelachse 356cdf0e10cSrcweir class SdrHdlLine: public SdrHdl 357cdf0e10cSrcweir { 358cdf0e10cSrcweir // create marker for this kind 359cdf0e10cSrcweir virtual void CreateB2dIAObject(); 360cdf0e10cSrcweir 361cdf0e10cSrcweir protected: 362cdf0e10cSrcweir SdrHdl* pHdl1; 363cdf0e10cSrcweir SdrHdl* pHdl2; 364cdf0e10cSrcweir 365cdf0e10cSrcweir public: 366cdf0e10cSrcweir SdrHdlLine(SdrHdl& rHdl1, SdrHdl& rHdl2, SdrHdlKind eNewKind=HDL_MIRX) { eKind=eNewKind; pHdl1=&rHdl1; pHdl2=&rHdl2; } 367cdf0e10cSrcweir virtual ~SdrHdlLine(); 368cdf0e10cSrcweir 369cdf0e10cSrcweir virtual Pointer GetPointer() const; 370cdf0e10cSrcweir }; 371cdf0e10cSrcweir 372cdf0e10cSrcweir // Ein SdrHdlBezWgt hat Kenntnis von seinem "BasisHandle". Seine Draw-Methode 373cdf0e10cSrcweir // zeichnet zusaetzlich eine Linie von seiner Position zur Position dieses 374cdf0e10cSrcweir // BasisHandles. 375cdf0e10cSrcweir class SdrHdlBezWgt: public SdrHdl 376cdf0e10cSrcweir { 377cdf0e10cSrcweir // create marker for this kind 378cdf0e10cSrcweir virtual void CreateB2dIAObject(); 379cdf0e10cSrcweir 380cdf0e10cSrcweir protected: 381cdf0e10cSrcweir const SdrHdl* pHdl1; 382cdf0e10cSrcweir 383cdf0e10cSrcweir public: 384cdf0e10cSrcweir // das ist kein Copy-Ctor!!! 385cdf0e10cSrcweir SdrHdlBezWgt(const SdrHdl* pRefHdl1, SdrHdlKind eNewKind=HDL_BWGT) { eKind=eNewKind; pHdl1=pRefHdl1; } 386cdf0e10cSrcweir virtual ~SdrHdlBezWgt(); 387cdf0e10cSrcweir }; 388cdf0e10cSrcweir 389cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////////////////////////// 390cdf0e10cSrcweir 391cdf0e10cSrcweir class E3dVolumeMarker : public SdrHdl 392cdf0e10cSrcweir { 393cdf0e10cSrcweir basegfx::B2DPolyPolygon aWireframePoly; 394cdf0e10cSrcweir 395cdf0e10cSrcweir // create marker for this kind 396cdf0e10cSrcweir virtual void CreateB2dIAObject(); 397cdf0e10cSrcweir 398cdf0e10cSrcweir public: 399cdf0e10cSrcweir E3dVolumeMarker(const basegfx::B2DPolyPolygon& rWireframePoly); 400cdf0e10cSrcweir }; 401cdf0e10cSrcweir 402cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////////////////////////// 403cdf0e10cSrcweir 404cdf0e10cSrcweir class ImpEdgeHdl: public SdrHdl 405cdf0e10cSrcweir { 406cdf0e10cSrcweir SdrEdgeLineCode eLineCode; 407cdf0e10cSrcweir 408cdf0e10cSrcweir // create marker for this kind 409cdf0e10cSrcweir virtual void CreateB2dIAObject(); 410cdf0e10cSrcweir 411cdf0e10cSrcweir public: 412cdf0e10cSrcweir ImpEdgeHdl(const Point& rPnt, SdrHdlKind eNewKind): SdrHdl(rPnt,eNewKind),eLineCode(MIDDLELINE) {} 413cdf0e10cSrcweir virtual ~ImpEdgeHdl(); 414cdf0e10cSrcweir 415cdf0e10cSrcweir void SetLineCode(SdrEdgeLineCode eCode); 416cdf0e10cSrcweir SdrEdgeLineCode GetLineCode() const { return eLineCode; } 417cdf0e10cSrcweir sal_Bool IsHorzDrag() const; 418cdf0e10cSrcweir virtual Pointer GetPointer() const; 419cdf0e10cSrcweir }; 420cdf0e10cSrcweir 421cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////////////////////////// 422cdf0e10cSrcweir 423cdf0e10cSrcweir class ImpMeasureHdl: public SdrHdl 424cdf0e10cSrcweir { 425cdf0e10cSrcweir // create marker for this kind 426cdf0e10cSrcweir virtual void CreateB2dIAObject(); 427cdf0e10cSrcweir 428cdf0e10cSrcweir public: 429cdf0e10cSrcweir ImpMeasureHdl(const Point& rPnt, SdrHdlKind eNewKind): SdrHdl(rPnt,eNewKind) {} 430cdf0e10cSrcweir virtual ~ImpMeasureHdl(); 431cdf0e10cSrcweir 432cdf0e10cSrcweir virtual Pointer GetPointer() const; 433cdf0e10cSrcweir }; 434cdf0e10cSrcweir 435cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////////////////////////// 436cdf0e10cSrcweir 437cdf0e10cSrcweir class ImpTextframeHdl: public SdrHdl 438cdf0e10cSrcweir { 439cdf0e10cSrcweir const Rectangle maRect; 440cdf0e10cSrcweir 441cdf0e10cSrcweir // create marker for this kind 442cdf0e10cSrcweir virtual void CreateB2dIAObject(); 443cdf0e10cSrcweir 444cdf0e10cSrcweir public: 445cdf0e10cSrcweir explicit ImpTextframeHdl(const Rectangle& rRect); 446cdf0e10cSrcweir }; 447cdf0e10cSrcweir 448cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////////////////////////// 449cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////////////////////////// 450cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////////////////////////// 451cdf0e10cSrcweir 452cdf0e10cSrcweir // #97016# II 453cdf0e10cSrcweir class ImplHdlListData; 454cdf0e10cSrcweir 455cdf0e10cSrcweir class SVX_DLLPUBLIC SdrHdlList 456cdf0e10cSrcweir { 457cdf0e10cSrcweir protected: 458cdf0e10cSrcweir sal_uIntPtr mnFocusIndex; 459cdf0e10cSrcweir SdrMarkView* pView; 460cdf0e10cSrcweir Container aList; 461cdf0e10cSrcweir sal_uInt16 nHdlSize; 462cdf0e10cSrcweir 463cdf0e10cSrcweir unsigned bRotateShear : 1; 464cdf0e10cSrcweir unsigned bDistortShear : 1; 465cdf0e10cSrcweir unsigned bMoveOutside : 1; // Handles nach aussen ruecken (fuer TextEdit) 466cdf0e10cSrcweir unsigned bFineHandles : 1; 467cdf0e10cSrcweir 468cdf0e10cSrcweir private: 469cdf0e10cSrcweir SVX_DLLPRIVATE SdrHdlList(const SdrHdlList&): aList(1024,64,64) {} 470cdf0e10cSrcweir SVX_DLLPRIVATE void operator=(const SdrHdlList&) {} 471cdf0e10cSrcweir SVX_DLLPRIVATE sal_Bool operator==(const SdrHdlList&) const { return sal_False; } 472cdf0e10cSrcweir SVX_DLLPRIVATE sal_Bool operator!=(const SdrHdlList&) const { return sal_False; } 473cdf0e10cSrcweir 474cdf0e10cSrcweir public: 475cdf0e10cSrcweir SdrHdlList(SdrMarkView* pV); 476cdf0e10cSrcweir ~SdrHdlList(); 477cdf0e10cSrcweir void Clear(); 478cdf0e10cSrcweir 479cdf0e10cSrcweir // #97016# II 480cdf0e10cSrcweir void TravelFocusHdl(sal_Bool bForward); 481cdf0e10cSrcweir SdrHdl* GetFocusHdl() const; 482cdf0e10cSrcweir void SetFocusHdl(SdrHdl* pNew); 483cdf0e10cSrcweir void ResetFocusHdl(); 484cdf0e10cSrcweir 485cdf0e10cSrcweir // Access to View 486cdf0e10cSrcweir SdrMarkView* GetView() const; 487cdf0e10cSrcweir 488cdf0e10cSrcweir // Sortierung: 1.Level Erst Refpunkt-Handles, dann normale Handles, dann Glue, dann User, dann Plushandles 489cdf0e10cSrcweir // 2.Level PageView (Pointer) 490cdf0e10cSrcweir // 3.Level Position (x+y) 491cdf0e10cSrcweir void Sort(); 492cdf0e10cSrcweir sal_uIntPtr GetHdlCount() const { return aList.Count(); } 493cdf0e10cSrcweir SdrHdl* GetHdl(sal_uIntPtr nNum) const { return (SdrHdl*)(aList.GetObject(nNum)); } 494cdf0e10cSrcweir sal_uIntPtr GetHdlNum(const SdrHdl* pHdl) const; 495cdf0e10cSrcweir void SetHdlSize(sal_uInt16 nSiz); 496cdf0e10cSrcweir sal_uInt16 GetHdlSize() const { return nHdlSize; } 497cdf0e10cSrcweir void SetMoveOutside(sal_Bool bOn); 498cdf0e10cSrcweir sal_Bool IsMoveOutside() const { return bMoveOutside; } 499cdf0e10cSrcweir void SetRotateShear(sal_Bool bOn); 500cdf0e10cSrcweir sal_Bool IsRotateShear() const { return bRotateShear; } 501cdf0e10cSrcweir void SetDistortShear(sal_Bool bOn); 502cdf0e10cSrcweir sal_Bool IsDistortShear() const { return bDistortShear; } 503cdf0e10cSrcweir void SetFineHdl(sal_Bool bOn); 504cdf0e10cSrcweir sal_Bool IsFineHdl() const { return bFineHandles; } 505cdf0e10cSrcweir 506cdf0e10cSrcweir // AddHdl uebernimmt das Handle in sein Eigentum. Es muss 507cdf0e10cSrcweir // also auf dem Heap stehen, da Clear() ein delete macht. 508cdf0e10cSrcweir void AddHdl(SdrHdl* pHdl, sal_Bool bAtBegin=sal_False); 509cdf0e10cSrcweir SdrHdl* RemoveHdl(sal_uIntPtr nNum); 510cdf0e10cSrcweir 511cdf0e10cSrcweir // Zuletzt eingefuegte Handles werden am ehesten getroffen 512cdf0e10cSrcweir // (wenn Handles uebereinander liegen). 513cdf0e10cSrcweir SdrHdl* IsHdlListHit(const Point& rPnt, sal_Bool bBack=sal_False, sal_Bool bNext=sal_False, SdrHdl* pHdl0=NULL) const; 514cdf0e10cSrcweir SdrHdl* GetHdl(SdrHdlKind eKind1) const; 515cdf0e10cSrcweir }; 516cdf0e10cSrcweir 517cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////////////////////////// 518cdf0e10cSrcweir 519cdf0e10cSrcweir class SVX_DLLPUBLIC SdrCropHdl : public SdrHdl 520cdf0e10cSrcweir { 521*414a0e15SArmin Le Grand private: 522*414a0e15SArmin Le Grand // evtl. shear and rotation, equal to the object's one to allow adaption of 523*414a0e15SArmin Le Grand // the visualization handles 524*414a0e15SArmin Le Grand double mfShearX; 525*414a0e15SArmin Le Grand double mfRotation; 526*414a0e15SArmin Le Grand 527cdf0e10cSrcweir public: 528*414a0e15SArmin Le Grand SdrCropHdl( 529*414a0e15SArmin Le Grand const Point& rPnt, 530*414a0e15SArmin Le Grand SdrHdlKind eNewKind, 531*414a0e15SArmin Le Grand double fShearX, 532*414a0e15SArmin Le Grand double fRotation); 533cdf0e10cSrcweir 534cdf0e10cSrcweir protected: 535cdf0e10cSrcweir // create marker for this kind 536cdf0e10cSrcweir virtual void CreateB2dIAObject(); 537cdf0e10cSrcweir 538cdf0e10cSrcweir BitmapEx GetBitmapForHandle( const BitmapEx& rBitmap, int nSize ); 539cdf0e10cSrcweir 540cdf0e10cSrcweir static BitmapEx GetHandlesBitmap( bool bIsFineHdl, bool bIsHighContrast ); 541cdf0e10cSrcweir }; 542cdf0e10cSrcweir 5432376739dSArmin Le Grand //////////////////////////////////////////////////////////////////////////////////////////////////// 5442376739dSArmin Le Grand 5452376739dSArmin Le Grand class SVX_DLLPUBLIC SdrCropViewHdl : public SdrHdl 5462376739dSArmin Le Grand { 5472376739dSArmin Le Grand private: 5482376739dSArmin Le Grand basegfx::B2DHomMatrix maObjectTransform; 5492376739dSArmin Le Grand Graphic maGraphic; 5502376739dSArmin Le Grand double mfCropLeft; 5512376739dSArmin Le Grand double mfCropTop; 5522376739dSArmin Le Grand double mfCropRight; 5532376739dSArmin Le Grand double mfCropBottom; 5542376739dSArmin Le Grand 5552376739dSArmin Le Grand public: 5562376739dSArmin Le Grand SdrCropViewHdl( 5572376739dSArmin Le Grand const basegfx::B2DHomMatrix& rObjectTransform, 5582376739dSArmin Le Grand const Graphic& rGraphic, 5592376739dSArmin Le Grand double fCropLeft, 5602376739dSArmin Le Grand double fCropTop, 5612376739dSArmin Le Grand double fCropRight, 562*414a0e15SArmin Le Grand double fCropBottom); 5632376739dSArmin Le Grand 5642376739dSArmin Le Grand protected: 5652376739dSArmin Le Grand // create marker for this kind 5662376739dSArmin Le Grand virtual void CreateB2dIAObject(); 5672376739dSArmin Le Grand }; 5682376739dSArmin Le Grand 5692376739dSArmin Le Grand //////////////////////////////////////////////////////////////////////////////////////////////////// 5702376739dSArmin Le Grand 571cdf0e10cSrcweir #endif //_SVDHDL_HXX 572cdf0e10cSrcweir 5732376739dSArmin Le Grand //////////////////////////////////////////////////////////////////////////////////////////////////// 5742376739dSArmin Le Grand // eof 575