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