X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fbase%2Fdocument.cpp;fp=src%2Fbase%2Fdocument.cpp;h=0000000000000000000000000000000000000000;hb=9f6ad3fe0b9cb30115a5d38e8af3aebed0d70c08;hp=b1d31b754c9399f2825edffeb359b2e87e1174f3;hpb=43c13b052d069ba435277d93867380d00c04931f;p=architektonas diff --git a/src/base/document.cpp b/src/base/document.cpp deleted file mode 100644 index b1d31b7..0000000 --- a/src/base/document.cpp +++ /dev/null @@ -1,121 +0,0 @@ -// document.cpp -// -// Part of the Architektonas Project -// Originally part of QCad Community Edition by Andrew Mustun -// Extensively rewritten and refactored by James L. Hammons -// Portions copyright (C) 2001-2003 RibbonSoft -// Copyright (C) 2010 Underground Software -// See the README and GPLv2 files for licensing and warranty information -// -// JLH = James L. Hammons -// -// Who When What -// --- ---------- ----------------------------------------------------------- -// JLH 05/28/2010 Added this text. :-) -// - -#include "document.h" - -#include "debug.h" - -/** - * Constructor. - * - * @param parent Parent of the document. Often that's NULL but - * for blocks it's the blocklist. - */ -Document::Document(EntityContainer * parent): - EntityContainer(parent), Undo() -{ - DEBUG->print("Document::Document() "); - - filename = ""; - formatType = RS2::FormatUnknown; - setModified(false); - Color col(RS2::FlagByLayer); - activePen = Pen(col, RS2::WidthByLayer, RS2::LineByLayer); -} - -Document::~Document() -{ -} - -/** - * @return true for all document entities (e.g. Graphics or Blocks). - */ -bool Document::isDocument() const -{ - return true; -} - -/** - * Removes an entity from the entiy container. Implementation - * from Undo. - */ -void Document::removeUndoable(Undoable * u) -{ - if (u != NULL && u->undoRtti() == RS2::UndoableEntity) - { - removeEntity((Entity *)u); - } -} - -/** - * @return Currently active drawing pen. - */ -Pen Document::getActivePen() const -{ - return activePen; -} - -/** - * Sets the currently active drawing pen to p. - */ -void Document::setActivePen(Pen p) -{ - activePen = p; -} - -/** - * @return File name of the document currently loaded. - * Note, that the default file name is empty. - */ -QString Document::getFilename() const -{ - return filename; -} - -/** - * Sets file name for the document currently loaded. - */ -void Document::setFilename(const QString & fn) -{ - filename = fn; -} - -/** - * Sets the documents modified status to 'm'. - */ -void Document::setModified(bool m) -{ - //std::cout << "Document::setModified: %d" << (int)m << std::endl; - modified = m; -} - -/** - * @retval true The document has been modified since it was last saved. - * @retval false The document has not been modified since it was last saved. - */ -bool Document::isModified() const -{ - return modified; -} - -/** - * Overwritten to set modified flag before starting an undo cycle. - */ -void Document::startUndoCycle() -{ - setModified(true); - Undo::startUndoCycle(); -}