karbon
VObject Class Reference
#include <vobject.h>
Inheritance diagram for VObject:

Detailed Description
The base class for all karbon objects.Every object should have the ability to draw itself using a painter, perform hit detection, transform on demand, clone and load/save itself. Also each object manages its own bounding box and keeps track of its parent object.
Definition at line 49 of file vobject.h.
Public Types | |
enum | VState { normal = 0, normal_locked = 1, hidden = 2, hidden_locked = 3, deleted = 4, selected = 5, edit = 6 } |
Public Member Functions | |
VObject (VObject *parent, VState state=edit) | |
VObject (const VObject &obj) | |
virtual | ~VObject () |
virtual DCOPObject * | dcopObject () |
virtual void | draw (VPainter *painter, const KoRect *rect=0L) const |
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 | save (QDomElement &element) const |
virtual void | saveOasis (KoStore *store, KoXmlWriter *docWriter, KoGenStyles &mainStyles, int &index) const |
virtual void | load (const QDomElement &element) |
virtual bool | loadOasis (const QDomElement &element, KoOasisLoadingContext &context) |
virtual VObject * | clone () const =0 |
virtual void | accept (VVisitor &) |
virtual void | insertInfrontOf (VObject *newObject, VObject *oldObject) |
virtual QString | name () const |
void | setName (const QString &s) |
VDocument * | document () const |
Protected Member Functions | |
void | addStyles (const QDomElement *style, KoOasisLoadingContext &context) |
virtual void | saveOasisFill (KoGenStyles &mainStyles, KoGenStyle &stylesojectauto) const |
Protected Attributes | |
KoRect | m_boundingBox |
VState | m_state: 8 |
bool | m_boundingBoxIsInvalid: 1 |
VStroke * | m_stroke |
VFill * | m_fill |
DCOPObject * | m_dcop |
Member Enumeration Documentation
|
|
Constructor & Destructor Documentation
|
Constructs a new object that is child of parent and has the given state.
Definition at line 36 of file vobject.cc. |
|
Copy constructor. Copies parent, state and name of given object.
Definition at line 47 of file vobject.cc. |
|
Destroys the object and deletes the stroke, fill and DCOP-object.
Definition at line 67 of file vobject.cc. |
Member Function Documentation
|
Accept a VVisitor.
Reimplemented in VPath, VDocument, VGroup, VImage, VLayer, VSubpath, VSelection, VText, and VShadowDecorator. |
|
Adds a new given style to the specified OASIS context.
Definition at line 204 of file vobject.cc. |
|
Calculates the tightest bounding box around the object.
Reimplemented in VPath, VGroup, VSubpath, VSelection, VText, and VShadowDecorator. |
|
Checks if the bounding box is invalid and needs to be recalculated.
|
|
Create an exact copy of this object.
Implemented in VClipGroup, VPath, VDocument, VGroup, VImage, VLayer, VSubpath, VSelection, VText, VShadowDecorator, VEllipse, VPolygon, VPolyline, VRectangle, VSinus, VSpiral, and VStar. |
|
Returns pointer to internal DCOP object. If no internal DCOP object exist yet, it is created. Reimplemented in VPath, VLayer, and VText. Definition at line 75 of file vobject.cc. |
|
Return document the object belongs to.
Definition at line 216 of file vobject.cc. |
|
Draw the object to a painting device.
Reimplemented in VClipGroup, VPath, VDocument, VGroup, VImage, VLayer, VText, and VShadowDecorator. |
|
Gets the object's actual fill.
Reimplemented in VShadowDecorator. |
|
This function is important for undo/redo. It inserts newObject in front of oldObject.
Reimplemented in VGroup. |
|
Invalidates the bounding box, so it has to be recalculated. This function is public so visitors can access it themself at the right time when they manipulate many VSegments. |
|
Load this object's state from xml and initialize this object accordingly.
Reimplemented in VClipGroup, VPath, VDocument, VGroup, VImage, VLayer, VSubpath, VText, VShadowDecorator, VEllipse, VPolygon, VPolyline, VRectangle, VSinus, VSpiral, and VStar. Definition at line 157 of file vobject.cc. |
|
Load this object's state from OpenDocument and initialize this object accordingly.
Reimplemented in VPath, VDocument, VGroup, VEllipse, VPolygon, VPolyline, and VRectangle. Definition at line 181 of file vobject.cc. |
|
Returns the name of the object.
Reimplemented in VEllipse, VPolygon, VPolyline, VRectangle, VSinus, VSpiral, and VStar. Definition at line 225 of file vobject.cc. |
|
Returns pointer to current parent object.
|
|
Save this object's state to xml.
Reimplemented in VClipGroup, VPath, VDocument, VGroup, VImage, VLayer, VSubpath, VText, VShadowDecorator, VEllipse, VPolygon, VPolyline, VRectangle, VSinus, VSpiral, and VStar. Definition at line 102 of file vobject.cc. |
|
Save this object's state to OpenDocument.
Reimplemented in VPath, VGroup, VLayer, VEllipse, VPolygon, VPolyline, and VRectangle. Definition at line 116 of file vobject.cc. |
|
Sets the fill to a given new fill.
Reimplemented in VGroup, and VShadowDecorator. Definition at line 93 of file vobject.cc. |
|
Sets the object's name to a given new name.
Definition at line 231 of file vobject.cc. |
|
Sets a new parent object.
|
|
Sets the state to a specified new state. Note that this will not have any visual effect until draw() is called on this object.
Reimplemented in VGroup, VText, and VShadowDecorator. |
|
Sets the stroke to a given new stroke.
Reimplemented in VGroup, and VShadowDecorator. Definition at line 84 of file vobject.cc. |
|
Get the state the object is in.
Reimplemented in VShadowDecorator. |
|
Gets the object's actual stroke.
Reimplemented in VShadowDecorator. |
Member Data Documentation
|
the object's bounding box
|
|
the flag stating if the bounding box is valid
|
|
the object's DCOP object
|
|
the object's fill
|
|
the object's state
|
|
the object's stroke
|
The documentation for this class was generated from the following files: