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