Krita Source Code Documentation
Loading...
Searching...
No Matches
KoSvgTextRemoveShapeCommand Class Reference

#include <KoSvgTextAddRemoveShapeCommands.h>

+ Inheritance diagram for KoSvgTextRemoveShapeCommand:

Public Member Functions

 KoSvgTextRemoveShapeCommand (KoSvgTextShape *textShape, KoShape *shape, KUndo2Command *parentCommand=0)
 
 ~KoSvgTextRemoveShapeCommand ()
 
- Public Member Functions inherited from KoSvgTextAddRemoveShapeCommandImpl
 KoSvgTextAddRemoveShapeCommandImpl (KoSvgTextShape *textShape, KoShape *shape, ContourType type, State state, int startPos, int endPos, KUndo2Command *parent=nullptr)
 
void partA () override
 
void partB () override
 
 ~KoSvgTextAddRemoveShapeCommandImpl ()
 
- Public Member Functions inherited from KisCommandUtils::FlipFlopCommand
 FlipFlopCommand (bool finalizing=false, KUndo2Command *parent=0)
 
 FlipFlopCommand (State initialState, KUndo2Command *parent=0)
 
void redo () override
 
void undo () override
 
- Public Member Functions inherited from KUndo2Command
QString actionText () const
 
virtual bool canAnnihilateWith (const KUndo2Command *other) const
 
const KUndo2Commandchild (int index) const
 
int childCount () const
 
virtual QTime endTime () const
 
KUndo2CommandExtraDataextraData () const
 
bool hasParent () const
 
virtual int id () const
 
virtual bool isMerged () const
 
 KUndo2Command (const KUndo2MagicString &text, KUndo2Command *parent=0)
 
 KUndo2Command (KUndo2Command *parent=0)
 
virtual QVector< KUndo2Command * > mergeCommandsVector () const
 
virtual bool mergeWith (const KUndo2Command *other)
 
virtual void redoMergedCommands ()
 
void setEndTime ()
 
virtual void setEndTime (const QTime &time)
 
void setExtraData (KUndo2CommandExtraData *data)
 
void setText (const KUndo2MagicString &text)
 
void setTime ()
 
virtual void setTime (const QTime &time)
 
virtual void setTimedID (int timedID)
 
KUndo2MagicString text () const
 
virtual QTime time () const
 
virtual int timedId () const
 
virtual bool timedMergeWith (KUndo2Command *other)
 
virtual void undoMergedCommands ()
 
virtual ~KUndo2Command ()
 

Static Public Member Functions

static void removeContourShapesFromFlow (KoSvgTextShape *textShape, KUndo2Command *parent, bool textInShape, bool textPaths)
 removeContourShapesFromFlow Create a command to remove all contour shapes of a certain type from the flow and add the command to the parent.
 

Additional Inherited Members

- Public Types inherited from KoSvgTextAddRemoveShapeCommandImpl
enum  ContourType { Unknown , Inside , Subtract , TextPath }
 
- Public Types inherited from KisCommandUtils::FlipFlopCommand
enum  State { INITIALIZING , FINALIZING }
 
- Protected Member Functions inherited from KisCommandUtils::FlipFlopCommand
State getState () const
 
bool isFirstRedo () const
 

Detailed Description

Definition at line 41 of file KoSvgTextAddRemoveShapeCommands.h.

Constructor & Destructor Documentation

◆ KoSvgTextRemoveShapeCommand()

KoSvgTextRemoveShapeCommand::KoSvgTextRemoveShapeCommand ( KoSvgTextShape * textShape,
KoShape * shape,
KUndo2Command * parentCommand = 0 )

Definition at line 159 of file KoSvgTextAddRemoveShapeCommands.cpp.

160: KoSvgTextAddRemoveShapeCommandImpl(textShape, shape, Unknown, FINALIZING, -1, -1, parentCommand)
161{
162 // the \p shape will be ungrouped into the parent of \p textShape
164}
KoSvgTextAddRemoveShapeCommandImpl(KoSvgTextShape *textShape, KoShape *shape, ContourType type, State state, int startPos, int endPos, KUndo2Command *parent=nullptr)
bool shapeInContours(KoShape *shape)
shapeInContours
#define KIS_SAFE_ASSERT_RECOVER_NOOP(cond)
Definition kis_assert.h:130

References KIS_SAFE_ASSERT_RECOVER_NOOP, and KoSvgTextShape::shapeInContours().

◆ ~KoSvgTextRemoveShapeCommand()

KoSvgTextRemoveShapeCommand::~KoSvgTextRemoveShapeCommand ( )

Definition at line 166 of file KoSvgTextAddRemoveShapeCommands.cpp.

167{
168
169}

Member Function Documentation

◆ removeContourShapesFromFlow()

void KoSvgTextRemoveShapeCommand::removeContourShapesFromFlow ( KoSvgTextShape * textShape,
KUndo2Command * parent,
bool textInShape,
bool textPaths )
static

removeContourShapesFromFlow Create a command to remove all contour shapes of a certain type from the flow and add the command to the parent.

Parameters
textShape– textShape to work on.
parent– parentCommand to add remove commands to.
textInShape– remove all text-in-shape shapeInside and ShapeSubtract shapes.
textPaths– remove all text paths.

Definition at line 171 of file KoSvgTextAddRemoveShapeCommands.cpp.

172{
173 QList<KoShape*> shapes;
174 if (textInShape) {
175 shapes.append(textShape->shapesInside());
176 shapes.append(textShape->shapesSubtract());
177 }
178 if (textPaths) {
179 shapes.append(textShape->textPathsAtRange(0, textShape->posForIndex(textShape->plainText().size())));
180 }
181 Q_FOREACH(KoShape *shape, shapes) {
182 new KoSvgTextRemoveShapeCommand(textShape, shape, parent);
183 }
184}
KoSvgTextRemoveShapeCommand(KoSvgTextShape *textShape, KoShape *shape, KUndo2Command *parentCommand=0)
QList< KoShape * > shapesInside
int posForIndex(int index, bool firstIndex=false, bool skipSynthetic=false) const
posForIndex Get the cursor position for a given index in a string.
QList< KoShape * > textPathsAtRange(const int startPos=-1, const int endPos=-1)
textPathsAtRange Get a list of textPaths at the given range. This includes textPaths whose node is on...
QList< KoShape * > shapesSubtract

References KoSvgTextRemoveShapeCommand(), KoSvgTextShape::plainText, KoSvgTextShape::posForIndex(), KoSvgTextShape::shapesInside, KoSvgTextShape::shapesSubtract, and KoSvgTextShape::textPathsAtRange().


The documentation for this class was generated from the following files: