#include <vdocument.h>
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
-
document the document to copy properties from
Definition at line 53 of file vdocument.cpp.
◆ ~VDocument()
|
virtual |
Destroys the document and all of the layers.
Definition at line 60 of file vdocument.cpp.
Member Function Documentation
◆ accept()
|
virtual |
◆ activeLayer()
|
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
-
object the 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
-
layer the 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
-
layer the layer to check
- Returns
- true if layer can be raised, else false
Definition at line 152 of file vdocument.cpp.
◆ clone()
|
virtual |
Create an exact copy of this object.
- Returns
- the exact object copy
Implements VObject.
Definition at line 255 of file vdocument.cpp.
◆ draw()
|
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.cpp.
◆ drawPage()
| 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.cpp.
◆ grid()
|
inline |
◆ height()
|
inline |
◆ 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
-
layer the 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
-
layer the layer to retrieve the position for
- Returns
- the layer position
Definition at line 187 of file vdocument.cpp.
◆ layers()
|
inline |
Returns the list of layers.
Definition at line 217 of file vdocument.h.
◆ load()
|
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.cpp.
◆ loadDocumentContent()
| void VDocument::loadDocumentContent | ( | const TQDomElement & | doc | ) |
Definition at line 287 of file vdocument.cpp.
◆ loadOasis()
|
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.cpp.
◆ loadXML()
| bool VDocument::loadXML | ( | const TQDomElement & | doc | ) |
Definition at line 267 of file vdocument.cpp.
◆ lowerLayer()
| void VDocument::lowerLayer | ( | VLayer * | layer | ) |
◆ objectName()
| TQString 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.cpp.
◆ raiseLayer()
| void VDocument::raiseLayer | ( | VLayer * | layer | ) |
◆ removeLayer()
| 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.cpp.
◆ save()
|
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.cpp.
◆ saveAsPath() [1/2]
|
inline |
Definition at line 281 of file vdocument.h.
◆ saveAsPath() [2/2]
|
inline |
Definition at line 282 of file vdocument.h.
◆ saveOasis()
|
virtual |
Definition at line 216 of file vdocument.cpp.
◆ saveXML()
| TQDomDocument VDocument::saveXML | ( | ) | const |
Definition at line 206 of file vdocument.cpp.
◆ selection()
|
inline |
Returns a pointer to the selection.
- Returns
- the document's selection
Definition at line 238 of file vdocument.h.
◆ 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
-
layer the layer to set active
Definition at line 193 of file vdocument.cpp.
◆ setHeight()
|
inline |
Sets document height.
- Parameters
-
height the new document height
Definition at line 118 of file vdocument.h.
◆ setObjectName()
|
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.
◆ setSelectionMode()
|
inline |
Sets the selection mode.
- Parameters
-
mode the new selection mode
Definition at line 253 of file vdocument.h.
◆ setUnit()
|
inline |
Sets document unit.
- Parameters
-
unit the new document unit
Definition at line 133 of file vdocument.h.
◆ setWidth()
|
inline |
Sets document width.
- Parameters
-
width the new document width
Definition at line 111 of file vdocument.h.
◆ unit()
|
inline |
◆ width()
|
inline |
The documentation for this class was generated from the following files:
