8 #ifndef ABSTRACT_PROJECT_H 9 #define ABSTRACT_PROJECT_H 12 #include <QSharedPointer> 13 #include <QDomElement> 14 #include "helper/settings_scope.h" 30 virtual bool save() = 0;
84 virtual void reset() = 0;
194 const QString&
name()
const;
203 void setName(
const QString& name);
344 void internDomChanged();
345 void externDomChange();
348 bool loadSettingsScope();
350 QScopedPointer<SettingsScope> _settingsScope;
351 int _majorProjectVersion;
352 int _minorProjectVersion;
355 QString _description;
357 QString _connectionString;
358 bool _isDirty =
false;
359 bool _isValid =
false;
360 bool _isFastLoad =
false;
361 bool _isLoaded =
false;
362 bool _isExternChanged =
false;
365 #endif // ABSTRACT_PROJECT_H bool isValid() const
Definition: abstract_project.cpp:241
void setDirty(bool isDirty)
The isDirty flag represent the project save state.
Definition: abstract_project.cpp:169
bool isLoaded() const
Definition: abstract_project.cpp:120
virtual QDomDocument autosaveDomDocument() const =0
void setFastLoad(bool isFastLoad)
Set the project fastload property. The project can directly loaded by open the related workspace...
Definition: abstract_project.cpp:154
int minorProjectVersion() const
Definition: abstract_project.cpp:215
static bool compareDomDocumentMD5(const QDomDocument &dom1, const QDomDocument &dom2)
Compare two domdocuments with each other via md5 hash bytearray.
Definition: abstract_project.cpp:198
virtual void cleanAutosave()=0
Remove the autosave project xml structure.
void setVersion(const QString &version)
Set the project version. If the version is not compatible with the application, the project will be i...
Definition: abstract_project.cpp:99
void setLastError(const QString &lastError)
Set an error message to the project.
Definition: abstract_project.cpp:115
virtual bool save()=0
Save the project in a xml structure.
bool init()
Initialize the project properties (e.g. settings scope) and connect them.
Definition: abstract_project.cpp:17
virtual void setLoaded(bool isLoaded)
Set the project loaded property. This indicates, that the project is currently loaded by the related ...
Definition: abstract_project.cpp:125
The SettingsScope class acts as a container for scoped settings.
Definition: settings_scope.h:21
QString lastError() const
Definition: abstract_project.cpp:110
SettingsScope * settingsScope() const
Returns a pointer to the settings scope associated with the project.
Definition: abstract_project.cpp:159
void setDescription(const QString &description)
Set the project description.
Definition: abstract_project.cpp:140
virtual bool setDomDocument(const QDomDocument &domDocument)=0
Set and validate the project domDocument xml structure.
void setExternChanged(bool isExternChanged)
Set project changed by extern (e.g. project file was changed outside Traviz).
Definition: abstract_project.cpp:105
Definition: abstract_project.h:16
bool isExternChanged() const
Definition: abstract_project.cpp:94
bool isDirty() const
Definition: abstract_project.cpp:164
virtual bool autosave()=0
Save the project in a xml structure.
virtual QDomDocument domDocument() const =0
void setName(const QString &name)
Set the project name.
Definition: abstract_project.cpp:225
QString description() const
Definition: abstract_project.cpp:135
void setValid(bool isValid)
Set the project valid. This property decides if a project is loadable or not.
Definition: abstract_project.cpp:236
AbstractProject(SettingsScope *parentSettingsScope)
Abstract project constructor.
Definition: abstract_project.cpp:8
virtual QString connectionString()=0
The connection string defines the link to the project xml source (e.g file, sql). ...
Definition: abstract_project.cpp:130
bool isFastLoad() const
Definition: abstract_project.cpp:149
bool validateProjectDomDocument(const QDomDocument &domDocument)
This function validates a project domDocument xml structure. A validation error can be printed by las...
Definition: abstract_project.cpp:34
virtual bool autosaveExists()=0
Check autosave project xml exists.
static QDomDocument projectDomDocumentTemplate(const QString &name, const QString &version, const QString &description="")
The project is defined by a xml structure. This structure is represented by a domDocument. The static projectDomDocumentTemplate function creats a clean project domDocument.
Definition: abstract_project.cpp:182
int majorProjectVersion() const
Definition: abstract_project.cpp:210
virtual QString autosaveInfo()=0
Information about the autosave project xml structure.
virtual void reset()=0
Reload the complete project structure from xml. All settings, which are not saved will be discarded a...
QString version() const
Definition: abstract_project.cpp:177
const QString & name() const
Definition: abstract_project.cpp:220