LibreOffice Module svx (master) 1
svddrgm1.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#ifndef INCLUDED_SVX_SOURCE_SVDRAW_SVDDRGM1_HXX
21#define INCLUDED_SVX_SOURCE_SVDRAW_SVDDRGM1_HXX
22
23#include <svx/xpoly.hxx>
24#include <svx/svdhdl.hxx>
25#include <svx/svddrgv.hxx>
26#include <svx/svddrgmt.hxx>
27
28class SdrDragView;
29
31{
32protected:
33 // define nothing, override to do so
34 virtual void createSdrDragEntries() override;
35
36public:
37 explicit SdrDragMovHdl(SdrDragView& rNewView);
38
39 virtual OUString GetSdrDragComment() const override;
40 virtual bool BeginSdrDrag() override;
41 virtual void MoveSdrDrag(const Point& rPnt) override;
42 virtual bool EndSdrDrag(bool bCopy) override;
43 virtual void CancelSdrDrag() override;
44 virtual PointerStyle GetSdrDragPointer() const override;
45};
46
48{
49private:
50 double nSin;
51 double nCos;
54 bool bRight;
55
56public:
57 explicit SdrDragRotate(SdrDragView& rNewView);
58
59 virtual OUString GetSdrDragComment() const override;
60 virtual bool BeginSdrDrag() override;
61 virtual void MoveSdrDrag(const Point& rPnt) override;
62 virtual bool EndSdrDrag(bool bCopy) override;
63 virtual PointerStyle GetSdrDragPointer() const override;
64
65 virtual basegfx::B2DHomMatrix getCurrentTransformation() const override;
66 virtual void applyCurrentTransformationToSdrObject(SdrObject& rTarget) override;
67};
68
70{
71private:
75 double nTan;
76 bool bVertical; // contort vertically
77 bool bResize; // shear and resize
78 bool bUpSideDown; // mirror and shear/slant
79 bool bSlant;
80
81public:
82 SdrDragShear(SdrDragView& rNewView,bool bSlant1);
83
84 virtual OUString GetSdrDragComment() const override;
85 virtual bool BeginSdrDrag() override;
86 virtual void MoveSdrDrag(const Point& rPnt) override;
87 virtual bool EndSdrDrag(bool bCopy) override;
88 virtual PointerStyle GetSdrDragPointer() const override;
89
90 virtual basegfx::B2DHomMatrix getCurrentTransformation() const override;
91 virtual void applyCurrentTransformationToSdrObject(SdrObject& rTarget) override;
92};
93
95{
96private:
100 bool bSide0;
101
102 bool ImpCheckSide(const Point& rPnt) const;
103
104public:
105 explicit SdrDragMirror(SdrDragView& rNewView);
106
107 virtual OUString GetSdrDragComment() const override;
108 virtual bool BeginSdrDrag() override;
109 virtual void MoveSdrDrag(const Point& rPnt) override;
110 virtual bool EndSdrDrag(bool bCopy) override;
111 virtual PointerStyle GetSdrDragPointer() const override;
112
113 virtual basegfx::B2DHomMatrix getCurrentTransformation() const override;
114 virtual void applyCurrentTransformationToSdrObject(SdrObject& rTarget) override;
115};
116
118{
119private:
120 // Handles to work on
122
123 // is this for gradient (or for transparency)?
124 bool bIsGradient : 1;
125
126public:
127 SdrDragGradient(SdrDragView& rNewView, bool bGrad = true);
128
129 bool IsGradient() const { return bIsGradient; }
130
131 virtual OUString GetSdrDragComment() const override;
132 virtual bool BeginSdrDrag() override;
133 virtual void MoveSdrDrag(const Point& rPnt) override;
134 virtual bool EndSdrDrag(bool bCopy) override;
135 virtual PointerStyle GetSdrDragPointer() const override;
136 virtual void CancelSdrDrag() override;
137};
138
140{
141private:
156 bool bValid;
157 bool bLft;
158 bool bRgt;
159 bool bUpr;
160 bool bLwr;
165
166 // helpers for applyCurrentTransformationToPolyPolygon
168 void MovCrookPoint(Point& rPnt, Point* pC1, Point* pC2);
169
170protected:
171 // needs to add drag geometry to the default
172 virtual void createSdrDragEntries() override;
173
174public:
175 explicit SdrDragCrook(SdrDragView& rNewView);
176
177 virtual OUString GetSdrDragComment() const override;
178 virtual bool BeginSdrDrag() override;
179 virtual void MoveSdrDrag(const Point& rPnt) override;
180 virtual bool EndSdrDrag(bool bCopy) override;
181 virtual PointerStyle GetSdrDragPointer() const override;
182
183 virtual void applyCurrentTransformationToSdrObject(SdrObject& rTarget) override;
185};
186
188{
189private:
192 sal_uInt16 nPolyPt;
196
197 // helper for applyCurrentTransformationToPolyPolygon
199
200protected:
201 // needs to add drag geometry to the default
202 virtual void createSdrDragEntries() override;
203
204public:
205 explicit SdrDragDistort(SdrDragView& rNewView);
206
207 virtual OUString GetSdrDragComment() const override;
208 virtual bool BeginSdrDrag() override;
209 virtual void MoveSdrDrag(const Point& rPnt) override;
210 virtual bool EndSdrDrag(bool bCopy) override;
211 virtual PointerStyle GetSdrDragPointer() const override;
212
213 virtual void applyCurrentTransformationToSdrObject(SdrObject& rTarget) override;
215};
216
217// derive from SdrDragObjOwn to have handles aligned to object when it
218// is sheared or rotated
220{
221public:
222 explicit SdrDragCrop(SdrDragView& rNewView);
223
224 virtual OUString GetSdrDragComment() const override;
225 virtual bool BeginSdrDrag() override;
226 virtual bool EndSdrDrag(bool bCopy) override;
227 virtual PointerStyle GetSdrDragPointer() const override;
228};
229
230#endif // INCLUDED_SVX_SOURCE_SVDRAW_SVDDRGM1_HXX
231
232/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SdrCrookMode eMode
Definition: svddrgm1.hxx:164
virtual void MoveSdrDrag(const Point &rPnt) override
Definition: svddrgmt.cxx:3079
virtual void createSdrDragEntries() override
Definition: svddrgmt.cxx:2875
void MovCrookPoint(Point &rPnt, Point *pC1, Point *pC2)
Definition: svddrgmt.cxx:3033
tools::Long nMarkSize
Definition: svddrgm1.hxx:163
SdrDragCrook(SdrDragView &rNewView)
Definition: svddrgmt.cxx:2752
virtual bool EndSdrDrag(bool bCopy) override
Definition: svddrgmt.cxx:3300
virtual bool BeginSdrDrag() override
Definition: svddrgmt.cxx:2892
Fraction aFact
Definition: svddrgm1.hxx:146
virtual OUString GetSdrDragComment() const override
Definition: svddrgmt.cxx:2775
bool bAtCenter
Definition: svddrgm1.hxx:161
void MovAllPoints(basegfx::B2DPolyPolygon &rTarget)
Definition: svddrgmt.cxx:2916
virtual void applyCurrentTransformationToSdrObject(SdrObject &rTarget) override
Definition: svddrgmt.cxx:3242
bool bContortionAllowed
Definition: svddrgm1.hxx:148
bool bVertical
Definition: svddrgm1.hxx:155
virtual void applyCurrentTransformationToPolyPolygon(basegfx::B2DPolyPolygon &rTarget) override
Definition: svddrgmt.cxx:3294
Point aStart
Definition: svddrgm1.hxx:145
Degree100 nAngle
Definition: svddrgm1.hxx:162
tools::Rectangle aMarkRect
Definition: svddrgm1.hxx:142
Point aCenter
Definition: svddrgm1.hxx:144
bool bResizeAllowed
Definition: svddrgm1.hxx:151
Point aMarkCenter
Definition: svddrgm1.hxx:143
bool bContortion
Definition: svddrgm1.hxx:150
bool bNoContortionAllowed
Definition: svddrgm1.hxx:149
virtual PointerStyle GetSdrDragPointer() const override
Definition: svddrgmt.cxx:3377
bool bRotateAllowed
Definition: svddrgm1.hxx:153
virtual PointerStyle GetSdrDragPointer() const override
Definition: svddrgmt.cxx:3856
SdrDragCrop(SdrDragView &rNewView)
Definition: svddrgmt.cxx:3529
virtual OUString GetSdrDragComment() const override
Definition: svddrgmt.cxx:3537
virtual bool BeginSdrDrag() override
Definition: svddrgmt.cxx:3551
virtual bool EndSdrDrag(bool bCopy) override
Definition: svddrgmt.cxx:3565
XPolygon aDistortedRect
Definition: svddrgm1.hxx:191
tools::Rectangle aMarkRect
Definition: svddrgm1.hxx:190
bool bNoContortionAllowed
Definition: svddrgm1.hxx:194
virtual PointerStyle GetSdrDragPointer() const override
Definition: svddrgmt.cxx:3507
virtual void createSdrDragEntries() override
Definition: svddrgmt.cxx:3406
sal_uInt16 nPolyPt
Definition: svddrgm1.hxx:192
virtual OUString GetSdrDragComment() const override
Definition: svddrgmt.cxx:3392
virtual void applyCurrentTransformationToSdrObject(SdrObject &rTarget) override
Definition: svddrgmt.cxx:3512
SdrDragDistort(SdrDragView &rNewView)
Definition: svddrgmt.cxx:3383
bool bContortionAllowed
Definition: svddrgm1.hxx:193
virtual void MoveSdrDrag(const Point &rPnt) override
Definition: svddrgmt.cxx:3471
virtual bool EndSdrDrag(bool bCopy) override
Definition: svddrgmt.cxx:3493
void MovAllPoints(basegfx::B2DPolyPolygon &rTarget)
Definition: svddrgmt.cxx:3450
virtual bool BeginSdrDrag() override
Definition: svddrgmt.cxx:3423
virtual void applyCurrentTransformationToPolyPolygon(basegfx::B2DPolyPolygon &rTarget) override
Definition: svddrgmt.cxx:3522
virtual void MoveSdrDrag(const Point &rPnt) override
Definition: svddrgmt.cxx:2678
virtual bool EndSdrDrag(bool bCopy) override
Definition: svddrgmt.cxx:2719
bool IsGradient() const
Definition: svddrgm1.hxx:129
SdrHdlGradient * pIAOHandle
Definition: svddrgm1.hxx:121
virtual bool BeginSdrDrag() override
Definition: svddrgmt.cxx:2609
virtual PointerStyle GetSdrDragPointer() const override
Definition: svddrgmt.cxx:2746
virtual OUString GetSdrDragComment() const override
Definition: svddrgmt.cxx:2601
virtual void CancelSdrDrag() override
Definition: svddrgmt.cxx:2730
SdrDragGradient(SdrDragView &rNewView, bool bGrad=true)
Definition: svddrgmt.cxx:2594
virtual basegfx::B2DHomMatrix getCurrentTransformation() const override
Definition: svddrgmt.cxx:2539
Degree100 nAngle
Definition: svddrgm1.hxx:98
bool ImpCheckSide(const Point &rPnt) const
Definition: svddrgmt.cxx:2480
virtual OUString GetSdrDragComment() const override
Definition: svddrgmt.cxx:2489
SdrDragMirror(SdrDragView &rNewView)
Definition: svddrgmt.cxx:2472
bool bMirrored
Definition: svddrgm1.hxx:99
virtual bool BeginSdrDrag() override
Definition: svddrgmt.cxx:2506
virtual void MoveSdrDrag(const Point &rPnt) override
Definition: svddrgmt.cxx:2559
virtual void applyCurrentTransformationToSdrObject(SdrObject &rTarget) override
Definition: svddrgmt.cxx:2464
virtual bool EndSdrDrag(bool bCopy) override
Definition: svddrgmt.cxx:2576
virtual PointerStyle GetSdrDragPointer() const override
Definition: svddrgmt.cxx:2588
virtual void CancelSdrDrag() override
Definition: svddrgmt.cxx:1133
virtual OUString GetSdrDragComment() const override
Definition: svddrgmt.cxx:957
virtual bool BeginSdrDrag() override
Definition: svddrgmt.cxx:964
virtual PointerStyle GetSdrDragPointer() const override
Definition: svddrgmt.cxx:1147
virtual void MoveSdrDrag(const Point &rPnt) override
Definition: svddrgmt.cxx:994
virtual bool EndSdrDrag(bool bCopy) override
Definition: svddrgmt.cxx:1107
virtual void createSdrDragEntries() override
Definition: svddrgmt.cxx:951
SdrDragMovHdl(SdrDragView &rNewView)
Definition: svddrgmt.cxx:946
virtual PointerStyle GetSdrDragPointer() const override
Definition: svddrgmt.cxx:2182
double nSin
Definition: svddrgm1.hxx:50
virtual void applyCurrentTransformationToSdrObject(SdrObject &rTarget) override
Definition: svddrgmt.cxx:2045
virtual void MoveSdrDrag(const Point &rPnt) override
Definition: svddrgmt.cxx:2113
double nCos
Definition: svddrgm1.hxx:51
Degree100 nAngle0
Definition: svddrgm1.hxx:52
virtual OUString GetSdrDragComment() const override
Definition: svddrgmt.cxx:2060
virtual basegfx::B2DHomMatrix getCurrentTransformation() const override
Definition: svddrgmt.cxx:2106
virtual bool EndSdrDrag(bool bCopy) override
Definition: svddrgmt.cxx:2160
Degree100 nAngle
Definition: svddrgm1.hxx:53
SdrDragRotate(SdrDragView &rNewView)
Definition: svddrgmt.cxx:2050
virtual bool BeginSdrDrag() override
Definition: svddrgmt.cxx:2078
virtual OUString GetSdrDragComment() const override
Definition: svddrgmt.cxx:2201
double nTan
Definition: svddrgm1.hxx:75
virtual basegfx::B2DHomMatrix getCurrentTransformation() const override
Definition: svddrgmt.cxx:2252
Degree100 nAngle0
Definition: svddrgm1.hxx:73
SdrDragShear(SdrDragView &rNewView, bool bSlant1)
Definition: svddrgmt.cxx:2188
virtual void MoveSdrDrag(const Point &rPnt) override
Definition: svddrgmt.cxx:2276
virtual bool EndSdrDrag(bool bCopy) override
Definition: svddrgmt.cxx:2408
virtual void applyCurrentTransformationToSdrObject(SdrObject &rTarget) override
Definition: svddrgmt.cxx:2388
bool bVertical
Definition: svddrgm1.hxx:76
Degree100 nAngle
Definition: svddrgm1.hxx:74
Fraction aFact
Definition: svddrgm1.hxx:72
virtual PointerStyle GetSdrDragPointer() const override
Definition: svddrgmt.cxx:2455
bool bUpSideDown
Definition: svddrgm1.hxx:78
virtual bool BeginSdrDrag() override
Definition: svddrgmt.cxx:2220
bool bResize
Definition: svddrgm1.hxx:77
Abstract DrawObject.
Definition: svdobj.hxx:261
long Long
PointerStyle
SdrCrookMode
Definition: svdsnpv.hxx:83