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