Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | Related Pages

RS_Document Class Reference

Base class for documents. More...

#include <rs_document.h>

Inheritance diagram for RS_Document:

RS_EntityContainer RS_Undo RS_Entity RS_Undoable RS_Flags RS_Block RS_Graphic RS_FontChar List of all members.

Public Member Functions

 RS_Document (RS_EntityContainer *parent=NULL)
 Constructor.
virtual RS_LayerListgetLayerList ()=0
virtual RS_BlockListgetBlockList ()=0
virtual void newDoc ()=0
virtual bool save ()=0
virtual bool saveAs (const RS_String &filename, RS2::FormatType type)=0
virtual bool open (const RS_String &filename, RS2::FormatType type)=0
virtual bool isDocument () const
virtual void removeUndoable (RS_Undoable *u)
 Removes an entity from the entiy container.
RS_Pen getActivePen () const
void setActivePen (RS_Pen p)
 Sets the currently active drawing pen to p.
RS_String getFilename () const
void setFilename (const RS_String &fn)
 Sets file name for the document currently loaded.
virtual void setModified (bool m)
 Sets the documents modified status to 'm'.
virtual bool isModified () const
virtual void startUndoCycle ()
 Overwritten to set modified flag before starting an undo cycle.

Protected Attributes

bool modified
 Flag set if the document was modified and not yet saved.
RS_Pen activePen
 Active pen.
RS_String filename
 File name of the document or empty for a new document.
RS2::FormatType formatType
 Format type.

Detailed Description

Base class for documents.

Documents can be either graphics or blocks and are typically shown in graphic views. Documents hold an active pen for drawing in the Document, a file name and they know whether they have been modified or not.

Author:
Andrew Mustun


Constructor & Destructor Documentation

RS_Document::RS_Document RS_EntityContainer parent = NULL  ) 
 

Constructor.

Parameters:
parent Parent of the document. Often that's NULL but for blocks it's the blocklist.


Member Function Documentation

RS_Pen RS_Document::getActivePen  )  const [inline]
 

Returns:
Currently active drawing pen.

RS_String RS_Document::getFilename  )  const [inline]
 

Returns:
File name of the document currently loaded. Note, that the default file name is empty.

virtual bool RS_Document::isDocument  )  const [inline, virtual]
 

Returns:
true for all document entities (e.g. Graphics or Blocks).

Reimplemented from RS_Entity.

virtual bool RS_Document::isModified  )  const [inline, virtual]
 

Return values:
true The document has been modified since it was last saved.
false The document has not been modified since it was last saved.

Reimplemented in RS_Graphic.

virtual void RS_Document::removeUndoable RS_Undoable u  )  [inline, virtual]
 

Removes an entity from the entiy container.

Implementation from RS_Undo.

Implements RS_Undo.


The documentation for this class was generated from the following files:
Generated on Sat Jan 6 13:48:23 2007 for qcadlib by  doxygen 1.4.4