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
;
32 bool bSetMarkedPointsSmoothPossible
: 1;
33 bool bSetMarkedSegmentsKindPossible
: 1;
35 SdrPathSmoothKind eMarkedPointsSmooth
;
36 SdrPathSegmentKind eMarkedSegmentsKind
;
39 SVX_DLLPRIVATE
void ImpResetPolyPossibilityFlags();
40 SVX_DLLPRIVATE
void ImpCheckPolyPossibilities();
42 typedef void (*PPolyTrFunc
)(Point
&, Point
*, Point
*, const void*, const void*, const void*, const void*);
43 SVX_DLLPRIVATE
void ImpTransformMarkedPoints(PPolyTrFunc pTrFunc
, const void* p1
, const void* p2
=nullptr, const void* p3
=nullptr, const void* p4
=nullptr);
46 // #i71538# make constructors of SdrView sub-components protected to avoid incomplete incarnations which may get casted to SdrView
51 virtual ~SdrPolyEditView() override
;
54 bool IsSetMarkedPointsSmoothPossible() const override
;
55 SdrPathSmoothKind
GetMarkedPointsSmooth() const override
;
56 void SetMarkedPointsSmooth(SdrPathSmoothKind eKind
) override
;
58 // A PolySegment can either be a segment or a Bézier curve
59 bool IsSetMarkedSegmentsKindPossible() const override
;
60 SdrPathSegmentKind
GetMarkedSegmentsKind() const override
;
61 void SetMarkedSegmentsKind(SdrPathSegmentKind eKind
) override
;
63 // Probably Obj has been deleted afterwards
64 void DeleteMarkedPoints() override
;
65 bool IsDeleteMarkedPointsPossible() const override
;
67 void MoveMarkedPoints(const Size
& rSiz
);
68 void ResizeMarkedPoints(const Point
& rRef
, const Fraction
& xFact
, const Fraction
& yFact
);
69 void RotateMarkedPoints(const Point
& rRef
, long nAngle
);
71 // This probably creates an abitrary amount of new objects
72 void RipUpAtMarkedPoints() override
;
73 bool IsRipUpAtMarkedPointsPossible() const override
;
75 // All marked Polylines are turned into polygons
76 // All open Bézier curves are turned into closed ones
77 bool IsOpenCloseMarkedObjectsPossible() const override
;
78 SdrObjClosedKind
GetMarkedObjectsClosedState() const override
;
80 void CheckPolyPossibilitiesHelper( SdrMark
* pM
, bool& b1stSmooth
, bool& b1stSegm
, bool& bCurve
, bool& bSmoothFuz
, bool& bSegmFuz
, basegfx::B2VectorContinuity
& eSmooth
);
83 #endif // INCLUDED_SVX_SVDPOEV_HXX
85 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */