ember/business/projectmanager.h

51 lines
1.0 KiB
C++

#ifndef PROJECTMANAGER_H
#define PROJECTMANAGER_H
#include <vector>
#include <map>
#include <string>
#include <model/project.h>
namespace Ember
{
class ProjectManager
{
public:
typedef std::map<boost::filesystem::path, RecentProject> RecentProjectMap;
/**
* @brief Constructor
*/
ProjectManager();
/**
* @brief Gets a list of recent projects. First time reads from disk.
* @return Map of recent projects.
*/
const RecentProjectMap& recentProjects();
/**
* @brief Pins or unpins a recent project. Updates storage as well.
* @param path Path
* @param pinned True to pin, false to unpin
*/
void pinRecentProject(boost::filesystem::path path, bool pinned = true);
/**
* @brief Deletes a recent project.
* @param path
*/
void deleteRecentProject(boost::filesystem::path path);
private:
void saveRecentProjects();
Project* m_currentProject;
RecentProjectMap m_recentProjects;
bool m_recentProjectsLoaded;
};
}
#endif // PROJECTMANAGER_H