xref: /AOO41X/main/svx/inc/svx/svdhdl.hxx (revision 2a90d9ea970a0d418bab8f60bf290d990ca33fb2)
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
73*2a90d9eaSmseidel 	HDL_UPLFT,		// top left
74*2a90d9eaSmseidel 	HDL_UPPER,		// top
75*2a90d9eaSmseidel 	HDL_UPRGT,		// top right
76*2a90d9eaSmseidel 	HDL_LEFT,		// left
77*2a90d9eaSmseidel 	HDL_RIGHT,		// right
78*2a90d9eaSmseidel 	HDL_LWLFT,		// bottom left
79*2a90d9eaSmseidel 	HDL_LOWER,		// bottom
80*2a90d9eaSmseidel 	HDL_LWRGT,		// bottom right
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
87*2a90d9eaSmseidel 	HDL_GLUE,		// glue point
88*2a90d9eaSmseidel 	HDL_GLUE_UNSEL,	// glue point unselected
89cdf0e10cSrcweir 	HDL_ANCHOR,		// anchor symbol (SD, SW)
90*2a90d9eaSmseidel 	HDL_TRNS,		// interactive transparency
91cdf0e10cSrcweir 	HDL_GRAD,		// interactive gradient
92cdf0e10cSrcweir 	HDL_COLR,		// interactive color
93cdf0e10cSrcweir 	HDL_USER,
94cdf0e10cSrcweir 	HDL_ANCHOR_TR,	// #101688# Anchor handle with (0,0) at top right for SW
95cdf0e10cSrcweir 
96cdf0e10cSrcweir 	// for SJ and the CustomShapeHandles:
97cdf0e10cSrcweir 	HDL_CUSTOMSHAPE1,
98cdf0e10cSrcweir 
99cdf0e10cSrcweir 	HDL_SMARTTAG
100cdf0e10cSrcweir };
101cdf0e10cSrcweir 
102cdf0e10cSrcweir ////////////////////////////////////////////////////////////////////////////////////////////////////
103cdf0e10cSrcweir 
104cdf0e10cSrcweir enum BitmapColorIndex
105cdf0e10cSrcweir {
106cdf0e10cSrcweir 	LightGreen,
107cdf0e10cSrcweir 	Cyan,
108cdf0e10cSrcweir 	LightCyan,
109cdf0e10cSrcweir 	Red,
110cdf0e10cSrcweir 	LightRed,
111cdf0e10cSrcweir 	Yellow
112cdf0e10cSrcweir };
113cdf0e10cSrcweir 
114cdf0e10cSrcweir ////////////////////////////////////////////////////////////////////////////////////////////////////
115cdf0e10cSrcweir 
116cdf0e10cSrcweir enum BitmapMarkerKind
117cdf0e10cSrcweir {
118cdf0e10cSrcweir 	Rect_7x7,
119cdf0e10cSrcweir 	Rect_9x9,
120cdf0e10cSrcweir 	Rect_11x11,
121cdf0e10cSrcweir 	Rect_13x13,
122cdf0e10cSrcweir 	Circ_7x7,
123cdf0e10cSrcweir 	Circ_9x9,
124cdf0e10cSrcweir 	Circ_11x11,
125cdf0e10cSrcweir 	Elli_7x9,
126cdf0e10cSrcweir 	Elli_9x11,
127cdf0e10cSrcweir 	Elli_9x7,
128cdf0e10cSrcweir 	Elli_11x9,
129cdf0e10cSrcweir 	RectPlus_7x7,
130cdf0e10cSrcweir 	RectPlus_9x9,
131cdf0e10cSrcweir 	RectPlus_11x11,
132cdf0e10cSrcweir 	Crosshair,
133*2a90d9eaSmseidel 	Crosshair_Unselected,
134cdf0e10cSrcweir 	Glue,
135*2a90d9eaSmseidel 	Glue_Unselected,
136cdf0e10cSrcweir 	Anchor,
137cdf0e10cSrcweir 
138*2a90d9eaSmseidel 	// #98388# add AnchorPressed to be able to animate anchor control, too.
139cdf0e10cSrcweir 	AnchorPressed,
140cdf0e10cSrcweir 
141cdf0e10cSrcweir 	// #101688# AnchorTR for SW
142cdf0e10cSrcweir 	AnchorTR,
143cdf0e10cSrcweir 	AnchorPressedTR,
144cdf0e10cSrcweir 
145cdf0e10cSrcweir 	// for SJ and the CustomShapeHandles:
1464772d9afSArmin Le Grand 	Customshape_7x7,
1474772d9afSArmin Le Grand 	Customshape_9x9,
1484772d9afSArmin Le Grand 	Customshape_11x11
149cdf0e10cSrcweir };
150cdf0e10cSrcweir 
151cdf0e10cSrcweir ////////////////////////////////////////////////////////////////////////////////////////////////////
152cdf0e10cSrcweir 
153cdf0e10cSrcweir class SVX_DLLPUBLIC SdrHdl
154cdf0e10cSrcweir {
155cdf0e10cSrcweir 	friend class				SdrMarkView; // fuer den Zugriff auf nObjHdlNum
156cdf0e10cSrcweir 	friend class				SdrHdlList;
157cdf0e10cSrcweir 
158cdf0e10cSrcweir 	// #101928#
159cdf0e10cSrcweir 	BitmapEx ImpGetBitmapEx(BitmapMarkerKind eKindOfMarker, sal_uInt16 nInd, sal_Bool bFine, sal_Bool bIsHighContrast);
160cdf0e10cSrcweir 
161cdf0e10cSrcweir protected:
162cdf0e10cSrcweir 	SdrObject*					pObj; // Gehoert das Handle zu einem Objekt?
163cdf0e10cSrcweir 	SdrPageView*				pPV; // Gehoert das Handle zu einem Objekt in einer bestimmten PageView?
164*2a90d9eaSmseidel 	SdrHdlList*					pHdlList; // Zum Feststellen der Handlegroesse
165cdf0e10cSrcweir 
166cdf0e10cSrcweir 	// OVERLAYMANAGER
167cdf0e10cSrcweir 	::sdr::overlay::OverlayObjectList			maOverlayGroup;
168cdf0e10cSrcweir 
169cdf0e10cSrcweir 	Point						aPos;
170cdf0e10cSrcweir 
171cdf0e10cSrcweir 	SdrHdlKind					eKind;
172cdf0e10cSrcweir 
173cdf0e10cSrcweir 	long						nDrehWink; // Handles bzw. Mauszeiger drehen
174cdf0e10cSrcweir 	sal_uInt32					nObjHdlNum; // wird von der MarkView benoetigt
175cdf0e10cSrcweir 	sal_uInt32					nPolyNum; // Polygonpunktes
176cdf0e10cSrcweir 	sal_uInt32					nPPntNum; // Punktnummer des Polygons
177cdf0e10cSrcweir 	sal_uInt32					nSourceHdlNum; // ist noch vollstaendig zu implementieren
178cdf0e10cSrcweir 
179cdf0e10cSrcweir 	unsigned					bSelect : 1; // Ein selektierter Polygonpunkt?
180cdf0e10cSrcweir 	unsigned					b1PixMore : 1; // True=Handle wird 1 Pixel groesser dargestellt
181cdf0e10cSrcweir 	unsigned					bPlusHdl : 1; // u.a. fuer Hld-Paint Optimierung bei MarkPoint/UnmarkPoint, ...
182cdf0e10cSrcweir 
183cdf0e10cSrcweir 	bool						mbMoveOutside; // forces this handle to be moved outside of the selection rectangle
184cdf0e10cSrcweir 
185cdf0e10cSrcweir 	// create marker for this kind
186cdf0e10cSrcweir 	virtual void CreateB2dIAObject();
187cdf0e10cSrcweir 
188cdf0e10cSrcweir 	// cleanup marker if one exists
189cdf0e10cSrcweir 	void GetRidOfIAObject();
190cdf0e10cSrcweir 
191cdf0e10cSrcweir private:
192cdf0e10cSrcweir 	bool						mbMouseOver; // is true if the mouse is over this handle
193cdf0e10cSrcweir 
194cdf0e10cSrcweir protected:
195cdf0e10cSrcweir 	::sdr::overlay::OverlayObject* CreateOverlayObject(
196cdf0e10cSrcweir 		const basegfx::B2DPoint& rPos,
197cdf0e10cSrcweir 		BitmapColorIndex eColIndex, BitmapMarkerKind eKindOfMarker, Point aMoveOutsideOffset = Point());
198cdf0e10cSrcweir 	BitmapMarkerKind GetNextBigger(BitmapMarkerKind eKnd) const;
199cdf0e10cSrcweir 
200cdf0e10cSrcweir public:
201cdf0e10cSrcweir 	SdrHdl();
202cdf0e10cSrcweir 	SdrHdl(const Point& rPnt, SdrHdlKind eNewKind=HDL_MOVE);
203cdf0e10cSrcweir 	virtual ~SdrHdl();
204cdf0e10cSrcweir 
getOverlayObjectList() const205cdf0e10cSrcweir 	const ::sdr::overlay::OverlayObjectList& getOverlayObjectList() const { return maOverlayGroup; }
206cdf0e10cSrcweir 
207cdf0e10cSrcweir 	void SetHdlList(SdrHdlList* pList);
GetKind() const208cdf0e10cSrcweir 	SdrHdlKind GetKind() const { return eKind; }
209cdf0e10cSrcweir 	void Touch();
210cdf0e10cSrcweir 
GetPos() const211cdf0e10cSrcweir 	const Point& GetPos() const { return aPos; }
212cdf0e10cSrcweir 	void SetPos(const Point& rPnt);
213cdf0e10cSrcweir 
GetPageView() const214cdf0e10cSrcweir 	SdrPageView* GetPageView() const { return pPV; }
SetPageView(SdrPageView * pNewPV)215cdf0e10cSrcweir 	void SetPageView(SdrPageView* pNewPV) { pPV=pNewPV; }
216cdf0e10cSrcweir 
GetObj() const217cdf0e10cSrcweir 	SdrObject* GetObj() const { return pObj; }
218cdf0e10cSrcweir 	void SetObj(SdrObject* pNewObj);
219cdf0e10cSrcweir 
IsSelected() const220cdf0e10cSrcweir 	sal_Bool IsSelected() const { return bSelect; }
221cdf0e10cSrcweir 	void SetSelected(sal_Bool bJa=sal_True);
222cdf0e10cSrcweir 
223cdf0e10cSrcweir 	void Set1PixMore(sal_Bool bJa=sal_True);
224cdf0e10cSrcweir 	void SetDrehWink(long n);
225cdf0e10cSrcweir 
IsCornerHdl() const226cdf0e10cSrcweir 	sal_Bool IsCornerHdl() const { return eKind==HDL_UPLFT || eKind==HDL_UPRGT || eKind==HDL_LWLFT || eKind==HDL_LWRGT; }
IsVertexHdl() const227cdf0e10cSrcweir 	sal_Bool IsVertexHdl() const { return eKind==HDL_UPPER || eKind==HDL_LOWER || eKind==HDL_LEFT  || eKind==HDL_RIGHT; }
228cdf0e10cSrcweir 
SetObjHdlNum(sal_uInt32 nNum)229cdf0e10cSrcweir 	void SetObjHdlNum(sal_uInt32 nNum) { nObjHdlNum=nNum; }
GetObjHdlNum() const230cdf0e10cSrcweir 	sal_uInt32 GetObjHdlNum() const { return nObjHdlNum; }
231cdf0e10cSrcweir 
SetPolyNum(sal_uInt32 nNum)232cdf0e10cSrcweir 	void SetPolyNum(sal_uInt32 nNum) { nPolyNum=nNum; }
GetPolyNum() const233cdf0e10cSrcweir 	sal_uInt32 GetPolyNum() const { return nPolyNum; }
234cdf0e10cSrcweir 
SetPointNum(sal_uInt32 nNum)235cdf0e10cSrcweir 	void SetPointNum(sal_uInt32 nNum) { nPPntNum=nNum; }
GetPointNum() const236cdf0e10cSrcweir 	sal_uInt32 GetPointNum() const { return nPPntNum; }
237cdf0e10cSrcweir 
SetPlusHdl(sal_Bool bOn)238cdf0e10cSrcweir 	void SetPlusHdl(sal_Bool bOn) { bPlusHdl=bOn; }
IsPlusHdl() const239cdf0e10cSrcweir 	sal_Bool IsPlusHdl() const { return bPlusHdl; }
240cdf0e10cSrcweir 
SetSourceHdlNum(sal_uInt32 nNum)241cdf0e10cSrcweir 	void SetSourceHdlNum(sal_uInt32 nNum) { nSourceHdlNum=nNum; }
GetSourceHdlNum() const242cdf0e10cSrcweir 	sal_uInt32 GetSourceHdlNum() const { return nSourceHdlNum; }
243cdf0e10cSrcweir 
244cdf0e10cSrcweir 	virtual Pointer GetPointer() const;
245cdf0e10cSrcweir 	bool IsHdlHit(const Point& rPnt) const;
246cdf0e10cSrcweir 
247cdf0e10cSrcweir 	// #97016# II
248cdf0e10cSrcweir 	virtual sal_Bool IsFocusHdl() const;
249cdf0e10cSrcweir 
250cdf0e10cSrcweir 	void SetMoveOutside( bool bMoveOutside );
251cdf0e10cSrcweir 
252cdf0e10cSrcweir 	/** is called when the mouse enters the area of this handle. If the handle changes his
253*2a90d9eaSmseidel 		visualization during mouse over it must override this method and call Touch(). */
254cdf0e10cSrcweir 	virtual void onMouseEnter(const MouseEvent& rMEvt);
255cdf0e10cSrcweir 
256cdf0e10cSrcweir 	/** is called when the mouse leaves the area of this handle. If the handle changes his
257*2a90d9eaSmseidel 		visualization during mouse over it must override this method and call Touch(). */
258cdf0e10cSrcweir 	virtual void onMouseLeave();
259cdf0e10cSrcweir 
260cdf0e10cSrcweir 	bool isMouseOver() const;
261cdf0e10cSrcweir };
262cdf0e10cSrcweir 
263cdf0e10cSrcweir ////////////////////////////////////////////////////////////////////////////////////////////////////
264cdf0e10cSrcweir 
265cdf0e10cSrcweir #define	SDR_HANDLE_COLOR_SIZE_NORMAL			Size(13, 13)
266cdf0e10cSrcweir #define	SDR_HANDLE_COLOR_SIZE_SELECTED			Size(17, 17)
267cdf0e10cSrcweir 
268cdf0e10cSrcweir class SVX_DLLPUBLIC SdrHdlColor : public SdrHdl
269cdf0e10cSrcweir {
270cdf0e10cSrcweir private:
271*2a90d9eaSmseidel 	// size of color markers
272cdf0e10cSrcweir 	Size						aMarkerSize;
273cdf0e10cSrcweir 
274cdf0e10cSrcweir 	// color
275cdf0e10cSrcweir 	Color						aMarkerColor;
276cdf0e10cSrcweir 
277cdf0e10cSrcweir 	// callback link when value changed
278cdf0e10cSrcweir 	Link						aColorChangeHdl;
279cdf0e10cSrcweir 
280cdf0e10cSrcweir 	// use luminance values only
281cdf0e10cSrcweir 	unsigned					bUseLuminance : 1;
282cdf0e10cSrcweir 
283cdf0e10cSrcweir 	// create marker for this kind
284cdf0e10cSrcweir 	SVX_DLLPRIVATE virtual void CreateB2dIAObject();
285cdf0e10cSrcweir 
286cdf0e10cSrcweir 	// help functions
287cdf0e10cSrcweir 	SVX_DLLPRIVATE Bitmap CreateColorDropper(Color aCol);
288cdf0e10cSrcweir 	SVX_DLLPRIVATE Color GetLuminance(const Color& rCol);
289cdf0e10cSrcweir 	SVX_DLLPRIVATE void CallColorChangeLink();
290cdf0e10cSrcweir 
291cdf0e10cSrcweir public:
292cdf0e10cSrcweir 	SdrHdlColor(const Point& rRef, Color aCol = Color(COL_BLACK), const Size& rSize = Size(11, 11), sal_Bool bLum = sal_False);
293cdf0e10cSrcweir 	virtual ~SdrHdlColor();
294cdf0e10cSrcweir 
IsUseLuminance() const295cdf0e10cSrcweir 	sal_Bool IsUseLuminance() const { return bUseLuminance; }
296cdf0e10cSrcweir 
GetColor() const297cdf0e10cSrcweir 	Color GetColor() const { return aMarkerColor; }
298cdf0e10cSrcweir 	void SetColor(Color aNew, sal_Bool bCallLink = sal_False);
299cdf0e10cSrcweir 
GetSize() const300cdf0e10cSrcweir 	const Size& GetSize() const { return aMarkerSize; }
301cdf0e10cSrcweir 	void SetSize(const Size& rNew);
302cdf0e10cSrcweir 
SetColorChangeHdl(const Link & rLink)303cdf0e10cSrcweir 	void SetColorChangeHdl(const Link& rLink) { aColorChangeHdl = rLink; }
GetColorChangeHdl() const304cdf0e10cSrcweir 	const Link& GetColorChangeHdl() const { return aColorChangeHdl; }
305cdf0e10cSrcweir };
306cdf0e10cSrcweir 
307cdf0e10cSrcweir ////////////////////////////////////////////////////////////////////////////////////////////////////
308cdf0e10cSrcweir 
309cdf0e10cSrcweir class SdrHdlGradient : public SdrHdl
310cdf0e10cSrcweir {
311cdf0e10cSrcweir private:
312cdf0e10cSrcweir 	// pointer to used color handles
313cdf0e10cSrcweir 	SdrHdlColor*				pColHdl1;
314cdf0e10cSrcweir 	SdrHdlColor*				pColHdl2;
315cdf0e10cSrcweir 
316cdf0e10cSrcweir 	// 2nd position
317cdf0e10cSrcweir 	Point						a2ndPos;
318cdf0e10cSrcweir 
319*2a90d9eaSmseidel 	// is this a gradient or a transparency
320cdf0e10cSrcweir 	unsigned					bGradient : 1;
321cdf0e10cSrcweir 
322cdf0e10cSrcweir 	// select which handle to move
323cdf0e10cSrcweir 	unsigned					bMoveSingleHandle : 1;
324cdf0e10cSrcweir 	unsigned					bMoveFirstHandle : 1;
325cdf0e10cSrcweir 
326cdf0e10cSrcweir 	// create marker for this kind
327cdf0e10cSrcweir 	virtual void CreateB2dIAObject();
328cdf0e10cSrcweir 
329cdf0e10cSrcweir public:
330cdf0e10cSrcweir 	SdrHdlGradient(const Point& rRef1, const Point& rRef2, sal_Bool bGrad = sal_True);
331cdf0e10cSrcweir 	virtual ~SdrHdlGradient();
332cdf0e10cSrcweir 
IsGradient() const333cdf0e10cSrcweir 	sal_Bool IsGradient() const { return bGradient; }
334cdf0e10cSrcweir 
335cdf0e10cSrcweir 	// set the associated color handles
SetColorHandles(SdrHdlColor * pL1,SdrHdlColor * pL2)336cdf0e10cSrcweir 	void SetColorHandles(SdrHdlColor* pL1, SdrHdlColor* pL2) { pColHdl1 = pL1; pColHdl2 = pL2; }
GetColorHdl1() const337cdf0e10cSrcweir 	SdrHdlColor* GetColorHdl1() const { return pColHdl1; }
GetColorHdl2() const338cdf0e10cSrcweir 	SdrHdlColor* GetColorHdl2() const { return pColHdl2; }
339cdf0e10cSrcweir 
Get2ndPos() const340cdf0e10cSrcweir 	const Point& Get2ndPos() const { return a2ndPos; }
341cdf0e10cSrcweir 	void Set2ndPos(const Point& rPnt);
342cdf0e10cSrcweir 
343cdf0e10cSrcweir 	// the link called by the color handles
344cdf0e10cSrcweir 	DECL_LINK(ColorChangeHdl, SdrHdl*);
345cdf0e10cSrcweir 
346cdf0e10cSrcweir 	// transformation call, create gradient from this handle
347cdf0e10cSrcweir 	void FromIAOToItem(SdrObject* pObj, sal_Bool bSetItemOnObject, sal_Bool bUndo);
348cdf0e10cSrcweir 
349cdf0e10cSrcweir 	// selection flags for interaction
IsMoveSingleHandle() const350cdf0e10cSrcweir 	sal_Bool IsMoveSingleHandle() const { return bMoveSingleHandle; }
SetMoveSingleHandle(sal_Bool bNew)351cdf0e10cSrcweir 	void SetMoveSingleHandle(sal_Bool bNew) { bMoveSingleHandle = bNew; }
IsMoveFirstHandle() const352cdf0e10cSrcweir 	sal_Bool IsMoveFirstHandle() const { return bMoveFirstHandle; }
SetMoveFirstHandle(sal_Bool bNew)353cdf0e10cSrcweir 	void SetMoveFirstHandle(sal_Bool bNew) { bMoveFirstHandle = bNew; }
354cdf0e10cSrcweir };
355cdf0e10cSrcweir 
356cdf0e10cSrcweir ////////////////////////////////////////////////////////////////////////////////////////////////////
357cdf0e10cSrcweir 
358cdf0e10cSrcweir // Spiegelachse
359cdf0e10cSrcweir class SdrHdlLine: public SdrHdl
360cdf0e10cSrcweir {
361cdf0e10cSrcweir 	// create marker for this kind
362cdf0e10cSrcweir 	virtual void CreateB2dIAObject();
363cdf0e10cSrcweir 
364cdf0e10cSrcweir protected:
365cdf0e10cSrcweir 	SdrHdl*						pHdl1;
366cdf0e10cSrcweir 	SdrHdl*						pHdl2;
367cdf0e10cSrcweir 
368cdf0e10cSrcweir public:
SdrHdlLine(SdrHdl & rHdl1,SdrHdl & rHdl2,SdrHdlKind eNewKind=HDL_MIRX)369cdf0e10cSrcweir 	SdrHdlLine(SdrHdl& rHdl1, SdrHdl& rHdl2, SdrHdlKind eNewKind=HDL_MIRX) { eKind=eNewKind; pHdl1=&rHdl1; pHdl2=&rHdl2; }
370cdf0e10cSrcweir 	virtual ~SdrHdlLine();
371cdf0e10cSrcweir 
372cdf0e10cSrcweir 	virtual Pointer GetPointer() const;
373cdf0e10cSrcweir };
374cdf0e10cSrcweir 
375cdf0e10cSrcweir // Ein SdrHdlBezWgt hat Kenntnis von seinem "BasisHandle". Seine Draw-Methode
376cdf0e10cSrcweir // zeichnet zusaetzlich eine Linie von seiner Position zur Position dieses
377cdf0e10cSrcweir // BasisHandles.
378cdf0e10cSrcweir class SdrHdlBezWgt: public SdrHdl
379cdf0e10cSrcweir {
380cdf0e10cSrcweir 	// create marker for this kind
381cdf0e10cSrcweir 	virtual void CreateB2dIAObject();
382cdf0e10cSrcweir 
383cdf0e10cSrcweir protected:
384cdf0e10cSrcweir 	const SdrHdl* pHdl1;
385cdf0e10cSrcweir 
386cdf0e10cSrcweir public:
387cdf0e10cSrcweir 	// das ist kein Copy-Ctor!!!
SdrHdlBezWgt(const SdrHdl * pRefHdl1,SdrHdlKind eNewKind=HDL_BWGT)388cdf0e10cSrcweir 	SdrHdlBezWgt(const SdrHdl* pRefHdl1, SdrHdlKind eNewKind=HDL_BWGT) { eKind=eNewKind; pHdl1=pRefHdl1; }
389cdf0e10cSrcweir 	virtual ~SdrHdlBezWgt();
390cdf0e10cSrcweir };
391cdf0e10cSrcweir 
392cdf0e10cSrcweir ////////////////////////////////////////////////////////////////////////////////////////////////////
393cdf0e10cSrcweir 
394cdf0e10cSrcweir class E3dVolumeMarker : public SdrHdl
395cdf0e10cSrcweir {
396cdf0e10cSrcweir 	basegfx::B2DPolyPolygon				aWireframePoly;
397cdf0e10cSrcweir 
398cdf0e10cSrcweir 	// create marker for this kind
399cdf0e10cSrcweir 	virtual void CreateB2dIAObject();
400cdf0e10cSrcweir 
401cdf0e10cSrcweir public:
402cdf0e10cSrcweir 	E3dVolumeMarker(const basegfx::B2DPolyPolygon& rWireframePoly);
403cdf0e10cSrcweir };
404cdf0e10cSrcweir 
405cdf0e10cSrcweir ////////////////////////////////////////////////////////////////////////////////////////////////////
406cdf0e10cSrcweir 
407cdf0e10cSrcweir class ImpEdgeHdl: public SdrHdl
408cdf0e10cSrcweir {
409cdf0e10cSrcweir 	SdrEdgeLineCode eLineCode;
410cdf0e10cSrcweir 
411cdf0e10cSrcweir 	// create marker for this kind
412cdf0e10cSrcweir 	virtual void CreateB2dIAObject();
413cdf0e10cSrcweir 
414cdf0e10cSrcweir public:
ImpEdgeHdl(const Point & rPnt,SdrHdlKind eNewKind)415cdf0e10cSrcweir 	ImpEdgeHdl(const Point& rPnt, SdrHdlKind eNewKind): SdrHdl(rPnt,eNewKind),eLineCode(MIDDLELINE) {}
416cdf0e10cSrcweir 	virtual ~ImpEdgeHdl();
417cdf0e10cSrcweir 
418cdf0e10cSrcweir 	void SetLineCode(SdrEdgeLineCode eCode);
GetLineCode() const419cdf0e10cSrcweir 	SdrEdgeLineCode GetLineCode() const     { return eLineCode; }
420cdf0e10cSrcweir 	sal_Bool IsHorzDrag() const;
421cdf0e10cSrcweir 	virtual Pointer GetPointer() const;
422cdf0e10cSrcweir };
423cdf0e10cSrcweir 
424cdf0e10cSrcweir ////////////////////////////////////////////////////////////////////////////////////////////////////
425cdf0e10cSrcweir 
426cdf0e10cSrcweir class ImpMeasureHdl: public SdrHdl
427cdf0e10cSrcweir {
428cdf0e10cSrcweir 	// create marker for this kind
429cdf0e10cSrcweir 	virtual void CreateB2dIAObject();
430cdf0e10cSrcweir 
431cdf0e10cSrcweir public:
ImpMeasureHdl(const Point & rPnt,SdrHdlKind eNewKind)432cdf0e10cSrcweir 	ImpMeasureHdl(const Point& rPnt, SdrHdlKind eNewKind): SdrHdl(rPnt,eNewKind) {}
433cdf0e10cSrcweir 	virtual ~ImpMeasureHdl();
434cdf0e10cSrcweir 
435cdf0e10cSrcweir 	virtual Pointer GetPointer() const;
436cdf0e10cSrcweir };
437cdf0e10cSrcweir 
438cdf0e10cSrcweir ////////////////////////////////////////////////////////////////////////////////////////////////////
439cdf0e10cSrcweir 
440cdf0e10cSrcweir class ImpTextframeHdl: public SdrHdl
441cdf0e10cSrcweir {
442cdf0e10cSrcweir 	const Rectangle maRect;
443cdf0e10cSrcweir 
444cdf0e10cSrcweir 	// create marker for this kind
445cdf0e10cSrcweir 	virtual void CreateB2dIAObject();
446cdf0e10cSrcweir 
447cdf0e10cSrcweir public:
448cdf0e10cSrcweir 	explicit ImpTextframeHdl(const Rectangle& rRect);
449cdf0e10cSrcweir };
450cdf0e10cSrcweir 
451cdf0e10cSrcweir ////////////////////////////////////////////////////////////////////////////////////////////////////
452cdf0e10cSrcweir 
453cdf0e10cSrcweir // #97016# II
454cdf0e10cSrcweir class ImplHdlListData;
455cdf0e10cSrcweir 
456cdf0e10cSrcweir class SVX_DLLPUBLIC SdrHdlList
457cdf0e10cSrcweir {
458cdf0e10cSrcweir protected:
459cdf0e10cSrcweir 	sal_uIntPtr					mnFocusIndex;
460cdf0e10cSrcweir 	SdrMarkView*				pView;
461cdf0e10cSrcweir 	Container					aList;
462cdf0e10cSrcweir 	sal_uInt16						nHdlSize;
463cdf0e10cSrcweir 
464cdf0e10cSrcweir 	unsigned					bRotateShear : 1;
465cdf0e10cSrcweir 	unsigned					bDistortShear : 1;
466cdf0e10cSrcweir 	unsigned					bMoveOutside : 1; // Handles nach aussen ruecken (fuer TextEdit)
467cdf0e10cSrcweir 	unsigned					bFineHandles : 1;
468cdf0e10cSrcweir 
469cdf0e10cSrcweir private:
SdrHdlList(const SdrHdlList &)470cdf0e10cSrcweir 	SVX_DLLPRIVATE SdrHdlList(const SdrHdlList&): aList(1024,64,64)  {}
operator =(const SdrHdlList &)471cdf0e10cSrcweir 	SVX_DLLPRIVATE void operator=(const SdrHdlList&)                 {}
operator ==(const SdrHdlList &) const472cdf0e10cSrcweir 	SVX_DLLPRIVATE sal_Bool operator==(const SdrHdlList&) const      { return sal_False; }
operator !=(const SdrHdlList &) const473cdf0e10cSrcweir 	SVX_DLLPRIVATE sal_Bool operator!=(const SdrHdlList&) const      { return sal_False; }
474cdf0e10cSrcweir 
475cdf0e10cSrcweir public:
476cdf0e10cSrcweir 	SdrHdlList(SdrMarkView* pV);
477cdf0e10cSrcweir 	~SdrHdlList();
478cdf0e10cSrcweir 	void Clear();
479cdf0e10cSrcweir 
480cdf0e10cSrcweir 	// #97016# II
481cdf0e10cSrcweir 	void TravelFocusHdl(sal_Bool bForward);
482cdf0e10cSrcweir 	SdrHdl* GetFocusHdl() const;
483cdf0e10cSrcweir 	void SetFocusHdl(SdrHdl* pNew);
484cdf0e10cSrcweir 	void ResetFocusHdl();
485cdf0e10cSrcweir 
486cdf0e10cSrcweir 	// Access to View
487cdf0e10cSrcweir 	SdrMarkView* GetView() const;
488cdf0e10cSrcweir 
489cdf0e10cSrcweir 	// Sortierung: 1.Level Erst Refpunkt-Handles, dann normale Handles, dann Glue, dann User, dann Plushandles
490cdf0e10cSrcweir 	//             2.Level PageView (Pointer)
491cdf0e10cSrcweir 	//             3.Level Position (x+y)
492cdf0e10cSrcweir 	void     Sort();
GetHdlCount() const493cdf0e10cSrcweir 	sal_uIntPtr    GetHdlCount() const                       { return aList.Count(); }
GetHdl(sal_uIntPtr nNum) const494cdf0e10cSrcweir 	SdrHdl*  GetHdl(sal_uIntPtr nNum) const                  { return (SdrHdl*)(aList.GetObject(nNum)); }
495cdf0e10cSrcweir 	sal_uIntPtr    GetHdlNum(const SdrHdl* pHdl) const;
496cdf0e10cSrcweir 	void     SetHdlSize(sal_uInt16 nSiz);
GetHdlSize() const497cdf0e10cSrcweir 	sal_uInt16   GetHdlSize() const                        { return nHdlSize; }
498cdf0e10cSrcweir 	void     SetMoveOutside(sal_Bool bOn);
IsMoveOutside() const499cdf0e10cSrcweir 	sal_Bool IsMoveOutside() const                     { return bMoveOutside; }
500cdf0e10cSrcweir 	void     SetRotateShear(sal_Bool bOn);
IsRotateShear() const501cdf0e10cSrcweir 	sal_Bool IsRotateShear() const                     { return bRotateShear; }
502cdf0e10cSrcweir 	void     SetDistortShear(sal_Bool bOn);
IsDistortShear() const503cdf0e10cSrcweir 	sal_Bool IsDistortShear() const                    { return bDistortShear; }
504cdf0e10cSrcweir 	void     SetFineHdl(sal_Bool bOn);
IsFineHdl() const505cdf0e10cSrcweir 	sal_Bool IsFineHdl() const                        { return bFineHandles; }
506cdf0e10cSrcweir 
507cdf0e10cSrcweir 	// AddHdl uebernimmt das Handle in sein Eigentum. Es muss
508cdf0e10cSrcweir 	// also auf dem Heap stehen, da Clear() ein delete macht.
509cdf0e10cSrcweir 	void    AddHdl(SdrHdl* pHdl, sal_Bool bAtBegin=sal_False);
510cdf0e10cSrcweir 	SdrHdl* RemoveHdl(sal_uIntPtr nNum);
511cdf0e10cSrcweir 
512cdf0e10cSrcweir 	// Zuletzt eingefuegte Handles werden am ehesten getroffen
513cdf0e10cSrcweir 	// (wenn Handles uebereinander liegen).
514cdf0e10cSrcweir 	SdrHdl* IsHdlListHit(const Point& rPnt, sal_Bool bBack=sal_False, sal_Bool bNext=sal_False, SdrHdl* pHdl0=NULL) const;
515cdf0e10cSrcweir 	SdrHdl* GetHdl(SdrHdlKind eKind1) const;
516cdf0e10cSrcweir };
517cdf0e10cSrcweir 
518cdf0e10cSrcweir ////////////////////////////////////////////////////////////////////////////////////////////////////
519cdf0e10cSrcweir 
520cdf0e10cSrcweir class SVX_DLLPUBLIC SdrCropHdl : public SdrHdl
521cdf0e10cSrcweir {
522414a0e15SArmin Le Grand private:
523414a0e15SArmin Le Grand 	// evtl. shear and rotation, equal to the object's one to allow adaption of
524414a0e15SArmin Le Grand 	// the visualization handles
525414a0e15SArmin Le Grand 	double			mfShearX;
526414a0e15SArmin Le Grand 	double			mfRotation;
527414a0e15SArmin Le Grand 
528cdf0e10cSrcweir public:
529414a0e15SArmin Le Grand 	SdrCropHdl(
530414a0e15SArmin Le Grand 		const Point& rPnt,
531414a0e15SArmin Le Grand 		SdrHdlKind eNewKind,
532414a0e15SArmin Le Grand 		double fShearX,
533414a0e15SArmin Le Grand 		double fRotation);
534cdf0e10cSrcweir 
535cdf0e10cSrcweir protected:
536cdf0e10cSrcweir 	// create marker for this kind
537cdf0e10cSrcweir 	virtual void CreateB2dIAObject();
538cdf0e10cSrcweir 
539cdf0e10cSrcweir 	BitmapEx GetBitmapForHandle( const BitmapEx& rBitmap, int nSize );
540cdf0e10cSrcweir 
541cdf0e10cSrcweir 	static BitmapEx GetHandlesBitmap( bool bIsFineHdl, bool bIsHighContrast );
542cdf0e10cSrcweir };
543cdf0e10cSrcweir 
5442376739dSArmin Le Grand ////////////////////////////////////////////////////////////////////////////////////////////////////
5452376739dSArmin Le Grand 
5462376739dSArmin Le Grand class SVX_DLLPUBLIC SdrCropViewHdl : public SdrHdl
5472376739dSArmin Le Grand {
5482376739dSArmin Le Grand private:
5492376739dSArmin Le Grand 	basegfx::B2DHomMatrix		maObjectTransform;
5502376739dSArmin Le Grand 	Graphic						maGraphic;
5512376739dSArmin Le Grand 	double						mfCropLeft;
5522376739dSArmin Le Grand 	double						mfCropTop;
5532376739dSArmin Le Grand 	double						mfCropRight;
5542376739dSArmin Le Grand 	double						mfCropBottom;
5552376739dSArmin Le Grand 
5562376739dSArmin Le Grand public:
5572376739dSArmin Le Grand 	SdrCropViewHdl(
5582376739dSArmin Le Grand 		const basegfx::B2DHomMatrix& rObjectTransform,
5592376739dSArmin Le Grand 		const Graphic& rGraphic,
5602376739dSArmin Le Grand 		double fCropLeft,
5612376739dSArmin Le Grand 		double fCropTop,
5622376739dSArmin Le Grand 		double fCropRight,
563414a0e15SArmin Le Grand 		double fCropBottom);
5642376739dSArmin Le Grand 
5652376739dSArmin Le Grand protected:
5662376739dSArmin Le Grand 	// create marker for this kind
5672376739dSArmin Le Grand 	virtual void CreateB2dIAObject();
5682376739dSArmin Le Grand };
5692376739dSArmin Le Grand 
5702376739dSArmin Le Grand ////////////////////////////////////////////////////////////////////////////////////////////////////
5712376739dSArmin Le Grand 
572cdf0e10cSrcweir #endif //_SVDHDL_HXX
573cdf0e10cSrcweir 
5742376739dSArmin Le Grand ////////////////////////////////////////////////////////////////////////////////////////////////////
5752376739dSArmin Le Grand // eof
576