xref: /AOO41X/main/svx/inc/svx/svdhdl.hxx (revision 4772d9af2982d09413f91b3bb1d641db3b938dc3)
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>
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:
141*4772d9afSArmin Le Grand 	Customshape_7x7,
142*4772d9afSArmin Le Grand 	Customshape_9x9,
143*4772d9afSArmin Le Grand 	Customshape_11x11
144cdf0e10cSrcweir };
145cdf0e10cSrcweir 
146cdf0e10cSrcweir ////////////////////////////////////////////////////////////////////////////////////////////////////
147cdf0e10cSrcweir 
148cdf0e10cSrcweir class SVX_DLLPUBLIC SdrHdl
149cdf0e10cSrcweir {
150cdf0e10cSrcweir 	friend class				SdrMarkView; // fuer den Zugriff auf nObjHdlNum
151cdf0e10cSrcweir 	friend class				SdrHdlList;
152cdf0e10cSrcweir 
153cdf0e10cSrcweir 	// #101928#
154cdf0e10cSrcweir 	BitmapEx ImpGetBitmapEx(BitmapMarkerKind eKindOfMarker, sal_uInt16 nInd, sal_Bool bFine, sal_Bool bIsHighContrast);
155cdf0e10cSrcweir 
156cdf0e10cSrcweir protected:
157cdf0e10cSrcweir 	SdrObject*					pObj;      // Gehoert das Handle zu einem Objekt?
158cdf0e10cSrcweir 	SdrPageView*				pPV;       // Gehoert das Handle zu einem Objekt in einer bestimmten PageView?
159cdf0e10cSrcweir 	SdrHdlList*					pHdlList;  // Zum Feststelen der Handlegroesse
160cdf0e10cSrcweir 
161cdf0e10cSrcweir 	// OVERLAYMANAGER
162cdf0e10cSrcweir 	::sdr::overlay::OverlayObjectList			maOverlayGroup;
163cdf0e10cSrcweir 
164cdf0e10cSrcweir 	Point						aPos;
165cdf0e10cSrcweir 
166cdf0e10cSrcweir 	SdrHdlKind					eKind;
167cdf0e10cSrcweir 
168cdf0e10cSrcweir 	long						nDrehWink; // Handles bzw. Mauszeiger drehen
169cdf0e10cSrcweir 	sal_uInt32					nObjHdlNum; // wird von der MarkView benoetigt
170cdf0e10cSrcweir 	sal_uInt32					nPolyNum;  // Polygonpunktes
171cdf0e10cSrcweir 	sal_uInt32					nPPntNum;  // Punktnummer des Polygons
172cdf0e10cSrcweir 	sal_uInt32					nSourceHdlNum; // ist noch vollstaendig zu implementieren
173cdf0e10cSrcweir 
174cdf0e10cSrcweir 	unsigned					bSelect : 1;   // Ein selektierter Polygonpunkt?
175cdf0e10cSrcweir 	unsigned					b1PixMore : 1; // True=Handle wird 1 Pixel groesser dargestellt
176cdf0e10cSrcweir 	unsigned					bPlusHdl : 1;  // u.a. fuer Hld-Paint Optimierung bei MarkPoint/UnmarkPoint, ...
177cdf0e10cSrcweir 
178cdf0e10cSrcweir 	bool						mbMoveOutside; // forces this handle to be moved outside of the selection rectangle
179cdf0e10cSrcweir 
180cdf0e10cSrcweir 	// create marker for this kind
181cdf0e10cSrcweir 	virtual void CreateB2dIAObject();
182cdf0e10cSrcweir 
183cdf0e10cSrcweir 	// cleanup marker if one exists
184cdf0e10cSrcweir 	void GetRidOfIAObject();
185cdf0e10cSrcweir 
186cdf0e10cSrcweir private:
187cdf0e10cSrcweir 	bool						mbMouseOver;	// is true if the mouse is over this handle
188cdf0e10cSrcweir 
189cdf0e10cSrcweir protected:
190cdf0e10cSrcweir 	::sdr::overlay::OverlayObject* CreateOverlayObject(
191cdf0e10cSrcweir 		const basegfx::B2DPoint& rPos,
192cdf0e10cSrcweir 		BitmapColorIndex eColIndex, BitmapMarkerKind eKindOfMarker, Point aMoveOutsideOffset = Point());
193cdf0e10cSrcweir 	BitmapMarkerKind GetNextBigger(BitmapMarkerKind eKnd) const;
194cdf0e10cSrcweir 
195cdf0e10cSrcweir public:
196cdf0e10cSrcweir 	SdrHdl();
197cdf0e10cSrcweir 	SdrHdl(const Point& rPnt, SdrHdlKind eNewKind=HDL_MOVE);
198cdf0e10cSrcweir 	virtual ~SdrHdl();
199cdf0e10cSrcweir 
200cdf0e10cSrcweir 	const ::sdr::overlay::OverlayObjectList& getOverlayObjectList() const { return maOverlayGroup; }
201cdf0e10cSrcweir 
202cdf0e10cSrcweir 	void SetHdlList(SdrHdlList* pList);
203cdf0e10cSrcweir 	SdrHdlKind GetKind() const { return eKind; }
204cdf0e10cSrcweir 	void Touch();
205cdf0e10cSrcweir 
206cdf0e10cSrcweir 	const Point& GetPos() const { return aPos; }
207cdf0e10cSrcweir 	void SetPos(const Point& rPnt);
208cdf0e10cSrcweir 
209cdf0e10cSrcweir 	SdrPageView* GetPageView() const { return pPV; }
210cdf0e10cSrcweir 	void SetPageView(SdrPageView* pNewPV) { pPV=pNewPV; }
211cdf0e10cSrcweir 
212cdf0e10cSrcweir 	SdrObject* GetObj() const { return pObj;  }
213cdf0e10cSrcweir 	void SetObj(SdrObject* pNewObj);
214cdf0e10cSrcweir 
215cdf0e10cSrcweir 	sal_Bool IsSelected() const { return bSelect; }
216cdf0e10cSrcweir 	void SetSelected(sal_Bool bJa=sal_True);
217cdf0e10cSrcweir 
218cdf0e10cSrcweir 	void Set1PixMore(sal_Bool bJa=sal_True);
219cdf0e10cSrcweir 	void SetDrehWink(long n);
220cdf0e10cSrcweir 
221cdf0e10cSrcweir 	sal_Bool IsCornerHdl() const { return eKind==HDL_UPLFT || eKind==HDL_UPRGT || eKind==HDL_LWLFT || eKind==HDL_LWRGT; }
222cdf0e10cSrcweir 	sal_Bool IsVertexHdl() const { return eKind==HDL_UPPER || eKind==HDL_LOWER || eKind==HDL_LEFT  || eKind==HDL_RIGHT; }
223cdf0e10cSrcweir 
224cdf0e10cSrcweir 	void SetObjHdlNum(sal_uInt32 nNum) { nObjHdlNum=nNum; }
225cdf0e10cSrcweir 	sal_uInt32 GetObjHdlNum() const { return nObjHdlNum; }
226cdf0e10cSrcweir 
227cdf0e10cSrcweir 	void SetPolyNum(sal_uInt32 nNum) { nPolyNum=nNum; }
228cdf0e10cSrcweir 	sal_uInt32 GetPolyNum() const { return nPolyNum; }
229cdf0e10cSrcweir 
230cdf0e10cSrcweir 	void SetPointNum(sal_uInt32 nNum) { nPPntNum=nNum; }
231cdf0e10cSrcweir 	sal_uInt32 GetPointNum() const { return nPPntNum; }
232cdf0e10cSrcweir 
233cdf0e10cSrcweir 	void SetPlusHdl(sal_Bool bOn) { bPlusHdl=bOn; }
234cdf0e10cSrcweir 	sal_Bool IsPlusHdl() const { return bPlusHdl; }
235cdf0e10cSrcweir 
236cdf0e10cSrcweir 	void SetSourceHdlNum(sal_uInt32 nNum) { nSourceHdlNum=nNum; }
237cdf0e10cSrcweir 	sal_uInt32 GetSourceHdlNum() const { return nSourceHdlNum; }
238cdf0e10cSrcweir 
239cdf0e10cSrcweir 	virtual Pointer GetPointer() const;
240cdf0e10cSrcweir 	bool IsHdlHit(const Point& rPnt) const;
241cdf0e10cSrcweir 
242cdf0e10cSrcweir 	// #97016# II
243cdf0e10cSrcweir 	virtual sal_Bool IsFocusHdl() const;
244cdf0e10cSrcweir 
245cdf0e10cSrcweir 	void SetMoveOutside( bool bMoveOutside );
246cdf0e10cSrcweir 
247cdf0e10cSrcweir 	/** is called when the mouse enters the area of this handle. If the handle changes his
248cdf0e10cSrcweir 		visualisation during mouse over it must override this method and call Touch(). */
249cdf0e10cSrcweir 	virtual void onMouseEnter(const MouseEvent& rMEvt);
250cdf0e10cSrcweir 
251cdf0e10cSrcweir 	/** is called when the mouse leaves the area of this handle. If the handle changes his
252cdf0e10cSrcweir 		visualisation during mouse over it must override this method and call Touch(). */
253cdf0e10cSrcweir 	virtual void onMouseLeave();
254cdf0e10cSrcweir 
255cdf0e10cSrcweir 	bool isMouseOver() const;
256cdf0e10cSrcweir };
257cdf0e10cSrcweir 
258cdf0e10cSrcweir ////////////////////////////////////////////////////////////////////////////////////////////////////
259cdf0e10cSrcweir 
260cdf0e10cSrcweir #define	SDR_HANDLE_COLOR_SIZE_NORMAL			Size(13, 13)
261cdf0e10cSrcweir #define	SDR_HANDLE_COLOR_SIZE_SELECTED			Size(17, 17)
262cdf0e10cSrcweir 
263cdf0e10cSrcweir class SVX_DLLPUBLIC SdrHdlColor : public SdrHdl
264cdf0e10cSrcweir {
265cdf0e10cSrcweir private:
266cdf0e10cSrcweir 	// size of colr markers
267cdf0e10cSrcweir 	Size						aMarkerSize;
268cdf0e10cSrcweir 
269cdf0e10cSrcweir 	// color
270cdf0e10cSrcweir 	Color						aMarkerColor;
271cdf0e10cSrcweir 
272cdf0e10cSrcweir 	// callback link when value changed
273cdf0e10cSrcweir     Link						aColorChangeHdl;
274cdf0e10cSrcweir 
275cdf0e10cSrcweir 	// use luminance values only
276cdf0e10cSrcweir 	unsigned					bUseLuminance : 1;
277cdf0e10cSrcweir 
278cdf0e10cSrcweir 	// create marker for this kind
279cdf0e10cSrcweir 	SVX_DLLPRIVATE virtual void CreateB2dIAObject();
280cdf0e10cSrcweir 
281cdf0e10cSrcweir 	// help functions
282cdf0e10cSrcweir 	SVX_DLLPRIVATE Bitmap CreateColorDropper(Color aCol);
283cdf0e10cSrcweir 	SVX_DLLPRIVATE Color GetLuminance(const Color& rCol);
284cdf0e10cSrcweir 	SVX_DLLPRIVATE void CallColorChangeLink();
285cdf0e10cSrcweir 
286cdf0e10cSrcweir public:
287cdf0e10cSrcweir 	SdrHdlColor(const Point& rRef, Color aCol = Color(COL_BLACK), const Size& rSize = Size(11, 11), sal_Bool bLum = sal_False);
288cdf0e10cSrcweir 	virtual ~SdrHdlColor();
289cdf0e10cSrcweir 
290cdf0e10cSrcweir 	sal_Bool IsUseLuminance() const { return bUseLuminance; }
291cdf0e10cSrcweir 
292cdf0e10cSrcweir 	Color GetColor() const { return aMarkerColor; }
293cdf0e10cSrcweir 	void SetColor(Color aNew, sal_Bool bCallLink = sal_False);
294cdf0e10cSrcweir 
295cdf0e10cSrcweir 	const Size& GetSize() const { return aMarkerSize; }
296cdf0e10cSrcweir 	void SetSize(const Size& rNew);
297cdf0e10cSrcweir 
298cdf0e10cSrcweir     void SetColorChangeHdl(const Link& rLink) { aColorChangeHdl = rLink; }
299cdf0e10cSrcweir     const Link& GetColorChangeHdl() const { return aColorChangeHdl; }
300cdf0e10cSrcweir };
301cdf0e10cSrcweir 
302cdf0e10cSrcweir ////////////////////////////////////////////////////////////////////////////////////////////////////
303cdf0e10cSrcweir 
304cdf0e10cSrcweir class SdrHdlGradient : public SdrHdl
305cdf0e10cSrcweir {
306cdf0e10cSrcweir private:
307cdf0e10cSrcweir 	// pointer to used color handles
308cdf0e10cSrcweir 	SdrHdlColor*				pColHdl1;
309cdf0e10cSrcweir 	SdrHdlColor*				pColHdl2;
310cdf0e10cSrcweir 
311cdf0e10cSrcweir 	// 2nd position
312cdf0e10cSrcweir 	Point						a2ndPos;
313cdf0e10cSrcweir 
314cdf0e10cSrcweir 	// is this a gradient or a transparence
315cdf0e10cSrcweir 	unsigned					bGradient : 1;
316cdf0e10cSrcweir 
317cdf0e10cSrcweir 	// select which handle to move
318cdf0e10cSrcweir 	unsigned					bMoveSingleHandle : 1;
319cdf0e10cSrcweir 	unsigned					bMoveFirstHandle : 1;
320cdf0e10cSrcweir 
321cdf0e10cSrcweir 	// create marker for this kind
322cdf0e10cSrcweir 	virtual void CreateB2dIAObject();
323cdf0e10cSrcweir 
324cdf0e10cSrcweir public:
325cdf0e10cSrcweir 	SdrHdlGradient(const Point& rRef1, const Point& rRef2, sal_Bool bGrad = sal_True);
326cdf0e10cSrcweir 	virtual ~SdrHdlGradient();
327cdf0e10cSrcweir 
328cdf0e10cSrcweir 	sal_Bool IsGradient() const { return bGradient; }
329cdf0e10cSrcweir 
330cdf0e10cSrcweir 	// set the associated color handles
331cdf0e10cSrcweir 	void SetColorHandles(SdrHdlColor* pL1, SdrHdlColor* pL2) { pColHdl1 = pL1; pColHdl2 = pL2; }
332cdf0e10cSrcweir 	SdrHdlColor* GetColorHdl1() const { return pColHdl1; }
333cdf0e10cSrcweir 	SdrHdlColor* GetColorHdl2() const { return pColHdl2; }
334cdf0e10cSrcweir 
335cdf0e10cSrcweir 	const Point& Get2ndPos() const { return a2ndPos; }
336cdf0e10cSrcweir 	void Set2ndPos(const Point& rPnt);
337cdf0e10cSrcweir 
338cdf0e10cSrcweir 	// the link called by the color handles
339cdf0e10cSrcweir 	DECL_LINK(ColorChangeHdl, SdrHdl*);
340cdf0e10cSrcweir 
341cdf0e10cSrcweir 	// transformation call, create gradient from this handle
342cdf0e10cSrcweir 	void FromIAOToItem(SdrObject* pObj, sal_Bool bSetItemOnObject, sal_Bool bUndo);
343cdf0e10cSrcweir 
344cdf0e10cSrcweir 	// selection flags for interaction
345cdf0e10cSrcweir 	sal_Bool IsMoveSingleHandle() const { return bMoveSingleHandle; }
346cdf0e10cSrcweir 	void SetMoveSingleHandle(sal_Bool bNew) { bMoveSingleHandle = bNew; }
347cdf0e10cSrcweir 	sal_Bool IsMoveFirstHandle() const { return bMoveFirstHandle; }
348cdf0e10cSrcweir 	void SetMoveFirstHandle(sal_Bool bNew) { bMoveFirstHandle = bNew; }
349cdf0e10cSrcweir };
350cdf0e10cSrcweir 
351cdf0e10cSrcweir ////////////////////////////////////////////////////////////////////////////////////////////////////
352cdf0e10cSrcweir 
353cdf0e10cSrcweir // Spiegelachse
354cdf0e10cSrcweir class SdrHdlLine: public SdrHdl
355cdf0e10cSrcweir {
356cdf0e10cSrcweir 	// create marker for this kind
357cdf0e10cSrcweir 	virtual void CreateB2dIAObject();
358cdf0e10cSrcweir 
359cdf0e10cSrcweir protected:
360cdf0e10cSrcweir 	SdrHdl*						pHdl1;
361cdf0e10cSrcweir 	SdrHdl*						pHdl2;
362cdf0e10cSrcweir 
363cdf0e10cSrcweir public:
364cdf0e10cSrcweir 	SdrHdlLine(SdrHdl& rHdl1, SdrHdl& rHdl2, SdrHdlKind eNewKind=HDL_MIRX) { eKind=eNewKind; pHdl1=&rHdl1; pHdl2=&rHdl2; }
365cdf0e10cSrcweir 	virtual ~SdrHdlLine();
366cdf0e10cSrcweir 
367cdf0e10cSrcweir 	virtual Pointer GetPointer() const;
368cdf0e10cSrcweir };
369cdf0e10cSrcweir 
370cdf0e10cSrcweir // Ein SdrHdlBezWgt hat Kenntnis von seinem "BasisHandle". Seine Draw-Methode
371cdf0e10cSrcweir // zeichnet zusaetzlich eine Linie von seiner Position zur Position dieses
372cdf0e10cSrcweir // BasisHandles.
373cdf0e10cSrcweir class SdrHdlBezWgt: public SdrHdl
374cdf0e10cSrcweir {
375cdf0e10cSrcweir 	// create marker for this kind
376cdf0e10cSrcweir 	virtual void CreateB2dIAObject();
377cdf0e10cSrcweir 
378cdf0e10cSrcweir protected:
379cdf0e10cSrcweir 	const SdrHdl* pHdl1;
380cdf0e10cSrcweir 
381cdf0e10cSrcweir public:
382cdf0e10cSrcweir 	// das ist kein Copy-Ctor!!!
383cdf0e10cSrcweir 	SdrHdlBezWgt(const SdrHdl* pRefHdl1, SdrHdlKind eNewKind=HDL_BWGT) { eKind=eNewKind; pHdl1=pRefHdl1; }
384cdf0e10cSrcweir 	virtual ~SdrHdlBezWgt();
385cdf0e10cSrcweir };
386cdf0e10cSrcweir 
387cdf0e10cSrcweir ////////////////////////////////////////////////////////////////////////////////////////////////////
388cdf0e10cSrcweir 
389cdf0e10cSrcweir class E3dVolumeMarker : public SdrHdl
390cdf0e10cSrcweir {
391cdf0e10cSrcweir 	basegfx::B2DPolyPolygon				aWireframePoly;
392cdf0e10cSrcweir 
393cdf0e10cSrcweir 	// create marker for this kind
394cdf0e10cSrcweir 	virtual void CreateB2dIAObject();
395cdf0e10cSrcweir 
396cdf0e10cSrcweir public:
397cdf0e10cSrcweir 	E3dVolumeMarker(const basegfx::B2DPolyPolygon& rWireframePoly);
398cdf0e10cSrcweir };
399cdf0e10cSrcweir 
400cdf0e10cSrcweir ////////////////////////////////////////////////////////////////////////////////////////////////////
401cdf0e10cSrcweir 
402cdf0e10cSrcweir class ImpEdgeHdl: public SdrHdl
403cdf0e10cSrcweir {
404cdf0e10cSrcweir 	SdrEdgeLineCode eLineCode;
405cdf0e10cSrcweir 
406cdf0e10cSrcweir 	// create marker for this kind
407cdf0e10cSrcweir 	virtual void CreateB2dIAObject();
408cdf0e10cSrcweir 
409cdf0e10cSrcweir public:
410cdf0e10cSrcweir 	ImpEdgeHdl(const Point& rPnt, SdrHdlKind eNewKind): SdrHdl(rPnt,eNewKind),eLineCode(MIDDLELINE) {}
411cdf0e10cSrcweir 	virtual ~ImpEdgeHdl();
412cdf0e10cSrcweir 
413cdf0e10cSrcweir 	void SetLineCode(SdrEdgeLineCode eCode);
414cdf0e10cSrcweir 	SdrEdgeLineCode GetLineCode() const     { return eLineCode; }
415cdf0e10cSrcweir 	sal_Bool IsHorzDrag() const;
416cdf0e10cSrcweir 	virtual Pointer GetPointer() const;
417cdf0e10cSrcweir };
418cdf0e10cSrcweir 
419cdf0e10cSrcweir ////////////////////////////////////////////////////////////////////////////////////////////////////
420cdf0e10cSrcweir 
421cdf0e10cSrcweir class ImpMeasureHdl: public SdrHdl
422cdf0e10cSrcweir {
423cdf0e10cSrcweir 	// create marker for this kind
424cdf0e10cSrcweir 	virtual void CreateB2dIAObject();
425cdf0e10cSrcweir 
426cdf0e10cSrcweir public:
427cdf0e10cSrcweir 	ImpMeasureHdl(const Point& rPnt, SdrHdlKind eNewKind): SdrHdl(rPnt,eNewKind) {}
428cdf0e10cSrcweir 	virtual ~ImpMeasureHdl();
429cdf0e10cSrcweir 
430cdf0e10cSrcweir 	virtual Pointer GetPointer() const;
431cdf0e10cSrcweir };
432cdf0e10cSrcweir 
433cdf0e10cSrcweir ////////////////////////////////////////////////////////////////////////////////////////////////////
434cdf0e10cSrcweir 
435cdf0e10cSrcweir class ImpTextframeHdl: public SdrHdl
436cdf0e10cSrcweir {
437cdf0e10cSrcweir     const Rectangle maRect;
438cdf0e10cSrcweir 
439cdf0e10cSrcweir 	// create marker for this kind
440cdf0e10cSrcweir 	virtual void CreateB2dIAObject();
441cdf0e10cSrcweir 
442cdf0e10cSrcweir public:
443cdf0e10cSrcweir 	explicit ImpTextframeHdl(const Rectangle& rRect);
444cdf0e10cSrcweir };
445cdf0e10cSrcweir 
446cdf0e10cSrcweir ////////////////////////////////////////////////////////////////////////////////////////////////////
447cdf0e10cSrcweir ////////////////////////////////////////////////////////////////////////////////////////////////////
448cdf0e10cSrcweir ////////////////////////////////////////////////////////////////////////////////////////////////////
449cdf0e10cSrcweir 
450cdf0e10cSrcweir // #97016# II
451cdf0e10cSrcweir class ImplHdlListData;
452cdf0e10cSrcweir 
453cdf0e10cSrcweir class SVX_DLLPUBLIC SdrHdlList
454cdf0e10cSrcweir {
455cdf0e10cSrcweir protected:
456cdf0e10cSrcweir 	sal_uIntPtr					mnFocusIndex;
457cdf0e10cSrcweir 	SdrMarkView*				pView;
458cdf0e10cSrcweir 	Container					aList;
459cdf0e10cSrcweir 	sal_uInt16						nHdlSize;
460cdf0e10cSrcweir 
461cdf0e10cSrcweir 	unsigned					bRotateShear : 1;
462cdf0e10cSrcweir 	unsigned					bDistortShear : 1;
463cdf0e10cSrcweir 	unsigned					bMoveOutside : 1;      // Handles nach aussen ruecken (fuer TextEdit)
464cdf0e10cSrcweir 	unsigned					bFineHandles : 1;
465cdf0e10cSrcweir 
466cdf0e10cSrcweir private:
467cdf0e10cSrcweir 	SVX_DLLPRIVATE SdrHdlList(const SdrHdlList&): aList(1024,64,64)  {}
468cdf0e10cSrcweir 	SVX_DLLPRIVATE void operator=(const SdrHdlList&)                 {}
469cdf0e10cSrcweir 	SVX_DLLPRIVATE sal_Bool operator==(const SdrHdlList&) const      { return sal_False; }
470cdf0e10cSrcweir 	SVX_DLLPRIVATE sal_Bool operator!=(const SdrHdlList&) const      { return sal_False; }
471cdf0e10cSrcweir 
472cdf0e10cSrcweir public:
473cdf0e10cSrcweir 	SdrHdlList(SdrMarkView* pV);
474cdf0e10cSrcweir 	~SdrHdlList();
475cdf0e10cSrcweir 	void Clear();
476cdf0e10cSrcweir 
477cdf0e10cSrcweir 	// #97016# II
478cdf0e10cSrcweir 	void TravelFocusHdl(sal_Bool bForward);
479cdf0e10cSrcweir 	SdrHdl* GetFocusHdl() const;
480cdf0e10cSrcweir 	void SetFocusHdl(SdrHdl* pNew);
481cdf0e10cSrcweir 	void ResetFocusHdl();
482cdf0e10cSrcweir 
483cdf0e10cSrcweir 	// Access to View
484cdf0e10cSrcweir 	SdrMarkView* GetView() const;
485cdf0e10cSrcweir 
486cdf0e10cSrcweir 	// Sortierung: 1.Level Erst Refpunkt-Handles, dann normale Handles, dann Glue, dann User, dann Plushandles
487cdf0e10cSrcweir 	//             2.Level PageView (Pointer)
488cdf0e10cSrcweir 	//             3.Level Position (x+y)
489cdf0e10cSrcweir 	void     Sort();
490cdf0e10cSrcweir 	sal_uIntPtr    GetHdlCount() const                       { return aList.Count(); }
491cdf0e10cSrcweir 	SdrHdl*  GetHdl(sal_uIntPtr nNum) const                  { return (SdrHdl*)(aList.GetObject(nNum)); }
492cdf0e10cSrcweir 	sal_uIntPtr    GetHdlNum(const SdrHdl* pHdl) const;
493cdf0e10cSrcweir 	void     SetHdlSize(sal_uInt16 nSiz);
494cdf0e10cSrcweir 	sal_uInt16   GetHdlSize() const                        { return nHdlSize; }
495cdf0e10cSrcweir 	void     SetMoveOutside(sal_Bool bOn);
496cdf0e10cSrcweir 	sal_Bool IsMoveOutside() const                     { return bMoveOutside; }
497cdf0e10cSrcweir 	void     SetRotateShear(sal_Bool bOn);
498cdf0e10cSrcweir 	sal_Bool IsRotateShear() const                     { return bRotateShear; }
499cdf0e10cSrcweir 	void     SetDistortShear(sal_Bool bOn);
500cdf0e10cSrcweir 	sal_Bool IsDistortShear() const                    { return bDistortShear; }
501cdf0e10cSrcweir 	void     SetFineHdl(sal_Bool bOn);
502cdf0e10cSrcweir 	sal_Bool IsFineHdl() const                        { return bFineHandles; }
503cdf0e10cSrcweir 
504cdf0e10cSrcweir 	// AddHdl uebernimmt das Handle in sein Eigentum. Es muss
505cdf0e10cSrcweir 	// also auf dem Heap stehen, da Clear() ein delete macht.
506cdf0e10cSrcweir 	void    AddHdl(SdrHdl* pHdl, sal_Bool bAtBegin=sal_False);
507cdf0e10cSrcweir 	SdrHdl* RemoveHdl(sal_uIntPtr nNum);
508cdf0e10cSrcweir 
509cdf0e10cSrcweir 	// Zuletzt eingefuegte Handles werden am ehesten getroffen
510cdf0e10cSrcweir 	// (wenn Handles uebereinander liegen).
511cdf0e10cSrcweir 	SdrHdl* IsHdlListHit(const Point& rPnt, sal_Bool bBack=sal_False, sal_Bool bNext=sal_False, SdrHdl* pHdl0=NULL) const;
512cdf0e10cSrcweir 	SdrHdl* GetHdl(SdrHdlKind eKind1) const;
513cdf0e10cSrcweir };
514cdf0e10cSrcweir 
515cdf0e10cSrcweir ////////////////////////////////////////////////////////////////////////////////////////////////////
516cdf0e10cSrcweir 
517cdf0e10cSrcweir class SVX_DLLPUBLIC SdrCropHdl : public SdrHdl
518cdf0e10cSrcweir {
519cdf0e10cSrcweir public:
520cdf0e10cSrcweir 	SdrCropHdl(const Point& rPnt, SdrHdlKind eNewKind);
521cdf0e10cSrcweir 
522cdf0e10cSrcweir protected:
523cdf0e10cSrcweir 	// create marker for this kind
524cdf0e10cSrcweir 	virtual void CreateB2dIAObject();
525cdf0e10cSrcweir 
526cdf0e10cSrcweir 	BitmapEx GetBitmapForHandle( const BitmapEx& rBitmap, int nSize );
527cdf0e10cSrcweir 
528cdf0e10cSrcweir 	static BitmapEx GetHandlesBitmap( bool bIsFineHdl, bool bIsHighContrast );
529cdf0e10cSrcweir };
530cdf0e10cSrcweir 
531cdf0e10cSrcweir #endif //_SVDHDL_HXX
532cdf0e10cSrcweir 
533