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 .
22 #include <svx/svxdllapi.h>
23 #include <svx/svdedtv.hxx>
25 #include <svx/ipolypolygoneditorcontroller.hxx>
27 class SVXCORE_DLLPUBLIC SdrPolyEditView
: public SdrEditView
, public IPolyPolygonEditorController
29 friend class SdrEditView
;
31 bool bSetMarkedPointsSmoothPossible
: 1;
32 bool bSetMarkedSegmentsKindPossible
: 1;
34 SdrPathSmoothKind eMarkedPointsSmooth
;
35 SdrPathSegmentKind eMarkedSegmentsKind
;
38 SVX_DLLPRIVATE
void ImpResetPolyPossibilityFlags();
39 SVX_DLLPRIVATE
void ImpCheckPolyPossibilities();
41 typedef void (*PPolyTrFunc
)(Point
&, Point
*, Point
*, const void*, const void*, const void*, const void*);
42 SVX_DLLPRIVATE
void ImpTransformMarkedPoints(PPolyTrFunc pTrFunc
, const void* p1
, const void* p2
=nullptr, const void* p3
=nullptr, const void* p4
=nullptr);
45 // #i71538# make constructors of SdrView sub-components protected to avoid incomplete incarnations which may get casted to SdrView
50 virtual ~SdrPolyEditView() override
;
53 bool IsSetMarkedPointsSmoothPossible() const override
;
54 SdrPathSmoothKind
GetMarkedPointsSmooth() const override
;
55 void SetMarkedPointsSmooth(SdrPathSmoothKind eKind
) override
;
57 // A PolySegment can either be a segment or a Bézier curve
58 bool IsSetMarkedSegmentsKindPossible() const override
;
59 SdrPathSegmentKind
GetMarkedSegmentsKind() const override
;
60 void SetMarkedSegmentsKind(SdrPathSegmentKind eKind
) override
;
62 // Probably Obj has been deleted afterwards
63 void DeleteMarkedPoints() override
;
64 bool IsDeleteMarkedPointsPossible() const override
;
66 void MoveMarkedPoints(const Size
& rSiz
);
67 void ResizeMarkedPoints(const Point
& rRef
, const Fraction
& xFact
, const Fraction
& yFact
);
68 void RotateMarkedPoints(const Point
& rRef
, Degree100 nAngle
);
70 // This probably creates an arbitrary amount of new objects
71 void RipUpAtMarkedPoints() override
;
72 bool IsRipUpAtMarkedPointsPossible() const override
;
74 // All marked Polylines are turned into polygons
75 // All open Bézier curves are turned into closed ones
76 bool IsOpenCloseMarkedObjectsPossible() const override
;
77 SdrObjClosedKind
GetMarkedObjectsClosedState() const override
;
79 void CheckPolyPossibilitiesHelper( SdrMark
* pM
, bool& b1stSmooth
, bool& b1stSegm
, bool& bCurve
, bool& bSmoothFuz
, bool& bSegmFuz
, basegfx::B2VectorContinuity
& eSmooth
);
82 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */