karbon
VDocument Class Reference
#include <vdocument.h>
Inheritance diagram for VDocument:

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 | |
ActiveLayer | |
VisibleLayers | |
SelectedLayers | |
AllLayers | |
STYLE_GRAPHICAUTO = 20 | |
STYLE_LINEAR_GRADIENT | |
STYLE_RADIAL_GRADIENT | |
STYLE_STROKE | |
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) |
VLayer * | activeLayer () 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 VDocument * | clone () const |
virtual void | accept (VVisitor &visitor) |
VSelection * | selection () 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 | ( | ) |
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] |
Member Function Documentation
void VDocument::accept | ( | VVisitor & | visitor | ) | [virtual] |
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.
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.
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.
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.
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::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.
KarbonGridData& VDocument::grid | ( | ) | [inline] |
double VDocument::height | ( | ) | const [inline] |
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.
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.
const VLayerList& VDocument::layers | ( | ) | const [inline] |
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.
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::lowerLayer | ( | VLayer * | layer | ) |
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::raiseLayer | ( | VLayer * | layer | ) |
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::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.
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::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.
void VDocument::setHeight | ( | double | height | ) | [inline] |
Sets document height.
- Parameters:
-
height the new document height
Definition at line 118 of file vdocument.h.
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.
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::setUnit | ( | KoUnit::Unit | unit | ) | [inline] |
Sets document unit.
- Parameters:
-
unit the new document unit
Definition at line 133 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.
KoUnit::Unit VDocument::unit | ( | ) | const [inline] |
double VDocument::width | ( | ) | const [inline] |
The documentation for this class was generated from the following files: