src/documentmanager.h

Sat, 14 Dec 2019 23:00:01 +0200

author
Teemu Piippo <teemu@hecknology.net>
date
Sat, 14 Dec 2019 23:00:01 +0200
changeset 20
cef43609a374
parent 12
fe67489523b5
child 21
0133e565e072
permissions
-rw-r--r--

fixed build

#pragma once
#include "libraries.h"
#include "model.h"

class DocumentManager : public QObject
{
	Q_OBJECT
	using ModelPointer = std::unique_ptr<Model>;
public:
	DocumentManager(QObject* parent = nullptr);
	DocumentManager(const DocumentManager&) = delete;
	DocumentManager(DocumentManager&&) = default;
	DocumentManager& operator=(const DocumentManager&) = delete;
	DocumentManager& operator=(DocumentManager&&) = default;
	QString newModel();
	Model* findModelByName(const QString& name);
	QString openModel(const QString& path, QTextStream& errorStream);
	QString makeNewModelName();
	void loadDependenciesForModel(const QString& modelName,
		const LibraryManager& libraries,
		QTextStream& errorStream);
private:
	int untitledNameCounter = 0;
	std::map<QString, ModelPointer> openModels;
	void loadDependenciesForModel(const QString& modelName,
		const LibraryManager& libraries,
		QStringList& missing,
		QStringList& processed,
		QTextStream& errorStream);
};

mercurial