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_SVDPOEV_HXX
21 #define INCLUDED_SVX_SVDPOEV_HXX
23 #include <svx/svxdllapi.h>
24 #include <svx/svdedtv.hxx>
26 #include <svx/ipolypolygoneditorcontroller.hxx>
28 class SVX_DLLPUBLIC SdrPolyEditView
: public SdrEditView
, public IPolyPolygonEditorController
30 friend class SdrEditView
;
33 bool bSetMarkedPointsSmoothPossible
: 1;
34 bool bSetMarkedSegmentsKindPossible
: 1;
36 SdrPathSmoothKind eMarkedPointsSmooth
;
37 SdrPathSegmentKind eMarkedSegmentsKind
;
40 SVX_DLLPRIVATE
void ImpResetPolyPossibilityFlags();
41 SVX_DLLPRIVATE
void ImpCheckPolyPossibilities();
43 typedef void (*PPolyTrFunc
)(Point
&, Point
*, Point
*, const void*, const void*, const void*, const void*);
44 SVX_DLLPRIVATE
void ImpTransformMarkedPoints(PPolyTrFunc pTrFunc
, const void* p1
, const void* p2
=nullptr, const void* p3
=nullptr, const void* p4
=nullptr);
47 // #i71538# make constructors of SdrView sub-components protected to avoid incomplete incarnations which may get casted to SdrView
48 SdrPolyEditView(SdrModel
* pModel1
, OutputDevice
* pOut
);
49 virtual ~SdrPolyEditView() override
;
52 bool IsSetMarkedPointsSmoothPossible() const override
;
53 SdrPathSmoothKind
GetMarkedPointsSmooth() const override
;
54 void SetMarkedPointsSmooth(SdrPathSmoothKind eKind
) override
;
56 // A PolySegment can either be a segment or a Bézier curve
57 bool IsSetMarkedSegmentsKindPossible() const override
;
58 SdrPathSegmentKind
GetMarkedSegmentsKind() const override
;
59 void SetMarkedSegmentsKind(SdrPathSegmentKind eKind
) override
;
61 // Probably Obj has been deleted afterwards
62 void DeleteMarkedPoints() override
;
63 bool IsDeleteMarkedPointsPossible() const override
;
65 void MoveMarkedPoints(const Size
& rSiz
);
66 void ResizeMarkedPoints(const Point
& rRef
, const Fraction
& xFact
, const Fraction
& yFact
);
67 void RotateMarkedPoints(const Point
& rRef
, long nAngle
);
69 // This probably creates an abitrary amount of new objects
70 void RipUpAtMarkedPoints() override
;
71 bool IsRipUpAtMarkedPointsPossible() const override
;
73 // All marked Polylines are turned into polygons
74 // All open Bézier curves are turned into closed ones
75 bool IsOpenCloseMarkedObjectsPossible() const override
;
76 SdrObjClosedKind
GetMarkedObjectsClosedState() const override
;
78 void CheckPolyPossibilitiesHelper( SdrMark
* pM
, bool& b1stSmooth
, bool& b1stSegm
, bool& bCurve
, bool& bSmoothFuz
, bool& bSegmFuz
, basegfx::B2VectorContinuity
& eSmooth
);
81 #endif // INCLUDED_SVX_SVDPOEV_HXX
83 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */