2012-11-22 12:30:02 +00:00
|
|
|
#ifndef CSM_DOC_DOCUMENTMGR_H
|
|
|
|
#define CSM_DOC_DOCUMENTMGR_H
|
2012-11-21 16:31:18 +00:00
|
|
|
|
|
|
|
#include <vector>
|
2012-11-23 13:05:49 +00:00
|
|
|
#include <string>
|
2012-11-21 16:31:18 +00:00
|
|
|
|
2013-02-04 12:46:54 +00:00
|
|
|
#include <boost/filesystem/path.hpp>
|
|
|
|
|
2013-09-27 13:24:58 +00:00
|
|
|
namespace Files
|
|
|
|
{
|
|
|
|
class ConfigurationManager;
|
|
|
|
}
|
|
|
|
|
2012-11-21 16:31:18 +00:00
|
|
|
namespace CSMDoc
|
|
|
|
{
|
|
|
|
class Document;
|
|
|
|
|
|
|
|
class DocumentManager
|
|
|
|
{
|
|
|
|
std::vector<Document *> mDocuments;
|
2013-09-27 13:24:58 +00:00
|
|
|
const Files::ConfigurationManager& mConfiguration;
|
2012-11-21 16:31:18 +00:00
|
|
|
|
|
|
|
DocumentManager (const DocumentManager&);
|
|
|
|
DocumentManager& operator= (const DocumentManager&);
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
2013-09-27 13:24:58 +00:00
|
|
|
DocumentManager (const Files::ConfigurationManager& configuration);
|
2012-11-21 16:31:18 +00:00
|
|
|
|
|
|
|
~DocumentManager();
|
|
|
|
|
2013-10-17 16:21:41 +00:00
|
|
|
Document *addDocument (const std::vector< boost::filesystem::path >& files, const boost::filesystem::path& savePath, bool new_);
|
2012-11-21 16:31:18 +00:00
|
|
|
///< The ownership of the returned document is not transferred to the caller.
|
2013-02-04 12:46:54 +00:00
|
|
|
///
|
|
|
|
/// \param new_ Do not load the last content file in \a files and instead create in an
|
|
|
|
/// appropriate way.
|
2012-11-21 16:31:18 +00:00
|
|
|
|
|
|
|
bool removeDocument (Document *document);
|
|
|
|
///< \return last document removed?
|
2013-10-17 16:21:41 +00:00
|
|
|
void setResourceDir (const boost::filesystem::path& parResDir);
|
|
|
|
|
|
|
|
private:
|
|
|
|
boost::filesystem::path mResDir;
|
2012-11-21 16:31:18 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|