kig
#include <object_holder.h>
Detailed Description
An ObjectHolder represents an object as it is known to the document.
It keeps a pointer to an ObjectCalcer, where it gets its data ( the ObjectImp that the ObjectCalcer holds ) from. It also holds information about how to draw this ObjectImp on the window, by keeping a pointer to an ObjectDrawer ( see below ). In its draw method, it gets the ObjectImp from the ObjectCalcer, and passes it to the ObjectDrawer, asking it to draw the ObjectImp on the window.
The document ( check the KigDocument class ) holds a list of these ObjectHolder's. This is its only link with the ObjectCalcer dependency graph.
An ObjectHolder keeps a reference to its * ObjectCalcer.
Definition at line 40 of file object_holder.h.
Constructor & Destructor Documentation
ObjectHolder::ObjectHolder | ( | ObjectCalcer * | calcer, |
ObjectDrawer * | drawer, | ||
ObjectConstCalcer * | namecalcer | ||
) |
Construct a new ObjectHolder with a given ObjectCalcer and ObjectDrawer, with a given name calcer.
Definition at line 31 of file object_holder.cc.
ObjectHolder::ObjectHolder | ( | ObjectCalcer * | calcer, |
ObjectDrawer * | drawer | ||
) |
Construct a new ObjectHolder with a given ObjectCalcer and ObjectDrawer.
Definition at line 38 of file object_holder.cc.
ObjectHolder::ObjectHolder | ( | ObjectCalcer * | calcer | ) |
equivalent to the previous constructor, but with a default ObjectDrawer and no name.
Definition at line 26 of file object_holder.cc.
ObjectHolder::~ObjectHolder | ( | ) |
Definition at line 43 of file object_holder.cc.
Member Function Documentation
void ObjectHolder::calc | ( | const KigDocument & | d | ) |
Make our ObjectCalcer recalculate its ObjectImp.
Definition at line 73 of file object_holder.cc.
const ObjectCalcer * ObjectHolder::calcer | ( | ) | const |
Definition at line 53 of file object_holder.cc.
ObjectCalcer * ObjectHolder::calcer | ( | ) |
Definition at line 93 of file object_holder.cc.
bool ObjectHolder::canMove | ( | ) | const |
This call is simply forwarded to the ObjectCalcer.
Check the documentation of ObjectCalcer::canMove() for more info.
Definition at line 118 of file object_holder.cc.
bool ObjectHolder::contains | ( | const Coordinate & | p, |
const KigWidget & | w, | ||
bool | nv = false |
||
) | const |
Returns whether this object contains the point p
.
Definition at line 83 of file object_holder.cc.
void ObjectHolder::draw | ( | KigPainter & | p, |
bool | selected | ||
) | const |
Draw this object on the given KigPainter.
If selected
is true, then it will be drawn in red, instead of its normal color.
Definition at line 78 of file object_holder.cc.
const ObjectDrawer * ObjectHolder::drawer | ( | ) | const |
Definition at line 58 of file object_holder.cc.
ObjectDrawer * ObjectHolder::drawer | ( | ) |
Definition at line 98 of file object_holder.cc.
const ObjectImp * ObjectHolder::imp | ( | ) | const |
Definition at line 48 of file object_holder.cc.
Returns whether this object is in the rectangle r
.
Definition at line 88 of file object_holder.cc.
bool ObjectHolder::isFreelyTranslatable | ( | ) | const |
This call is simply forwarded to the ObjectCalcer.
Check the documentation of ObjectCalcer::isFreelyTranslatable() for more info.
Definition at line 123 of file object_holder.cc.
void ObjectHolder::move | ( | const Coordinate & | to, |
const KigDocument & | doc | ||
) |
This call is simply forwarded to the ObjectCalcer.
Check the documentation of ObjectCalcer::move() for more info.
Definition at line 113 of file object_holder.cc.
const Coordinate ObjectHolder::moveReferencePoint | ( | ) | const |
This call is simply forwarded to the ObjectCalcer.
Check the documentation of ObjectCalcer::moveReferencePoint() for more info.
Definition at line 108 of file object_holder.cc.
const QString ObjectHolder::name | ( | ) | const |
returns a null QString if no name is set.
Definition at line 140 of file object_holder.cc.
const ObjectConstCalcer * ObjectHolder::nameCalcer | ( | ) | const |
Definition at line 63 of file object_holder.cc.
ObjectConstCalcer * ObjectHolder::nameCalcer | ( | ) |
Definition at line 103 of file object_holder.cc.
QString ObjectHolder::selectStatement | ( | ) | const |
Return a statement saying something like "select this segment" or "select segment ab" depending on whether this ObjectHolder has a name.
Definition at line 157 of file object_holder.cc.
void ObjectHolder::setDrawer | ( | ObjectDrawer * | d | ) |
Set the ObjectDrawer of this ObjectHolder to d
, the old ObjectDrawer is deleted.
Definition at line 68 of file object_holder.cc.
void ObjectHolder::setNameCalcer | ( | ObjectConstCalcer * | namecalcer | ) |
Setting the namecalcer is only allowed if previously none was set.
This way, we avoid keeping a useless namecalcer around if no name is set.
Definition at line 151 of file object_holder.cc.
bool ObjectHolder::shown | ( | ) | const |
Returns whether this object is shown.
Definition at line 135 of file object_holder.cc.
ObjectDrawer * ObjectHolder::switchDrawer | ( | ObjectDrawer * | d | ) |
Set the ObjectDrawer of this ObjectHolder to d
, the old ObjectDrawer is not deleted, but returned.
Definition at line 128 of file object_holder.cc.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:12:06 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.