QElectroTech
0.70
|
#include <templatescollection.h>
Public Member Functions | |
TitleBlockTemplatesProjectCollection (QETProject *, QObject *parent=nullptr) | |
~TitleBlockTemplatesProjectCollection () override | |
QString | title () const override |
QString | protocol () const override |
QETProject * | parentProject () override |
QStringList | templates () override |
TitleBlockTemplate * | getTemplate (const QString &) override |
QDomElement | getTemplateXmlDescription (const QString &) override |
bool | setTemplateXmlDescription (const QString &, const QDomElement &) override |
void | removeTemplate (const QString &) override |
TitleBlockTemplateLocation | location (const QString &=QString()) override |
bool | hasFilePath () override |
QString | filePath () override |
bool | isReadOnly (const QString &=QString()) const override |
virtual void | fromXml (const QDomElement &) |
virtual void | deleteUnusedTitleBlocKTemplates () |
Public Member Functions inherited from TitleBlockTemplatesCollection | |
TitleBlockTemplatesCollection (QObject *parent) | |
~TitleBlockTemplatesCollection () override | |
virtual void | setTitle (const QString &) |
virtual void | setProtocol (const QString &) |
virtual QET::QetCollection | collection () const |
TitleBlockTemplatesCollection::collection. More... | |
virtual void | setCollection (QET::QetCollection) |
TitleBlockTemplatesCollection::setCollection Set the storage of this collection. More... | |
virtual QList< TitleBlockTemplateLocation > | templatesLocations () |
Private Member Functions | |
TitleBlockTemplatesProjectCollection (const TitleBlockTemplatesProjectCollection &) | |
Private Attributes | |
QETProject * | project_ |
Parent project. More... | |
QDomDocument | xml_document_ |
Parent QDomDocument for stored QDomElements. More... | |
QHash< QString, QDomElement > | titleblock_templates_xml_ |
XML descriptions of embedded titleblock templates. More... | |
Additional Inherited Members | |
Signals inherited from TitleBlockTemplatesCollection | |
void | changed (TitleBlockTemplatesCollection *, const QString &=QString()) |
void | aboutToRemove (TitleBlockTemplatesCollection *, const QString &) |
Protected Attributes inherited from TitleBlockTemplatesCollection | |
QString | title_ |
Human-readable title for this collection. More... | |
QString | protocol_ |
Protocol used to designate this collection. More... | |
QET::QetCollection | m_collection |
QHash< QString, TitleBlockTemplate * > | titleblock_templates_ |
Already parsed embedded titleblock templates. More... | |
This class represents a simple abastraction layer for a collection of title block templates embedded within a project.
Definition at line 83 of file templatescollection.h.
TitleBlockTemplatesProjectCollection::TitleBlockTemplatesProjectCollection | ( | QETProject * | project, |
QObject * | parent = nullptr |
||
) |
Constructor
project | Parent project |
parent | Parent QObject |
Definition at line 112 of file templatescollection.cpp.
References QET::Embedded, and TitleBlockTemplatesCollection::m_collection.
|
override |
Destructor
Definition at line 122 of file templatescollection.cpp.
|
private |
|
virtual |
Delete all title block templates not used within the parent project
Definition at line 340 of file templatescollection.cpp.
References location(), project_, removeTemplate(), and templates().
Referenced by ProjectView::cleanProject().
|
overridevirtual |
Implements TitleBlockTemplatesCollection.
Definition at line 302 of file templatescollection.cpp.
|
virtual |
xml_element | XML element to be parsed to load title block templates |
Definition at line 322 of file templatescollection.cpp.
References QET::findInDomElement(), and titleblock_templates_xml_.
Referenced by QETProject::readProjectXml().
|
overridevirtual |
template_name | Name of the requested template |
Implements TitleBlockTemplatesCollection.
Definition at line 190 of file templatescollection.cpp.
References TitleBlockTemplatesCollection::titleblock_templates_, titleblock_templates_xml_, and QET::TitleBlockTemplate.
Referenced by QETTitleBlockTemplateEditor::edit(), Diagram::setTitleBlockTemplate(), and Diagram::titleBlockTemplateRemoved().
|
overridevirtual |
template_name | Name of the requested template |
Implements TitleBlockTemplatesCollection.
Definition at line 216 of file templatescollection.cpp.
References titleblock_templates_xml_.
Referenced by QETProject::toXml().
|
overridevirtual |
Implements TitleBlockTemplatesCollection.
Definition at line 294 of file templatescollection.cpp.
|
overridevirtual |
template_name | Either an empty QString to know whether the collection itself is read only, or a specific template name. |
Implements TitleBlockTemplatesCollection.
Definition at line 311 of file templatescollection.cpp.
References project_.
|
overridevirtual |
template_name | Name of the requested template |
Implements TitleBlockTemplatesCollection.
Definition at line 286 of file templatescollection.cpp.
Referenced by deleteUnusedTitleBlocKTemplates().
|
overridevirtual |
Reimplemented from TitleBlockTemplatesCollection.
Definition at line 174 of file templatescollection.cpp.
References project_.
|
overridevirtual |
Reimplemented from TitleBlockTemplatesCollection.
Definition at line 160 of file templatescollection.cpp.
References project_, QETApp::projectId(), and TitleBlockTemplatesCollection::protocol().
|
overridevirtual |
This methods allows removing a template embedded within the project. This method emits the signal changed() if necessary.
template_name | Name of the template to be removed |
Implements TitleBlockTemplatesCollection.
Definition at line 271 of file templatescollection.cpp.
References TitleBlockTemplatesCollection::aboutToRemove(), TitleBlockTemplatesCollection::changed(), TitleBlockTemplatesCollection::titleblock_templates_, and titleblock_templates_xml_.
Referenced by deleteUnusedTitleBlocKTemplates().
|
overridevirtual |
This methods allows adding or modifying a template embedded within the project. This method emits the signal changed() if necessary.
template_name | Name / Identifier of the template - will be used to determine whether the given description will be added or will replace an existing one. |
xml_elmt | An <titleblocktemplate> XML element describing the template. Its "name" attribute must equal to template_name. |
Implements TitleBlockTemplatesCollection.
Definition at line 234 of file templatescollection.cpp.
References TitleBlockTemplatesCollection::changed(), project_, TitleBlockTemplatesCollection::titleblock_templates_, titleblock_templates_xml_, and xml_document_.
Referenced by QETProject::integrateTitleBlockTemplate().
|
overridevirtual |
Implements TitleBlockTemplatesCollection.
Definition at line 181 of file templatescollection.cpp.
References titleblock_templates_xml_.
Referenced by deleteUnusedTitleBlocKTemplates(), QETProject::integrateTitleBlockTemplate(), QETProject::projectWasModified(), and QETProject::toXml().
|
overridevirtual |
Reimplemented from TitleBlockTemplatesCollection.
Definition at line 128 of file templatescollection.cpp.
References project_, QETApp::projectId(), TitleBlockTemplatesCollection::title_, and QET::Icons::tr.
|
private |
Parent project.
Definition at line 113 of file templatescollection.h.
Referenced by deleteUnusedTitleBlocKTemplates(), isReadOnly(), parentProject(), protocol(), setTemplateXmlDescription(), and title().
|
private |
XML descriptions of embedded titleblock templates.
Definition at line 117 of file templatescollection.h.
Referenced by fromXml(), getTemplate(), getTemplateXmlDescription(), removeTemplate(), setTemplateXmlDescription(), and templates().
|
private |
Parent QDomDocument for stored QDomElements.
Definition at line 115 of file templatescollection.h.
Referenced by setTemplateXmlDescription().