QElectroTech
0.70
|
#include <templatescollection.h>
Public Member Functions | |
TitleBlockTemplatesFilesCollection (const QString &, QObject *=nullptr) | |
~TitleBlockTemplatesFilesCollection () override | |
QString | path (const QString &=QString()) const |
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 |
Public Member Functions inherited from TitleBlockTemplatesCollection | |
TitleBlockTemplatesCollection (QObject *parent) | |
~TitleBlockTemplatesCollection () override | |
virtual QString | title () const |
virtual void | setTitle (const QString &) |
virtual QString | protocol () const |
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 QETProject * | parentProject () |
virtual QList< TitleBlockTemplateLocation > | templatesLocations () |
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. More... | |
QDir | dir_ |
Collection real directory. 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 classe represents a simple abastraction layer for a file-based title block templates directory.
Definition at line 124 of file templatescollection.h.
TitleBlockTemplatesFilesCollection::TitleBlockTemplatesFilesCollection | ( | const QString & | path, |
QObject * | parent = nullptr |
||
) |
Constructor
path | Path of the directory containing the collection |
parent | Parent QObject |
Definition at line 355 of file templatescollection.cpp.
References dir_, fileSystemChanged(), and watcher_.
|
override |
Destructor
Definition at line 373 of file templatescollection.cpp.
|
private |
|
overridevirtual |
Implements TitleBlockTemplatesCollection.
Definition at line 501 of file templatescollection.cpp.
References dir_.
|
privateslot |
Handle the changes occuring on the file system.
str | Path of the directory that changed. |
Definition at line 542 of file templatescollection.cpp.
References TitleBlockTemplatesCollection::changed(), and dir_.
Referenced by TitleBlockTemplatesFilesCollection().
|
overridevirtual |
Implements TitleBlockTemplatesCollection.
Definition at line 403 of file templatescollection.cpp.
References path(), templates(), and QET::TitleBlockTemplate.
|
overridevirtual |
template_name | Name of a template (which has to already exist) |
Implements TitleBlockTemplatesCollection.
Definition at line 421 of file templatescollection.cpp.
References path().
|
overridevirtual |
Implements TitleBlockTemplatesCollection.
Definition at line 494 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 510 of file templatescollection.cpp.
References dir_, and toFileName().
|
overridevirtual |
template_name | Name of a template supposed to be contained within this collection. |
Implements TitleBlockTemplatesCollection.
Definition at line 486 of file templatescollection.cpp.
QString TitleBlockTemplatesFilesCollection::path | ( | const QString & | template_name = QString() | ) | const |
Definition at line 379 of file templatescollection.cpp.
References dir_, and toFileName().
Referenced by getTemplate(), getTemplateXmlDescription(), and setTemplateXmlDescription().
|
overridevirtual |
Remove the template_name template.
Implements TitleBlockTemplatesCollection.
Definition at line 469 of file templatescollection.cpp.
References TitleBlockTemplatesCollection::aboutToRemove(), TitleBlockTemplatesCollection::changed(), dir_, and toFileName().
|
overridevirtual |
Set the XML description of the template_name template to xml_element.
template_name | Name of a template (which does not have to already exist) |
xml_element | XML element describing the template |
Implements TitleBlockTemplatesCollection.
Definition at line 448 of file templatescollection.cpp.
References TitleBlockTemplatesCollection::changed(), path(), and QET::writeXmlFile().
|
overridevirtual |
Implements TitleBlockTemplatesCollection.
Definition at line 390 of file templatescollection.cpp.
References dir_, and TITLEBLOCKS_FILE_EXTENSION.
Referenced by getTemplate().
|
static |
template_name | A template name |
Definition at line 534 of file templatescollection.cpp.
References TITLEBLOCKS_FILE_EXTENSION.
Referenced by isReadOnly(), path(), and removeTemplate().
|
static |
file_name | A file name |
Definition at line 524 of file templatescollection.cpp.
References TITLEBLOCKS_FILE_EXTENSION.
|
private |
Collection real directory.
Definition at line 158 of file templatescollection.h.
Referenced by filePath(), fileSystemChanged(), isReadOnly(), path(), removeTemplate(), templates(), and TitleBlockTemplatesFilesCollection().
|
private |
File System Watcher object to track the files changes made outside the application.
Definition at line 156 of file templatescollection.h.
Referenced by TitleBlockTemplatesFilesCollection().