1 #ifndef PROJECTCONTROLLER_H 2 #define PROJECTCONTROLLER_H 4 #include <QSharedPointer> 6 #include "../Model/recordidtype.h" 12 class FieldDefinitionSet;
14 class RecordExportTemplate;
16 class RecordSetSerializer;
17 class RecordTableImportTemplate;
145 QString
buildFullFilePath(QString filePath, QString projectPath, QString desiredExtension)
const;
153 void createProject(
const QString& projectName,
const QString& projectPath,
const Tome::RecordIdType::RecordIdType recordIdType);
317 void progressChanged(
const QString title,
const QString text,
const int currentValue,
const int maximumValue);
326 void onProgressChanged(
const QString title,
const QString text,
const int currentValue,
const int maximumValue);
329 QSharedPointer<Project> project;
334 QString readFile(
const QString& fullPath)
const;
335 void saveProject(QSharedPointer<Project> project)
const;
336 void setProject(QSharedPointer<Project> project);
340 #endif // PROJECTCONTROLLER_H Definition: commandlineoptions.h:6
void loadExportTemplate(const QString &projectPath, RecordExportTemplate &exportTemplate) const
Loads the specified export template from disk.
Definition: projectcontroller.cpp:299
const QString getProjectName() const
Gets the name of the current project.
Definition: projectcontroller.cpp:116
Named set of Tome components.
Definition: componentset.h:11
void loadCustomTypeSet(const QString &projectPath, CustomTypeSet &customTypeSet) const
Loads the specified custom type set from disk.
Definition: projectcontroller.cpp:265
bool hasFieldDefinitionSet(const QString &fieldDefinitionSetName) const
Checks whether a field definition set with the specified name has already been added to the project...
Definition: projectcontroller.cpp:181
static const QString RecordExportRecordDelimiterExtension
File extension of Tome record export record delimiter files, including the dot.
Definition: projectcontroller.h:110
static const QString RecordExportComponentDelimiterExtension
File extension of Tome record export component delimiter files, including the dot.
Definition: projectcontroller.h:45
void loadImportTemplate(const QString &projectPath, RecordTableImportTemplate &importTemplate) const
Loads the specified import template set from disk.
Definition: projectcontroller.cpp:416
static const QString RecordExportTemplateFileExtension
File extension of Tome record export template files, including the dot.
Definition: projectcontroller.h:115
Template for exporting record data.
Definition: recordexporttemplate.h:12
Named set of Tome records.
Definition: recordset.h:11
RecordIdType::RecordIdType getProjectRecordIdType() const
Gets the type of the ids of the records of the current project.
Definition: projectcontroller.cpp:126
bool hasComponentSet(const QString &componentSetName) const
Checks whether a component set with the specified name has already been added to the project...
Definition: projectcontroller.cpp:136
bool hasCustomTypeSet(const QString &customTypeSetName) const
Checks whether a custom type set with the specified name has already been added to the project...
Definition: projectcontroller.cpp:151
void projectChanged(QSharedPointer< Tome::Project > project)
Current project has changed (e.g. newly created or loaded from disk).
static const QString RecordExportRecordTemplateExtension
File extension of Tome record export record template files, including the dot.
Definition: projectcontroller.h:105
QString buildFullFilePath(QString filePath, QString projectPath, QString desiredExtension) const
Ensures the specified file path is an absolute file path with the passed extension.
Definition: projectcontroller.cpp:58
static const QString RecordExportFieldValueDelimiterExtension
File extension of Tome record export field value delimiter files, including the dot.
Definition: projectcontroller.h:60
bool isProjectLoaded() const
Checks whether any project is loaded.
Definition: projectcontroller.cpp:226
static const QString RecordExportFieldValueTemplateExtension
File extension of Tome record export field value template files, including the dot.
Definition: projectcontroller.h:55
bool getProjectIgnoreReadOnly() const
Checks whether the current project allows to modify read-only data.
Definition: projectcontroller.cpp:131
static const QString RecordImportTemplateFileExtension
File extension of Tome import template files, including the dot.
Definition: projectcontroller.h:125
static const QString RecordExportMapTemplateExtension
File extension of Tome record export map template files, including the dot.
Definition: projectcontroller.h:85
static const QString RecordExportMapItemDelimiterExtension
File extension of Tome record export map item delimiter files, including the dot. ...
Definition: projectcontroller.h:95
void openProject(const QString &projectFileName)
Opens the specified project file.
Definition: projectcontroller.cpp:482
static const QString RecordExportRecordFileTemplateExtension
File extension of Tome record export record file template files, including the dot.
Definition: projectcontroller.h:100
static const QString TypeFileExtension
File extension of Tome type files, including the dot.
Definition: projectcontroller.h:130
static const QString RecordFileExtension
File extension of Tome record files, including the dot.
Definition: projectcontroller.h:120
static const QString ProjectFileExtension
File extension of Tome project files, including the dot.
Definition: projectcontroller.h:40
static const QString RecordExportLocalizedFieldValueTemplateExtension
File extension of Tome record export localized field value template files, including the dot...
Definition: projectcontroller.h:80
void loadRecordSet(const QString &projectPath, RecordSet &recordSet) const
Loads the specified record set set from disk.
Definition: projectcontroller.cpp:450
Named set of Tome field definitions.
Definition: fielddefinitionset.h:13
void loadFieldDefinitionSet(const QString &projectPath, FieldDefinitionSet &fieldDefinitionSet) const
Loads the specified field definition set from disk.
Definition: projectcontroller.cpp:382
bool hasRecordSet(const QString &recordSetName) const
Checks whether a record set with the specified name has already been added to the project...
Definition: projectcontroller.cpp:211
const QString getFullProjectPath() const
Gets the absolute path of the current project, including project file name and extension.
Definition: projectcontroller.cpp:110
static const QString RecordExportListTemplateExtension
File extension of Tome record export list template files, including the dot.
Definition: projectcontroller.h:65
void saveProject() const
Saves the current project to disk, including all data and templates.
Definition: projectcontroller.cpp:566
static const QString FieldDefinitionFileExtension
File extension of Tome field definition files, including the dot.
Definition: projectcontroller.h:35
void loadComponentSet(const QString &projectPath, ComponentSet &componentSet) const
Loads the specified component set from disk.
Definition: projectcontroller.cpp:231
Controller for creating, loading and saving projects.
Definition: projectcontroller.h:22
static const QString ComponentFileExtension
File extension of Tome component files, including the dot.
Definition: projectcontroller.h:30
Named set of Tome custom types.
Definition: customtypeset.h:11
static const QString RecordExportComponentTemplateExtension
File extension of Tome record export component template files, including the dot. ...
Definition: projectcontroller.h:50
const QString getProjectPath() const
Gets the absolute path of the current project, without project file name.
Definition: projectcontroller.cpp:121
static const QString RecordExportMapItemTemplateExtension
File extension of Tome record export map item template files, including the dot.
Definition: projectcontroller.h:90
void progressChanged(const QString title, const QString text, const int currentValue, const int maximumValue)
Progress of the current project operation has changed.
bool hasExportTemplate(const QString &exportTemplatePath) const
Checks whether an export template with the specified path has already been added to the project...
Definition: projectcontroller.cpp:166
static const QString RecordExportListItemDelimiterExtension
File extension of Tome record export list item delimiter files, including the dot.
Definition: projectcontroller.h:75
Template for importing record data.
Definition: recordtableimporttemplate.h:15
Reads and writes records from any device.
Definition: recordsetserializer.h:13
static const QString RecordExportListItemTemplateExtension
File extension of Tome record export list item template files, including the dot. ...
Definition: projectcontroller.h:70
ProjectController()
Constructs a new controller for creating, loading and saving projects.
Definition: projectcontroller.cpp:42
bool hasImportTemplate(const QString &importTemplatePath) const
Checks whether an import template with the specified path has already been added to the project...
Definition: projectcontroller.cpp:196
void createProject(const QString &projectName, const QString &projectPath, const Tome::RecordIdType::RecordIdType recordIdType)
Creates a new project with the specified name and path and saves it to disk.
Definition: projectcontroller.cpp:73