16#include "kritatoolsvgtext_export.h"
23class QInputMethodEvent;
117 void setCaretSetting(
int cursorWidth = 1,
int cursorFlash = 1000,
int cursorFlashLimit = 5000,
bool drawCursorInAdditionToSelection =
false);
125 void setVisualMode(
const bool visualMode =
true);
131 void setPasteRichTextByDefault(
const bool pasteRichText =
true);
134 void setTypeSettingModeActive(
bool activate);
143 void setPos(
int pos,
int anchor);
146 void setPosToPoint(QPointF point,
bool moveAnchor =
true);
156 void setDrawTypeSettingHandle(
bool draw);
159 void updateTypeSettingDecorFromShape();
162 QCursor cursorTypeForTypeSetting()
const;
184 int posForTypeSettingHandleAndRect(
const TypeSettingModeHandle handle,
const QRectF regionOfInterest);
187 void moveCursor(
MoveMode mode,
bool moveAnchor =
true);
212 void removeLastCodePoint();
218 QPair<KoSvgTextProperties, KoSvgTextProperties> currentTextProperties()
const;
242 void mergePropertiesIntoSelection(
const KoSvgTextProperties props,
const QSet<KoSvgTextProperties::PropertyId> removeProperties = QSet<KoSvgTextProperties::PropertyId>(),
bool paragraphOnly =
false,
bool selectWord =
false);
250 void removeSelection();
270 void paintDecorations(QPainter &gc, QColor selectionColor,
int decorationThickness = 1, qreal handleRadius = 5.0);
273 QVariant inputMethodQuery(Qt::InputMethodQuery query)
const;
275 void inputMethodEvent(QInputMethodEvent *event);
291 void keyPressEvent(QKeyEvent *event);
293 void updateModifiers(
const Qt::KeyboardModifiers modifiers);
305 bool registerPropertyAction(QAction *action,
const QString &name);
324 void stopBlinkCursor();
330 void updateInputMethodItemTransform();
332 void canvasResourceChanged(
int key,
const QVariant &
value);
334 void propertyAction();
336 void clearFormattingAction();
349 bool pastePlainText();
358 void updateCanvasResources();
372 void updateCursor(
bool firstUpdate =
false);
373 void updateSelection();
374 void updateIMEDecoration();
375 void updateTypeSettingDecoration();
381 int moveModeResult(
const MoveMode mode,
int &pos,
bool visual =
false)
const;
386 bool acceptableInput(
const QKeyEvent *event)
const;
390 void commitIMEPreEdit();
393 const QScopedPointer<Private>
d;
405 virtual void setPropertiesOnSelected(
KoSvgTextProperties properties, QSet<KoSvgTextProperties::PropertyId> removeProperties = QSet<KoSvgTextProperties::PropertyId>())
override;
406 virtual void setCharacterPropertiesOnSelected(
KoSvgTextProperties properties, QSet<KoSvgTextProperties::PropertyId> removeProperties = QSet<KoSvgTextProperties::PropertyId>())
override;
407 virtual bool spanSelection()
override;
408 virtual bool characterPropertiesEnabled()
override;
409 void emitSelectionChange();
410 void emitCharacterSelectionChange();
413 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.