7#ifndef KOSVGTEXTSHAPE_H
8#define KOSVGTEXTSHAPE_H
10#include "kritaflake_export.h"
24#define KoSvgTextShape_SHAPEID "KoSvgTextShapeID"
35 static const QString &defaultPlaceholderText();
39 void paint(QPainter &painter)
const override;
42 QPainterPath
outline()
const override;
51 void paintDebug(QPainter &painter, DebugElements elements)
const;
58 void relayout()
const;
70 PrePositionedText = 0,
87 TextType textType()
const;
113 QMap<QString, QString> shapeTypeSpecificStyles(
SvgSavingContext &context)
const;
121 int posLeft(
int pos,
bool visual =
false);
124 int posRight(
int pos,
bool visual =
false);
126 int posUp(
int pos,
bool visual =
false);
128 int posDown(
int pos,
bool visual =
false);
137 int lineStart(
int pos);
145 int lineEnd(
int pos);
154 int wordLeft(
int pos,
bool visual =
false);
162 int wordRight(
int pos,
bool visual =
false);
172 int nextIndex(
int pos);
180 int previousIndex(
int pos);
188 int nextLine(
int pos);
195 int previousLine(
int pos);
203 int wordEnd(
int pos);
210 int wordStart(
int pos);
219 QPainterPath cursorForPos(
int pos, QLineF &caret, QColor &color,
double bidiFlagSize = 1.0);
229 QPainterPath selectionBoxes(
int pos,
int anchor);
231 QPainterPath underlines(
int pos,
int anchor,
232 KoSvgText::TextDecorations decor,
234 qreal minimum,
bool thick);
245 int posForPoint(QPointF point,
int start = -1,
int end = -1,
bool *overlaps =
nullptr);
261 int posForPointLineSensitive(QPointF point);
270 int posForIndex(
int index,
bool firstIndex =
false,
bool skipSynthetic =
false)
const;
277 int indexForPos(
int pos)
const;
295 bool insertText(
int pos, QString text);
312 bool removeText(
int &index,
int &
length);
349 void mergePropertiesIntoRange(
const int startPos,
352 const QSet<KoSvgTextProperties::PropertyId> removeProperties = QSet<KoSvgTextProperties::PropertyId>());
362 std::unique_ptr<KoSvgTextShape> copyRange(
int index,
int length)
const;
436 void notifyCursorPosChanged(
int pos,
int anchor);
438 void notifyMarkupChanged();
448 void convertCharTransformsToPreformatted(
bool makeInlineSize =
false);
455 void setCharacterTransformsFromLayout();
465 void enterNodeSubtree();
467 void leaveNodeSubtree();
487 void setRelayoutBlocked(
const bool disable);
494 bool relayoutIsBlocked()
const;
504 void setFontMatchingDisabled(
const bool disable);
510 bool fontMatchingDisabled()
const;
517 friend class TestSvgText;
525 int nextPos(
int pos,
bool visual);
533 int previousPos(
int pos,
bool visual);
540 QPainterPath defaultCursorShape();
545 QScopedPointer<Private>
d;
599 QScopedPointer<Private>
d;
qreal length(const QPointF &vec)
QSharedPointer< KoSvgTextShapeMemento > KoSvgTextShapeMementoSP
The HtmlSavingContext class provides context for saving a flake-based document to html.
virtual void setPaintOrder(PaintOrder first, PaintOrder second)
setPaintOrder set the paint order. As there's only three entries in any given paintorder,...
virtual void paintStroke(QPainter &painter) const
paintStroke paints the shape's stroked outline
virtual QRectF outlineRect() const
virtual QPainterPath outline() const
virtual QVector< PaintOrder > paintOrder() const
paintOrder
virtual KoShapeStrokeModelSP stroke() const
virtual void setResolution(qreal xRes, qreal yRes)
virtual QRectF boundingRect() const
Get the bounding box of the shape.
virtual void shapeChanged(ChangeType type, KoShape *shape=0)
virtual void setStroke(KoShapeStrokeModelSP stroke)
virtual void setBackground(QSharedPointer< KoShapeBackground > background)
virtual void paint(QPainter &painter) const =0
Paint the shape fill The class extending this one is responsible for painting itself....
ChangeType
Used by shapeChanged() to select which change was made.
virtual KoShape * cloneShape() const
creates a deep copy of the shape or shape's subtree
virtual QSharedPointer< KoShapeBackground > background() const
The KoSvgTextNodeIndex class.
QScopedPointer< Private > d
KoSvgTextShapeFactory()
constructor
bool supports(const QDomElement &e, KoShapeLoadingContext &context) const override
Reimplemented.
KoShape * createDefaultShape(KoDocumentResourceManager *documentResources=0) const override
KoShape * createShape(const KoProperties *params, KoDocumentResourceManager *documentResources=0) const override
virtual ~KoSvgTextShapeMemento()
QString plainText()
plainText plain text of all text inside this text shape, without the bidi controls or any transforms.
@ InlineWrap
Uses inline size to wrap and preserves spaces.
QPointF initialTextPosition() const
initialTextPosition Returns the initial text position as per SVG algorithm. The eventual result of th...
QScopedPointer< Private > d
Q_DECLARE_FLAGS(DebugElements, DebugElement)
QList< KoShape * > shapesSubtract() const
shapesSubtract
QList< KoShape * > shapesInside() const
shapesInside
Context for saving svg files.
An interface providing svg loading and saving routines.
virtual bool saveSvg(SvgSavingContext &context)
Saves data utilizing specified svg saving context.
Q_DECLARE_OPERATORS_FOR_FLAGS(KisBaseRectsWalker::SubtreeVisitFlags)
TextDecorationStyle
Style of the text-decoration.
ShapeChangeListener so we can inform any text cursors that the cursor needs updating.
virtual void notifyMarkupChanged()=0
virtual void notifyCursorPosChanged(int pos, int anchor)=0