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 398 of file SvgTextCursor.h.

Constructor & Destructor Documentation

◆ SvgTextCursorPropertyInterface()

SvgTextCursorPropertyInterface::SvgTextCursorPropertyInterface ( SvgTextCursor * parent)

Definition at line 2197 of file SvgTextCursor.cpp.

2198 : KoSvgTextPropertiesInterface(parent), d(new Private(parent))
2199{
2200 connect(&d->compressor, SIGNAL(timeout()), this, SIGNAL(textSelectionChanged()));
2201 connect(&d->characterCompressor, SIGNAL(timeout()), this, SIGNAL(textCharacterSelectionChanged()));
2202}
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 2204 of file SvgTextCursor.cpp.

2205{
2206
2207}

Member Function Documentation

◆ characterPropertiesEnabled()

bool SvgTextCursorPropertyInterface::characterPropertiesEnabled ( )
overridevirtual

Whether character selections are possible at all.

Implements KoSvgTextPropertiesInterface.

Definition at line 2245 of file SvgTextCursor.cpp.

2246{
2247 return true;
2248}

◆ emitCharacterSelectionChange()

void SvgTextCursorPropertyInterface::emitCharacterSelectionChange ( )

Definition at line 2258 of file SvgTextCursor.cpp.

2259{
2260 d->characterCompressor.start();
2261}

References d.

◆ emitSelectionChange()

void SvgTextCursorPropertyInterface::emitSelectionChange ( )

Definition at line 2250 of file SvgTextCursor.cpp.

2251{
2252 // Don't bother updating the selection when there's no shape
2253 // this is so we can use the text properties last used to create new texts.
2254 if (!d->parent->shape()) return;
2255 d->compressor.start();
2256}

References d.

◆ getCharacterProperties()

QList< KoSvgTextProperties > SvgTextCursorPropertyInterface::getCharacterProperties ( )
overridevirtual

getSelectedProperties

Returns
all KoSvgTextProperties for the given character selection.

Implements KoSvgTextPropertiesInterface.

Definition at line 2213 of file SvgTextCursor.cpp.

2214{
2215 // When there's only a single node, its best to only return empty properties, as paragraph properties handle that single node.
2216 if (!d->parent->shape()) return QList<KoSvgTextProperties>();
2217 if (d->parent->shape()->singleNode()) {
2218 return {KoSvgTextProperties()};
2219 }
2220 return d->parent->propertiesForRange();
2221}

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

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

References d.

◆ getSelectedProperties()

QList< KoSvgTextProperties > SvgTextCursorPropertyInterface::getSelectedProperties ( )
overridevirtual

getSelectedProperties

Returns
all KoSvgTextProperties for the given selection.

Implements KoSvgTextPropertiesInterface.

Definition at line 2208 of file SvgTextCursor.cpp.

2209{
2210 return d->parent->propertiesForShape();
2211}

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

2236{
2237 d->parent->mergePropertiesIntoSelection(properties, removeProperties, false, true);
2238}

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

2231{
2232 d->parent->mergePropertiesIntoSelection(properties, removeProperties, true);
2233}

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

2241{
2242 return d->parent->hasSelection();
2243}

References d.

Member Data Documentation

◆ d

const QScopedPointer<Private> SvgTextCursorPropertyInterface::d
private

Definition at line 414 of file SvgTextCursor.h.


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