31 #ifndef TEMPLATEFACTORY_H
32 #define TEMPLATEFACTORY_H
37 #include <QDomDocument>
41 #define FIND_DATA_ELEMENT(target_name, source_document) \
42 QStringList way_to_data_element = QString(XML_BUNDLE_ROOT_DATA_ELEMENT).split('/'); \
43 QDomElement target_name = source_document.documentElement(); \
45 while (!way_to_data_element.isEmpty()) { \
46 QDomNode child_item = data_element.namedItem(way_to_data_element.at(0)); \
48 if (!child_item.isNull() && child_item.isElement()) { \
49 target_name = child_item.toElement(); \
50 way_to_data_element.removeFirst(); \
87 void setTempDirectory(
const QString &temp_directory);
93 void setOutputDirectory(
const QString &output_directory);
99 void setApplicationFileNamePattern(
const QString &file_name_pattern);
110 return m_activeEntryPoint;
122 const QString &author_name,
123 const QString &author_email,
124 const QString &project_title,
125 const QString &project_description,
126 const QString &template_version);
173 void clearEntryAndCore();
174 void setupTemplates();
176 QHash<QString, TemplateEntryPoint*> m_availableTemplates;
182 #endif // TEMPLATEFACTORY_H
TemplateEntryPoint * entryPointForBundle(const QString &bundle_data)
Decides which entry point raw XML bundle data belong to.
void newTemplateCoreCreated(TemplateCore *core)
Emitted if new project using some template core is started.
QString applicationFileName(const QString &project_name)
Generates file name for output APK file.
static bool entryPointIsLessThan(TemplateEntryPoint *s1, TemplateEntryPoint &s2)
Performs lexicographical comparison of two entry points.
TemplateGenerator * generator() const
Access to component which supervises generating of APK files.
bool saveCurrentProject()
Saves current project to assigned file if there is any.
QString outputDirectory() const
Access to directory used throughout APK generation process.
QDomDocument generateBundleHeader(const QString &template_type, const QString &author_name, const QString &author_email, const QString &project_title, const QString &project_description, const QString &template_version)
Generates common XML bundle.
QString applicationFileNamePattern() const
Access to pattern used for name of output APK file.
TemplateCore * activeCore() const
Access to active core.
bool startNewProject(TemplateEntryPoint *entry_point)
Starts new project core from given entry point.
bool loadProject(const QString &bundle_file_name)
Loads stored project and initializes new core according to it.
TemplateEntryPoint * activeEntryPoint() const
Access to active entry point.
The top-level manager of templates.
bool saveCurrentProjectAs(const QString &bundle_file_name)
Saves current project to given file.
QList< TemplateEntryPoint * > availableTemplates()
Access to available templates.
Generator responsible for generating APK mobile applications.
void quit()
Quits running actions of template manager.
The entry point for a template.
The core class container for single template.
QString tempDirectory() const
Access to temporary directory used throughout APK generation process.