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

Constructor & Destructor Documentation

◆ SvgTextCursorPropertyInterface()

SvgTextCursorPropertyInterface::SvgTextCursorPropertyInterface ( SvgTextCursor * parent)

Definition at line 2192 of file SvgTextCursor.cpp.

2193 : KoSvgTextPropertiesInterface(parent), d(new Private(parent))
2194{
2195 connect(&d->compressor, SIGNAL(timeout()), this, SIGNAL(textSelectionChanged()));
2196 connect(&d->characterCompressor, SIGNAL(timeout()), this, SIGNAL(textCharacterSelectionChanged()));
2197}
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 2199 of file SvgTextCursor.cpp.

2200{
2201
2202}

Member Function Documentation

◆ characterPropertiesEnabled()

bool SvgTextCursorPropertyInterface::characterPropertiesEnabled ( )
overridevirtual

Whether character selections are possible at all.

Implements KoSvgTextPropertiesInterface.

Definition at line 2240 of file SvgTextCursor.cpp.

2241{
2242 return true;
2243}

◆ emitCharacterSelectionChange()

void SvgTextCursorPropertyInterface::emitCharacterSelectionChange ( )

Definition at line 2253 of file SvgTextCursor.cpp.

2254{
2255 d->characterCompressor.start();
2256}

References d.

◆ emitSelectionChange()

void SvgTextCursorPropertyInterface::emitSelectionChange ( )

Definition at line 2245 of file SvgTextCursor.cpp.

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

References d.

◆ getCharacterProperties()

QList< KoSvgTextProperties > SvgTextCursorPropertyInterface::getCharacterProperties ( )
overridevirtual

getSelectedProperties

Returns
all KoSvgTextProperties for the given character selection.

Implements KoSvgTextPropertiesInterface.

Definition at line 2208 of file SvgTextCursor.cpp.

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

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

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

References d.

◆ getSelectedProperties()

QList< KoSvgTextProperties > SvgTextCursorPropertyInterface::getSelectedProperties ( )
overridevirtual

getSelectedProperties

Returns
all KoSvgTextProperties for the given selection.

Implements KoSvgTextPropertiesInterface.

Definition at line 2203 of file SvgTextCursor.cpp.

2204{
2205 return d->parent->propertiesForShape();
2206}

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

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

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

2226{
2227 d->parent->mergePropertiesIntoSelection(properties, removeProperties, true);
2228}

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

2236{
2237 return d->parent->hasSelection();
2238}

References d.

Member Data Documentation

◆ d

const QScopedPointer<Private> SvgTextCursorPropertyInterface::d
private

Definition at line 413 of file SvgTextCursor.h.


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