5 #include "rs_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 RS_Document: public RS_EntityContainer, public RS_Undo
22 RS_Document(RS_EntityContainer * parent = NULL);
23 virtual ~RS_Document();
25 virtual RS_LayerList * getLayerList() = 0;
26 virtual RS_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(RS_Undoable * u);
35 RS_Pen getActivePen() const;
36 void setActivePen(RS_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;