16#include "kritatoolsvgtext_export.h"
23class QInputMethodEvent;
112 void setCaretSetting(
int cursorWidth = 1,
int cursorFlash = 1000,
int cursorFlashLimit = 5000,
bool drawCursorInAdditionToSelection =
false);
120 void setVisualMode(
const bool visualMode =
true);
126 void setPasteRichTextByDefault(
const bool pasteRichText =
true);
129 void setTypeSettingModeActive(
bool activate);
138 void setPos(
int pos,
int anchor);
141 void setPosToPoint(QPointF point,
bool moveAnchor =
true);
151 void setDrawTypeSettingHandle(
bool draw);
154 void updateTypeSettingDecorFromShape();
157 QCursor cursorTypeForTypeSetting()
const;
179 int posForTypeSettingHandleAndRect(
const TypeSettingModeHandle handle,
const QRectF regionOfInterest);
182 void moveCursor(
MoveMode mode,
bool moveAnchor =
true);
207 void removeLastCodePoint();
213 QPair<KoSvgTextProperties, KoSvgTextProperties> currentTextProperties()
const;
237 void mergePropertiesIntoSelection(
const KoSvgTextProperties props,
const QSet<KoSvgTextProperties::PropertyId> removeProperties = QSet<KoSvgTextProperties::PropertyId>(),
bool paragraphOnly =
false,
bool selectWord =
false);
245 void removeSelection();
265 void paintDecorations(QPainter &gc, QColor selectionColor,
int decorationThickness = 1, qreal handleRadius = 5.0);
268 QVariant inputMethodQuery(Qt::InputMethodQuery query)
const;
270 void inputMethodEvent(QInputMethodEvent *event);
286 void keyPressEvent(QKeyEvent *event);
288 void updateModifiers(
const Qt::KeyboardModifiers modifiers);
300 bool registerPropertyAction(QAction *action,
const QString &name);
319 void stopBlinkCursor();
325 void updateInputMethodItemTransform();
327 void canvasResourceChanged(
int key,
const QVariant &
value);
329 void propertyAction();
331 void clearFormattingAction();
344 bool pastePlainText();
353 void updateCanvasResources();
367 void updateCursor(
bool firstUpdate =
false);
368 void updateSelection();
369 void updateIMEDecoration();
370 void updateTypeSettingDecoration();
376 int moveModeResult(
const MoveMode mode,
int &pos,
bool visual =
false)
const;
381 bool acceptableInput(
const QKeyEvent *event)
const;
385 void commitIMEPreEdit();
388 const QScopedPointer<Private>
d;
400 virtual void setPropertiesOnSelected(
KoSvgTextProperties properties, QSet<KoSvgTextProperties::PropertyId> removeProperties = QSet<KoSvgTextProperties::PropertyId>())
override;
401 virtual void setCharacterPropertiesOnSelected(
KoSvgTextProperties properties, QSet<KoSvgTextProperties::PropertyId> removeProperties = QSet<KoSvgTextProperties::PropertyId>())
override;
402 virtual bool spanSelection()
override;
403 virtual bool characterPropertiesEnabled()
override;
404 void emitSelectionChange();
405 void emitCharacterSelectionChange();
408 const QScopedPointer<Private>
d;
float value(const T *src, size_t ch)
ChangeType
Used by shapeChanged() to select which change was made.
The KoSvgTextPropertiesInterface class.
void removeTransformsFromRange(const int startPos, const int endPos)
QList< KoSvgTextProperties > propertiesForRange(const int startPos, const int endPos, bool inherited=false) const
propertiesForRange get the properties for a range.
bool insertRichText(int pos, const KoSvgTextShape *richText, bool inheritPropertiesIfPossible=false)
insertRichText Insert rich text at the given cursor pos. This will first split contents at the given ...
bool insertText(int pos, QString text)
insertText Insert a text somewhere in the KoTextShape.
bool removeText(int &index, int &length)
removeText Where insert text explicitly uses a cursorposition, remove text uses a string index....
Interface to interact with the text property manager.
const QScopedPointer< Private > d
Q_DECLARE_METATYPE(KisPaintopLodLimitations)
ShapeChangeListener so we can inform any text cursors that the cursor needs updating.
void notifyShapeChanged(ChangeType type, KoShape *shape) override
virtual void notifyMarkupChanged()=0
virtual void notifyCursorPosChanged(int pos, int anchor)=0
KoSvgTextShape * shape() const
Get the current text shape.
bool pasteRichText()
pasteRichText
bool isAddingCommand() const
the cursor is currently adding a command
const QScopedPointer< Private > d
void sigOpenGlyphPalette()
Called by actions, tells the parent tool to open the glyph palette.
TypeSettingModeHandle
Handles used by type setting mode.
@ BaselineAlphabetic
Baselines.
@ BaselineShift
The text properties handles.
void selectionChanged()
Sents an update selection was changed.
void updateCursorDecoration(QRectF updateRect)
Sents an update to the parent tool to update it's decorations.