5 #include "entitycontainer.h"
12 * Base class for documents. Documents can be either graphics or
13 * blocks and are typically shown in graphic views. Documents hold
14 * an active pen for drawing in the Document, a file name and they
15 * know whether they have been modified or not.
17 * @author Andrew Mustun
19 class Document: public EntityContainer, public Undo
22 Document(EntityContainer * parent = NULL);
25 virtual LayerList * getLayerList() = 0;
26 virtual BlockList * getBlockList() = 0;
28 virtual void newDoc() = 0;
29 virtual bool save() = 0;
30 virtual bool saveAs(const QString &filename, RS2::FormatType type) = 0;
31 virtual bool open(const QString &filename, RS2::FormatType type) = 0;
33 virtual bool isDocument() const;
34 virtual void removeUndoable(Undoable * u);
35 Pen getActivePen() const;
36 void setActivePen(Pen p);
37 QString getFilename() const;
38 void setFilename(const QString & fn);
39 virtual void setModified(bool m);
40 virtual bool isModified() const;
41 virtual void startUndoCycle();
44 /** Flag set if the document was modified and not yet saved. */
48 /** File name of the document or empty for a new document. */
51 RS2::FormatType formatType;