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

Interface to interact with the text property manager. More...

#include <SvgTextCursor.h>

+ Inheritance diagram for SvgTextCursorPropertyInterface:

Classes

struct  Private
 

Public Member Functions

void emitSelectionChange ()
 
virtual KoSvgTextProperties getInheritedProperties () override
 getInheritedProperties The properties that should be visible when a given property isn't available in common properties. This is typically the paragraph properties.
 
virtual QList< KoSvgTextPropertiesgetSelectedProperties () override
 getSelectedProperties
 
virtual void setPropertiesOnSelected (KoSvgTextProperties properties, QSet< KoSvgTextProperties::PropertyId > removeProperties=QSet< KoSvgTextProperties::PropertyId >()) override
 setPropertiesOnSelected This sets the properties on the selection. The implementation is responsible for handling the undo states.
 
virtual bool spanSelection () override
 Whether the tool is currently selecting a set of characters instead of whole paragraphs.
 
 SvgTextCursorPropertyInterface (SvgTextCursor *parent)
 
 ~SvgTextCursorPropertyInterface ()
 
- Public Member Functions inherited from KoSvgTextPropertiesInterface
 KoSvgTextPropertiesInterface (QObject *parent=nullptr)
 

Private Attributes

const QScopedPointer< Privated
 

Additional Inherited Members

- Signals inherited from KoSvgTextPropertiesInterface
void textSelectionChanged ()
 

Detailed Description

Interface to interact with the text property manager.

Definition at line 266 of file SvgTextCursor.h.

Constructor & Destructor Documentation

◆ SvgTextCursorPropertyInterface()

SvgTextCursorPropertyInterface::SvgTextCursorPropertyInterface ( SvgTextCursor * parent)

Definition at line 1515 of file SvgTextCursor.cpp.

1516 : KoSvgTextPropertiesInterface(parent), d(new Private(parent))
1517{
1518 connect(&d->compressor, SIGNAL(timeout()), this, SIGNAL(textSelectionChanged()));
1519}
connect(this, SIGNAL(optionsChanged()), this, SLOT(saveOptions()))
KoSvgTextPropertiesInterface(QObject *parent=nullptr)
const QScopedPointer< Private > d

References connect(), d, and KoSvgTextPropertiesInterface::textSelectionChanged().

◆ ~SvgTextCursorPropertyInterface()

SvgTextCursorPropertyInterface::~SvgTextCursorPropertyInterface ( )

Definition at line 1521 of file SvgTextCursor.cpp.

1522{
1523
1524}

Member Function Documentation

◆ emitSelectionChange()

void SvgTextCursorPropertyInterface::emitSelectionChange ( )

Definition at line 1547 of file SvgTextCursor.cpp.

1548{
1549 // Don't bother updating the selection when there's no shape
1550 // this is so we can use the text properties last used to create new texts.
1551 if (!d->parent->shape()) return;
1552 d->compressor.start();
1553}

References d.

◆ getInheritedProperties()

KoSvgTextProperties SvgTextCursorPropertyInterface::getInheritedProperties ( )
overridevirtual

getInheritedProperties The properties that should be visible when a given property isn't available in common properties. This is typically the paragraph properties.

Returns
what counts as the inherited properties for the given selection.

Implements KoSvgTextPropertiesInterface.

Definition at line 1530 of file SvgTextCursor.cpp.

1531{
1532 // 9 times out of 10 this is correct, though we could do better by actually
1533 // getting inherited properties for the range and not just defaulting to the paragraph.
1534 return (d->parent->shape() && spanSelection())? d->parent->shape()->textProperties(): KoSvgTextProperties();
1535}
virtual bool spanSelection() override
Whether the tool is currently selecting a set of characters instead of whole paragraphs.

References d, and spanSelection().

◆ getSelectedProperties()

QList< KoSvgTextProperties > SvgTextCursorPropertyInterface::getSelectedProperties ( )
overridevirtual

getSelectedProperties

Returns
all KoSvgTextProperties for the given selection.

Implements KoSvgTextPropertiesInterface.

Definition at line 1525 of file SvgTextCursor.cpp.

1526{
1527 return d->parent->propertiesForRange();
1528}

References d.

◆ setPropertiesOnSelected()

void SvgTextCursorPropertyInterface::setPropertiesOnSelected ( KoSvgTextProperties properties,
QSet< KoSvgTextProperties::PropertyId > removeProperties = QSet< KoSvgTextProperties::PropertyId >() )
overridevirtual

setPropertiesOnSelected This sets the properties on the selection. The implementation is responsible for handling the undo states.

Parameters
properties– the properties to set.

Implements KoSvgTextPropertiesInterface.

Definition at line 1537 of file SvgTextCursor.cpp.

1538{
1539 d->parent->mergePropertiesIntoSelection(properties, removeProperties);
1540}

References d.

◆ spanSelection()

bool SvgTextCursorPropertyInterface::spanSelection ( )
overridevirtual

Whether the tool is currently selecting a set of characters instead of whole paragraphs.

Implements KoSvgTextPropertiesInterface.

Definition at line 1542 of file SvgTextCursor.cpp.

1543{
1544 return d->parent->hasSelection();
1545}

References d.

Member Data Documentation

◆ d

const QScopedPointer<Private> SvgTextCursorPropertyInterface::d
private

Definition at line 278 of file SvgTextCursor.h.


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