src/documentmanager.h

changeset 1210
0b3b35f560f2
parent 1159
6ad8cdcd88d9
child 1211
83b8ed708909
equal deleted inserted replaced
1209:c2723022b173 1210:0b3b35f560f2
18 18
19 #pragma once 19 #pragma once
20 #include <QSet> 20 #include <QSet>
21 #include "main.h" 21 #include "main.h"
22 #include "hierarchyelement.h" 22 #include "hierarchyelement.h"
23 #include "librarycollection.h"
23 24
24 class Model; 25 class Model;
25 26
26 class DocumentManager : public QObject, public HierarchyElement 27 class DocumentManager : public QObject, public HierarchyElement
27 { 28 {
36 void addRecentFile (QString path); 37 void addRecentFile (QString path);
37 const Documents& allDocuments() const { return m_documents; } 38 const Documents& allDocuments() const { return m_documents; }
38 void clear(); 39 void clear();
39 LDDocument* createNew(); 40 LDDocument* createNew();
40 LDDocument* findDocumentByName (QString name); 41 LDDocument* findDocumentByName (QString name);
41 QString findDocumentPath (QString relpath, bool subdirs); 42 QString findDocumentPath (QString relpath);
42 LDDocument* getDocumentByName (QString filename); 43 LDDocument* getDocumentByName (QString filename);
43 bool isSafeToCloseAll(); 44 bool isSafeToCloseAll();
44 void loadFileContents(QIODevice* fp, Model& model, int* numWarnings, bool* ok); 45 void loadFileContents(QIODevice* fp, Model& model, int* numWarnings, bool* ok);
45 void loadLogoedStuds(); 46 void loadLogoedStuds();
46 LDDocument* openDocument (QString path, bool search, bool implicit, LDDocument* fileToOverride = nullptr, 47 LDDocument* openDocument (QString path, bool search, bool implicit, LDDocument* fileToOverride = nullptr,
47 bool* aborted = nullptr); 48 bool* aborted = nullptr);
48 QFile* openLDrawFile (QString relpath, bool subdirs, QString* pathpointer); 49 QFile* openLDrawFile (QString relpath, QString* pathpointer);
49 void openMainModel (QString path); 50 void openMainModel (QString path);
50 bool preInline (LDDocument* doc, Model& model, bool deep, bool renderinline); 51 bool preInline (LDDocument* doc, Model& model, bool deep, bool renderinline);
51 52
52 static const QStringList specialSubdirectories; 53 static const QStringList specialSubdirectories;
53 54
56 57
57 private: 58 private:
58 Q_SLOT void printParseErrorMessage(QString message); 59 Q_SLOT void printParseErrorMessage(QString message);
59 60
60 Documents m_documents; 61 Documents m_documents;
62 LibraryCollection m_libraries;
61 bool m_loadingMainFile; 63 bool m_loadingMainFile;
62 bool m_isLoadingLogoedStuds; 64 bool m_isLoadingLogoedStuds;
63 LDDocument* m_logoedStud; 65 LDDocument* m_logoedStud;
64 LDDocument* m_logoedStud2; 66 LDDocument* m_logoedStud2;
65 }; 67 };

mercurial