LibrePCB Developers Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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  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 (std::unique_ptr< TransactionalDirectory > directory)
 
 ~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
LibraryElementCheckMessageList 
runChecks () const override
 
void registerGraphicsItem (SymbolGraphicsItem &item) noexcept
 
void unregisterGraphicsItem (SymbolGraphicsItem &item) noexcept
 
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 (std::unique_ptr< TransactionalDirectory > directory, const QString &shortElementName, const QString &longElementName)
 
virtual ~LibraryElement () noexcept
 
const QSet< Uuid > & getCategories () const noexcept
 
void setCategories (const QSet< Uuid > &uuids) noexcept
 
LibraryElementoperator= (const LibraryElement &rhs)=delete
 
- Public Member Functions inherited from LibraryBaseElement
 LibraryBaseElement ()=delete
 
 LibraryBaseElement (const LibraryBaseElement &other)=delete
 
 LibraryBaseElement (bool dirnameMustBeUuid, 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 (std::unique_ptr< TransactionalDirectory > directory, bool dirnameMustBeUuid, const QString &shortElementName, const QString &longElementName)
 
virtual ~LibraryBaseElement () noexcept
 
const TransactionalDirectorygetDirectory () const noexcept
 
TransactionalDirectorygetDirectory () noexcept
 
const QString & getShortElementName () const noexcept
 
const QString & getLongElementName () const 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
 
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
 
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
 
- 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...
 

Static Public Member Functions

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
 
- 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)
 

Public Attributes

Signal< Symbol, EventonEdited
 

Private Member Functions

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
 
void serialize (SExpression &root) const override
 Serialize the object into an existing S-Expression node. More...
 

Private Attributes

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

Additional Inherited Members

- Protected Member Functions inherited from LibraryBaseElement
virtual void cleanupAfterLoadingElementFromFile () noexcept
 
- Protected Attributes inherited from LibraryElement
QSet< UuidmCategories
 
- Protected Attributes inherited from LibraryBaseElement
std::unique_ptr
< TransactionalDirectory
mDirectory
 
bool mDirectoryNameMustBeUuid
 
QString mShortElementName
 e.g. "lib", "cmpcat", "sym" More...
 
QString mLongElementName
 e.g. "library", "component_category", "symbol" More...
 
SExpression mLoadingFileDocument
 
Uuid mUuid
 
Version mVersion
 
QString mAuthor
 
QDateTime mCreated
 
bool mIsDeprecated
 
LocalizedNameMap mNames
 
LocalizedDescriptionMap mDescriptions
 
LocalizedKeywordsMap mKeywords
 

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

Member Enumeration Documentation

enum Event
strong
Enumerator
PinsEdited 
PolygonsEdited 
CirclesEdited 
TextsEdited 

Constructor & Destructor Documentation

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 ( std::unique_ptr< TransactionalDirectory directory)
explicit

+ Here is the call graph for this function:

~Symbol ( )
noexcept

Member Function Documentation

SymbolPinList& getPins ( )
inlinenoexcept

+ Here is the caller graph for this function:

const SymbolPinList& getPins ( ) const
inlinenoexcept
PolygonList& getPolygons ( )
inlinenoexcept

+ Here is the caller graph for this function:

const PolygonList& getPolygons ( ) const
inlinenoexcept
CircleList& getCircles ( )
inlinenoexcept

+ Here is the caller graph for this function:

const CircleList& getCircles ( ) const
inlinenoexcept
TextList& getTexts ( )
inlinenoexcept

+ Here is the caller graph for this function:

const TextList& getTexts ( ) const
inlinenoexcept
LibraryElementCheckMessageList runChecks ( ) const
overridevirtual

Reimplemented from LibraryElement.

+ Here is the call graph for this function:

void registerGraphicsItem ( SymbolGraphicsItem item)
noexcept
void unregisterGraphicsItem ( SymbolGraphicsItem item)
noexcept

+ Here is the caller graph for this function:

Symbol& operator= ( const Symbol rhs)
delete
static QString getShortElementName ( )
inlinestaticnoexcept
static QString getLongElementName ( )
inlinestaticnoexcept
void pinsEdited ( const SymbolPinList list,
int  index,
const std::shared_ptr< const SymbolPin > &  pin,
SymbolPinList::Event  event 
)
privatenoexcept
void polygonsEdited ( const PolygonList list,
int  index,
const std::shared_ptr< const Polygon > &  polygon,
PolygonList::Event  event 
)
privatenoexcept
void circlesEdited ( const CircleList list,
int  index,
const std::shared_ptr< const Circle > &  circle,
CircleList::Event  event 
)
privatenoexcept
void textsEdited ( const TextList list,
int  index,
const std::shared_ptr< const Text > &  text,
TextList::Event  event 
)
privatenoexcept
void serialize ( SExpression root) const
overrideprivatevirtual

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.

Reimplemented from LibraryElement.

+ Here is the call graph for this function:

Member Data Documentation

Signal<Symbol, Event> onEdited
SymbolPinList mPins
private
PolygonList mPolygons
private
CircleList mCircles
private
TextList mTexts
private
SymbolGraphicsItem* mRegisteredGraphicsItem
private
SymbolPinList::OnEditedSlot mPinsEditedSlot
private
PolygonList::OnEditedSlot mPolygonsEditedSlot
private
CircleList::OnEditedSlot mCirclesEditedSlot
private
TextList::OnEditedSlot mTextsEditedSlot
private

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