LibreOffice Module sw (master)
1
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
sw
source
uibase
docvw
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
22
#include <
svx/sdr/overlay/overlayobject.hxx
>
23
#include <
tools/long.hxx
>
24
#include <
basegfx/polygon/b2dpolygon.hxx
>
25
26
class
SwView
;
27
class
SwRect
;
28
class
Point
;
29
30
namespace
sw::sidebarwindows
{
31
32
enum class
AnchorState
33
{
34
All
,
35
End
,
36
Tri
37
};
38
39
class
AnchorOverlayObject
final :
public
sdr::overlay::OverlayObjectWithBasePosition
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
49
const
basegfx::B2DPoint
&
GetSecondPosition
()
const
{
return
maSecondPosition
; }
50
const
basegfx::B2DPoint
&
GetThirdPosition
()
const
{
return
maThirdPosition
; }
51
const
basegfx::B2DPoint
&
GetFourthPosition
()
const
{
return
maFourthPosition
; }
52
const
basegfx::B2DPoint
&
GetFifthPosition
()
const
{
return
maFifthPosition
; }
53
const
basegfx::B2DPoint
&
GetSixthPosition
()
const
{
return
maSixthPosition
; }
54
const
basegfx::B2DPoint
&
GetSeventhPosition
()
const
{
return
maSeventhPosition
; }
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 );
75
AnchorState
GetAnchorState
()
const
{
return
mAnchorState
; }
76
77
private
:
78
/* 6------------7
79
1 /
80
/4\ ---------------5
81
2 - 3
82
*/
83
84
basegfx::B2DPoint
maSecondPosition
;
85
basegfx::B2DPoint
maThirdPosition
;
86
basegfx::B2DPoint
maFourthPosition
;
87
basegfx::B2DPoint
maFifthPosition
;
88
basegfx::B2DPoint
maSixthPosition
;
89
basegfx::B2DPoint
maSeventhPosition
;
90
91
// helpers to fill and reset geometry
92
void
implEnsureGeometry
();
93
void
implResetGeometry
();
94
95
// geometry creation for OverlayObject
96
virtual
drawinglayer::primitive2d::Primitive2DContainer
createOverlayObjectPrimitive2DSequence
()
override
;
97
98
// object's geometry
99
basegfx::B2DPolygon
maTriangle
;
100
basegfx::B2DPolygon
maLine
;
101
basegfx::B2DPolygon
maLineTop
;
102
AnchorState
mAnchorState
;
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: */
sw::sidebarwindows::AnchorState::Tri
sw::sidebarwindows::AnchorOverlayObject::maFourthPosition
basegfx::B2DPoint maFourthPosition
Definition:
AnchorOverlayObject.hxx:86
basegfx::B2DPoint
sw::sidebarwindows::AnchorOverlayObject::maFifthPosition
basegfx::B2DPoint maFifthPosition
Definition:
AnchorOverlayObject.hxx:87
drawinglayer::primitive2d::Primitive2DContainer
sw::sidebarwindows::AnchorOverlayObject
Definition:
AnchorOverlayObject.hxx:39
sdr::overlay::OverlayObjectWithBasePosition
tools::Long
long Long
sw::sidebarwindows
Definition:
AnchorOverlayObject.cxx:37
sw::sidebarwindows::AnchorOverlayObject::implResetGeometry
void implResetGeometry()
Definition:
AnchorOverlayObject.cxx:271
sw::sidebarwindows::AnchorOverlayObject::maTriangle
basegfx::B2DPolygon maTriangle
Definition:
AnchorOverlayObject.hxx:99
SwRect
Of course Writer needs its own rectangles.
Definition:
swrect.hxx:34
sw::sidebarwindows::AnchorOverlayObject::SetAllPosition
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)
Definition:
AnchorOverlayObject.cxx:295
sw::sidebarwindows::AnchorOverlayObject::GetFifthPosition
const basegfx::B2DPoint & GetFifthPosition() const
Definition:
AnchorOverlayObject.hxx:52
sw::sidebarwindows::AnchorOverlayObject::getLineSolid
bool getLineSolid() const
Definition:
AnchorOverlayObject.hxx:72
sw::sidebarwindows::AnchorOverlayObject::AnchorOverlayObject
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)
Definition:
AnchorOverlayObject.cxx:218
sw::sidebarwindows::AnchorOverlayObject::GetFourthPosition
const basegfx::B2DPoint & GetFourthPosition() const
Definition:
AnchorOverlayObject.hxx:51
sw::sidebarwindows::AnchorOverlayObject::SetSixthPosition
void SetSixthPosition(const basegfx::B2DPoint &rNew)
Definition:
AnchorOverlayObject.cxx:324
sw::sidebarwindows::AnchorOverlayObject::mAnchorState
AnchorState mAnchorState
Definition:
AnchorOverlayObject.hxx:102
overlayobject.hxx
sw::sidebarwindows::AnchorOverlayObject::SetTriPosition
void SetTriPosition(const basegfx::B2DPoint &rPoint1, const basegfx::B2DPoint &rPoint2, const basegfx::B2DPoint &rPoint3, const basegfx::B2DPoint &rPoint4, const basegfx::B2DPoint &rPoint5)
Definition:
AnchorOverlayObject.cxx:344
sw::sidebarwindows::AnchorOverlayObject::implEnsureGeometry
void implEnsureGeometry()
Definition:
AnchorOverlayObject.cxx:247
sw::sidebarwindows::AnchorOverlayObject::GetSecondPosition
const basegfx::B2DPoint & GetSecondPosition() const
Definition:
AnchorOverlayObject.hxx:49
long.hxx
sw::sidebarwindows::AnchorOverlayObject::maSixthPosition
basegfx::B2DPoint maSixthPosition
Definition:
AnchorOverlayObject.hxx:88
sw::sidebarwindows::AnchorOverlayObject::SetSeventhPosition
void SetSeventhPosition(const basegfx::B2DPoint &rNew)
Definition:
AnchorOverlayObject.cxx:334
sw::sidebarwindows::AnchorOverlayObject::GetThirdPosition
const basegfx::B2DPoint & GetThirdPosition() const
Definition:
AnchorOverlayObject.hxx:50
basegfx::B2DPolygon
sw::sidebarwindows::AnchorOverlayObject::mbLineSolid
bool mbLineSolid
Definition:
AnchorOverlayObject.hxx:104
sw::sidebarwindows::AnchorOverlayObject::createOverlayObjectPrimitive2DSequence
virtual drawinglayer::primitive2d::Primitive2DContainer createOverlayObjectPrimitive2DSequence() override
Definition:
AnchorOverlayObject.cxx:278
sw::sidebarwindows::AnchorOverlayObject::SetAnchorState
void SetAnchorState(const AnchorState aState)
Definition:
AnchorOverlayObject.cxx:373
sw::sidebarwindows::AnchorOverlayObject::maLine
basegfx::B2DPolygon maLine
Definition:
AnchorOverlayObject.hxx:100
SnapKind::Point
sw::sidebarwindows::AnchorOverlayObject::CreateAnchorOverlayObject
static std::unique_ptr< AnchorOverlayObject > CreateAnchorOverlayObject(SwView const &rDocView, const SwRect &aAnchorRect, tools::Long aPageBorder, const Point &aLineStart, const Point &aLineEnd, const Color &aColorAnchor)
Definition:
AnchorOverlayObject.cxx:183
sw::sidebarwindows::AnchorOverlayObject::maSeventhPosition
basegfx::B2DPoint maSeventhPosition
Definition:
AnchorOverlayObject.hxx:89
sw::sidebarwindows::AnchorOverlayObject::GetSixthPosition
const basegfx::B2DPoint & GetSixthPosition() const
Definition:
AnchorOverlayObject.hxx:53
sw::sidebarwindows::AnchorState::All
Color
sw::sidebarwindows::AnchorOverlayObject::GetAnchorState
AnchorState GetAnchorState() const
Definition:
AnchorOverlayObject.hxx:75
b2dpolygon.hxx
sw::sidebarwindows::AnchorOverlayObject::maThirdPosition
basegfx::B2DPoint maThirdPosition
Definition:
AnchorOverlayObject.hxx:85
sw::sidebarwindows::AnchorOverlayObject::maLineTop
basegfx::B2DPolygon maLineTop
Definition:
AnchorOverlayObject.hxx:101
sw::sidebarwindows::AnchorOverlayObject::maSecondPosition
basegfx::B2DPoint maSecondPosition
Definition:
AnchorOverlayObject.hxx:84
sw::sidebarwindows::AnchorState
AnchorState
Definition:
AnchorOverlayObject.hxx:32
sw::sidebarwindows::AnchorOverlayObject::setLineSolid
void setLineSolid(const bool bNew)
Definition:
AnchorOverlayObject.cxx:364
sw::sidebarwindows::AnchorOverlayObject::~AnchorOverlayObject
virtual ~AnchorOverlayObject() override
Definition:
AnchorOverlayObject.cxx:238
sw::sidebarwindows::AnchorState::End
sw::sidebarwindows::AnchorOverlayObject::GetSeventhPosition
const basegfx::B2DPoint & GetSeventhPosition() const
Definition:
AnchorOverlayObject.hxx:54
SwView
Definition:
view.hxx:144
Generated on Tue May 24 2022 12:21:58 for LibreOffice Module sw (master) by
1.8.10