Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #ifndef _SVDDRGM1_HXX
30 : : #define _SVDDRGM1_HXX
31 : :
32 : : #include <svx/xpoly.hxx>
33 : : #include <svx/svdhdl.hxx>
34 : : #include <svx/svddrgv.hxx>
35 : : #include <svx/svddrgmt.hxx>
36 : :
37 : : ////////////////////////////////////////////////////////////////////////////////////////////////////
38 : : // predeclarations
39 : :
40 : : class SdrDragView;
41 : :
42 : : ////////////////////////////////////////////////////////////////////////////////////////////////////
43 : : // SdrDragMovHdl
44 : :
45 [ # # ]: 0 : class SdrDragMovHdl : public SdrDragMethod
46 : : {
47 : : protected:
48 : : // define nothing, overload to do so
49 : : virtual void createSdrDragEntries();
50 : :
51 : : public:
52 : : TYPEINFO();
53 : : SdrDragMovHdl(SdrDragView& rNewView);
54 : :
55 : : virtual void TakeSdrDragComment(String& rStr) const;
56 : : virtual bool BeginSdrDrag();
57 : : virtual void MoveSdrDrag(const Point& rPnt);
58 : : virtual bool EndSdrDrag(bool bCopy);
59 : : virtual void CancelSdrDrag();
60 : : virtual Pointer GetSdrDragPointer() const;
61 : : };
62 : :
63 : : ////////////////////////////////////////////////////////////////////////////////////////////////////
64 : : // SdrDragRotate
65 : :
66 [ # # ]: 0 : class SdrDragRotate : public SdrDragMethod
67 : : {
68 : : private:
69 : : double nSin;
70 : : double nCos;
71 : : long nWink0;
72 : : long nWink;
73 : : bool bRight;
74 : :
75 : : public:
76 : : TYPEINFO();
77 : : SdrDragRotate(SdrDragView& rNewView);
78 : :
79 : : virtual void TakeSdrDragComment(String& rStr) const;
80 : : virtual bool BeginSdrDrag();
81 : : virtual void MoveSdrDrag(const Point& rPnt);
82 : : virtual bool EndSdrDrag(bool bCopy);
83 : : virtual Pointer GetSdrDragPointer() const;
84 : :
85 : : virtual basegfx::B2DHomMatrix getCurrentTransformation();
86 : : virtual void applyCurrentTransformationToSdrObject(SdrObject& rTarget);
87 : : };
88 : :
89 : : ////////////////////////////////////////////////////////////////////////////////////////////////////
90 : : // SdrDragShear
91 : :
92 [ # # ]: 0 : class SdrDragShear : public SdrDragMethod
93 : : {
94 : : private:
95 : : Fraction aFact;
96 : : long nWink0;
97 : : long nWink;
98 : : double nTan;
99 : : bool bVertical; // contort vertically
100 : : bool bResize; // shear and resize
101 : : bool bUpSideDown; // mirror and shear/slant
102 : : bool bSlant;
103 : :
104 : : public:
105 : : TYPEINFO();
106 : : SdrDragShear(SdrDragView& rNewView,bool bSlant1);
107 : :
108 : : virtual void TakeSdrDragComment(String& rStr) const;
109 : : virtual bool BeginSdrDrag();
110 : : virtual void MoveSdrDrag(const Point& rPnt);
111 : : virtual bool EndSdrDrag(bool bCopy);
112 : : virtual Pointer GetSdrDragPointer() const;
113 : :
114 : : virtual basegfx::B2DHomMatrix getCurrentTransformation();
115 : : virtual void applyCurrentTransformationToSdrObject(SdrObject& rTarget);
116 : : };
117 : :
118 : : ////////////////////////////////////////////////////////////////////////////////////////////////////
119 : : // SdrDragMirror
120 : :
121 [ # # ]: 0 : class SdrDragMirror : public SdrDragMethod
122 : : {
123 : : private:
124 : : Point aDif;
125 : : long nWink;
126 : : bool bMirrored;
127 : : bool bSide0;
128 : :
129 : : bool ImpCheckSide(const Point& rPnt) const;
130 : :
131 : : public:
132 : : TYPEINFO();
133 : : SdrDragMirror(SdrDragView& rNewView);
134 : :
135 : : virtual void TakeSdrDragComment(String& rStr) const;
136 : : virtual bool BeginSdrDrag();
137 : : virtual void MoveSdrDrag(const Point& rPnt);
138 : : virtual bool EndSdrDrag(bool bCopy);
139 : : virtual Pointer GetSdrDragPointer() const;
140 : :
141 : : virtual basegfx::B2DHomMatrix getCurrentTransformation();
142 : : virtual void applyCurrentTransformationToSdrObject(SdrObject& rTarget);
143 : : };
144 : :
145 : : ////////////////////////////////////////////////////////////////////////////////////////////////////
146 : : // SdrDragGradient
147 : :
148 [ # # ]: 0 : class SdrDragGradient : public SdrDragMethod
149 : : {
150 : : private:
151 : : // Handles to work on
152 : : SdrHdlGradient* pIAOHandle;
153 : :
154 : : // is this for gradient (or for transparency)?
155 : : unsigned bIsGradient : 1;
156 : :
157 : : public:
158 : : TYPEINFO();
159 : : SdrDragGradient(SdrDragView& rNewView, bool bGrad = true);
160 : :
161 : 0 : bool IsGradient() const { return bIsGradient; }
162 : :
163 : : virtual void TakeSdrDragComment(String& rStr) const;
164 : : virtual bool BeginSdrDrag();
165 : : virtual void MoveSdrDrag(const Point& rPnt);
166 : : virtual bool EndSdrDrag(bool bCopy);
167 : : virtual Pointer GetSdrDragPointer() const;
168 : : virtual void CancelSdrDrag();
169 : : };
170 : :
171 : : ////////////////////////////////////////////////////////////////////////////////////////////////////
172 : : // SdrDragCrook
173 : :
174 [ # # ]: 0 : class SdrDragCrook : public SdrDragMethod
175 : : {
176 : : private:
177 : : Rectangle aMarkRect;
178 : : Point aMarkCenter;
179 : : Point aCenter;
180 : : Point aStart;
181 : : Fraction aFact;
182 : : Point aRad;
183 : : bool bContortionAllowed;
184 : : bool bNoContortionAllowed;
185 : : bool bContortion;
186 : : bool bResizeAllowed;
187 : : bool bResize;
188 : : bool bRotateAllowed;
189 : : bool bRotate;
190 : : bool bVertical;
191 : : bool bValid;
192 : : bool bLft;
193 : : bool bRgt;
194 : : bool bUpr;
195 : : bool bLwr;
196 : : bool bAtCenter;
197 : : long nWink;
198 : : long nMarkSize;
199 : : SdrCrookMode eMode;
200 : :
201 : : // helpers for applyCurrentTransformationToPolyPolygon
202 : : void _MovAllPoints(basegfx::B2DPolyPolygon& rTarget);
203 : : void _MovCrookPoint(Point& rPnt, Point* pC1, Point* pC2);
204 : :
205 : : protected:
206 : : // needs to add drag geometry to the default
207 : : virtual void createSdrDragEntries();
208 : :
209 : : public:
210 : : TYPEINFO();
211 : : SdrDragCrook(SdrDragView& rNewView);
212 : :
213 : : virtual void TakeSdrDragComment(String& rStr) const;
214 : : virtual bool BeginSdrDrag();
215 : : virtual void MoveSdrDrag(const Point& rPnt);
216 : : virtual bool EndSdrDrag(bool bCopy);
217 : : virtual Pointer GetSdrDragPointer() const;
218 : :
219 : : virtual void applyCurrentTransformationToSdrObject(SdrObject& rTarget);
220 : : virtual void applyCurrentTransformationToPolyPolygon(basegfx::B2DPolyPolygon& rTarget);
221 : : };
222 : :
223 : : ////////////////////////////////////////////////////////////////////////////////////////////////////
224 : : // SdrDragDistort
225 : :
226 [ # # ][ # # ]: 0 : class SdrDragDistort : public SdrDragMethod
227 : : {
228 : : private:
229 : : Rectangle aMarkRect;
230 : : XPolygon aDistortedRect;
231 : : sal_uInt16 nPolyPt;
232 : : bool bContortionAllowed;
233 : : bool bNoContortionAllowed;
234 : : bool bContortion;
235 : :
236 : : // helper for applyCurrentTransformationToPolyPolygon
237 : : void _MovAllPoints(basegfx::B2DPolyPolygon& rTarget);
238 : :
239 : : protected:
240 : : // needs to add drag geometry to the default
241 : : virtual void createSdrDragEntries();
242 : :
243 : : public:
244 : : TYPEINFO();
245 : : SdrDragDistort(SdrDragView& rNewView);
246 : :
247 : : virtual void TakeSdrDragComment(String& rStr) const;
248 : : virtual bool BeginSdrDrag();
249 : : virtual void MoveSdrDrag(const Point& rPnt);
250 : : virtual bool EndSdrDrag(bool bCopy);
251 : : virtual Pointer GetSdrDragPointer() const;
252 : :
253 : : virtual void applyCurrentTransformationToSdrObject(SdrObject& rTarget);
254 : : virtual void applyCurrentTransformationToPolyPolygon(basegfx::B2DPolyPolygon& rTarget);
255 : : };
256 : :
257 : : ////////////////////////////////////////////////////////////////////////////////////////////////////
258 : : // SdrDragCrop
259 : :
260 [ # # ]: 0 : class SdrDragCrop : public SdrDragResize
261 : : {
262 : : public:
263 : : TYPEINFO();
264 : : SdrDragCrop(SdrDragView& rNewView);
265 : :
266 : : virtual void TakeSdrDragComment(String& rStr) const;
267 : : virtual bool EndSdrDrag(bool bCopy);
268 : : virtual Pointer GetSdrDragPointer() const;
269 : : };
270 : :
271 : : ////////////////////////////////////////////////////////////////////////////////////////////////////
272 : : #endif //_SVDDRGM1_HXX
273 : :
274 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|