65 |
65 |
66 public: |
66 public: |
67 LDFile(); |
67 LDFile(); |
68 ~LDFile(); |
68 ~LDFile(); |
69 |
69 |
70 int addObject (LDObject* obj); // Adds an object to this file at the end of the file. |
70 int addObject (LDObject* obj); // Adds an object to this file at the end of the file. |
71 void addObjects (const QList<LDObject*> objs); |
71 void addObjects (const QList<LDObject*> objs); |
72 void clearSelection(); |
72 void clearSelection(); |
73 void forgetObject (LDObject* obj); // Deletes the given object from the object chain. |
73 void forgetObject (LDObject* obj); // Deletes the given object from the object chain. |
74 str getShortName(); |
74 str getShortName(); |
75 const QList<LDObject*>& selection() const; |
75 const QList<LDObject*>& getSelection() const; |
76 bool hasUnsavedChanges() const; // Does this file have unsaved changes? |
76 bool hasUnsavedChanges() const; // Does this file have unsaved changes? |
77 QList<LDObject*> inlineContents (LDSubfile::InlineFlags flags); |
77 QList<LDObject*> inlineContents (LDSubfile::InlineFlags flags); |
78 void insertObj (int pos, LDObject* obj); |
78 void insertObj (int pos, LDObject* obj); |
79 int numObjs() const; |
79 int getObjectCount() const; |
80 LDObject* object (int pos) const; |
80 LDObject* getObject (int pos) const; |
81 LDObject* obj (int pos) const; |
81 bool save (str path = ""); // Saves this file to disk. |
82 bool save (str path = ""); // Saves this file to disk. |
82 bool isSafeToClose(); // Perform safety checks. Do this before closing any files! |
83 bool safeToClose(); // Perform safety checks. Do this before closing any files! |
|
84 void setObject (int idx, LDObject* obj); |
83 void setObject (int idx, LDObject* obj); |
85 |
84 |
86 inline LDFile& operator<< (LDObject* obj) |
85 inline LDFile& operator<< (LDObject* obj) |
87 { addObject (obj); |
86 { addObject (obj); |
88 return *this; |
87 return *this; |
163 QList<LDObject*> loadFileContents (File* f, int* numWarnings, bool* ok = null); |
162 QList<LDObject*> loadFileContents (File* f, int* numWarnings, bool* ok = null); |
164 |
163 |
165 extern QList<LDFile*> g_loadedFiles; |
164 extern QList<LDFile*> g_loadedFiles; |
166 |
165 |
167 inline const QList<LDObject*>& selection() |
166 inline const QList<LDObject*>& selection() |
168 { return LDFile::current()->selection(); |
167 { return LDFile::current()->getSelection(); |
169 } |
168 } |
170 |
169 |
171 void addRecentFile (str path); |
170 void addRecentFile (str path); |
172 void loadLogoedStuds(); |
171 void loadLogoedStuds(); |
173 str basename (str path); |
172 str basename (str path); |