LibrePCB Developers Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
StrokeText Class Referencefinal

The StrokeText class. More...

#include <stroketext.h>

+ Inheritance diagram for StrokeText:
+ Collaboration diagram for StrokeText:

Public Member Functions

 StrokeText ()=delete
 
 StrokeText (const StrokeText &other) noexcept
 
 StrokeText (const Uuid &uuid, const StrokeText &other) noexcept
 
 StrokeText (const Uuid &uuid, const GraphicsLayerName &layerName, const QString &text, const Point &pos, const Angle &rotation, const PositiveLength &height, const UnsignedLength &strokeWidth, const StrokeTextSpacing &letterSpacing, const StrokeTextSpacing &lineSpacing, const Alignment &align, bool mirrored, bool autoRotate) noexcept
 
 StrokeText (const SExpression &node)
 
 ~StrokeText () noexcept
 
const UuidgetUuid () const noexcept
 
const GraphicsLayerNamegetLayerName () const noexcept
 
const PointgetPosition () const noexcept
 
const AnglegetRotation () const noexcept
 
const PositiveLengthgetHeight () const noexcept
 
const UnsignedLengthgetStrokeWidth () const noexcept
 
const StrokeTextSpacinggetLetterSpacing () const noexcept
 
const StrokeTextSpacinggetLineSpacing () const noexcept
 
const AlignmentgetAlign () const noexcept
 
bool getMirrored () const noexcept
 
bool getAutoRotate () const noexcept
 
const QString & getText () const noexcept
 
const QVector< Path > & getPaths () const noexcept
 
bool needsAutoRotation () const noexcept
 
Length calcLetterSpacing () const noexcept
 
Length calcLineSpacing () const noexcept
 
void setLayerName (const GraphicsLayerName &name) noexcept
 
void setText (const QString &text) noexcept
 
void setPosition (const Point &pos) noexcept
 
void setRotation (const Angle &rotation) noexcept
 
void setHeight (const PositiveLength &height) noexcept
 
void setStrokeWidth (const UnsignedLength &strokeWidth) noexcept
 
void setLetterSpacing (const StrokeTextSpacing &spacing) noexcept
 
void setLineSpacing (const StrokeTextSpacing &spacing) noexcept
 
void setAlign (const Alignment &align) noexcept
 
void setMirrored (bool mirrored) noexcept
 
void setAutoRotate (bool autoRotate) noexcept
 
void setAttributeProvider (const AttributeProvider *provider) noexcept
 
void setFont (const StrokeFont *font) noexcept
 
const StrokeFontgetCurrentFont () const noexcept
 
void updatePaths () noexcept
 
void registerObserver (IF_StrokeTextObserver &object) const noexcept
 
void unregisterObserver (IF_StrokeTextObserver &object) const noexcept
 
void serialize (SExpression &root) const override
 Serialize the object into an existing S-Expression node. More...
 
bool operator== (const StrokeText &rhs) const noexcept
 
bool operator!= (const StrokeText &rhs) const noexcept
 
StrokeTextoperator= (const StrokeText &rhs) noexcept
 
- Public Member Functions inherited from SerializableObject
 SerializableObject () noexcept
 
virtual ~SerializableObject () noexcept
 
SExpression serializeToDomElement (const QString &name) const
 Serialize the object to a new S-Expression node. More...
 

Private Attributes

Uuid mUuid
 
GraphicsLayerName mLayerName
 
QString mText
 
Point mPosition
 
Angle mRotation
 
PositiveLength mHeight
 
UnsignedLength mStrokeWidth
 
StrokeTextSpacing mLetterSpacing
 
StrokeTextSpacing mLineSpacing
 
Alignment mAlign
 
bool mMirrored
 
bool mAutoRotate
 
QSet< IF_StrokeTextObserver * > mObservers
 A list of all observer objects. More...
 
const AttributeProvidermAttributeProvider
 for substituting placeholders in text More...
 
const StrokeFontmFont
 font used for calculating paths More...
 
QVector< PathmPaths
 
QVector< PathmPathsRotated
 same as mPaths, but rotated by 180° More...
 

Additional Inherited Members

- Static Public Member Functions inherited from SerializableObject
template<typename T >
static void serializeObjectContainer (SExpression &root, const T &container, const QString &itemName)
 
template<typename T >
static void serializePointerContainer (SExpression &root, const T &container, const QString &itemName)
 
template<typename T >
static void serializePointerContainerUuidSorted (SExpression &root, const T &container, const QString &itemName)
 

Detailed Description

The StrokeText class.

Constructor & Destructor Documentation

StrokeText ( )
delete
StrokeText ( const StrokeText other)
noexcept
StrokeText ( const Uuid uuid,
const StrokeText other 
)
noexcept
StrokeText ( const Uuid uuid,
const GraphicsLayerName layerName,
const QString &  text,
const Point pos,
const Angle rotation,
const PositiveLength height,
const UnsignedLength strokeWidth,
const StrokeTextSpacing letterSpacing,
const StrokeTextSpacing lineSpacing,
const Alignment align,
bool  mirrored,
bool  autoRotate 
)
noexcept
StrokeText ( const SExpression node)
explicit

+ Here is the call graph for this function:

~StrokeText ( )
noexcept

Member Function Documentation

const Uuid& getUuid ( ) const
inlinenoexcept
const GraphicsLayerName& getLayerName ( ) const
inlinenoexcept

+ Here is the caller graph for this function:

const Point& getPosition ( ) const
inlinenoexcept

+ Here is the caller graph for this function:

const Angle& getRotation ( ) const
inlinenoexcept

+ Here is the caller graph for this function:

const PositiveLength& getHeight ( ) const
inlinenoexcept
const UnsignedLength& getStrokeWidth ( ) const
inlinenoexcept

+ Here is the caller graph for this function:

const StrokeTextSpacing& getLetterSpacing ( ) const
inlinenoexcept
const StrokeTextSpacing& getLineSpacing ( ) const
inlinenoexcept
const Alignment& getAlign ( ) const
inlinenoexcept
bool getMirrored ( ) const
inlinenoexcept

+ Here is the caller graph for this function:

bool getAutoRotate ( ) const
inlinenoexcept
const QString& getText ( ) const
inlinenoexcept
const QVector< Path > & getPaths ( ) const
noexcept

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool needsAutoRotation ( ) const
noexcept

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Length calcLetterSpacing ( ) const
noexcept

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Length calcLineSpacing ( ) const
noexcept

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void setLayerName ( const GraphicsLayerName name)
noexcept

+ Here is the caller graph for this function:

void setText ( const QString &  text)
noexcept

+ Here is the caller graph for this function:

void setPosition ( const Point pos)
noexcept

+ Here is the caller graph for this function:

void setRotation ( const Angle rotation)
noexcept

+ Here is the caller graph for this function:

void setHeight ( const PositiveLength height)
noexcept

+ Here is the caller graph for this function:

void setStrokeWidth ( const UnsignedLength strokeWidth)
noexcept

+ Here is the caller graph for this function:

void setLetterSpacing ( const StrokeTextSpacing spacing)
noexcept

+ Here is the caller graph for this function:

void setLineSpacing ( const StrokeTextSpacing spacing)
noexcept

+ Here is the caller graph for this function:

void setAlign ( const Alignment align)
noexcept

+ Here is the caller graph for this function:

void setMirrored ( bool  mirrored)
noexcept

+ Here is the caller graph for this function:

void setAutoRotate ( bool  autoRotate)
noexcept

+ Here is the caller graph for this function:

void setAttributeProvider ( const AttributeProvider provider)
noexcept

+ Here is the caller graph for this function:

void setFont ( const StrokeFont font)
noexcept

+ Here is the caller graph for this function:

const StrokeFont* getCurrentFont ( ) const
inlinenoexcept
void updatePaths ( )
noexcept

+ Here is the call graph for this function:

void registerObserver ( IF_StrokeTextObserver object) const
noexcept
void unregisterObserver ( IF_StrokeTextObserver object) const
noexcept

+ Here is the caller graph for this function:

void serialize ( SExpression root) const
overridevirtual

Serialize the object into an existing S-Expression node.

This method inserts/appends all attributes and childs of the object to an existing S-Expression node. The content which already exists in the given S-Expression node will not be removed.

Note
The generated S-Expression node has always the format of the application's major version (it's not possible to generate DOMs of older versions).
Parameters
rootThe target DOM root node
Exceptions
ExceptionThis method throws an exception if an error occurs.

Implements SerializableObject.

+ Here is the call graph for this function:

bool operator== ( const StrokeText rhs) const
noexcept
bool operator!= ( const StrokeText rhs) const
inlinenoexcept
StrokeText & operator= ( const StrokeText rhs)
noexcept

Member Data Documentation

Uuid mUuid
private
GraphicsLayerName mLayerName
private
QString mText
private
Point mPosition
private
Angle mRotation
private
PositiveLength mHeight
private
UnsignedLength mStrokeWidth
private
StrokeTextSpacing mLetterSpacing
private
StrokeTextSpacing mLineSpacing
private
Alignment mAlign
private
bool mMirrored
private
bool mAutoRotate
private
QSet<IF_StrokeTextObserver*> mObservers
mutableprivate

A list of all observer objects.

const AttributeProvider* mAttributeProvider
private

for substituting placeholders in text

const StrokeFont* mFont
private

font used for calculating paths

QVector<Path> mPaths
private

stroke paths without transformations (mirror/rotate/translate)

QVector<Path> mPathsRotated
private

same as mPaths, but rotated by 180°


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