karbon

VDocument Class Reference

#include <vdocument.h>

Inheritance diagram for VDocument:

VObject

List of all members.


Detailed Description

All non-visual, static doc info is in here.

The karbon part uses this class. Filters can use this class as well instead of the visually oriented karbon part.

Definition at line 52 of file vdocument.h.


Public Types

enum  VSelectionMode { ActiveLayer, VisibleLayers, SelectedLayers, AllLayers }
enum  { STYLE_GRAPHICAUTO = 20, STYLE_LINEAR_GRADIENT, STYLE_RADIAL_GRADIENT, STYLE_STROKE }

Public Member Functions

 VDocument ()
 VDocument (const VDocument &document)
virtual ~VDocument ()
virtual void draw (VPainter *painter, const KoRect *rect) const
void drawPage (VPainter *painter, const KoPageLayout &pl, bool drawPageMargins) const
double width () const
double height () const
void setWidth (double width)
void setHeight (double height)
KoUnit::Unit unit () const
void setUnit (KoUnit::Unit unit)
bool canRaiseLayer (VLayer *layer)
bool canLowerLayer (VLayer *layer)
void raiseLayer (VLayer *layer)
void lowerLayer (VLayer *layer)
int layerPos (VLayer *layer)
void insertLayer (VLayer *layer)
void removeLayer (VLayer *layer)
void setActiveLayer (VLayer *layer)
VLayeractiveLayer () const
const VLayerList & layers () const
QDomDocument saveXML () const
virtual void saveOasis (KoStore *store, KoXmlWriter *docWriter, KoGenStyles &mainStyles) const
bool loadXML (const QDomElement &doc)
virtual bool loadOasis (const QDomElement &element, KoOasisLoadingContext &context)
virtual void save (QDomElement &element) const
virtual void load (const QDomElement &element)
void loadDocumentContent (const QDomElement &doc)
virtual VDocumentclone () const
virtual void accept (VVisitor &visitor)
VSelectionselection () const
VSelectionMode selectionMode ()
void setSelectionMode (VSelectionMode mode)
void append (VObject *object)
QString objectName (const VObject *obj) const
void setObjectName (const VObject *obj, const QString name)
bool saveAsPath () const
void saveAsPath (bool b)
KarbonGridData & grid ()

Member Enumeration Documentation

The different selection modes.

Enumerator:
ActiveLayer  selection within the active layer
VisibleLayers  selection within all visible layers
SelectedLayers  selection within all selected layers
AllLayers  selection within all layers

Definition at line 56 of file vdocument.h.


Constructor & Destructor Documentation

VDocument::VDocument (  ) 

Constructs a new document.

Definition at line 36 of file vdocument.cc.

VDocument::VDocument ( const VDocument document  ) 

Copy constructor.

Parameters:
document the document to copy properties from

Definition at line 53 of file vdocument.cc.

VDocument::~VDocument (  )  [virtual]

Destroys the document and all of the layers.

Definition at line 60 of file vdocument.cc.


Member Function Documentation

void VDocument::draw ( VPainter *  painter,
const KoRect *  rect 
) const [virtual]

Draw the object to a painting device.

Parameters:
painter abstraction that is used to render to a painting device.
rect represents the visible rectangular area. If this object doesn't intersect with this area it is not drawn.

Reimplemented from VObject.

Definition at line 125 of file vdocument.cc.

void VDocument::drawPage ( VPainter *  painter,
const KoPageLayout &  pl,
bool  drawPageMargins 
) const

Draw the document frame to a painting device.

Parameters:
painter abstraction that is used to render to a painting device.
pl layout describing the page to draw on (restricting the painter)
drawPageMargins if true, also draw the crop marks for the page margins, otherwise, don't draw them.

Definition at line 66 of file vdocument.cc.

double VDocument::width (  )  const [inline]

Returns document width.

Returns:
the document's width

Definition at line 97 of file vdocument.h.

double VDocument::height (  )  const [inline]

Returns document height.

Returns:
the document's height

Definition at line 104 of file vdocument.h.

void VDocument::setWidth ( double  width  )  [inline]

Sets document width.

Parameters:
width the new document width

Definition at line 111 of file vdocument.h.

void VDocument::setHeight ( double  height  )  [inline]

Sets document height.

Parameters:
height the new document height

Definition at line 118 of file vdocument.h.

KoUnit::Unit VDocument::unit (  )  const [inline]

Returns document unit.

Returns:
the document's unit

Definition at line 125 of file vdocument.h.

void VDocument::setUnit ( KoUnit::Unit  unit  )  [inline]

Sets document unit.

Parameters:
unit the new document unit

Definition at line 133 of file vdocument.h.

bool VDocument::canRaiseLayer ( VLayer layer  ) 

Checks if specified layer can be raised.

A layer can be raised if there is more than one layer and the specified layer is not already at the top.

Parameters:
layer the layer to check
Returns:
true if layer can be raised, else false

Definition at line 152 of file vdocument.cc.

bool VDocument::canLowerLayer ( VLayer layer  ) 

Checks if specified layer can be lowered.

A layer can be lowered if there is more than one layer and the specified layer is not already at the bottom.

Parameters:
layer the layer to check
Returns:
true if layer can be lowered, else false

Definition at line 158 of file vdocument.cc.

void VDocument::raiseLayer ( VLayer layer  ) 

Raises the layer.

Parameters:
layer the layer to raise

Definition at line 165 of file vdocument.cc.

void VDocument::lowerLayer ( VLayer layer  ) 

Lowers the layer.

Parameters:
layer the layer to lower

Definition at line 176 of file vdocument.cc.

int VDocument::layerPos ( VLayer layer  ) 

Returns the position of the specified layer.

Parameters:
layer the layer to retrieve the position for
Returns:
the layer position

Definition at line 187 of file vdocument.cc.

void VDocument::insertLayer ( VLayer layer  ) 

Inserts a new layer.

The layer is appended at the end, on top of all other layers, and is activated.

Parameters:
layer the layer to insert

Definition at line 136 of file vdocument.cc.

void VDocument::removeLayer ( VLayer layer  ) 

Removes the layer.

If there is no layer left, a new layer is created, inserted and activated.

Parameters:
layer the layer to remove

Definition at line 144 of file vdocument.cc.

void VDocument::setActiveLayer ( VLayer layer  ) 

Sets the active layer.

The specified layer is set active, if it is found in the layer list.

Parameters:
layer the layer to set active

Definition at line 193 of file vdocument.cc.

VLayer* VDocument::activeLayer (  )  const [inline]

Returns a pointer to the active layer.

Returns:
the currently active layer

Definition at line 212 of file vdocument.h.

const VLayerList& VDocument::layers (  )  const [inline]

Returns the list of layers.

Definition at line 217 of file vdocument.h.

bool VDocument::loadOasis ( const QDomElement &  element,
KoOasisLoadingContext &  context 
) [virtual]

Load this object's state from OpenDocument and initialize this object accordingly.

Parameters:
element the DOM element to read attributes from
context FIXME

Reimplemented from VObject.

Definition at line 307 of file vdocument.cc.

void VDocument::save ( QDomElement &  element  )  const [virtual]

Save this object's state to xml.

Parameters:
element the DOM element to which the attributes are saved

Reimplemented from VObject.

Definition at line 234 of file vdocument.cc.

void VDocument::load ( const QDomElement &  element  )  [virtual]

Load this object's state from xml and initialize this object accordingly.

Parameters:
element the DOM element from which the attributes are read

Reimplemented from VObject.

Definition at line 261 of file vdocument.cc.

VDocument * VDocument::clone (  )  const [virtual]

Create an exact copy of this object.

Returns:
the exact object copy

Implements VObject.

Definition at line 255 of file vdocument.cc.

void VDocument::accept ( VVisitor  )  [virtual]

Accept a VVisitor.

Reimplemented from VObject.

Definition at line 313 of file vdocument.cc.

VSelection* VDocument::selection (  )  const [inline]

Returns a pointer to the selection.

Returns:
the document's selection

Definition at line 238 of file vdocument.h.

VSelectionMode VDocument::selectionMode (  )  [inline]

Returns the selection mode.

Returns:
the actual selection mode

Definition at line 246 of file vdocument.h.

void VDocument::setSelectionMode ( VSelectionMode  mode  )  [inline]

Sets the selection mode.

Parameters:
mode the new selection mode

Definition at line 253 of file vdocument.h.

void VDocument::append ( VObject object  ) 

Appends a new object to the active layer.

Parameters:
object the object to append

Definition at line 200 of file vdocument.cc.

QString VDocument::objectName ( const VObject obj  )  const

Returns custom name of specified object.

Parameters:
obj the object to retrieve name for
Returns:
the custom name of the object or an empty string if no custom name is set

Definition at line 319 of file vdocument.cc.

void VDocument::setObjectName ( const VObject obj,
const QString  name 
) [inline]

Sets custom name of specified object.

By default all object have generic names like path, rectangle or text that is defined within the object's class.

Parameters:
obj the object to set custom name for
name the the custom name to set

Definition at line 279 of file vdocument.h.

KarbonGridData& VDocument::grid (  )  [inline]

Returns the document's grid.

Returns:
the doument's grid

Definition at line 289 of file vdocument.h.


The documentation for this class was generated from the following files:
KDE Home | KDE Accessibility Home | Description of Access Keys