Krita Source Code Documentation
Loading...
Searching...
No Matches
KoShapeAnchor.h
Go to the documentation of this file.
1
/* This file is part of the KDE project
2
* SPDX-FileCopyrightText: 2007, 2009 Thomas Zander <zander@kde.org>
3
* SPDX-FileCopyrightText: 2011 Matus Hanzes <matus.hanzes@ixonos.com>
4
* SPDX-FileCopyrightText: 2013 C. Boemann <cbo@boemann.dk>
5
*
6
* SPDX-License-Identifier: LGPL-2.0-or-later
7
*/
8
#ifndef KOSHAPEANCHOR_H
9
#define KOSHAPEANCHOR_H
10
11
#include "kritaflake_export.h"
12
13
14
class
KoShape
;
15
#include <QDomDocument>
16
class
KoShapeLoadingContext
;
17
class
KoShapeSavingContext
;
18
class
KoShapeAnchorPrivate;
19
20
class
QTextDocument;
21
class
QPointF;
22
class
QString;
23
51
class
KRITAFLAKE_EXPORT
KoShapeAnchor
52
{
53
public
:
57
class
PlacementStrategy
{
58
public
:
59
PlacementStrategy
(){};
60
virtual
~PlacementStrategy
(){};
61
66
virtual
void
detachFromModel
() = 0;
67
74
virtual
void
updateContainerModel
() = 0;
75
};
76
77
class
TextLocation
{
78
public
:
79
TextLocation
(){};
80
virtual
~TextLocation
(){};
81
virtual
const
QTextDocument *
document
()
const
= 0;
82
virtual
int
position
()
const
= 0;
83
};
84
85
enum
HorizontalPos
{
86
HCenter
,
87
HFromInside
,
88
HFromLeft
,
89
HInside
,
90
HLeft
,
91
HOutside
,
92
HRight
93
};
94
95
enum
HorizontalRel
{
//NOTE: update KWAnchoringProperties if you change this
96
HChar
,
97
HPage
,
98
HPageContent
,
99
HPageStartMargin
,
100
HPageEndMargin
,
101
HFrame
,
102
HFrameContent
,
103
HFrameEndMargin
,
104
HFrameStartMargin
,
105
HParagraph
,
106
HParagraphContent
,
107
HParagraphEndMargin
,
108
HParagraphStartMargin
109
};
110
111
enum
VerticalPos
{
112
VBelow
,
113
VBottom
,
114
VFromTop
,
115
VMiddle
,
116
VTop
117
};
118
119
enum
VerticalRel
{
//NOTE: update KWAnchoringProperties if you change this
120
VBaseline
,
121
VChar
,
122
VFrame
,
123
VFrameContent
,
124
VLine
,
125
VPage
,
126
VPageContent
,
127
VParagraph
,
128
VParagraphContent
,
129
VText
130
};
131
132
enum
AnchorType
{
133
AnchorAsCharacter
,
134
AnchorToCharacter
,
135
AnchorParagraph
,
136
AnchorPage
137
};
138
143
explicit
KoShapeAnchor
(
KoShape
*shape);
144
virtual
~KoShapeAnchor
();
145
149
KoShape
*
shape
()
const
;
150
175
AnchorType
anchorType
()
const
;
176
180
void
setAnchorType(
AnchorType
type);
181
183
void
setHorizontalPos(
HorizontalPos
);
184
186
HorizontalPos
horizontalPos
()
const
;
187
189
void
setHorizontalRel(
HorizontalRel
);
190
192
HorizontalRel
horizontalRel
()
const
;
193
195
void
setVerticalPos(
VerticalPos
);
196
198
VerticalPos
verticalPos
()
const
;
199
201
void
setVerticalRel(
VerticalRel
);
202
204
VerticalRel
verticalRel
()
const
;
205
207
QString
wrapInfluenceOnPosition
()
const
;
208
210
bool
flowWithText
()
const
;
211
213
int
pageNumber
()
const
;
214
216
const
QPointF &
offset
()
const
;
217
219
void
setOffset(
const
QPointF &offset);
220
222
TextLocation
*
textLocation
()
const
;
223
226
void
setTextLocation(
TextLocation
*textLocation);
227
229
PlacementStrategy
*
placementStrategy
()
const
;
230
233
void
setPlacementStrategy(
PlacementStrategy
*placementStrategy);
234
235
private
:
236
class
Private
;
237
Private
*
const
d
;
238
};
239
240
#endif
KoShapeAnchor::PlacementStrategy
Definition
KoShapeAnchor.h:57
KoShapeAnchor::PlacementStrategy::updateContainerModel
virtual void updateContainerModel()=0
KoShapeAnchor::PlacementStrategy::~PlacementStrategy
virtual ~PlacementStrategy()
Definition
KoShapeAnchor.h:60
KoShapeAnchor::PlacementStrategy::detachFromModel
virtual void detachFromModel()=0
KoShapeAnchor::PlacementStrategy::PlacementStrategy
PlacementStrategy()
Definition
KoShapeAnchor.h:59
KoShapeAnchor::TextLocation
Definition
KoShapeAnchor.h:77
KoShapeAnchor::TextLocation::position
virtual int position() const =0
KoShapeAnchor::TextLocation::document
virtual const QTextDocument * document() const =0
KoShapeAnchor::TextLocation::~TextLocation
virtual ~TextLocation()
Definition
KoShapeAnchor.h:80
KoShapeAnchor::TextLocation::TextLocation
TextLocation()
Definition
KoShapeAnchor.h:79
KoShapeAnchor
Definition
KoShapeAnchor.cpp:22
KoShapeAnchor::VerticalPos
VerticalPos
Definition
KoShapeAnchor.h:111
KoShapeAnchor::VFromTop
@ VFromTop
Definition
KoShapeAnchor.h:114
KoShapeAnchor::VBelow
@ VBelow
Definition
KoShapeAnchor.h:112
KoShapeAnchor::VMiddle
@ VMiddle
Definition
KoShapeAnchor.h:115
KoShapeAnchor::VBottom
@ VBottom
Definition
KoShapeAnchor.h:113
KoShapeAnchor::verticalPos
VerticalPos verticalPos() const
return the current horizontal-pos
KoShapeAnchor::AnchorType
AnchorType
Definition
KoShapeAnchor.h:132
KoShapeAnchor::AnchorToCharacter
@ AnchorToCharacter
Definition
KoShapeAnchor.h:134
KoShapeAnchor::AnchorAsCharacter
@ AnchorAsCharacter
Definition
KoShapeAnchor.h:133
KoShapeAnchor::AnchorParagraph
@ AnchorParagraph
Definition
KoShapeAnchor.h:135
KoShapeAnchor::verticalRel
VerticalRel verticalRel() const
return the current horizontal-rel
KoShapeAnchor::flowWithText
bool flowWithText() const
return if flow-with-text (odf attribute)
KoShapeAnchor::placementStrategy
PlacementStrategy * placementStrategy() const
Get placement strategy which is used to position shape linked to text anchor.
KoShapeAnchor::anchorType
AnchorType anchorType() const
KoShapeAnchor::horizontalRel
HorizontalRel horizontalRel() const
return the current vertical-rel
KoShapeAnchor::HorizontalPos
HorizontalPos
Definition
KoShapeAnchor.h:85
KoShapeAnchor::HFromLeft
@ HFromLeft
Definition
KoShapeAnchor.h:88
KoShapeAnchor::HLeft
@ HLeft
Definition
KoShapeAnchor.h:90
KoShapeAnchor::HOutside
@ HOutside
Definition
KoShapeAnchor.h:91
KoShapeAnchor::HInside
@ HInside
Definition
KoShapeAnchor.h:89
KoShapeAnchor::HFromInside
@ HFromInside
Definition
KoShapeAnchor.h:87
KoShapeAnchor::HCenter
@ HCenter
Definition
KoShapeAnchor.h:86
KoShapeAnchor::wrapInfluenceOnPosition
QString wrapInfluenceOnPosition() const
return the wrap influence on position
KoShapeAnchor::pageNumber
int pageNumber() const
return the page number of the shape (valid with page anchoring, -1 indicates auto).
KoShapeAnchor::offset
const QPointF & offset() const
return the offset of the shape from the anchor.
KoShapeAnchor::HorizontalRel
HorizontalRel
Definition
KoShapeAnchor.h:95
KoShapeAnchor::HFrameEndMargin
@ HFrameEndMargin
Definition
KoShapeAnchor.h:103
KoShapeAnchor::HFrameContent
@ HFrameContent
Definition
KoShapeAnchor.h:102
KoShapeAnchor::HPageStartMargin
@ HPageStartMargin
Definition
KoShapeAnchor.h:99
KoShapeAnchor::HFrameStartMargin
@ HFrameStartMargin
Definition
KoShapeAnchor.h:104
KoShapeAnchor::HPageContent
@ HPageContent
Definition
KoShapeAnchor.h:98
KoShapeAnchor::HFrame
@ HFrame
Definition
KoShapeAnchor.h:101
KoShapeAnchor::HChar
@ HChar
Definition
KoShapeAnchor.h:96
KoShapeAnchor::HParagraph
@ HParagraph
Definition
KoShapeAnchor.h:105
KoShapeAnchor::HPage
@ HPage
Definition
KoShapeAnchor.h:97
KoShapeAnchor::HParagraphContent
@ HParagraphContent
Definition
KoShapeAnchor.h:106
KoShapeAnchor::HParagraphEndMargin
@ HParagraphEndMargin
Definition
KoShapeAnchor.h:107
KoShapeAnchor::HPageEndMargin
@ HPageEndMargin
Definition
KoShapeAnchor.h:100
KoShapeAnchor::VerticalRel
VerticalRel
Definition
KoShapeAnchor.h:119
KoShapeAnchor::VFrameContent
@ VFrameContent
Definition
KoShapeAnchor.h:123
KoShapeAnchor::VLine
@ VLine
Definition
KoShapeAnchor.h:124
KoShapeAnchor::VParagraphContent
@ VParagraphContent
Definition
KoShapeAnchor.h:128
KoShapeAnchor::VParagraph
@ VParagraph
Definition
KoShapeAnchor.h:127
KoShapeAnchor::VPage
@ VPage
Definition
KoShapeAnchor.h:125
KoShapeAnchor::VFrame
@ VFrame
Definition
KoShapeAnchor.h:122
KoShapeAnchor::VChar
@ VChar
Definition
KoShapeAnchor.h:121
KoShapeAnchor::VBaseline
@ VBaseline
Definition
KoShapeAnchor.h:120
KoShapeAnchor::VPageContent
@ VPageContent
Definition
KoShapeAnchor.h:126
KoShapeAnchor::horizontalPos
HorizontalPos horizontalPos() const
return the current vertical-pos
KoShapeAnchor::textLocation
TextLocation * textLocation() const
Get extra data structure that is what is actually inside a text document.
KoShapeAnchor::shape
KoShape * shape() const
KoShapeAnchor::d
Private *const d
Definition
KoShapeAnchor.h:237
KoShapeLoadingContext
Definition
KoShapeLoadingContext.cpp:30
KoShapeSavingContext
Definition
KoShapeSavingContext.h:32
KoShape
Definition
KoShape.h:92
Private
Definition
SvgTransformParser.cpp:20
libs
flake
KoShapeAnchor.h
Generated at
2025-11-04 02:30:02+01:00
from
Krita
branch
master
, commit
c9dde2e79561a8aea4a7e8d9ac99c98a7bac9e52