LibrePCB Developers Documentation
Loading...
Searching...
No Matches
Symbol Class Referencefinal

The Symbol class represents the part of a component which is added to schematics. More...

#include <symbol.h>

+ Inheritance diagram for Symbol:
+ Collaboration diagram for Symbol:

Public Types

enum class  Event
 
typedef Slot< Symbol, EventOnEditedSlot
 

Public Member Functions

 Symbol ()=delete
 
 Symbol (const Symbol &other)=delete
 
 Symbol (const Uuid &uuid, const Version &version, const QString &author, const ElementName &name_en_US, const QString &description_en_US, const QString &keywords_en_US)
 
 ~Symbol () noexcept
 
SymbolPinListgetPins () noexcept
 
const SymbolPinListgetPins () const noexcept
 
PolygonListgetPolygons () noexcept
 
const PolygonListgetPolygons () const noexcept
 
CircleListgetCircles () noexcept
 
const CircleListgetCircles () const noexcept
 
TextListgetTexts () noexcept
 
const TextListgetTexts () const noexcept
 
virtual RuleCheckMessageList runChecks () const override
 
Symboloperator= (const Symbol &rhs)=delete
 
- Public Member Functions inherited from LibraryElement
 LibraryElement ()=delete
 
 LibraryElement (const LibraryElement &other)=delete
 
 LibraryElement (const QString &shortElementName, const QString &longElementName, const Uuid &uuid, const Version &version, const QString &author, const ElementName &name_en_US, const QString &description_en_US, const QString &keywords_en_US)
 
 LibraryElement (const QString &shortElementName, const QString &longElementName, bool dirnameMustBeUuid, std::unique_ptr< TransactionalDirectory > directory, const SExpression &root)
 
virtual ~LibraryElement () noexcept
 
const QString & getGeneratedBy () const noexcept
 
const QSet< Uuid > & getCategories () const noexcept
 
const ResourceListgetResources () const noexcept
 
void setGeneratedBy (const QString &gen) noexcept
 
void setCategories (const QSet< Uuid > &uuids) noexcept
 
void setResources (const ResourceList &resources) noexcept
 
LibraryElementoperator= (const LibraryElement &rhs)=delete
 
- Public Member Functions inherited from LibraryBaseElement
 LibraryBaseElement ()=delete
 
 LibraryBaseElement (const LibraryBaseElement &other)=delete
 
 LibraryBaseElement (const QString &shortElementName, const QString &longElementName, const Uuid &uuid, const Version &version, const QString &author, const ElementName &name_en_US, const QString &description_en_US, const QString &keywords_en_US)
 
 LibraryBaseElement (const QString &shortElementName, const QString &longElementName, bool dirnameMustBeUuid, std::unique_ptr< TransactionalDirectory > directory, const SExpression &root)
 
virtual ~LibraryBaseElement () noexcept
 
const TransactionalDirectorygetDirectory () const noexcept
 
TransactionalDirectorygetDirectory () noexcept
 
const UuidgetUuid () const noexcept
 
const VersiongetVersion () const noexcept
 
const QString & getAuthor () const noexcept
 
const QDateTime & getCreated () const noexcept
 
bool isDeprecated () const noexcept
 
const LocalizedNameMapgetNames () const noexcept
 
const LocalizedDescriptionMapgetDescriptions () const noexcept
 
const LocalizedKeywordsMapgetKeywords () const noexcept
 
QStringList getAllAvailableLocales () const noexcept
 
const QSet< SExpression > & getMessageApprovals () const noexcept
 
void setVersion (const Version &version) noexcept
 
void setAuthor (const QString &author) noexcept
 
void setDeprecated (bool deprecated) noexcept
 
void setNames (const LocalizedNameMap &names) noexcept
 
void setDescriptions (const LocalizedDescriptionMap &descriptions) noexcept
 
void setKeywords (const LocalizedKeywordsMap &keywords) noexcept
 
void setMessageApprovals (const QSet< SExpression > &approvals) noexcept
 
virtual void save ()
 
virtual void saveTo (TransactionalDirectory &dest)
 
virtual void moveTo (TransactionalDirectory &dest)
 
virtual void saveIntoParentDirectory (TransactionalDirectory &dest)
 
virtual void moveIntoParentDirectory (TransactionalDirectory &dest)
 
LibraryBaseElementoperator= (const LibraryBaseElement &rhs)=delete
 

Static Public Member Functions

static std::unique_ptr< Symbolopen (std::unique_ptr< TransactionalDirectory > directory, bool abortBeforeMigration=false)
 
static QString getShortElementName () noexcept
 
static QString getLongElementName () noexcept
 
- Static Public Member Functions inherited from LibraryBaseElement
template<typename ElementType >
static bool isValidElementDirectory (const FilePath &dir) noexcept
 
template<typename ElementType >
static bool isValidElementDirectory (const TransactionalDirectory &dir, const QString &path) noexcept
 

Public Attributes

Signal< Symbol, EventonEdited
 

Protected Member Functions

virtual void serialize (SExpression &root) const override
 Serialize into librepcb::SExpression node.
 
- Protected Member Functions inherited from LibraryBaseElement
void serializeMessageApprovals (SExpression &root) const
 
void removeObsoleteMessageApprovals ()
 

Private Member Functions

 Symbol (std::unique_ptr< TransactionalDirectory > directory, const SExpression &root)
 
void pinsEdited (const SymbolPinList &list, int index, const std::shared_ptr< const SymbolPin > &pin, SymbolPinList::Event event) noexcept
 
void polygonsEdited (const PolygonList &list, int index, const std::shared_ptr< const Polygon > &polygon, PolygonList::Event event) noexcept
 
void circlesEdited (const CircleList &list, int index, const std::shared_ptr< const Circle > &circle, CircleList::Event event) noexcept
 
void textsEdited (const TextList &list, int index, const std::shared_ptr< const Text > &text, TextList::Event event) noexcept
 

Private Attributes

SymbolPinList mPins
 
PolygonList mPolygons
 
CircleList mCircles
 
TextList mTexts
 
SymbolPinList::OnEditedSlot mPinsEditedSlot
 
PolygonList::OnEditedSlot mPolygonsEditedSlot
 
CircleList::OnEditedSlot mCirclesEditedSlot
 
TextList::OnEditedSlot mTextsEditedSlot
 

Additional Inherited Members

- Static Protected Member Functions inherited from LibraryBaseElement
static Version readFileFormat (const TransactionalDirectory &directory, const QString &fileName)
 
- Protected Attributes inherited from LibraryElement
QString mGeneratedBy
 If not empty, the element is generated.
 
QSet< UuidmCategories
 
ResourceList mResources
 
- Protected Attributes inherited from LibraryBaseElement
const QString mShortElementName
 e.g. "lib", "cmpcat"
 
const QString mLongElementName
 e.g. "library", "component_category"
 
std::unique_ptr< TransactionalDirectorymDirectory
 
Uuid mUuid
 
Version mVersion
 
QString mAuthor
 
QDateTime mCreated
 
bool mIsDeprecated
 
LocalizedNameMap mNames
 
LocalizedDescriptionMap mDescriptions
 
LocalizedKeywordsMap mKeywords
 
QSet< SExpressionmMessageApprovals
 

Detailed Description

The Symbol class represents the part of a component which is added to schematics.

Following information is considered as the "interface" of a symbol and must therefore never be changed:

  • UUID
  • Pins (neither adding nor removing pins is allowed)
    • UUID

Member Typedef Documentation

◆ OnEditedSlot

Member Enumeration Documentation

◆ Event

enum class Event
strong
Enumerator
PinsEdited 
PolygonsEdited 
CirclesEdited 
TextsEdited 

Constructor & Destructor Documentation

◆ Symbol() [1/4]

Symbol ( )
delete
+ Here is the caller graph for this function:

◆ Symbol() [2/4]

Symbol ( const Symbol other)
delete

◆ Symbol() [3/4]

Symbol ( const Uuid uuid,
const Version version,
const QString &  author,
const ElementName name_en_US,
const QString &  description_en_US,
const QString &  keywords_en_US 
)

◆ ~Symbol()

~Symbol ( )
noexcept

◆ Symbol() [4/4]

Symbol ( std::unique_ptr< TransactionalDirectory directory,
const SExpression root 
)
private

Member Function Documentation

◆ getPins() [1/2]

SymbolPinList & getPins ( )
inlinenoexcept
+ Here is the caller graph for this function:

◆ getPins() [2/2]

const SymbolPinList & getPins ( ) const
inlinenoexcept

◆ getPolygons() [1/2]

PolygonList & getPolygons ( )
inlinenoexcept
+ Here is the caller graph for this function:

◆ getPolygons() [2/2]

const PolygonList & getPolygons ( ) const
inlinenoexcept

◆ getCircles() [1/2]

CircleList & getCircles ( )
inlinenoexcept
+ Here is the caller graph for this function:

◆ getCircles() [2/2]

const CircleList & getCircles ( ) const
inlinenoexcept

◆ getTexts() [1/2]

TextList & getTexts ( )
inlinenoexcept
+ Here is the caller graph for this function:

◆ getTexts() [2/2]

const TextList & getTexts ( ) const
inlinenoexcept

◆ runChecks()

RuleCheckMessageList runChecks ( ) const
overridevirtual

Reimplemented from LibraryElement.

+ Here is the call graph for this function:

◆ operator=()

Symbol & operator= ( const Symbol rhs)
delete

◆ open()

std::unique_ptr< Symbol > open ( std::unique_ptr< TransactionalDirectory directory,
bool  abortBeforeMigration = false 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getShortElementName()

static QString getShortElementName ( )
inlinestaticnoexcept
+ Here is the caller graph for this function:

◆ getLongElementName()

static QString getLongElementName ( )
inlinestaticnoexcept
+ Here is the caller graph for this function:

◆ serialize()

void serialize ( SExpression root) const
overrideprotectedvirtual

Serialize into librepcb::SExpression node.

Parameters
rootRoot node to serialize into.

Reimplemented from LibraryElement.

+ Here is the call graph for this function:

◆ pinsEdited()

void pinsEdited ( const SymbolPinList list,
int  index,
const std::shared_ptr< const SymbolPin > &  pin,
SymbolPinList::Event  event 
)
privatenoexcept

◆ polygonsEdited()

void polygonsEdited ( const PolygonList list,
int  index,
const std::shared_ptr< const Polygon > &  polygon,
PolygonList::Event  event 
)
privatenoexcept

◆ circlesEdited()

void circlesEdited ( const CircleList list,
int  index,
const std::shared_ptr< const Circle > &  circle,
CircleList::Event  event 
)
privatenoexcept

◆ textsEdited()

void textsEdited ( const TextList list,
int  index,
const std::shared_ptr< const Text > &  text,
TextList::Event  event 
)
privatenoexcept

Member Data Documentation

◆ onEdited

Signal<Symbol, Event> onEdited

◆ mPins

SymbolPinList mPins
private

◆ mPolygons

PolygonList mPolygons
private

◆ mCircles

CircleList mCircles
private

◆ mTexts

TextList mTexts
private

◆ mPinsEditedSlot

SymbolPinList::OnEditedSlot mPinsEditedSlot
private

◆ mPolygonsEditedSlot

PolygonList::OnEditedSlot mPolygonsEditedSlot
private

◆ mCirclesEditedSlot

CircleList::OnEditedSlot mCirclesEditedSlot
private

◆ mTextsEditedSlot

TextList::OnEditedSlot mTextsEditedSlot
private

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