QElectroTech 0.200.1-dev
Loading...
Searching...
No Matches
TitleBlockTemplatesFilesCollection Class Reference

#include <templatescollection.h>

Inheritance diagram for TitleBlockTemplatesFilesCollection:
Inheritance graph
Collaboration diagram for TitleBlockTemplatesFilesCollection:
Collaboration graph

Public Member Functions

 TitleBlockTemplatesFilesCollection (const QString &, QObject *=nullptr)
 ~TitleBlockTemplatesFilesCollection () override
QString path (const QString &=QString()) const
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
Public Member Functions inherited from TitleBlockTemplatesCollection
 TitleBlockTemplatesCollection (QObject *parent)
 ~TitleBlockTemplatesCollection () override
virtual QString title () const
virtual void setTitle (const QString &)
 TitleBlockTemplatesCollection::setTitle.
virtual QString protocol () const
virtual void setProtocol (const QString &)
virtual QET::QetCollection collection () const
 TitleBlockTemplatesCollection::collection.
virtual void setCollection (QET::QetCollection)
 TitleBlockTemplatesCollection::setCollection Set the storage of this collection.
virtual QETProjectparentProject ()
virtual QList< TitleBlockTemplateLocationtemplatesLocations ()

Static Public Member Functions

static QString toTemplateName (const QString &)
static QString toFileName (const QString &)

Private Slots

void fileSystemChanged (const QString &str)

Private Member Functions

 TitleBlockTemplatesFilesCollection (const TitleBlockTemplatesFilesCollection &)

Private Attributes

QFileSystemWatcher watcher_
 File System Watcher object to track the files changes made outside the application.
QDir dir_
 Collection real directory.

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.
QString protocol_
 Protocol used to designate this collection.
QET::QetCollection m_collection
QHash< QString, TitleBlockTemplate * > titleblock_templates_
 Already parsed embedded titleblock templates.

Detailed Description

This classe represents a simple abastraction layer for a file-based title block templates directory.

Constructor & Destructor Documentation

◆ TitleBlockTemplatesFilesCollection() [1/2]

TitleBlockTemplatesFilesCollection::TitleBlockTemplatesFilesCollection ( const QString & path,
QObject * parent = nullptr )

Constructor

Parameters
pathPath of the directory containing the collection
parentParent QObject
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ~TitleBlockTemplatesFilesCollection()

TitleBlockTemplatesFilesCollection::~TitleBlockTemplatesFilesCollection ( )
override

Destructor

◆ TitleBlockTemplatesFilesCollection() [2/2]

TitleBlockTemplatesFilesCollection::TitleBlockTemplatesFilesCollection ( const TitleBlockTemplatesFilesCollection & )
private
Here is the call graph for this function:

Member Function Documentation

◆ filePath()

QString TitleBlockTemplatesFilesCollection::filePath ( )
overridevirtual
Returns
The filesystem path where this files collection is actually stored.

Implements TitleBlockTemplatesCollection.

◆ fileSystemChanged

void TitleBlockTemplatesFilesCollection::fileSystemChanged ( const QString & str)
privateslot

Handle the changes occurring on the file system.

Parameters
strPath of the directory that changed.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getTemplate()

TitleBlockTemplate * TitleBlockTemplatesFilesCollection::getTemplate ( const QString & template_name)
overridevirtual
Returns
the template which name is template_name, or 0 if the template could not be loaded.

Implements TitleBlockTemplatesCollection.

Here is the call graph for this function:

◆ getTemplateXmlDescription()

QDomElement TitleBlockTemplatesFilesCollection::getTemplateXmlDescription ( const QString & template_name)
overridevirtual
Parameters
template_nameName of a template (which has to already exist)
Returns
the XML description for the template_name template, or a null QDomElement if no such template exists.

Implements TitleBlockTemplatesCollection.

Here is the call graph for this function:

◆ hasFilePath()

bool TitleBlockTemplatesFilesCollection::hasFilePath ( )
overridevirtual
Returns
always true since a files collection is always stored on a filesystem.

Implements TitleBlockTemplatesCollection.

◆ isReadOnly()

bool TitleBlockTemplatesFilesCollection::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.

Here is the call graph for this function:

◆ location()

TitleBlockTemplateLocation TitleBlockTemplatesFilesCollection::location ( const QString & template_name = QString())
overridevirtual
Parameters
template_nameName of a template supposed to be contained within this collection.
Returns

Implements TitleBlockTemplatesCollection.

◆ path()

QString TitleBlockTemplatesFilesCollection::path ( const QString & template_name = QString()) const
Returns
the canonical path of the directory hosting this collection.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ removeTemplate()

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

Remove the template_name template.

Implements TitleBlockTemplatesCollection.

Here is the call graph for this function:

◆ setTemplateXmlDescription()

bool TitleBlockTemplatesFilesCollection::setTemplateXmlDescription ( const QString & template_name,
const QDomElement & xml_element )
overridevirtual

Set the XML description of the template_name template to xml_element.

Parameters
template_nameName of a template (which does not have to already exist)
xml_elementXML element describing the template

Implements TitleBlockTemplatesCollection.

Here is the call graph for this function:

◆ templates()

QStringList TitleBlockTemplatesFilesCollection::templates ( )
overridevirtual
Returns
the list of templates contained in this collection

Implements TitleBlockTemplatesCollection.

Here is the caller graph for this function:

◆ toFileName()

QString TitleBlockTemplatesFilesCollection::toFileName ( const QString & template_name)
static
Parameters
template_nameA template name
Returns
the file name for template_name
Here is the caller graph for this function:

◆ toTemplateName()

QString TitleBlockTemplatesFilesCollection::toTemplateName ( const QString & file_name)
static
Parameters
file_nameA file name
Returns
the template name for file_name

Member Data Documentation

◆ dir_

QDir TitleBlockTemplatesFilesCollection::dir_
private

Collection real directory.

◆ watcher_

QFileSystemWatcher TitleBlockTemplatesFilesCollection::watcher_
private

File System Watcher object to track the files changes made outside the application.


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