1*b1cdbd2cSJim Jagielski /************************************************************** 2*b1cdbd2cSJim Jagielski * 3*b1cdbd2cSJim Jagielski * Licensed to the Apache Software Foundation (ASF) under one 4*b1cdbd2cSJim Jagielski * or more contributor license agreements. See the NOTICE file 5*b1cdbd2cSJim Jagielski * distributed with this work for additional information 6*b1cdbd2cSJim Jagielski * regarding copyright ownership. The ASF licenses this file 7*b1cdbd2cSJim Jagielski * to you under the Apache License, Version 2.0 (the 8*b1cdbd2cSJim Jagielski * "License"); you may not use this file except in compliance 9*b1cdbd2cSJim Jagielski * with the License. You may obtain a copy of the License at 10*b1cdbd2cSJim Jagielski * 11*b1cdbd2cSJim Jagielski * http://www.apache.org/licenses/LICENSE-2.0 12*b1cdbd2cSJim Jagielski * 13*b1cdbd2cSJim Jagielski * Unless required by applicable law or agreed to in writing, 14*b1cdbd2cSJim Jagielski * software distributed under the License is distributed on an 15*b1cdbd2cSJim Jagielski * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*b1cdbd2cSJim Jagielski * KIND, either express or implied. See the License for the 17*b1cdbd2cSJim Jagielski * specific language governing permissions and limitations 18*b1cdbd2cSJim Jagielski * under the License. 19*b1cdbd2cSJim Jagielski * 20*b1cdbd2cSJim Jagielski *************************************************************/ 21*b1cdbd2cSJim Jagielski 22*b1cdbd2cSJim Jagielski 23*b1cdbd2cSJim Jagielski 24*b1cdbd2cSJim Jagielski #ifndef _ANCHOROVERLAYOBJECT_HXX 25*b1cdbd2cSJim Jagielski #define _ANCHOROVERLAYOBJECT_HXX 26*b1cdbd2cSJim Jagielski 27*b1cdbd2cSJim Jagielski #include <svx/sdr/overlay/overlayobject.hxx> 28*b1cdbd2cSJim Jagielski 29*b1cdbd2cSJim Jagielski #include <basegfx/polygon/b2dpolygon.hxx> 30*b1cdbd2cSJim Jagielski 31*b1cdbd2cSJim Jagielski class SwView; 32*b1cdbd2cSJim Jagielski class SwRect; 33*b1cdbd2cSJim Jagielski class Point; 34*b1cdbd2cSJim Jagielski 35*b1cdbd2cSJim Jagielski namespace sw { namespace sidebarwindows { 36*b1cdbd2cSJim Jagielski 37*b1cdbd2cSJim Jagielski enum AnchorState 38*b1cdbd2cSJim Jagielski { 39*b1cdbd2cSJim Jagielski AS_ALL, 40*b1cdbd2cSJim Jagielski AS_START, 41*b1cdbd2cSJim Jagielski AS_END, 42*b1cdbd2cSJim Jagielski AS_TRI 43*b1cdbd2cSJim Jagielski }; 44*b1cdbd2cSJim Jagielski 45*b1cdbd2cSJim Jagielski class AnchorOverlayObject: public sdr::overlay::OverlayObjectWithBasePosition 46*b1cdbd2cSJim Jagielski { 47*b1cdbd2cSJim Jagielski public: 48*b1cdbd2cSJim Jagielski static AnchorOverlayObject* CreateAnchorOverlayObject( SwView& rDocView, 49*b1cdbd2cSJim Jagielski const SwRect& aAnchorRect, 50*b1cdbd2cSJim Jagielski const long& aPageBorder, 51*b1cdbd2cSJim Jagielski const Point& aLineStart, 52*b1cdbd2cSJim Jagielski const Point& aLineEnd, 53*b1cdbd2cSJim Jagielski const Color& aColorAnchor ); 54*b1cdbd2cSJim Jagielski static void DestroyAnchorOverlayObject( AnchorOverlayObject* pAnchor ); 55*b1cdbd2cSJim Jagielski GetSecondPosition() const56*b1cdbd2cSJim Jagielski inline const basegfx::B2DPoint& GetSecondPosition() const { return maSecondPosition; } GetThirdPosition() const57*b1cdbd2cSJim Jagielski const basegfx::B2DPoint& GetThirdPosition() const { return maThirdPosition; } GetFourthPosition() const58*b1cdbd2cSJim Jagielski const basegfx::B2DPoint& GetFourthPosition() const { return maFourthPosition; } GetFifthPosition() const59*b1cdbd2cSJim Jagielski const basegfx::B2DPoint& GetFifthPosition() const { return maFifthPosition; } GetSixthPosition() const60*b1cdbd2cSJim Jagielski const basegfx::B2DPoint& GetSixthPosition() const { return maSixthPosition; } GetSeventhPosition() const61*b1cdbd2cSJim Jagielski const basegfx::B2DPoint& GetSeventhPosition() const { return maSeventhPosition; } 62*b1cdbd2cSJim Jagielski 63*b1cdbd2cSJim Jagielski void SetAllPosition( const basegfx::B2DPoint& rPoint1, 64*b1cdbd2cSJim Jagielski const basegfx::B2DPoint& rPoint2, 65*b1cdbd2cSJim Jagielski const basegfx::B2DPoint& rPoint3, 66*b1cdbd2cSJim Jagielski const basegfx::B2DPoint& rPoint4, 67*b1cdbd2cSJim Jagielski const basegfx::B2DPoint& rPoint5, 68*b1cdbd2cSJim Jagielski const basegfx::B2DPoint& rPoint6, 69*b1cdbd2cSJim Jagielski const basegfx::B2DPoint& rPoint7 ); 70*b1cdbd2cSJim Jagielski void SetTriPosition( const basegfx::B2DPoint& rPoint1, 71*b1cdbd2cSJim Jagielski const basegfx::B2DPoint& rPoint2, 72*b1cdbd2cSJim Jagielski const basegfx::B2DPoint& rPoint3, 73*b1cdbd2cSJim Jagielski const basegfx::B2DPoint& rPoint4, 74*b1cdbd2cSJim Jagielski const basegfx::B2DPoint& rPoint5 ); 75*b1cdbd2cSJim Jagielski void SetSixthPosition( const basegfx::B2DPoint& rNew ); 76*b1cdbd2cSJim Jagielski void SetSeventhPosition( const basegfx::B2DPoint& rNew ); 77*b1cdbd2cSJim Jagielski 78*b1cdbd2cSJim Jagielski void setLineSolid( const bool bNew ); getLineSolid() const79*b1cdbd2cSJim Jagielski inline bool getLineSolid() const { return mbLineSolid; } 80*b1cdbd2cSJim Jagielski SetHeight(const unsigned long aHeight)81*b1cdbd2cSJim Jagielski inline void SetHeight( const unsigned long aHeight ) { mHeight = aHeight; }; 82*b1cdbd2cSJim Jagielski getShadowedEffect() const83*b1cdbd2cSJim Jagielski bool getShadowedEffect() const { return mbShadowedEffect; } 84*b1cdbd2cSJim Jagielski 85*b1cdbd2cSJim Jagielski void SetAnchorState( const AnchorState aState ); GetAnchorState() const86*b1cdbd2cSJim Jagielski inline AnchorState GetAnchorState() const { return mAnchorState; } 87*b1cdbd2cSJim Jagielski 88*b1cdbd2cSJim Jagielski protected: 89*b1cdbd2cSJim Jagielski /* 6------------7 90*b1cdbd2cSJim Jagielski 1 / 91*b1cdbd2cSJim Jagielski /4\ ---------------5 92*b1cdbd2cSJim Jagielski 2 - 3 93*b1cdbd2cSJim Jagielski */ 94*b1cdbd2cSJim Jagielski 95*b1cdbd2cSJim Jagielski basegfx::B2DPoint maSecondPosition; 96*b1cdbd2cSJim Jagielski basegfx::B2DPoint maThirdPosition; 97*b1cdbd2cSJim Jagielski basegfx::B2DPoint maFourthPosition; 98*b1cdbd2cSJim Jagielski basegfx::B2DPoint maFifthPosition; 99*b1cdbd2cSJim Jagielski basegfx::B2DPoint maSixthPosition; 100*b1cdbd2cSJim Jagielski basegfx::B2DPoint maSeventhPosition; 101*b1cdbd2cSJim Jagielski 102*b1cdbd2cSJim Jagielski // helpers to fill and reset geometry 103*b1cdbd2cSJim Jagielski void implEnsureGeometry(); 104*b1cdbd2cSJim Jagielski void implResetGeometry(); 105*b1cdbd2cSJim Jagielski 106*b1cdbd2cSJim Jagielski // geometry creation for OverlayObject 107*b1cdbd2cSJim Jagielski virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence(); 108*b1cdbd2cSJim Jagielski 109*b1cdbd2cSJim Jagielski private: 110*b1cdbd2cSJim Jagielski // object's geometry 111*b1cdbd2cSJim Jagielski basegfx::B2DPolygon maTriangle; 112*b1cdbd2cSJim Jagielski basegfx::B2DPolygon maLine; 113*b1cdbd2cSJim Jagielski basegfx::B2DPolygon maLineTop; 114*b1cdbd2cSJim Jagielski unsigned long mHeight; 115*b1cdbd2cSJim Jagielski AnchorState mAnchorState; 116*b1cdbd2cSJim Jagielski 117*b1cdbd2cSJim Jagielski bool mbShadowedEffect : 1; 118*b1cdbd2cSJim Jagielski bool mbLineSolid : 1; 119*b1cdbd2cSJim Jagielski 120*b1cdbd2cSJim Jagielski AnchorOverlayObject( const basegfx::B2DPoint& rBasePos, 121*b1cdbd2cSJim Jagielski const basegfx::B2DPoint& rSecondPos, 122*b1cdbd2cSJim Jagielski const basegfx::B2DPoint& rThirdPos, 123*b1cdbd2cSJim Jagielski const basegfx::B2DPoint& rFourthPos, 124*b1cdbd2cSJim Jagielski const basegfx::B2DPoint& rFifthPos, 125*b1cdbd2cSJim Jagielski const basegfx::B2DPoint& rSixthPos, 126*b1cdbd2cSJim Jagielski const basegfx::B2DPoint& rSeventhPos, 127*b1cdbd2cSJim Jagielski const Color aBaseColor, 128*b1cdbd2cSJim Jagielski const bool bShadowedEffect, 129*b1cdbd2cSJim Jagielski const bool bLineSolid ); 130*b1cdbd2cSJim Jagielski virtual ~AnchorOverlayObject(); 131*b1cdbd2cSJim Jagielski }; 132*b1cdbd2cSJim Jagielski 133*b1cdbd2cSJim Jagielski } } // end of namespace sw::annotation 134*b1cdbd2cSJim Jagielski 135*b1cdbd2cSJim Jagielski #endif 136