src/documentloader.h

changeset 1073
a0a0d581309b
parent 1072
9ce9496427f2
child 1159
6ad8cdcd88d9
equal deleted inserted replaced
1072:9ce9496427f2 1073:a0a0d581309b
16 * along with this program. If not, see <http://www.gnu.org/licenses/>. 16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */ 17 */
18 18
19 #pragma once 19 #pragma once
20 #include "main.h" 20 #include "main.h"
21 #include "model.h"
21 22
22 // 23 //
23 // DocumentLoader 24 // DocumentLoader
24 // 25 //
25 // Loads the given file and parses it to LDObjects. It's a separate class so as to be able to do the work progressively 26 // Loads the given file and parses it to LDObjects. It's a separate class so as to be able to do the work progressively
28 class DocumentLoader : public QObject 29 class DocumentLoader : public QObject
29 { 30 {
30 Q_OBJECT 31 Q_OBJECT
31 32
32 public: 33 public:
33 DocumentLoader (bool onForeground = false, QObject* parent = 0); 34 DocumentLoader (Model* model, bool onForeground = false, QObject* parent = 0);
34 35
35 Q_SLOT void abort(); 36 Q_SLOT void abort();
36 bool hasAborted(); 37 bool hasAborted();
37 bool isDone() const; 38 bool isDone() const;
38 bool isOnForeground() const; 39 bool isOnForeground() const;
39 const LDObjectList& objects() const; 40 const QVector<LDObject*>& objects() const;
40 int progress() const; 41 int progress() const;
41 void read (QIODevice* fp); 42 void read (QIODevice* fp);
42 Q_SLOT void start(); 43 Q_SLOT void start();
43 int warningCount() const; 44 int warningCount() const;
44 45
45 private: 46 private:
46 class OpenProgressDialog* m_progressDialog; 47 class OpenProgressDialog* m_progressDialog;
47 LDObjectList m_objects; 48 Model* _model;
48 QStringList m_lines; 49 QStringList m_lines;
49 int m_progress; 50 int m_progress;
50 int m_warningCount; 51 int m_warningCount;
51 bool m_isDone; 52 bool m_isDone;
52 bool m_hasAborted; 53 bool m_hasAborted;

mercurial