22 #ifndef TULIPPROJECT_H
23 #define TULIPPROJECT_H
27 #include <QTemporaryDir>
29 #include <tulip/tulipconf.h>
81 class TLP_QT_SCOPE TulipProject :
public QObject {
84 TulipProject() =
delete;
85 explicit TulipProject(QTemporaryDir *);
88 ~TulipProject()
override;
96 static TulipProject *newProject();
108 static TulipProject *openProject(
const QString &file,
tlp::PluginProgress *progress =
nullptr);
146 void setProjectFile(
const QString &projectFile);
167 QStringList entryList(
const QString &path, QDir::Filters filters = QDir::NoFilter,
168 QDir::SortFlags sort = QDir::NoSort);
177 QStringList entryList(
const QString &path,
const QStringList &nameFilters,
178 QDir::Filters filters = QDir::NoFilter,
179 QDir::SortFlags sort = QDir::NoSort);
187 bool exists(
const QString &path);
195 bool mkpath(
const QString &path);
203 bool isDir(
const QString &path);
212 bool removeFile(
const QString &path);
222 bool removeDir(
const QString &path);
232 bool removeAllDir(
const QString &path);
241 bool copy(
const QString &source,
const QString &destination);
251 bool touch(
const QString &path);
262 std::fstream *stdFileStream(
const QString &path, std::ios_base::openmode = std::fstream::in |
278 QIODevice *fileStream(
const QString &path, QIODevice::OpenMode mode = QIODevice::ReadWrite);
287 QString projectFile()
const {
298 QString absoluteRootPath()
const;
305 Q_PROPERTY(QString name READ name WRITE setName)
309 QString name()
const;
314 Q_PROPERTY(QString description READ description WRITE setDescription)
318 QString description()
const;
323 Q_PROPERTY(QString author READ author WRITE setAuthor)
327 QString author()
const;
338 Q_PROPERTY(QString perspective READ perspective WRITE setPerspective)
342 QString perspective()
const;
348 QString version()
const;
355 QString toAbsolutePath(
const QString &relativePath);
358 void projectFileChanged(
const QString &projectFile);
364 void setName(
const QString &);
368 void setDescription(
const QString &);
372 void setAuthor(
const QString &);
376 void setPerspective(
const QString &);
379 bool writeMetaInfo();
383 QTemporaryDir *_rootDir;
384 QString _projectFile;
386 inline const QString rootDir()
const {
387 return _rootDir->path();
393 QString _description;
394 QString _perspective;
PluginProcess subclasses are meant to notify about the progress state of some process (typically a pl...