xref: /trunk/main/svx/inc/svx/svdglev.hxx (revision 3334a7e6)
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 _SVDGLEV_HXX
25 #define _SVDGLEV_HXX
26 
27 #include "svx/svxdllapi.h"
28 #include <svx/svdpoev.hxx>
29 
30 //************************************************************
31 //   Vorausdeklarationen
32 //************************************************************
33 
34 class SdrGluePoint;
35 
36 ////////////////////////////////////////////////////////////////////////////////////////////////////
37 ////////////////////////////////////////////////////////////////////////////////////////////////////
38 //
39 //   @@@@  @@    @@  @@ @@@@@   @@@@@ @@@@@  @@ @@@@@@  @@ @@ @@ @@@@@ @@   @@
40 //  @@  @@ @@    @@  @@ @@      @@    @@  @@ @@   @@    @@ @@ @@ @@    @@   @@
41 //  @@     @@    @@  @@ @@      @@    @@  @@ @@   @@    @@ @@ @@ @@    @@ @ @@
42 //  @@ @@@ @@    @@  @@ @@@@    @@@@  @@  @@ @@   @@    @@@@@ @@ @@@@  @@@@@@@
43 //  @@  @@ @@    @@  @@ @@      @@    @@  @@ @@   @@     @@@  @@ @@    @@@@@@@
44 //  @@  @@ @@    @@  @@ @@      @@    @@  @@ @@   @@     @@@  @@ @@    @@@ @@@
45 //   @@@@@ @@@@@  @@@@  @@@@@   @@@@@ @@@@@  @@   @@      @   @@ @@@@@ @@   @@
46 //
47 //  Editieren von Klebepunkten an den Objekten (Klebepunkte fuer Verbinder)
48 //
49 ////////////////////////////////////////////////////////////////////////////////////////////////////
50 ////////////////////////////////////////////////////////////////////////////////////////////////////
51 
52 class SVX_DLLPUBLIC SdrGlueEditView: public SdrPolyEditView
53 {
54 	void ImpClearVars();
55 
56 	// Markierte Klebepunkte kopieren und anstelle der alten markieren
57 	void ImpCopyMarkedGluePoints();
58 	typedef void (*PGlueDoFunc)(SdrGluePoint&, const SdrObject* pObj, const void*, const void*, const void*, const void*, const void*);
59 	typedef void (*PGlueTrFunc)(Point&, const void*, const void*, const void*, const void*, const void*);
60 	void ImpDoMarkedGluePoints(PGlueDoFunc pDoFunc, sal_Bool bConst, const void* p1=NULL, const void* p2=NULL, const void* p3=NULL, const void* p4=NULL, const void* p5=NULL);
61 	void ImpTransformMarkedGluePoints(PGlueTrFunc pTrFunc, const void* p1=NULL, const void* p2=NULL, const void* p3=NULL, const void* p4=NULL, const void* p5=NULL);
62 
63 protected:
64 	// #i71538# make constructors of SdrView sub-components protected to avoid incomplete incarnations which may get casted to SdrView
65 	SdrGlueEditView(SdrModel* pModel1, OutputDevice* pOut = 0L);
66 	virtual ~SdrGlueEditView();
67 
68 public:
69 	// Durch den Parameter nThisEsc uebergibt man die Richtung, die man
70 	// checken bzw. setzen/loeschen will.
71 	// Moegliche Werte fuer nThisEsc sind z.Zt.
72 	// SDRESC_LEFT, SDRESC_RIGHT, SDRESC_TOP und SDRESC_BOTTOM
73 	TRISTATE IsMarkedGluePointsEscDir(sal_uInt16 nThisEsc) const;
74 	void SetMarkedGluePointsEscDir(sal_uInt16 nThisEsc, sal_Bool bOn);
IsSetMarkedGluePointsEscDirPossible() const75 	sal_Bool IsSetMarkedGluePointsEscDirPossible() const { return !IsReadOnly() && HasMarkedGluePoints(); }
76 
77 	// Checken/setzen, ob die Klebepunktpositionen relativ zur
78 	// Objektgroesse sind (Percent=sal_True) oder nicht (Percent=sal_False)
79 	TRISTATE IsMarkedGluePointsPercent() const;
80 	void SetMarkedGluePointsPercent(sal_Bool bOn);
IsSetMarkedGluePointsPercentPossible() const81 	sal_Bool IsSetMarkedGluePointsPercentPossible() const { return !IsReadOnly() && HasMarkedGluePoints(); }
82 
83 	// bVert=FALSE: Horizontales Alignment checken/setzen
84 	//      SDRHORZALIGN_CENTER
85 	//      SDRHORZALIGN_LEFT
86 	//      SDRHORZALIGN_RIGHT
87 	//      SDRHORZALIGN_DONTCARE (nur bei Get())
88 	// bVert=TRUE: Vertikales Alignment checken/setzen
89 	//      SDRVERTALIGN_CENTER
90 	//      SDRVERTALIGN_TOP
91 	//      SDRVERTALIGN_BOTTOM
92 	//      SDRVERTALIGN_DONTCARE (nur bei Get())
93 	sal_uInt16 GetMarkedGluePointsAlign(sal_Bool bVert) const;
94 	void SetMarkedGluePointsAlign(sal_Bool bVert, sal_uInt16 nAlign);
IsSetMarkedGluePointsAlignPossible() const95 	sal_Bool IsSetMarkedGluePointsAlignPossible() const { return !IsReadOnly() && HasMarkedGluePoints(); }
96 
97 	// Alle merkierten Klebepunkte entfernen
98 	void DeleteMarkedGluePoints();
99 	sal_Bool IsDeleteMarkedGluePointsPossible() const;
100 
101 	void MoveMarkedGluePoints  (const Size& rSiz, bool bCopy=false);
102 	void ResizeMarkedGluePoints(const Point& rRef, const Fraction& xFact, const Fraction& yFact, bool bCopy=false);
103 	void RotateMarkedGluePoints(const Point& rRef, long nWink, bool bCopy=false);
104 	void MirrorMarkedGluePoints(const Point& rRef1, const Point& rRef2, sal_Bool bCopy=sal_False);
105 	void MirrorMarkedGluePointsHorizontal(sal_Bool bCopy=sal_False);
106 	void MirrorMarkedGluePointsVertical(sal_Bool bCopy=sal_False);
107 	void ShearMarkedGluePoints(const Point& rRef, long nWink, sal_Bool bVShear=sal_False, sal_Bool bCopy=sal_False);
108 	void CrookMarkedGluePoints(const Point& rRef, const Point& rRad, SdrCrookMode eMode, sal_Bool bVertical=sal_False, sal_Bool bNoContortion=sal_False, sal_Bool bCopy=sal_False);
109 	void DistortMarkedGluePoints(const Rectangle& rRef, const XPolygon& rDistortedRect, sal_Bool bNoContortion=sal_False, sal_Bool bCopy=sal_False);
110 
111 	void AlignMarkedGluePoints(SdrHorAlign eHor, SdrVertAlign eVert);
112 };
113 
114 #endif //_SVDGLEV_HXX
115 
116