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

virtual bool characterPropertiesEnabled () override
 Whether character selections are possible at all.
 
void emitCharacterSelectionChange ()
 
void emitSelectionChange ()
 
virtual QList< KoSvgTextPropertiesgetCharacterProperties () override
 getSelectedProperties
 
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 setCharacterPropertiesOnSelected (KoSvgTextProperties properties, QSet< KoSvgTextProperties::PropertyId > removeProperties=QSet< KoSvgTextProperties::PropertyId >()) override
 setCharacterPropertiesOnSelected This sets the properties for a character selection instead of the full text shape. Typically the selection of characters. The implementation is responsible for handling the undo states.
 
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 textCharacterSelectionChanged ()
 
void textSelectionChanged ()
 Emit to signal to KisTextPropertiesManager to call getSelectedProperties.
 

Detailed Description

Interface to interact with the text property manager.

Definition at line 392 of file SvgTextCursor.h.

Constructor & Destructor Documentation

◆ SvgTextCursorPropertyInterface()

SvgTextCursorPropertyInterface::SvgTextCursorPropertyInterface ( SvgTextCursor * parent)

Definition at line 2169 of file SvgTextCursor.cpp.

2170 : KoSvgTextPropertiesInterface(parent), d(new Private(parent))
2171{
2172 connect(&d->compressor, SIGNAL(timeout()), this, SIGNAL(textSelectionChanged()));
2173 connect(&d->characterCompressor, SIGNAL(timeout()), this, SIGNAL(textCharacterSelectionChanged()));
2174}
void textSelectionChanged()
Emit to signal to KisTextPropertiesManager to call getSelectedProperties.
KoSvgTextPropertiesInterface(QObject *parent=nullptr)
const QScopedPointer< Private > d

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

◆ ~SvgTextCursorPropertyInterface()

SvgTextCursorPropertyInterface::~SvgTextCursorPropertyInterface ( )

Definition at line 2176 of file SvgTextCursor.cpp.

2177{
2178
2179}

Member Function Documentation

◆ characterPropertiesEnabled()

bool SvgTextCursorPropertyInterface::characterPropertiesEnabled ( )
overridevirtual

Whether character selections are possible at all.

Implements KoSvgTextPropertiesInterface.

Definition at line 2217 of file SvgTextCursor.cpp.

2218{
2219 return true;
2220}

◆ emitCharacterSelectionChange()

void SvgTextCursorPropertyInterface::emitCharacterSelectionChange ( )

Definition at line 2230 of file SvgTextCursor.cpp.

2231{
2232 d->characterCompressor.start();
2233}

References d.

◆ emitSelectionChange()

void SvgTextCursorPropertyInterface::emitSelectionChange ( )

Definition at line 2222 of file SvgTextCursor.cpp.

2223{
2224 // Don't bother updating the selection when there's no shape
2225 // this is so we can use the text properties last used to create new texts.
2226 if (!d->parent->shape()) return;
2227 d->compressor.start();
2228}

References d.

◆ getCharacterProperties()

QList< KoSvgTextProperties > SvgTextCursorPropertyInterface::getCharacterProperties ( )
overridevirtual

getSelectedProperties

Returns
all KoSvgTextProperties for the given character selection.

Implements KoSvgTextPropertiesInterface.

Definition at line 2185 of file SvgTextCursor.cpp.

2186{
2187 // When there's only a single node, its best to only return empty properties, as paragraph properties handle that single node.
2188 if (!d->parent->shape()) return QList<KoSvgTextProperties>();
2189 if (d->parent->shape()->singleNode()) {
2190 return {KoSvgTextProperties()};
2191 }
2192 return d->parent->propertiesForRange();
2193}

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 2195 of file SvgTextCursor.cpp.

2196{
2197 // 9 times out of 10 this is correct, though we could do better by actually
2198 // getting inherited properties for the range and not just defaulting to the paragraph.
2199 return (d->parent->shape())? d->parent->shape()->textProperties(): KoSvgTextProperties();
2200}

References d.

◆ getSelectedProperties()

QList< KoSvgTextProperties > SvgTextCursorPropertyInterface::getSelectedProperties ( )
overridevirtual

getSelectedProperties

Returns
all KoSvgTextProperties for the given selection.

Implements KoSvgTextPropertiesInterface.

Definition at line 2180 of file SvgTextCursor.cpp.

2181{
2182 return d->parent->propertiesForShape();
2183}

References d.

◆ setCharacterPropertiesOnSelected()

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

setCharacterPropertiesOnSelected This sets the properties for a character selection instead of the full text shape. Typically the selection of characters. The implementation is responsible for handling the undo states.

Parameters
properties– the properties to set.
removeProperties– properties to remove.

Implements KoSvgTextPropertiesInterface.

Definition at line 2207 of file SvgTextCursor.cpp.

2208{
2209 d->parent->mergePropertiesIntoSelection(properties, removeProperties, false, true);
2210}

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.
removeProperties– properties to remove.

Implements KoSvgTextPropertiesInterface.

Definition at line 2202 of file SvgTextCursor.cpp.

2203{
2204 d->parent->mergePropertiesIntoSelection(properties, removeProperties, true);
2205}

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 2212 of file SvgTextCursor.cpp.

2213{
2214 return d->parent->hasSelection();
2215}

References d.

Member Data Documentation

◆ d

const QScopedPointer<Private> SvgTextCursorPropertyInterface::d
private

Definition at line 408 of file SvgTextCursor.h.


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