![]() |
Isis 3 Programmer Reference
|
#include <TemplateList.h>


Classes | |
| class | XmlHandler |
Public Member Functions | |
| TemplateList (QString name, QString type, QString path, QObject *parent=NULL) | |
| Create a template from a file name, type, and path. More... | |
| TemplateList (QObject *parent=NULL) | |
| Creates a blank template list. More... | |
| TemplateList (Project *project, XmlStackedHandlerReader *xmlReader, QObject *parent=NULL) | |
| Create an TemplateList from XML. More... | |
| TemplateList (const TemplateList &) | |
| Copy constructor. More... | |
| ~TemplateList () | |
| Destructor. More... | |
| QString | name () const |
| Get the human-readable name of this TemplateList. More... | |
| QString | type () const |
| Get the type of template in this TemplateList. More... | |
| QString | path () const |
| Get the path to these Templates in the TemplateList (relative to project root). More... | |
| void | setName (QString newName) |
| Set the human-readable name of this TemplateList. More... | |
| void | setType (QString newType) |
| Set the type of template for of this TemplateList. More... | |
| void | setPath (QString newPath) |
| Set the relative path (from the project root) to this TemplateList's folder. More... | |
| void | deleteFromDisk (Project *project) |
| Delete all of the contained Templates from disk. More... | |
| void | save (QXmlStreamWriter &stream, const Project *project, FileName newProjectRoot) const |
| Convert this TemplateList into XML format for saving/restoring capabilities. More... | |
Private Attributes | |
| QString | m_path |
| QString | m_name |
| QString | m_type |
Definition at line 35 of file TemplateList.h.
| Isis::TemplateList::TemplateList | ( | QString | name, |
| QString | type, | ||
| QString | path, | ||
| QObject * | parent = NULL |
||
| ) |
Create a template from a file name, type, and path.
| name | The TemplateList's name (i.e. import1, import2, ...) |
| type | The TemplateList's folder name (i.e. maps, registrations, ...) |
| path | Path to the TemplateList's folder from the template root |
| parent | The Qt-relationship parent |
Definition at line 26 of file TemplateList.cpp.
|
explicit |
Creates a blank template list.
| parent | The Qt-relationship parent. |
Definition at line 38 of file TemplateList.cpp.
|
explicit |
Create an TemplateList from XML.
| project | The project with the TemplateList |
| xmlReader | The XML reader currently at an <templateList > tag. |
| parent | The Qt-relationship parent |
Definition at line 62 of file TemplateList.cpp.
References Isis::XmlStackedHandlerReader::pushContentHandler().
| Isis::TemplateList::TemplateList | ( | const TemplateList & | other | ) |
Copy constructor.
| other | The TemplateList to copy |
Definition at line 47 of file TemplateList.cpp.
| Isis::TemplateList::~TemplateList | ( | ) |
Destructor.
Definition at line 71 of file TemplateList.cpp.
| void Isis::TemplateList::deleteFromDisk | ( | Project * | project | ) |
Delete all of the contained Templates from disk.
| project | Project to delete templates from |
Definition at line 143 of file TemplateList.cpp.
References Isis::Template::deleteFromDisk(), and Isis::Project::templateRoot().
Referenced by Isis::ImportMapTemplateWorkOrder::undoExecution(), and Isis::ImportRegistrationTemplateWorkOrder::undoExecution().
| QString Isis::TemplateList::name | ( | ) | const |
Get the human-readable name of this TemplateList.
Definition at line 81 of file TemplateList.cpp.
Referenced by Isis::ProjectItem::setTemplateList(), Isis::TemplateList::XmlHandler::startElement(), and TemplateList().
| QString Isis::TemplateList::path | ( | ) | const |
Get the path to these Templates in the TemplateList (relative to project root).
Definition at line 101 of file TemplateList.cpp.
Referenced by Isis::ProjectItem::setTemplateList(), Isis::TemplateList::XmlHandler::startElement(), and TemplateList().
| void Isis::TemplateList::save | ( | QXmlStreamWriter & | stream, |
| const Project * | project, | ||
| FileName | newProjectRoot | ||
| ) | const |
Convert this TemplateList into XML format for saving/restoring capabilities.
This writes:
<templateList name="..." type= "..." path="...">
to the given xml stream, and creates an 'templates.xml' inside the folder with the templates. Inside the templates.xml, this writes:
<templates>
...
</templates>
| stream | XML stream that contains the TemplateList data |
| project | Project to save TemplateList from |
| newProjectRoot | Filename root to save TemplateList to |
| IException::Io | "Unable Failed to create directory" |
| IException::Io | "Unable to save template information, could not be opened for writing" |
Definition at line 180 of file TemplateList.cpp.
References Isis::FileName::dir(), Isis::Template::fileName(), Isis::IException::Io, Isis::FileName::name(), Isis::FileName::original(), Isis::FileName::path(), Isis::Template::save(), Isis::Project::templateRoot(), and Isis::FileName::toString().
| void Isis::TemplateList::setName | ( | QString | newName | ) |
Set the human-readable name of this TemplateList.
| newName | The name to give this TemplateList |
Definition at line 111 of file TemplateList.cpp.
| void Isis::TemplateList::setPath | ( | QString | newPath | ) |
Set the relative path (from the project root) to this TemplateList's folder.
| newPath | The path to the templates in this TemplateList |
Definition at line 131 of file TemplateList.cpp.
| void Isis::TemplateList::setType | ( | QString | newType | ) |
Set the type of template for of this TemplateList.
| newType | The type to give this TemplateList |
Definition at line 121 of file TemplateList.cpp.
| QString Isis::TemplateList::type | ( | ) | const |
Get the type of template in this TemplateList.
Definition at line 91 of file TemplateList.cpp.
Referenced by Isis::Project::addTemplates(), Isis::ControlPointEditWidget::addTemplates(), Isis::ProjectItemModel::onTemplatesAdded(), Isis::TemplateList::XmlHandler::startElement(), and TemplateList().