//////////////////////////////////////////////////////////////////////////////// /** * \file project.h * \version v1.0 * \author Ing. Dominik Malcik */ //////////////////////////////////////////////////////////////////////////////// #ifndef PROJECT_H #define PROJECT_H #include #include #include #include #include #include // singleton #include "./libs/staticsingleton.h" class Project : public QObject { Q_OBJECT public: static const QString PROJVERSION; static const QString PROJSUBDIR_IMAGES; static const QString PROJSUBDIR_LAYERS; static const QString XML_TRUE; static const QString XML_FALSE; static const QString PROJ_FILE_EXT; void valueInit(); void setProjectName (QString name); QString getProjectName (void); void setProjectFileName (QString name); QString getProjectFileName (void); void setProjectRootDir (QString s); QString getProjectRootDir (void); void setProjectRootDir_old (QString s); QString getProjectRootDir_old (void); void setImagesDir (QString s); QString getImagesDir (void); void setLayersDir (QString s); QString getLayersDir (void); void setFileImported (bool i); bool getFileImported (void); void setImages (std::vector i); std::vector getImages (void); void addToImages (QString s); QString getSelectedImage (unsigned int index); void eraseSelectedImage(unsigned int index); void emitDeleteImported(); void setLayers (std::vector i); std::vector getLayers (void); void addToLayers (QString s); QString getSelectedLayer (unsigned int index); void eraseSelectedLayer(unsigned int index); void emitDeleteAnalysings(); int layersCount(); void prepareProject(QString rootDir, QString projectName, QString projectFileName, bool fileImported, std::vector images, std::vector layers); bool saveToFile(bool removeSubDirs); bool fileCopy(QString fileName, QString destDir, QString destFilename, QString * newFileName); bool removeDir(QString dirName); bool deleteAnalysing(int index); bool deleteImported(int index); signals: void imagesValueChanged(); void layersValueChanged(); public slots: private: // constructor, destructor private = singleton explicit Project(QObject *parent = 0); ~Project(); // friend allows singleton to be created by this object friend class cStaticSingleton; QString projectRootDir; QString projectRootDir_old; QString projectFileName; QString projectName; bool fileImported; QString imagesDir; QString layersDir; std::vector images; std::vector layers; }; // singleton instance of the project typedef cStaticSingleton cProject; #endif // PROJECT_H