1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 INCLUDED_SVX_SOURCE_SVDRAW_SVDDRGM1_HXX
21 #define INCLUDED_SVX_SOURCE_SVDRAW_SVDDRGM1_HXX
23 #include <svx/xpoly.hxx>
24 #include <svx/svdhdl.hxx>
25 #include <svx/svddrgv.hxx>
26 #include <svx/svddrgmt.hxx>
36 class SdrDragMovHdl
: public SdrDragMethod
39 // define nothing, overload to do so
40 virtual void createSdrDragEntries() SAL_OVERRIDE
;
44 SdrDragMovHdl(SdrDragView
& rNewView
);
46 virtual void TakeSdrDragComment(OUString
& rStr
) const SAL_OVERRIDE
;
47 virtual bool BeginSdrDrag() SAL_OVERRIDE
;
48 virtual void MoveSdrDrag(const Point
& rPnt
) SAL_OVERRIDE
;
49 virtual bool EndSdrDrag(bool bCopy
) SAL_OVERRIDE
;
50 virtual void CancelSdrDrag() SAL_OVERRIDE
;
51 virtual Pointer
GetSdrDragPointer() const SAL_OVERRIDE
;
57 class SdrDragRotate
: public SdrDragMethod
68 SdrDragRotate(SdrDragView
& rNewView
);
70 virtual void TakeSdrDragComment(OUString
& rStr
) const SAL_OVERRIDE
;
71 virtual bool BeginSdrDrag() SAL_OVERRIDE
;
72 virtual void MoveSdrDrag(const Point
& rPnt
) SAL_OVERRIDE
;
73 virtual bool EndSdrDrag(bool bCopy
) SAL_OVERRIDE
;
74 virtual Pointer
GetSdrDragPointer() const SAL_OVERRIDE
;
76 virtual basegfx::B2DHomMatrix
getCurrentTransformation() SAL_OVERRIDE
;
77 virtual void applyCurrentTransformationToSdrObject(SdrObject
& rTarget
) SAL_OVERRIDE
;
83 class SdrDragShear
: public SdrDragMethod
90 bool bVertical
; // contort vertically
91 bool bResize
; // shear and resize
92 bool bUpSideDown
; // mirror and shear/slant
97 SdrDragShear(SdrDragView
& rNewView
,bool bSlant1
);
99 virtual void TakeSdrDragComment(OUString
& rStr
) const SAL_OVERRIDE
;
100 virtual bool BeginSdrDrag() SAL_OVERRIDE
;
101 virtual void MoveSdrDrag(const Point
& rPnt
) SAL_OVERRIDE
;
102 virtual bool EndSdrDrag(bool bCopy
) SAL_OVERRIDE
;
103 virtual Pointer
GetSdrDragPointer() const SAL_OVERRIDE
;
105 virtual basegfx::B2DHomMatrix
getCurrentTransformation() SAL_OVERRIDE
;
106 virtual void applyCurrentTransformationToSdrObject(SdrObject
& rTarget
) SAL_OVERRIDE
;
112 class SdrDragMirror
: public SdrDragMethod
120 bool ImpCheckSide(const Point
& rPnt
) const;
124 SdrDragMirror(SdrDragView
& rNewView
);
126 virtual void TakeSdrDragComment(OUString
& rStr
) const SAL_OVERRIDE
;
127 virtual bool BeginSdrDrag() SAL_OVERRIDE
;
128 virtual void MoveSdrDrag(const Point
& rPnt
) SAL_OVERRIDE
;
129 virtual bool EndSdrDrag(bool bCopy
) SAL_OVERRIDE
;
130 virtual Pointer
GetSdrDragPointer() const SAL_OVERRIDE
;
132 virtual basegfx::B2DHomMatrix
getCurrentTransformation() SAL_OVERRIDE
;
133 virtual void applyCurrentTransformationToSdrObject(SdrObject
& rTarget
) SAL_OVERRIDE
;
139 class SdrDragGradient
: public SdrDragMethod
142 // Handles to work on
143 SdrHdlGradient
* pIAOHandle
;
145 // is this for gradient (or for transparency)?
146 bool bIsGradient
: 1;
150 SdrDragGradient(SdrDragView
& rNewView
, bool bGrad
= true);
152 bool IsGradient() const { return bIsGradient
; }
154 virtual void TakeSdrDragComment(OUString
& rStr
) const SAL_OVERRIDE
;
155 virtual bool BeginSdrDrag() SAL_OVERRIDE
;
156 virtual void MoveSdrDrag(const Point
& rPnt
) SAL_OVERRIDE
;
157 virtual bool EndSdrDrag(bool bCopy
) SAL_OVERRIDE
;
158 virtual Pointer
GetSdrDragPointer() const SAL_OVERRIDE
;
159 virtual void CancelSdrDrag() SAL_OVERRIDE
;
165 class SdrDragCrook
: public SdrDragMethod
174 bool bContortionAllowed
;
175 bool bNoContortionAllowed
;
192 // helpers for applyCurrentTransformationToPolyPolygon
193 void _MovAllPoints(basegfx::B2DPolyPolygon
& rTarget
);
194 void _MovCrookPoint(Point
& rPnt
, Point
* pC1
, Point
* pC2
);
197 // needs to add drag geometry to the default
198 virtual void createSdrDragEntries() SAL_OVERRIDE
;
202 SdrDragCrook(SdrDragView
& rNewView
);
204 virtual void TakeSdrDragComment(OUString
& rStr
) const SAL_OVERRIDE
;
205 virtual bool BeginSdrDrag() SAL_OVERRIDE
;
206 virtual void MoveSdrDrag(const Point
& rPnt
) SAL_OVERRIDE
;
207 virtual bool EndSdrDrag(bool bCopy
) SAL_OVERRIDE
;
208 virtual Pointer
GetSdrDragPointer() const SAL_OVERRIDE
;
210 virtual void applyCurrentTransformationToSdrObject(SdrObject
& rTarget
) SAL_OVERRIDE
;
211 virtual void applyCurrentTransformationToPolyPolygon(basegfx::B2DPolyPolygon
& rTarget
) SAL_OVERRIDE
;
217 class SdrDragDistort
: public SdrDragMethod
221 XPolygon aDistortedRect
;
223 bool bContortionAllowed
;
224 bool bNoContortionAllowed
;
227 // helper for applyCurrentTransformationToPolyPolygon
228 void _MovAllPoints(basegfx::B2DPolyPolygon
& rTarget
);
231 // needs to add drag geometry to the default
232 virtual void createSdrDragEntries() SAL_OVERRIDE
;
236 SdrDragDistort(SdrDragView
& rNewView
);
238 virtual void TakeSdrDragComment(OUString
& rStr
) const SAL_OVERRIDE
;
239 virtual bool BeginSdrDrag() SAL_OVERRIDE
;
240 virtual void MoveSdrDrag(const Point
& rPnt
) SAL_OVERRIDE
;
241 virtual bool EndSdrDrag(bool bCopy
) SAL_OVERRIDE
;
242 virtual Pointer
GetSdrDragPointer() const SAL_OVERRIDE
;
244 virtual void applyCurrentTransformationToSdrObject(SdrObject
& rTarget
) SAL_OVERRIDE
;
245 virtual void applyCurrentTransformationToPolyPolygon(basegfx::B2DPolyPolygon
& rTarget
) SAL_OVERRIDE
;
251 // derive from SdrDragObjOwn to have handles aligned to object when it
252 // is sheared or rotated
253 class SdrDragCrop
: public SdrDragObjOwn
257 SdrDragCrop(SdrDragView
& rNewView
);
259 virtual void TakeSdrDragComment(OUString
& rStr
) const SAL_OVERRIDE
;
260 virtual bool BeginSdrDrag() SAL_OVERRIDE
;
261 virtual bool EndSdrDrag(bool bCopy
) SAL_OVERRIDE
;
262 virtual Pointer
GetSdrDragPointer() const SAL_OVERRIDE
;
266 #endif // INCLUDED_SVX_SOURCE_SVDRAW_SVDDRGM1_HXX
268 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */