Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | Class Members

QS_DocumentWrapper Class Reference

Wrapper class for documents (graphics, drawings). More...

#include <qs_documentwrapper.h>

List of all members.

Public Slots

QS_EntityWrapperfirstEntity ()
QS_EntityWrappernextEntity ()
void setActivePen (QS_PenWrapper *p)
 Sets the currenly active pen for this document.
void setActiveLayer (QS_LayerWrapper *l)
 Sets the currenly active layer for this document.
void setActiveLayer (const QString &l)
 Sets the currenly active layer by name.
void addLayer (const QString &name, QS_PenWrapper *pen)
 Adds a new layer to this document.
void addEntity (QS_EntityWrapper *e)
 Adds the given entity to this document.

Public Member Functions

 QS_DocumentWrapper (RS_Document *d)
RS_Document * getDocument ()

Protected Member Functions

QS_EntityWrapperwrap (RS_Entity *e)
 Internal.


Detailed Description

Wrapper class for documents (graphics, drawings).


Member Function Documentation

void QS_DocumentWrapper::addEntity QS_EntityWrapper e  )  [slot]
 

Adds the given entity to this document.

This example script adds a line to a document:

 var doc = new Document;
 var line = new Line(doc, 0,0, 100,100);
 doc.addEntity(line);
 

void QS_DocumentWrapper::addLayer const QString &  name,
QS_PenWrapper pen
[slot]
 

Adds a new layer to this document.

This example script adds a layer to a document:

 var doc = new Document;
 var pen = new Pen(255,0,0);
 doc.addLayer("layername", pen);
 

Parameters:
name Name of the new layer.
pen Pen (attributes) of the new layer.

QS_EntityWrapper * QS_DocumentWrapper::firstEntity  )  [slot]
 

Returns:
Pointer to the first entity of this document or NULL if the document is empty.

QS_EntityWrapper * QS_DocumentWrapper::nextEntity  )  [slot]
 

Returns:
Pointer to the next entity of this document or NULL if the end of the document is reached.

void QS_DocumentWrapper::setActiveLayer const QString &  l  )  [slot]
 

Sets the currenly active layer by name.

This example script activates layer "mylayer".

 var doc = new Document;
 doc.setActiveLayer("mylayer");
 

void QS_DocumentWrapper::setActiveLayer QS_LayerWrapper l  )  [slot]
 

Sets the currenly active layer for this document.

Newly added entities will be placed on this layer.

void QS_DocumentWrapper::setActivePen QS_PenWrapper p  )  [slot]
 

Sets the currenly active pen for this document.

This pen will be used when new entities are added.

This example script activates a red 1mm pen.

 var doc = new Document;
 var pen = new Pen(255,0,0, 100);
 doc.setActivePen(pen);
 

QS_EntityWrapper * QS_DocumentWrapper::wrap RS_Entity *  e  )  [protected]
 

Internal.

Wraps the given native entity into an entity wrapper.


The documentation for this class was generated from the following files:
Generated on Sat May 6 04:36:12 2006 for qcadscripting by  doxygen 1.4.4