LibreOffice Module sw (master) 1
AnchorOverlayObject.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#pragma once
21
23#include <tools/long.hxx>
25
26class SwView;
27class SwRect;
28class Point;
29
30namespace sw::sidebarwindows {
31
32enum class AnchorState
33{
34 All,
35 End,
36 Tri
37};
38
40{
41 public:
42 static std::unique_ptr<AnchorOverlayObject> CreateAnchorOverlayObject( SwView const & rDocView,
43 const SwRect& aAnchorRect,
44 tools::Long aPageBorder,
45 const Point& aLineStart,
46 const Point& aLineEnd,
47 const Color& aColorAnchor );
48
55
56 void SetAllPosition( const basegfx::B2DPoint& rPoint1,
57 const basegfx::B2DPoint& rPoint2,
58 const basegfx::B2DPoint& rPoint3,
59 const basegfx::B2DPoint& rPoint4,
60 const basegfx::B2DPoint& rPoint5,
61 const basegfx::B2DPoint& rPoint6,
62 const basegfx::B2DPoint& rPoint7 );
63 void SetTriPosition( const basegfx::B2DPoint& rPoint1,
64 const basegfx::B2DPoint& rPoint2,
65 const basegfx::B2DPoint& rPoint3,
66 const basegfx::B2DPoint& rPoint4,
67 const basegfx::B2DPoint& rPoint5 );
68 void SetSixthPosition( const basegfx::B2DPoint& rNew );
69 void SetSeventhPosition( const basegfx::B2DPoint& rNew );
70
71 void setLineSolid( const bool bNew );
72 bool getLineSolid() const { return mbLineSolid; }
73
74 void SetAnchorState( const AnchorState aState );
76
77 private:
78 /* 6------------7
79 1 /
80 /4\ ---------------5
81 2 - 3
82 */
83
90
91 // helpers to fill and reset geometry
92 void implEnsureGeometry();
93 void implResetGeometry();
94
95 // geometry creation for OverlayObject
97
98 // object's geometry
103
104 bool mbLineSolid : 1;
105
106 AnchorOverlayObject( const basegfx::B2DPoint& rBasePos,
107 const basegfx::B2DPoint& rSecondPos,
108 const basegfx::B2DPoint& rThirdPos,
109 const basegfx::B2DPoint& rFourthPos,
110 const basegfx::B2DPoint& rFifthPos,
111 const basegfx::B2DPoint& rSixthPos,
112 const basegfx::B2DPoint& rSeventhPos,
113 const Color& rBaseColor );
114 public:
115 virtual ~AnchorOverlayObject() override;
116};
117
118} // end of namespace sw::annotation
119
120/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Of course Writer needs its own rectangles.
Definition: swrect.hxx:35
Definition: view.hxx:146
const basegfx::B2DPoint & GetSecondPosition() const
const basegfx::B2DPoint & GetSixthPosition() const
const basegfx::B2DPoint & GetThirdPosition() const
const basegfx::B2DPoint & GetSeventhPosition() const
const basegfx::B2DPoint & GetFifthPosition() const
void SetAllPosition(const basegfx::B2DPoint &rPoint1, const basegfx::B2DPoint &rPoint2, const basegfx::B2DPoint &rPoint3, const basegfx::B2DPoint &rPoint4, const basegfx::B2DPoint &rPoint5, const basegfx::B2DPoint &rPoint6, const basegfx::B2DPoint &rPoint7)
AnchorOverlayObject(const basegfx::B2DPoint &rBasePos, const basegfx::B2DPoint &rSecondPos, const basegfx::B2DPoint &rThirdPos, const basegfx::B2DPoint &rFourthPos, const basegfx::B2DPoint &rFifthPos, const basegfx::B2DPoint &rSixthPos, const basegfx::B2DPoint &rSeventhPos, const Color &rBaseColor)
virtual drawinglayer::primitive2d::Primitive2DContainer createOverlayObjectPrimitive2DSequence() override
void SetSixthPosition(const basegfx::B2DPoint &rNew)
const basegfx::B2DPoint & GetFourthPosition() const
void SetTriPosition(const basegfx::B2DPoint &rPoint1, const basegfx::B2DPoint &rPoint2, const basegfx::B2DPoint &rPoint3, const basegfx::B2DPoint &rPoint4, const basegfx::B2DPoint &rPoint5)
void SetSeventhPosition(const basegfx::B2DPoint &rNew)
static std::unique_ptr< AnchorOverlayObject > CreateAnchorOverlayObject(SwView const &rDocView, const SwRect &aAnchorRect, tools::Long aPageBorder, const Point &aLineStart, const Point &aLineEnd, const Color &aColorAnchor)
void SetAnchorState(const AnchorState aState)
long Long