QElectroTech  0.8-dev
Public Member Functions | Private Member Functions | Private Attributes | List of all members
TitleBlockTemplatesProjectCollection Class Reference

#include <templatescollection.h>

Inheritance diagram for TitleBlockTemplatesProjectCollection:
Inheritance graph
Collaboration diagram for TitleBlockTemplatesProjectCollection:
Collaboration graph

Public Member Functions

 TitleBlockTemplatesProjectCollection (QETProject *, QObject *parent=nullptr)
 
 ~TitleBlockTemplatesProjectCollection () override
 
QString title () const override
 
QString protocol () const override
 
QETProjectparentProject () override
 
QStringList templates () override
 
TitleBlockTemplategetTemplate (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 &)
 TitleBlockTemplatesCollection::setTitle. More...
 
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< TitleBlockTemplateLocationtemplatesLocations ()
 

Private Member Functions

 TitleBlockTemplatesProjectCollection (const TitleBlockTemplatesProjectCollection &)
 

Private Attributes

QETProjectproject_
 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...
 

Detailed Description

This class represents a simple abastraction layer for a collection of title block templates embedded within a project.

Constructor & Destructor Documentation

◆ TitleBlockTemplatesProjectCollection() [1/2]

TitleBlockTemplatesProjectCollection::TitleBlockTemplatesProjectCollection ( QETProject project,
QObject *  parent = nullptr 
)

Constructor

Parameters
projectParent project
parentParent QObject

◆ ~TitleBlockTemplatesProjectCollection()

TitleBlockTemplatesProjectCollection::~TitleBlockTemplatesProjectCollection ( )
override

Destructor

◆ TitleBlockTemplatesProjectCollection() [2/2]

TitleBlockTemplatesProjectCollection::TitleBlockTemplatesProjectCollection ( const TitleBlockTemplatesProjectCollection )
private

Member Function Documentation

◆ deleteUnusedTitleBlocKTemplates()

void TitleBlockTemplatesProjectCollection::deleteUnusedTitleBlocKTemplates ( )
virtual

Delete all title block templates not used within the parent project

Here is the call graph for this function:
Here is the caller graph for this function:

◆ filePath()

QString TitleBlockTemplatesProjectCollection::filePath ( )
overridevirtual
Returns
always an empty string since a project collection is not stored on any filesystem.

Implements TitleBlockTemplatesCollection.

◆ fromXml()

void TitleBlockTemplatesProjectCollection::fromXml ( const QDomElement &  xml_element)
virtual
Parameters
xml_elementXML element to be parsed to load title block templates
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getTemplate()

TitleBlockTemplate * TitleBlockTemplatesProjectCollection::getTemplate ( const QString &  template_name)
overridevirtual
Parameters
template_nameName of the requested template
Returns
the requested template, or 0 if there is no valid template of this name within the project

Implements TitleBlockTemplatesCollection.

Here is the caller graph for this function:

◆ getTemplateXmlDescription()

QDomElement TitleBlockTemplatesProjectCollection::getTemplateXmlDescription ( const QString &  template_name)
overridevirtual
Parameters
template_nameName of the requested template
Returns
the XML description of the requested template, or a null QDomElement if the project does not have such an titleblock template

Implements TitleBlockTemplatesCollection.

Here is the caller graph for this function:

◆ hasFilePath()

bool TitleBlockTemplatesProjectCollection::hasFilePath ( )
overridevirtual
Returns
always false since a project collection is not stored on any filesystem.

Implements TitleBlockTemplatesCollection.

◆ isReadOnly()

bool TitleBlockTemplatesProjectCollection::isReadOnly ( const QString &  template_name = QString()) const
overridevirtual
Parameters
template_nameEither an empty QString to know whether the collection itself is read only, or a specific template name.
Returns
true if the specified template is read only, false otherwise

Implements TitleBlockTemplatesCollection.

◆ location()

TitleBlockTemplateLocation TitleBlockTemplatesProjectCollection::location ( const QString &  template_name = QString())
overridevirtual
Parameters
template_nameName of the requested template
Returns
the location object for the requested template

Implements TitleBlockTemplatesCollection.

Here is the caller graph for this function:

◆ parentProject()

QETProject * TitleBlockTemplatesProjectCollection::parentProject ( )
overridevirtual
Returns
the parent project of this project collection

Reimplemented from TitleBlockTemplatesCollection.

◆ protocol()

QString TitleBlockTemplatesProjectCollection::protocol ( ) const
overridevirtual
Returns
the protocol used to mention this collection

Reimplemented from TitleBlockTemplatesCollection.

Here is the call graph for this function:

◆ removeTemplate()

void TitleBlockTemplatesProjectCollection::removeTemplate ( const QString &  template_name)
overridevirtual

This methods allows removing a template embedded within the project. This method emits the signal changed() if necessary.

Parameters
template_nameName of the template to be removed

Implements TitleBlockTemplatesCollection.

Here is the caller graph for this function:

◆ setTemplateXmlDescription()

bool TitleBlockTemplatesProjectCollection::setTemplateXmlDescription ( const QString &  template_name,
const QDomElement &  xml_elmt 
)
overridevirtual

This methods allows adding or modifying a template embedded within the project. This method emits the signal changed() if necessary.

Parameters
template_nameName / Identifier of the template - will be used to determine whether the given description will be added or will replace an existing one.
xml_elmtAn <titleblocktemplate> XML element describing the template. Its "name" attribute must equal to template_name.
Returns
false if a problem occurred, true otherwise

Implements TitleBlockTemplatesCollection.

Here is the caller graph for this function:

◆ templates()

QStringList TitleBlockTemplatesProjectCollection::templates ( )
overridevirtual
Returns
the list of title block templates embedded within the project.

Implements TitleBlockTemplatesCollection.

Here is the caller graph for this function:

◆ title()

QString TitleBlockTemplatesProjectCollection::title ( ) const
overridevirtual
Returns
a human readable title for this collection

Reimplemented from TitleBlockTemplatesCollection.

Here is the call graph for this function:

Member Data Documentation

◆ project_

QETProject* TitleBlockTemplatesProjectCollection::project_
private

Parent project.

◆ titleblock_templates_xml_

QHash<QString, QDomElement> TitleBlockTemplatesProjectCollection::titleblock_templates_xml_
private

XML descriptions of embedded titleblock templates.

◆ xml_document_

QDomDocument TitleBlockTemplatesProjectCollection::xml_document_
private

Parent QDomDocument for stored QDomElements.


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