16#include "kritatoolsvgtext_export.h"
24class QInputMethodEvent;
118 void setCaretSetting(
int cursorWidth = 1,
int cursorFlash = 1000,
int cursorFlashLimit = 5000,
bool drawCursorInAdditionToSelection =
false);
126 void setVisualMode(
const bool visualMode =
true);
132 void setPasteRichTextByDefault(
const bool pasteRichText =
true);
135 void setTypeSettingModeActive(
bool activate);
144 void setPos(
int pos,
int anchor);
147 void setPosToPoint(QPointF point,
bool moveAnchor =
true);
157 void setDrawTypeSettingHandle(
bool draw);
160 void updateTypeSettingDecorFromShape();
163 QCursor cursorTypeForTypeSetting()
const;
185 int posForTypeSettingHandleAndRect(
const TypeSettingModeHandle handle,
const QRectF regionOfInterest);
188 void moveCursor(
MoveMode mode,
bool moveAnchor =
true);
213 void removeLastCodePoint();
219 QPair<KoSvgTextProperties, KoSvgTextProperties> currentTextProperties()
const;
243 void mergePropertiesIntoSelection(
const KoSvgTextProperties props,
const QSet<KoSvgTextProperties::PropertyId> removeProperties = QSet<KoSvgTextProperties::PropertyId>(),
bool paragraphOnly =
false,
bool selectWord =
false);
251 void removeSelection();
271 void paintDecorations(QPainter &gc, QColor selectionColor,
int decorationThickness = 1, qreal handleRadius = 5.0,
KisHandlePalette handlePalette =
KisHandlePalette());
274 QVariant inputMethodQuery(Qt::InputMethodQuery query)
const;
276 void inputMethodEvent(QInputMethodEvent *event);
292 void keyPressEvent(QKeyEvent *event);
294 void updateModifiers(
const Qt::KeyboardModifiers modifiers);
306 bool registerPropertyAction(QAction *action,
const QString &name);
325 void stopBlinkCursor();
331 void updateInputMethodItemTransform();
333 void canvasResourceChanged(
int key,
const QVariant &
value);
335 void propertyAction();
337 void clearFormattingAction();
350 bool pastePlainText();
359 void updateCanvasResources();
373 void updateCursor(
bool firstUpdate =
false);
374 void updateSelection();
375 void updateIMEDecoration();
376 void updateTypeSettingDecoration();
382 int moveModeResult(
const MoveMode mode,
int &pos,
bool visual =
false)
const;
387 bool acceptableInput(
const QKeyEvent *event)
const;
391 void commitIMEPreEdit();
394 const QScopedPointer<Private>
d;
406 virtual void setPropertiesOnSelected(
KoSvgTextProperties properties, QSet<KoSvgTextProperties::PropertyId> removeProperties = QSet<KoSvgTextProperties::PropertyId>())
override;
407 virtual void setCharacterPropertiesOnSelected(
KoSvgTextProperties properties, QSet<KoSvgTextProperties::PropertyId> removeProperties = QSet<KoSvgTextProperties::PropertyId>())
override;
408 virtual bool spanSelection()
override;
409 virtual bool characterPropertiesEnabled()
override;
410 void emitSelectionChange();
411 void emitCharacterSelectionChange();
414 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.