3 // Part of the Architektonas Project
4 // Originally part of QCad Community Edition by Andrew Mustun
5 // Extensively rewritten and refactored by James L. Hammons
6 // Portions copyright (C) 2001-2003 RibbonSoft
7 // Copyright (C) 2010 Underground Software
8 // See the README and GPLv2 files for licensing and warranty information
10 // JLH = James L. Hammons <jlhamm@acm.org>
13 // --- ---------- -----------------------------------------------------------
14 // JLH 05/28/2010 Added this text. :-)
24 * @param parent Parent of the document. Often that's NULL but
25 * for blocks it's the blocklist.
27 Document::Document(EntityContainer * parent):
28 EntityContainer(parent), Undo()
30 DEBUG->print("Document::Document() ");
33 formatType = RS2::FormatUnknown;
35 Color col(RS2::FlagByLayer);
36 activePen = Pen(col, RS2::WidthByLayer, RS2::LineByLayer);
44 * @return true for all document entities (e.g. Graphics or Blocks).
46 bool Document::isDocument() const
52 * Removes an entity from the entiy container. Implementation
55 void Document::removeUndoable(Undoable * u)
57 if (u != NULL && u->undoRtti() == RS2::UndoableEntity)
59 removeEntity((Entity *)u);
64 * @return Currently active drawing pen.
66 Pen Document::getActivePen() const
72 * Sets the currently active drawing pen to p.
74 void Document::setActivePen(Pen p)
80 * @return File name of the document currently loaded.
81 * Note, that the default file name is empty.
83 QString Document::getFilename() const
89 * Sets file name for the document currently loaded.
91 void Document::setFilename(const QString & fn)
97 * Sets the documents modified status to 'm'.
99 void Document::setModified(bool m)
101 //std::cout << "Document::setModified: %d" << (int)m << std::endl;
106 * @retval true The document has been modified since it was last saved.
107 * @retval false The document has not been modified since it was last saved.
109 bool Document::isModified() const
115 * Overwritten to set modified flag before starting an undo cycle.
117 void Document::startUndoCycle()
120 Undo::startUndoCycle();