roviz  0.7
Code Documentation of roviz
file_workspace.h
1 #ifndef FILE_WORKSPACE_H
2 #define FILE_WORKSPACE_H
3 
4 #include <QFileSystemWatcher>
5 #include <QFileInfo>
6 #include "abstract_workspace.h"
7 
9 {
10  Q_OBJECT
11  Q_PROPERTY(QString filePath READ filePath WRITE setFilePath USER true)
12 
13 public:
14  Q_INVOKABLE FileWorkspace();
15  ~FileWorkspace();
16  static QSharedPointer<FileWorkspace> createFileWorkspaceFromFile(const QString& filePath);
17 
18  bool compare(const QSharedPointer<AbstractWorkspace>& otherWorkspace) const Q_DECL_OVERRIDE;
19  bool deleteWorkspace(bool deleteProjects = false) Q_DECL_OVERRIDE;
20  bool deleteProject(const QSharedPointer<AbstractProject>& project) Q_DECL_OVERRIDE;
21  bool save() Q_DECL_OVERRIDE;
22  bool test() Q_DECL_OVERRIDE;
23  void init() Q_DECL_OVERRIDE;
24  void update() Q_DECL_OVERRIDE;
25  void setOpen(bool isOpen) Q_DECL_OVERRIDE;
26 
27  void setFilePath(const QString& filePath);
28  void setFileEditMode(bool editMode);
29  QString filePath() const;
30  QString path() const;
31  QString fileName() const;
32 
33 private:
34  void initProjects();
35  void updateProjects();
36  bool validateFileProperties();
37  bool _fileInfoChanged = false;
38  bool _internalSave = false;
39  bool _editMode = false;
40  QFileInfo _fileInfo;
41  QFileSystemWatcher _fileSystemWatcher;
42 
43 private slots:
44  void onWorkspaceFileChanged();
45 };
46 #endif // FILE_WORKSPACE_H
bool deleteProject(const QSharedPointer< AbstractProject > &project) Q_DECL_OVERRIDE
Delete a project and remove it from workspace.
Definition: file_workspace.cpp:309
Definition: file_workspace.h:8
QSharedPointer< AbstractProject > project(QString connectionString) const
Definition: abstract_workspace.cpp:165
bool test() Q_DECL_OVERRIDE
Workspace test procedure. The Test-Procedure is defined by the specific workspace class...
Definition: file_workspace.cpp:180
bool isOpen() const
Definition: abstract_workspace.cpp:130
bool compare(const QSharedPointer< AbstractWorkspace > &otherWorkspace) const Q_DECL_OVERRIDE
Compare a other Workspace source with this Workspace source (not the Object adress).
Definition: file_workspace.cpp:288
bool deleteWorkspace(bool deleteProjects=false) Q_DECL_OVERRIDE
Delete workspace. The function deletes this workspace and all included projects, if the deleteProject...
Definition: file_workspace.cpp:322
void update() Q_DECL_OVERRIDE
Update the workspace after property changes.
Definition: file_workspace.cpp:150
void setOpen(bool isOpen) Q_DECL_OVERRIDE
Set the workspace open (in use) state.
Definition: file_workspace.cpp:276
void init() Q_DECL_OVERRIDE
Initialize the Workspace and set isValid flag. This function must be called, otherwise the workspace ...
Definition: file_workspace.cpp:46
Definition: abstract_workspace.h:23
bool save() Q_DECL_OVERRIDE
Save workspace with all settings.
Definition: file_workspace.cpp:190