bump product version to 4.1.6.2
[LibreOffice.git] / svx / source / svdraw / svddrgm1.hxx
blob344dadac7c6e32f17dfb7a5351640bc29e8b8cd9
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef _SVDDRGM1_HXX
21 #define _SVDDRGM1_HXX
23 #include <svx/xpoly.hxx>
24 #include <svx/svdhdl.hxx>
25 #include <svx/svddrgv.hxx>
26 #include <svx/svddrgmt.hxx>
28 ////////////////////////////////////////////////////////////////////////////////////////////////////
29 // predeclarations
31 class SdrDragView;
33 ////////////////////////////////////////////////////////////////////////////////////////////////////
34 // SdrDragMovHdl
36 class SdrDragMovHdl : public SdrDragMethod
38 protected:
39 // define nothing, overload to do so
40 virtual void createSdrDragEntries();
42 public:
43 TYPEINFO();
44 SdrDragMovHdl(SdrDragView& rNewView);
46 virtual void TakeSdrDragComment(String& rStr) const;
47 virtual bool BeginSdrDrag();
48 virtual void MoveSdrDrag(const Point& rPnt);
49 virtual bool EndSdrDrag(bool bCopy);
50 virtual void CancelSdrDrag();
51 virtual Pointer GetSdrDragPointer() const;
54 ////////////////////////////////////////////////////////////////////////////////////////////////////
55 // SdrDragRotate
57 class SdrDragRotate : public SdrDragMethod
59 private:
60 double nSin;
61 double nCos;
62 long nWink0;
63 long nWink;
64 bool bRight;
66 public:
67 TYPEINFO();
68 SdrDragRotate(SdrDragView& rNewView);
70 virtual void TakeSdrDragComment(String& rStr) const;
71 virtual bool BeginSdrDrag();
72 virtual void MoveSdrDrag(const Point& rPnt);
73 virtual bool EndSdrDrag(bool bCopy);
74 virtual Pointer GetSdrDragPointer() const;
76 virtual basegfx::B2DHomMatrix getCurrentTransformation();
77 virtual void applyCurrentTransformationToSdrObject(SdrObject& rTarget);
80 ////////////////////////////////////////////////////////////////////////////////////////////////////
81 // SdrDragShear
83 class SdrDragShear : public SdrDragMethod
85 private:
86 Fraction aFact;
87 long nWink0;
88 long nWink;
89 double nTan;
90 bool bVertical; // contort vertically
91 bool bResize; // shear and resize
92 bool bUpSideDown; // mirror and shear/slant
93 bool bSlant;
95 public:
96 TYPEINFO();
97 SdrDragShear(SdrDragView& rNewView,bool bSlant1);
99 virtual void TakeSdrDragComment(String& rStr) const;
100 virtual bool BeginSdrDrag();
101 virtual void MoveSdrDrag(const Point& rPnt);
102 virtual bool EndSdrDrag(bool bCopy);
103 virtual Pointer GetSdrDragPointer() const;
105 virtual basegfx::B2DHomMatrix getCurrentTransformation();
106 virtual void applyCurrentTransformationToSdrObject(SdrObject& rTarget);
109 ////////////////////////////////////////////////////////////////////////////////////////////////////
110 // SdrDragMirror
112 class SdrDragMirror : public SdrDragMethod
114 private:
115 Point aDif;
116 long nWink;
117 bool bMirrored;
118 bool bSide0;
120 bool ImpCheckSide(const Point& rPnt) const;
122 public:
123 TYPEINFO();
124 SdrDragMirror(SdrDragView& rNewView);
126 virtual void TakeSdrDragComment(String& rStr) const;
127 virtual bool BeginSdrDrag();
128 virtual void MoveSdrDrag(const Point& rPnt);
129 virtual bool EndSdrDrag(bool bCopy);
130 virtual Pointer GetSdrDragPointer() const;
132 virtual basegfx::B2DHomMatrix getCurrentTransformation();
133 virtual void applyCurrentTransformationToSdrObject(SdrObject& rTarget);
136 ////////////////////////////////////////////////////////////////////////////////////////////////////
137 // SdrDragGradient
139 class SdrDragGradient : public SdrDragMethod
141 private:
142 // Handles to work on
143 SdrHdlGradient* pIAOHandle;
145 // is this for gradient (or for transparency)?
146 unsigned bIsGradient : 1;
148 public:
149 TYPEINFO();
150 SdrDragGradient(SdrDragView& rNewView, bool bGrad = true);
152 bool IsGradient() const { return bIsGradient; }
154 virtual void TakeSdrDragComment(String& rStr) const;
155 virtual bool BeginSdrDrag();
156 virtual void MoveSdrDrag(const Point& rPnt);
157 virtual bool EndSdrDrag(bool bCopy);
158 virtual Pointer GetSdrDragPointer() const;
159 virtual void CancelSdrDrag();
162 ////////////////////////////////////////////////////////////////////////////////////////////////////
163 // SdrDragCrook
165 class SdrDragCrook : public SdrDragMethod
167 private:
168 Rectangle aMarkRect;
169 Point aMarkCenter;
170 Point aCenter;
171 Point aStart;
172 Fraction aFact;
173 Point aRad;
174 bool bContortionAllowed;
175 bool bNoContortionAllowed;
176 bool bContortion;
177 bool bResizeAllowed;
178 bool bResize;
179 bool bRotateAllowed;
180 bool bRotate;
181 bool bVertical;
182 bool bValid;
183 bool bLft;
184 bool bRgt;
185 bool bUpr;
186 bool bLwr;
187 bool bAtCenter;
188 long nWink;
189 long nMarkSize;
190 SdrCrookMode eMode;
192 // helpers for applyCurrentTransformationToPolyPolygon
193 void _MovAllPoints(basegfx::B2DPolyPolygon& rTarget);
194 void _MovCrookPoint(Point& rPnt, Point* pC1, Point* pC2);
196 protected:
197 // needs to add drag geometry to the default
198 virtual void createSdrDragEntries();
200 public:
201 TYPEINFO();
202 SdrDragCrook(SdrDragView& rNewView);
204 virtual void TakeSdrDragComment(String& rStr) const;
205 virtual bool BeginSdrDrag();
206 virtual void MoveSdrDrag(const Point& rPnt);
207 virtual bool EndSdrDrag(bool bCopy);
208 virtual Pointer GetSdrDragPointer() const;
210 virtual void applyCurrentTransformationToSdrObject(SdrObject& rTarget);
211 virtual void applyCurrentTransformationToPolyPolygon(basegfx::B2DPolyPolygon& rTarget);
214 ////////////////////////////////////////////////////////////////////////////////////////////////////
215 // SdrDragDistort
217 class SdrDragDistort : public SdrDragMethod
219 private:
220 Rectangle aMarkRect;
221 XPolygon aDistortedRect;
222 sal_uInt16 nPolyPt;
223 bool bContortionAllowed;
224 bool bNoContortionAllowed;
225 bool bContortion;
227 // helper for applyCurrentTransformationToPolyPolygon
228 void _MovAllPoints(basegfx::B2DPolyPolygon& rTarget);
230 protected:
231 // needs to add drag geometry to the default
232 virtual void createSdrDragEntries();
234 public:
235 TYPEINFO();
236 SdrDragDistort(SdrDragView& rNewView);
238 virtual void TakeSdrDragComment(String& rStr) const;
239 virtual bool BeginSdrDrag();
240 virtual void MoveSdrDrag(const Point& rPnt);
241 virtual bool EndSdrDrag(bool bCopy);
242 virtual Pointer GetSdrDragPointer() const;
244 virtual void applyCurrentTransformationToSdrObject(SdrObject& rTarget);
245 virtual void applyCurrentTransformationToPolyPolygon(basegfx::B2DPolyPolygon& rTarget);
248 ////////////////////////////////////////////////////////////////////////////////////////////////////
249 // SdrDragCrop
251 class SdrDragCrop : public SdrDragResize
253 public:
254 TYPEINFO();
255 SdrDragCrop(SdrDragView& rNewView);
257 virtual void TakeSdrDragComment(String& rStr) const;
258 virtual bool EndSdrDrag(bool bCopy);
259 virtual Pointer GetSdrDragPointer() const;
262 ////////////////////////////////////////////////////////////////////////////////////////////////////
263 #endif //_SVDDRGM1_HXX
265 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */