src/documentmanager.h

Sun, 19 Jan 2020 02:54:48 +0200

author
Teemu Piippo <teemu@hecknology.net>
date
Sun, 19 Jan 2020 02:54:48 +0200
changeset 22
6da867fa5429
parent 21
0133e565e072
child 23
3387a84ddaba
permissions
-rw-r--r--

commit work on GL rendering

3
55a55a9ec2c2 Added lots of code
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
1 #pragma once
12
fe67489523b5 added dependency loading
Teemu Piippo <teemu@hecknology.net>
parents: 8
diff changeset
2 #include "libraries.h"
3
55a55a9ec2c2 Added lots of code
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
3 #include "model.h"
55a55a9ec2c2 Added lots of code
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
4
5
Teemu Piippo <teemu@hecknology.net>
parents: 3
diff changeset
5 class DocumentManager : public QObject
3
55a55a9ec2c2 Added lots of code
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
6 {
5
Teemu Piippo <teemu@hecknology.net>
parents: 3
diff changeset
7 Q_OBJECT
8
44679e468ba9 major update with many things
Teemu Piippo <teemu@hecknology.net>
parents: 5
diff changeset
8 using ModelPointer = std::unique_ptr<Model>;
3
55a55a9ec2c2 Added lots of code
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
9 public:
21
Teemu Piippo <teemu@hecknology.net>
parents: 12
diff changeset
10 DocumentManager(QObject* parent = nullptr);
8
44679e468ba9 major update with many things
Teemu Piippo <teemu@hecknology.net>
parents: 5
diff changeset
11 QString newModel();
44679e468ba9 major update with many things
Teemu Piippo <teemu@hecknology.net>
parents: 5
diff changeset
12 Model* findModelByName(const QString& name);
44679e468ba9 major update with many things
Teemu Piippo <teemu@hecknology.net>
parents: 5
diff changeset
13 QString openModel(const QString& path, QTextStream& errorStream);
44679e468ba9 major update with many things
Teemu Piippo <teemu@hecknology.net>
parents: 5
diff changeset
14 QString makeNewModelName();
12
fe67489523b5 added dependency loading
Teemu Piippo <teemu@hecknology.net>
parents: 8
diff changeset
15 void loadDependenciesForModel(const QString& modelName,
fe67489523b5 added dependency loading
Teemu Piippo <teemu@hecknology.net>
parents: 8
diff changeset
16 const LibraryManager& libraries,
fe67489523b5 added dependency loading
Teemu Piippo <teemu@hecknology.net>
parents: 8
diff changeset
17 QTextStream& errorStream);
3
55a55a9ec2c2 Added lots of code
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
18 private:
8
44679e468ba9 major update with many things
Teemu Piippo <teemu@hecknology.net>
parents: 5
diff changeset
19 int untitledNameCounter = 0;
44679e468ba9 major update with many things
Teemu Piippo <teemu@hecknology.net>
parents: 5
diff changeset
20 std::map<QString, ModelPointer> openModels;
12
fe67489523b5 added dependency loading
Teemu Piippo <teemu@hecknology.net>
parents: 8
diff changeset
21 void loadDependenciesForModel(const QString& modelName,
fe67489523b5 added dependency loading
Teemu Piippo <teemu@hecknology.net>
parents: 8
diff changeset
22 const LibraryManager& libraries,
fe67489523b5 added dependency loading
Teemu Piippo <teemu@hecknology.net>
parents: 8
diff changeset
23 QStringList& missing,
fe67489523b5 added dependency loading
Teemu Piippo <teemu@hecknology.net>
parents: 8
diff changeset
24 QStringList& processed,
fe67489523b5 added dependency loading
Teemu Piippo <teemu@hecknology.net>
parents: 8
diff changeset
25 QTextStream& errorStream);
3
55a55a9ec2c2 Added lots of code
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
26 };

mercurial