Update ooo320-m1
[ooovba.git] / binfilter / inc / bf_svx / svdhdl.hxx
blob57a186be5a45a312860878ad3b491f347da3e4a8
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: svdhdl.hxx,v $
10 * $Revision: 1.10 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _SVDHDL_HXX
32 #define _SVDHDL_HXX
34 #ifndef _GEN_HXX //autogen
35 #include <tools/gen.hxx>
36 #endif
38 #ifndef _POINTR_HXX //autogen
39 #include <vcl/pointr.hxx>
40 #endif
42 #ifndef _CONTNR_HXX //autogen
43 #include <tools/contnr.hxx>
44 #endif
46 #ifndef _SOLAR_HRC
47 #include <bf_svtools/solar.hrc>
48 #endif
50 //#ifndef _B2D_MPNT_HXX
51 //#include <bf_goodies/b2dmpnt.hxx>
52 //#endif
54 //#ifndef _B2D_MLINE_HXX
55 //#include <bf_goodies/b2dmline.hxx>
56 //#endif
58 //#ifndef _B2D_MBMP_HXX
59 //#include <bf_goodies/b2dmbmp.hxx>
60 //#endif
62 #include <bf_svx/xpoly.hxx>
63 #include <bf_svx/svdoedge.hxx>
64 class VirtualDevice;
65 class OutputDevice;
66 class Region;
67 class Window;
68 namespace binfilter {
71 class SdrHdlList;
72 class SdrObject;
73 class SdrPageView;
74 class SdrHdlBitmapSet;
75 class SdrMarkView;
77 ////////////////////////////////////////////////////////////////////////////////////////////////////
79 // Jedes Objekt muss in der Lage seine Handles zu erzeugen. Diese werden dann
80 // bei einer Selektion abgeholt, bei der View angemeldet und sichtbar gemacht.
81 // Wird ein Handle von der Maus beruehrt (IsHit()), so wird von der View der
82 // entsprechende Mauszeiger vom Handle abgeholt und der App auf Anfrage zum
83 // reinschalten uebergeben.
84 // Handles wie z.B. der Rotationsmittelpunkt oder die Spiegelachse werden von
85 // der View generiert, wenn vom Controller der entsprechende Transformations-
86 // Modus selektiert wird.
87 // HDL_MOVE...HDL_LWRGT muessen im enum immer zusammen stehen bleiben!
89 enum SdrHdlKind
91 HDL_MOVE, // Handle zum Verschieben des Objekts
92 HDL_UPLFT, // Oben links
93 HDL_UPPER, // Oben
94 HDL_UPRGT, // Oben rechts
95 HDL_LEFT, // Links
96 HDL_RIGHT, // Rechts
97 HDL_LWLFT, // Unten links
98 HDL_LOWER, // Unten
99 HDL_LWRGT, // Unten rechts
100 HDL_POLY, // Punktselektion an Polygon oder Bezierkurve
101 HDL_BWGT, // Gewicht an einer Bezierkurve
102 HDL_CIRC, // Winkel an Kreissegmenten, Eckenradius am Rect
103 HDL_REF1, // Referenzpunkt 1, z.B. Rotationsmitte
104 HDL_REF2, // Referenzpunkt 2, z.B. Endpunkt der Spiegelachse
105 HDL_MIRX, // Die Spiegelachse selbst
106 HDL_GLUE, // GluePoint
107 HDL_ANCHOR, // anchor symbol (SD, SW)
108 HDL_TRNS, // interactive transparence
109 HDL_GRAD, // interactive gradient
110 HDL_COLR, // interactive color
111 HDL_USER,
112 HDL_ANCHOR_TR // #101688# Anchor handle with (0,0) at top right for SW
115 ////////////////////////////////////////////////////////////////////////////////////////////////////
117 enum BitmapColorIndex
119 LightGreen,
120 Cyan,
121 LightCyan,
122 Red,
123 LightRed
126 ////////////////////////////////////////////////////////////////////////////////////////////////////
128 enum BitmapMarkerKind
130 Rect_7x7,
131 Rect_9x9,
132 Rect_11x11,
133 Rect_13x13,
134 Circ_7x7,
135 Circ_9x9,
136 Circ_11x11,
137 Elli_7x9,
138 Elli_9x11,
139 Elli_9x7,
140 Elli_11x9,
141 RectPlus_7x7,
142 RectPlus_9x9,
143 RectPlus_11x11,
144 Crosshair,
145 Glue,
146 Anchor,
148 // #98388# add AnchorPressed to be able to aninate anchor control, too.
149 AnchorPressed,
151 // #101688# AnchorTR for SW
152 AnchorTR,
153 AnchorPressedTR
156 ////////////////////////////////////////////////////////////////////////////////////////////////////
158 class SdrHdl
160 friend class SdrMarkView; // fuer den Zugriff auf nObjHdlNum
161 public:
162 virtual ~SdrHdl();
164 SdrHdlKind GetKind() const { DBG_BF_ASSERT(0, "STRIP"); return HDL_MOVE; }//STRIP001 SdrHdlKind GetKind() const { return eKind; }
165 SdrObject* GetObj() const {DBG_BF_ASSERT(0, "STRIP"); return NULL; }//STRIP001 SdrObject* GetObj() const { return pObj; }
168 ////////////////////////////////////////////////////////////////////////////////////////////////////
170 #define SDR_HANDLE_COLOR_SIZE_NORMAL Size(13, 13)
171 #define SDR_HANDLE_COLOR_SIZE_SELECTED Size(17, 17)
174 ////////////////////////////////////////////////////////////////////////////////////////////////////
177 ////////////////////////////////////////////////////////////////////////////////////////////////////
179 // Spiegelachse
181 // Ein SdrHdlBezWgt hat Kenntnis von seinem "BasisHandle". Seine Draw-Methode
182 // zeichnet zusaetzlich eine Linie von seiner Position zur Position dieses
183 // BasisHandles.
185 ////////////////////////////////////////////////////////////////////////////////////////////////////
188 ////////////////////////////////////////////////////////////////////////////////////////////////////
191 ////////////////////////////////////////////////////////////////////////////////////////////////////
194 ////////////////////////////////////////////////////////////////////////////////////////////////////
195 ////////////////////////////////////////////////////////////////////////////////////////////////////
196 ////////////////////////////////////////////////////////////////////////////////////////////////////
198 // #97016# II
199 class ImplHdlListData;
201 class SdrHdlList
203 protected:
204 // #97016# II: use ImplHdlListData here to hold two data items
205 //SdrMarkView* pView;
206 ImplHdlListData* pImpl;
208 Container aList;
209 USHORT nHdlSize;
211 unsigned bRotateShear : 1;
212 unsigned bDistortShear : 1;
213 unsigned bMoveOutside : 1; // Handles nach aussen ruecken (fuer TextEdit)
214 unsigned bFineHandles : 1;
216 private:
217 SdrHdlList(const SdrHdlList&): aList(1024,64,64) {}
218 void operator=(const SdrHdlList&) {}
219 BOOL operator==(const SdrHdlList&) const { return FALSE; }
220 BOOL operator!=(const SdrHdlList&) const { return FALSE; }
222 public:
223 SdrHdlList(SdrMarkView* pV);
224 ~SdrHdlList();
225 void Clear();
227 // #97016# II
228 SdrHdl* GetFocusHdl() const;
230 // Access to View
231 // #97016# II: moved implementation to cxx
232 SdrMarkView* GetView() const;
234 // Sortierung: 1.Level Erst Refpunkt-Handles, dann normale Handles, dann Glue, dann User, dann Plushandles
235 // 2.Level PageView (Pointer)
236 // 3.Level Position (x+y)
237 void Sort();
238 ULONG GetHdlCount() const { return aList.Count(); }
239 SdrHdl* GetHdl(ULONG nNum) const { return (SdrHdl*)(aList.GetObject(nNum)); }
240 USHORT GetHdlSize() const { return nHdlSize; }
241 BOOL IsMoveOutside() const { return bMoveOutside; }
242 void SetRotateShear(BOOL bOn);
243 BOOL IsRotateShear() const { return bRotateShear; }
244 void SetDistortShear(BOOL bOn);
245 BOOL IsDistortShear() const { return bDistortShear; }
246 void SetFineHdl(BOOL bOn);
247 BOOL IsFineHdl() const { return bFineHandles; }
250 }//end of namespace binfilter
251 #endif //_SVDHDL_HXX