xref: /aoo4110/main/svx/inc/svx/svdpoev.hxx (revision b1cdbd2c)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef _SVDPOEV_HXX
25 #define _SVDPOEV_HXX
26 
27 #include "svx/svxdllapi.h"
28 #include <svx/svdedtv.hxx>
29 
30 #include "svx/ipolypolygoneditorcontroller.hxx"
31 
32 ////////////////////////////////////////////////////////////////////////////////////////////////////
33 ////////////////////////////////////////////////////////////////////////////////////////////////////
34 //
35 // @@@@@   @@@@  @@  @@  @@  @@@@@ @@@@@  @@ @@@@@@  @@ @@ @@ @@@@@ @@   @@
36 // @@  @@ @@  @@ @@  @@  @@  @@    @@  @@ @@   @@    @@ @@ @@ @@    @@   @@
37 // @@  @@ @@  @@ @@  @@  @@  @@    @@  @@ @@   @@    @@ @@ @@ @@    @@ @ @@
38 // @@@@@  @@  @@ @@   @@@@   @@@@  @@  @@ @@   @@    @@@@@ @@ @@@@  @@@@@@@
39 // @@     @@  @@ @@    @@    @@    @@  @@ @@   @@     @@@  @@ @@    @@@@@@@
40 // @@     @@  @@ @@    @@    @@    @@  @@ @@   @@     @@@  @@ @@    @@@ @@@
41 // @@      @@@@  @@@@@ @@    @@@@@ @@@@@  @@   @@      @   @@ @@@@@ @@   @@
42 //
43 ////////////////////////////////////////////////////////////////////////////////////////////////////
44 ////////////////////////////////////////////////////////////////////////////////////////////////////
45 
46 class SVX_DLLPUBLIC SdrPolyEditView: public SdrEditView, public IPolyPolygonEditorController
47 {
48 	friend class				SdrEditView;
49 
50 protected:
51 	sal_Bool						bSetMarkedPointsSmoothPossible : 1;
52 	sal_Bool						bSetMarkedSegmentsKindPossible : 1;
53 
54 	SdrPathSmoothKind			eMarkedPointsSmooth;
55 	SdrPathSegmentKind			eMarkedSegmentsKind;
56 
57 private:
58 	SVX_DLLPRIVATE void ImpClearVars();
59 	SVX_DLLPRIVATE void ImpResetPolyPossibilityFlags();
60 	SVX_DLLPRIVATE void ImpCheckPolyPossibilities();
61 
62 	// Markierte Punkte kopieren und anstelle der alten markieren
63 	// ist noch nicht implementiert!
64 	SVX_DLLPRIVATE void ImpCopyMarkedPoints();
65 	typedef void (*PPolyTrFunc)(Point&, Point*, Point*, const void*, const void*, const void*, const void*, const void*);
66 	SVX_DLLPRIVATE void ImpTransformMarkedPoints(PPolyTrFunc pTrFunc, const void* p1=NULL, const void* p2=NULL, const void* p3=NULL, const void* p4=NULL, const void* p5=NULL);
67 
68 protected:
69 	// #i71538# make constructors of SdrView sub-components protected to avoid incomplete incarnations which may get casted to SdrView
70 	SdrPolyEditView(SdrModel* pModel1, OutputDevice* pOut = 0L);
71 	virtual ~SdrPolyEditView();
72 
73 public:
74 	sal_Bool IsSetMarkedPointsSmoothPossible() const;
75 	SdrPathSmoothKind GetMarkedPointsSmooth() const;
76 	void SetMarkedPointsSmooth(SdrPathSmoothKind eKind);
77 
78 	// Ein PolySegment kann eine Strecke oder eine Bezierkurve sein.
79 	sal_Bool IsSetMarkedSegmentsKindPossible() const;
80 	SdrPathSegmentKind GetMarkedSegmentsKind() const;
81 	void SetMarkedSegmentsKind(SdrPathSegmentKind eKind);
82 
83 	// Moeglicherweise ist das Obj hinterher geloescht:
84 	void DeleteMarkedPoints();
85 	sal_Bool IsDeleteMarkedPointsPossible() const;
86 
87 	void MoveMarkedPoints(const Size& rSiz, bool bCopy=false);
88 	void ResizeMarkedPoints(const Point& rRef, const Fraction& xFact, const Fraction& yFact, bool bCopy=false);
89 	void RotateMarkedPoints(const Point& rRef, long nWink, bool bCopy=false);
90 
91 	// Hierbei entstehen eventuell beliebig viele neue Objekte:
92 	void RipUpAtMarkedPoints();
93 	bool IsRipUpAtMarkedPointsPossible() const;
94 
95 	// Alle markierten Polylines werden zu Polygonen, alle offenen
96 	// Bezierkurven zu geschlossenen.
97 	void ShutMarkedObjects();
98 	void CloseMarkedObjects(sal_Bool bToggle=sal_False, sal_Bool bOpen=sal_False); // , long nOpenDistance=0);
99 	bool IsOpenCloseMarkedObjectsPossible() const;
100 	SdrObjClosedKind GetMarkedObjectsClosedState() const;
101 
102 	void CheckPolyPossibilitiesHelper( SdrMark* pM, bool& b1stSmooth, bool& b1stSegm, bool& bCurve, bool& bSmoothFuz, bool& bSegmFuz, basegfx::B2VectorContinuity& eSmooth );
103 };
104 
105 #endif //_SVDPOEV_HXX
106 
107