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 | |
normal = 0 | |
normal_locked = 1 | |
hidden = 2 | |
hidden_locked = 3 | |
deleted = 4 | |
selected = 5 | |
edit = 6 | |
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
enum VObject::VState |
Constructor & Destructor Documentation
Constructs a new object that is child of parent and has the given state.
- Parameters:
-
parent the new object's parent state the new object's state
Definition at line 36 of file vobject.cc.
VObject::VObject | ( | const VObject & | obj | ) |
Copy constructor.
Copies parent, state and name of given object.
- Parameters:
-
obj the object to copy properties from
Definition at line 47 of file vobject.cc.
VObject::~VObject | ( | ) | [virtual] |
Destroys the object and deletes the stroke, fill and DCOP-object.
Definition at line 67 of file vobject.cc.
Member Function Documentation
virtual void VObject::accept | ( | VVisitor & | ) | [inline, virtual] |
void VObject::addStyles | ( | const QDomElement * | style, | |
KoOasisLoadingContext & | context | |||
) | [protected] |
Adds a new given style to the specified OASIS context.
- Parameters:
-
style FIXME context FIXME
Definition at line 204 of file vobject.cc.
virtual const KoRect& VObject::boundingBox | ( | ) | const [inline, virtual] |
Calculates the tightest bounding box around the object.
- Returns:
- the bounding box.
Reimplemented in VPath, VGroup, VSubpath, VSelection, VText, and VShadowDecorator.
bool VObject::boundingBoxIsInvalid | ( | ) | const [inline] |
virtual VObject* VObject::clone | ( | ) | const [pure virtual] |
Create an exact copy of this object.
- Returns:
- the exact object copy
Implemented in VClipGroup, VPath, VDocument, VGroup, VImage, VLayer, VSubpath, VSelection, VText, VShadowDecorator, VEllipse, VPolygon, VPolyline, VRectangle, VSinus, VSpiral, and VStar.
DCOPObject * VObject::dcopObject | ( | ) | [virtual] |
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.
VDocument * VObject::document | ( | ) | const |
Return document the object belongs to.
- Returns:
- pointer to parent document or 0 if object does not belong to a document
Definition at line 216 of file vobject.cc.
virtual void VObject::draw | ( | VPainter * | painter, | |
const KoRect * | rect = 0L | |||
) | const [inline, 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 in VClipGroup, VPath, VDocument, VGroup, VImage, VLayer, VText, and VShadowDecorator.
virtual VFill* VObject::fill | ( | ) | const [inline, virtual] |
Gets the object's actual fill.
- Returns:
- pointer to the object's fill
Reimplemented in VShadowDecorator.
void VObject::invalidateBoundingBox | ( | ) | [inline] |
void VObject::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 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.
bool VObject::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 in VPath, VDocument, VGroup, VEllipse, VPolygon, VPolyline, and VRectangle.
Definition at line 181 of file vobject.cc.
QString VObject::name | ( | ) | const [virtual] |
Returns the name of the object.
- Returns:
- the object's name
Reimplemented in VEllipse, VPolygon, VPolyline, VRectangle, VSinus, VSpiral, and VStar.
Definition at line 225 of file vobject.cc.
VObject* VObject::parent | ( | ) | const [inline] |
void VObject::save | ( | QDomElement & | element | ) | const [virtual] |
Save this object's state to xml.
- Parameters:
-
element the DOM element to which the attributes are saved
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.
void VObject::saveOasis | ( | KoStore * | store, | |
KoXmlWriter * | docWriter, | |||
KoGenStyles & | mainStyles, | |||
int & | index | |||
) | const [virtual] |
Save this object's state to OpenDocument.
- Parameters:
-
store FIXME docWriter FIXME mainStyles FIXME
Reimplemented in VPath, VGroup, VLayer, VEllipse, VPolygon, VPolyline, and VRectangle.
Definition at line 116 of file vobject.cc.
void VObject::setFill | ( | const VFill & | fill | ) | [virtual] |
Sets the fill to a given new fill.
- Parameters:
-
fill the new fill
Reimplemented in VGroup, and VShadowDecorator.
Definition at line 93 of file vobject.cc.
void VObject::setName | ( | const QString & | s | ) |
Sets the object's name to a given new name.
- Parameters:
-
s the new object name
Definition at line 231 of file vobject.cc.
void VObject::setParent | ( | VObject * | parent | ) | [inline] |
virtual void VObject::setState | ( | const VState | state | ) | [inline, virtual] |
void VObject::setStroke | ( | const VStroke & | stroke | ) | [virtual] |
Sets the stroke to a given new stroke.
- Parameters:
-
stroke the new stroke
Reimplemented in VGroup, and VShadowDecorator.
Definition at line 84 of file vobject.cc.
VState VObject::state | ( | ) | const [inline] |
Get the state the object is in.
- Returns:
- the object state at time of calling.
Reimplemented in VShadowDecorator.
virtual VStroke* VObject::stroke | ( | ) | const [inline, virtual] |
Gets the object's actual stroke.
- Returns:
- pointer to the object's stroke
Reimplemented in VShadowDecorator.
Member Data Documentation
KoRect VObject::m_boundingBox [mutable, protected] |
bool VObject::m_boundingBoxIsInvalid [mutable, protected] |
DCOPObject* VObject::m_dcop [protected] |
VFill* VObject::m_fill [protected] |
VState VObject::m_state [mutable, protected] |
VStroke* VObject::m_stroke [protected] |
The documentation for this class was generated from the following files: