File failed to load: https://isis.astrogeology.usgs.gov/6.0.0/Object/assets/jax/output/NativeMML/config.js
Isis 3 Programmer Reference
Template.h
1 #ifndef Template_H
2 #define Template_H
3 
10 /* SPDX-License-Identifier: CC0-1.0 */
11 
12  #include <QObject>
13  #include <QString>
14  #include <QXmlStreamWriter>
15 
16  #include "FileName.h"
17  #include "XmlStackedHandler.h"
18 
19  namespace Isis {
20  class FileName;
21  class Project;
22 
30  class Template : public QObject {
31  Q_OBJECT
32 
33  public:
34  explicit Template(QString fileName, QString templateType, QString importName, QObject *parent = 0);
35  Template(FileName templateFolder, XmlStackedHandlerReader *xmlReader, QObject *parent = 0);
36  ~Template();
37 
38  QString importName() const;
39  QString fileName() const;
40  QString templateType() const;
41 
42  void deleteFromDisk();
43  void save(QXmlStreamWriter &stream, const Project *project, FileName newProjectRoot) const;
44 
45  public slots:
46  void updateFileName(Project * project);
47 
48  private:
57  class XmlHandler : public XmlStackedHandler {
58  public:
59  XmlHandler(Template *currentTemplate, FileName templateFolder);
60 
61  virtual bool startElement(const QString &namespaceURI, const QString &localName,
62  const QString &qName, const QXmlAttributes &atts);
63 
64  private:
65  Q_DISABLE_COPY(XmlHandler);
66 
70  };
71 
72  private:
73  QString m_fileName; // File name of the template associated with this object
74  QString m_templateType; // Type of template (maps/registrations)
75  QString m_importName; // Name of TemplateList this was imported in
76 
77  };
78  }
79 
81 
82  #endif
Isis::Template::XmlHandler::m_xmlHandlerTemplateFolderName
FileName m_xmlHandlerTemplateFolderName
The name of the folder for the template xml.
Definition: Template.h:69
Isis::FileName
File name manipulation and expansion.
Definition: FileName.h:100
Isis::Template::importName
QString importName() const
Get the name of the TemplateList this file was imported under.
Definition: Template.cpp:68
Isis::Template::deleteFromDisk
void deleteFromDisk()
Delete the template from disk.
Definition: Template.cpp:88
Isis::XmlStackedHandlerReader
Manage a stack of content handlers for reading XML files.
Definition: XmlStackedHandlerReader.h:30
Isis::Template::updateFileName
void updateFileName(Project *project)
Change the file name for this template to be where it now is with the given project.
Definition: Template.cpp:78
Isis::Template::XmlHandler::m_xmlHandlerTemplate
Template * m_xmlHandlerTemplate
A pointer to the Template object to be read or written.
Definition: Template.h:67
Isis::Project
The main project for ipce.
Definition: Project.h:289
Isis::Template::Template
Template(QString fileName, QString templateType, QString importName, QObject *parent=0)
Create a Template from template file's name.
Definition: Template.cpp:19
Isis::Template::save
void save(QXmlStreamWriter &stream, const Project *project, FileName newProjectRoot) const
Method to write this Template object's member data to an XML stream.
Definition: Template.cpp:105
Isis::Template::fileName
QString fileName() const
Get the file name that this Template represents.
Definition: Template.cpp:50
Isis::Template
Definition: Template.h:30
Isis::Template::XmlHandler::startElement
virtual bool startElement(const QString &namespaceURI, const QString &localName, const QString &qName, const QXmlAttributes &atts)
Method to read the given XML formatted attribute for a Template object into the XmlHandler.
Definition: Template.cpp:141
Isis::Template::~Template
~Template()
Destroys Template object.
Definition: Template.cpp:42
Isis::Template::templateType
QString templateType() const
Get the type of template.
Definition: Template.cpp:59
Isis::Template::XmlHandler
Definition: Template.h:57
Isis::XmlStackedHandler
XML Handler that parses XMLs in a stack-oriented way.
Definition: XmlStackedHandler.h:118
Isis::Template::XmlHandler::XmlHandler
XmlHandler(Template *currentTemplate, FileName templateFolder)
Constructor for the Template object's XmlHandler.
Definition: Template.cpp:123
QObject
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
Q_DECLARE_METATYPE
Q_DECLARE_METATYPE(Isis::PlotWindow *)
We have plot windows as QVariant data types, so here it's enabled.

U.S. Department of the Interior | U.S. Geological Survey
ISIS | Privacy & Disclaimers | Astrogeology Research Program
To contact us, please post comments and questions on the USGS Astrogeology Discussion Board
To report a bug, or suggest a feature go to: ISIS Github
File Modified: 07/13/2023 15:17:23