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

#include <SvgTextChangeCommand.h>

+ Inheritance diagram for SvgTextChangeCommand:

Public Member Functions

void redo () override
 redo the command
 
 SvgTextChangeCommand (KoSvgTextShape *shape, const QString &svg, const QString &defs, KUndo2Command *parent=0)
 
void undo () override
 revert the actions done in redo
 
virtual ~SvgTextChangeCommand ()
 
- Public Member Functions inherited from KUndo2Command
QString actionText () const
 
virtual bool canAnnihilateWith (const KUndo2Command *other) const
 
const KUndo2Command * child (int index) const
 
int childCount () const
 
virtual QTime endTime () const
 
KUndo2CommandExtraData * extraData () 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 ()
 

Private Attributes

QString m_defs
 
QString m_oldDefs
 
QString m_oldSvg
 
KoSvgTextShape * m_shape
 
QString m_svg
 

Detailed Description

Definition at line 14 of file SvgTextChangeCommand.h.

Constructor & Destructor Documentation

◆ SvgTextChangeCommand()

SvgTextChangeCommand::SvgTextChangeCommand ( KoSvgTextShape * shape,
const QString & svg,
const QString & defs,
KUndo2Command * parent = 0 )

Definition at line 15 of file SvgTextChangeCommand.cpp.

19 : KUndo2Command(parent)
20 , m_shape(shape)
21 , m_svg(svg)
22 , m_defs(defs)
23{
24 Q_ASSERT(shape);
25 setText(kundo2_i18n("Change SvgTextTool"));
27 converter.convertToSvg(&m_oldSvg, &m_oldDefs);
28}
void setText(const KUndo2MagicString &text)
KUndo2Command(KUndo2Command *parent=0)
KUndo2MagicString kundo2_i18n(const char *text)

References KoSvgTextShapeMarkupConverter::convertToSvg(), kundo2_i18n(), m_oldDefs, m_oldSvg, m_shape, and KUndo2Command::setText().

◆ ~SvgTextChangeCommand()

SvgTextChangeCommand::~SvgTextChangeCommand ( )
virtual

Definition at line 30 of file SvgTextChangeCommand.cpp.

31{
32}

Member Function Documentation

◆ redo()

void SvgTextChangeCommand::redo ( )
overridevirtual

redo the command

Reimplemented from KUndo2Command.

Definition at line 34 of file SvgTextChangeCommand.cpp.

35{
36 m_shape->update();
38 // Hardcoded resolution?
39 converter.convertFromSvg(m_svg, m_defs, m_shape->boundingRect(), 72.0);
40 m_shape->update();
41}
virtual void update() const
Definition KoShape.cpp:529
QRectF boundingRect() const override
Get the bounding box of the shape.

References KoSvgTextShape::boundingRect(), KoSvgTextShapeMarkupConverter::convertFromSvg(), m_defs, m_shape, m_svg, and KoShape::update().

◆ undo()

void SvgTextChangeCommand::undo ( )
overridevirtual

revert the actions done in redo

Reimplemented from KUndo2Command.

Definition at line 43 of file SvgTextChangeCommand.cpp.

44{
45 m_shape->update();
47 // Hardcoded resolution?
48 converter.convertFromSvg(m_oldSvg, m_oldDefs, m_shape->boundingRect(), 72.0);
49 m_shape->update();
50}

References KoSvgTextShape::boundingRect(), KoSvgTextShapeMarkupConverter::convertFromSvg(), m_oldDefs, m_oldSvg, m_shape, and KoShape::update().

Member Data Documentation

◆ m_defs

QString SvgTextChangeCommand::m_defs
private

Definition at line 31 of file SvgTextChangeCommand.h.

◆ m_oldDefs

QString SvgTextChangeCommand::m_oldDefs
private

Definition at line 33 of file SvgTextChangeCommand.h.

◆ m_oldSvg

QString SvgTextChangeCommand::m_oldSvg
private

Definition at line 32 of file SvgTextChangeCommand.h.

◆ m_shape

KoSvgTextShape* SvgTextChangeCommand::m_shape
private

Definition at line 29 of file SvgTextChangeCommand.h.

◆ m_svg

QString SvgTextChangeCommand::m_svg
private

Definition at line 30 of file SvgTextChangeCommand.h.


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