karbon

#include <vdocument.h>

Inheritance diagram for VDocument:
VObject

Public Types

enum  VSelectionMode { ActiveLayer , VisibleLayers , SelectedLayers , AllLayers }
enum  { STYLE_GRAPHICAUTO = 20 , STYLE_LINEAR_GRADIENT , STYLE_RADIAL_GRADIENT , STYLE_STROKE }
Public Types inherited from VObject
enum  VState {
  normal = 0 , normal_locked = 1 , hidden = 2 , hidden_locked = 3 ,
  deleted = 4 , selected = 5 , edit = 6
}

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)
VLayer * activeLayer () const
const VLayerList & layers () const
TQDomDocument saveXML () const
virtual void saveOasis (KoStore *store, KoXmlWriter *docWriter, KoGenStyles &mainStyles) const
bool loadXML (const TQDomElement &doc)
virtual bool loadOasis (const TQDomElement &element, KoOasisLoadingContext &context)
virtual void save (TQDomElement &element) const
virtual void load (const TQDomElement &element)
void loadDocumentContent (const TQDomElement &doc)
virtual VDocument * clone () const
virtual void accept (VVisitor &visitor)
VSelection * selection () const
VSelectionMode selectionMode ()
void setSelectionMode (VSelectionMode mode)
void append (VObject *object)
TQString objectName (const VObject *obj) const
void setObjectName (const VObject *obj, const TQString name)
bool saveAsPath () const
void saveAsPath (bool b)
KarbonGridData & grid ()
Public Member Functions inherited from VObject
 VObject (VObject *parent, VState state=edit)
 VObject (const VObject &obj)
virtual ~VObject ()
virtual DCOPObject * dcopObject ()
virtual const KoRect & boundingBox () const
bool boundingBoxIsInvalid () const
void invalidateBoundingBox ()
void setParent (VObject *parent)
VObject * parent () const
VState state () const
virtual void setState (const VState state)
virtual VStroke * stroke () const
virtual VFill * fill () const
virtual void setStroke (const VStroke &stroke)
virtual void setFill (const VFill &fill)
virtual void saveOasis (KoStore *store, KoXmlWriter *docWriter, KoGenStyles &mainStyles, int &index) const
virtual void insertInfrontOf (VObject *newObject, VObject *oldObject)
virtual TQString name () const
void setName (const TQString &s)
VDocument * document () const

Additional Inherited Members

Protected Member Functions inherited from VObject
void addStyles (const TQDomElement *style, KoOasisLoadingContext &context)
virtual void saveOasisFill (KoGenStyles &mainStyles, KoGenStyle &stylesojectauto) const
Protected Attributes inherited from VObject
KoRect m_boundingBox
VState m_state: 8
bool m_boundingBoxIsInvalid: 1
VStroke * m_stroke
VFill * m_fill
DCOPObject * m_dcop

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.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

Definition at line 221 of file vdocument.h.

◆ VSelectionMode

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() [1/2]

VDocument::VDocument ( )

Constructs a new document.

Definition at line 36 of file vdocument.cpp.

◆ VDocument() [2/2]

VDocument::VDocument ( const VDocument & document)

Copy constructor.

Parameters
documentthe document to copy properties from

Definition at line 53 of file vdocument.cpp.

◆ ~VDocument()

VDocument::~VDocument ( )
virtual

Destroys the document and all of the layers.

Definition at line 60 of file vdocument.cpp.

Member Function Documentation

◆ accept()

void VDocument::accept ( VVisitor & )
virtual

Accept a VVisitor.

Reimplemented from VObject.

Definition at line 313 of file vdocument.cpp.

◆ activeLayer()

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.

◆ append()

void VDocument::append ( VObject * object)

Appends a new object to the active layer.

Parameters
objectthe object to append

Definition at line 200 of file vdocument.cpp.

◆ canLowerLayer()

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
layerthe layer to check
Returns
true if layer can be lowered, else false

Definition at line 158 of file vdocument.cpp.

◆ canRaiseLayer()

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
layerthe layer to check
Returns
true if layer can be raised, else false

Definition at line 152 of file vdocument.cpp.

◆ clone()

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.cpp.

◆ draw()

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

Draw the object to a painting device.

Parameters
painterabstraction that is used to render to a painting device.
rectrepresents 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.cpp.

◆ drawPage()

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

Draw the document frame to a painting device.

Parameters
painterabstraction that is used to render to a painting device.
pllayout describing the page to draw on (restricting the painter)
drawPageMarginsif true, also draw the crop marks for the page margins, otherwise, don't draw them.

Definition at line 66 of file vdocument.cpp.

◆ grid()

KarbonGridData & VDocument::grid ( )
inline

Returns the document's grid.

Returns
the doument's grid

Definition at line 289 of file vdocument.h.

◆ height()

double VDocument::height ( ) const
inline

Returns document height.

Returns
the document's height

Definition at line 104 of file vdocument.h.

◆ insertLayer()

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
layerthe layer to insert

Definition at line 136 of file vdocument.cpp.

◆ layerPos()

int VDocument::layerPos ( VLayer * layer)

Returns the position of the specified layer.

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

Definition at line 187 of file vdocument.cpp.

◆ layers()

const VLayerList & VDocument::layers ( ) const
inline

Returns the list of layers.

Definition at line 217 of file vdocument.h.

◆ load()

void VDocument::load ( const TQDomElement & element)
virtual

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

Parameters
elementthe DOM element from which the attributes are read

Reimplemented from VObject.

Definition at line 261 of file vdocument.cpp.

◆ loadDocumentContent()

void VDocument::loadDocumentContent ( const TQDomElement & doc)

Definition at line 287 of file vdocument.cpp.

◆ loadOasis()

bool VDocument::loadOasis ( const TQDomElement & element,
KoOasisLoadingContext & context )
virtual

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

Parameters
elementthe DOM element to read attributes from
contextFIXME

Reimplemented from VObject.

Definition at line 307 of file vdocument.cpp.

◆ loadXML()

bool VDocument::loadXML ( const TQDomElement & doc)

Definition at line 267 of file vdocument.cpp.

◆ lowerLayer()

void VDocument::lowerLayer ( VLayer * layer)

Lowers the layer.

Parameters
layerthe layer to lower

Definition at line 176 of file vdocument.cpp.

◆ objectName()

TQString VDocument::objectName ( const VObject * obj) const

Returns custom name of specified object.

Parameters
objthe 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.cpp.

◆ raiseLayer()

void VDocument::raiseLayer ( VLayer * layer)

Raises the layer.

Parameters
layerthe layer to raise

Definition at line 165 of file vdocument.cpp.

◆ removeLayer()

void VDocument::removeLayer ( VLayer * layer)

Removes the layer.

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

Parameters
layerthe layer to remove

Definition at line 144 of file vdocument.cpp.

◆ save()

void VDocument::save ( TQDomElement & element) const
virtual

Save this object's state to xml.

Parameters
elementthe DOM element to which the attributes are saved

Reimplemented from VObject.

Definition at line 234 of file vdocument.cpp.

◆ saveAsPath() [1/2]

bool VDocument::saveAsPath ( ) const
inline

Definition at line 281 of file vdocument.h.

◆ saveAsPath() [2/2]

void VDocument::saveAsPath ( bool b)
inline

Definition at line 282 of file vdocument.h.

◆ saveOasis()

void VDocument::saveOasis ( KoStore * store,
KoXmlWriter * docWriter,
KoGenStyles & mainStyles ) const
virtual

Definition at line 216 of file vdocument.cpp.

◆ saveXML()

TQDomDocument VDocument::saveXML ( ) const

Definition at line 206 of file vdocument.cpp.

◆ selection()

VSelection * VDocument::selection ( ) const
inline

Returns a pointer to the selection.

Returns
the document's selection

Definition at line 238 of file vdocument.h.

◆ selectionMode()

VSelectionMode VDocument::selectionMode ( )
inline

Returns the selection mode.

Returns
the actual selection mode

Definition at line 246 of file vdocument.h.

◆ setActiveLayer()

void VDocument::setActiveLayer ( VLayer * layer)

Sets the active layer.

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

Parameters
layerthe layer to set active

Definition at line 193 of file vdocument.cpp.

◆ setHeight()

void VDocument::setHeight ( double height)
inline

Sets document height.

Parameters
heightthe new document height

Definition at line 118 of file vdocument.h.

◆ setObjectName()

void VDocument::setObjectName ( const VObject * obj,
const TQString 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
objthe object to set custom name for
namethe the custom name to set

Definition at line 279 of file vdocument.h.

◆ setSelectionMode()

void VDocument::setSelectionMode ( VSelectionMode mode)
inline

Sets the selection mode.

Parameters
modethe new selection mode

Definition at line 253 of file vdocument.h.

◆ setUnit()

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

Sets document unit.

Parameters
unitthe new document unit

Definition at line 133 of file vdocument.h.

◆ setWidth()

void VDocument::setWidth ( double width)
inline

Sets document width.

Parameters
widththe new document width

Definition at line 111 of file vdocument.h.

◆ unit()

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

Returns document unit.

Returns
the document's unit

Definition at line 125 of file vdocument.h.

◆ width()

double VDocument::width ( ) const
inline

Returns document width.

Returns
the document's width

Definition at line 97 of file vdocument.h.


The documentation for this class was generated from the following files: