karbon

#include <vgroup.h>

Inheritance diagram for VGroup:
VObject VClipGroup VLayer

Public Member Functions

 VGroup (VObject *parent, VState state=normal)
 
 VGroup (const VGroup &group)
 
virtual ~VGroup ()
 
virtual void draw (VPainter *painter, const KoRect *rect=0L) const
 
virtual const KoRect & boundingBox () const
 
virtual void setStroke (const VStroke &stroke)
 
virtual void setFill (const VFill &fill)
 
virtual void setState (const VState state)
 
virtual void save (TQDomElement &element) const
 
virtual void saveOasis (KoStore *store, KoXmlWriter *docWriter, KoGenStyles &mainStyles, int &index) const
 
virtual void load (const TQDomElement &element)
 
virtual bool loadOasis (const TQDomElement &element, KoOasisLoadingContext &context)
 
virtual VGroup * clone () const
 
virtual void accept (VVisitor &visitor)
 
void take (const VObject &object)
 
void append (VObject *object)
 
virtual void insertInfrontOf (VObject *newObject, VObject *oldObject)
 
void clear ()
 
const VObjectList & objects () const
 
- Public Member Functions inherited from VObject
 VObject (VObject *parent, VState state=edit)
 
 VObject (const VObject &obj)
 
virtual ~VObject ()
 
virtual DCOPObject * dcopObject ()
 
bool boundingBoxIsInvalid () const
 
void invalidateBoundingBox ()
 
void setParent (VObject *parent)
 
VObject * parent () const
 
VState state () const
 
virtual VStroke * stroke () const
 
virtual VFill * fill () const
 
virtual TQString name () const
 
void setName (const TQString &s)
 
VDocument * document () const
 

Protected Attributes

VObjectList m_objects
 
- 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
 

Additional Inherited Members

- Public Types inherited from VObject
enum  VState {
  normal = 0 , normal_locked = 1 , hidden = 2 , hidden_locked = 3 ,
  deleted = 4 , selected = 5 , edit = 6
}
 
- Protected Member Functions inherited from VObject
void addStyles (const TQDomElement *style, KoOasisLoadingContext &context)
 
virtual void saveOasisFill (KoGenStyles &mainStyles, KoGenStyle &stylesojectauto) const
 

Detailed Description

Base class for all sort of VObject conglomerats.

Definition at line 34 of file vgroup.h.

Constructor & Destructor Documentation

◆ VGroup() [1/2]

VGroup::VGroup ( VObject *  parent,
VState  state = normal 
)

Constructs a new group object that is child of parent and has the given state.

The object's fill and stroke are created here.

Parameters
parentthe new object's parent
statethe new object's state

Definition at line 54 of file vgroup.cpp.

◆ VGroup() [2/2]

VGroup::VGroup ( const VGroup &  group)

Copy constructor.

Parameters
groupthe group to copy properties from

Definition at line 61 of file vgroup.cpp.

◆ ~VGroup()

VGroup::~VGroup ( )
virtual

Destroys the group and all of the child objects.

Definition at line 73 of file vgroup.cpp.

Member Function Documentation

◆ accept()

void VGroup::accept ( VVisitor &  )
virtual

Accept a VVisitor.

Reimplemented from VObject.

Reimplemented in VLayer.

Definition at line 357 of file vgroup.cpp.

◆ append()

void VGroup::append ( VObject *  object)

Appends a new child object.

Parameters
objectthe object to append

Definition at line 372 of file vgroup.cpp.

◆ boundingBox()

const KoRect & VGroup::boundingBox ( ) const
virtual

Calculates the tightest bounding box around the object.

Returns
the bounding box.

Reimplemented from VObject.

Definition at line 100 of file vgroup.cpp.

◆ clear()

void VGroup::clear ( )

Clears the group, without destroying the grouped objects.

Definition at line 392 of file vgroup.cpp.

◆ clone()

VGroup * VGroup::clone ( ) const
virtual

Create an exact copy of this object.

Returns
the exact object copy

Implements VObject.

Reimplemented in VClipGroup, and VLayer.

Definition at line 120 of file vgroup.cpp.

◆ draw()

void VGroup::draw ( VPainter *  painter,
const KoRect *  rect = 0L 
) const
virtual

Draw the object to a painting device.

Parameters
painterabstraction that is used to render to a painting device.
rectrepresents the visible rectangular area. If this object doesn't intersect with this area it is not drawn.

Reimplemented from VObject.

Reimplemented in VClipGroup, and VLayer.

Definition at line 83 of file vgroup.cpp.

◆ insertInfrontOf()

void VGroup::insertInfrontOf ( VObject *  newObject,
VObject *  oldObject 
)
virtual

This function is important for undo/redo.

It inserts newObject in front of oldObject.

Parameters
newObjectthe new object to insert
oldObjectthe old object the new object is inserted in front of

Reimplemented from VObject.

Definition at line 382 of file vgroup.cpp.

◆ load()

void VGroup::load ( const TQDomElement &  element)
virtual

Load this object's state from xml and initialize this object accordingly.

Parameters
elementthe DOM element from which the attributes are read

Reimplemented from VObject.

Reimplemented in VClipGroup, and VLayer.

Definition at line 263 of file vgroup.cpp.

◆ loadOasis()

bool VGroup::loadOasis ( const TQDomElement &  element,
KoOasisLoadingContext &  context 
)
virtual

Load this object's state from OpenDocument and initialize this object accordingly.

Parameters
elementthe DOM element to read attributes from
contextFIXME

Reimplemented from VObject.

Definition at line 196 of file vgroup.cpp.

◆ objects()

const VObjectList & VGroup::objects ( ) const
inline

Read only access to the grouped objects.

Returns
reference to the list of grouped objects

Definition at line 110 of file vgroup.h.

◆ save()

void VGroup::save ( TQDomElement &  element) const
virtual

Save this object's state to xml.

Parameters
elementthe DOM element to which the attributes are saved

Reimplemented from VObject.

Reimplemented in VClipGroup, and VLayer.

Definition at line 160 of file vgroup.cpp.

◆ saveOasis()

void VGroup::saveOasis ( KoStore *  store,
KoXmlWriter *  docWriter,
KoGenStyles &  mainStyles,
int &  index 
) const
virtual

Save this object's state to OpenDocument.

Parameters
storeFIXME
docWriterFIXME
mainStylesFIXME

Reimplemented from VObject.

Reimplemented in VLayer.

Definition at line 178 of file vgroup.cpp.

◆ setFill()

void VGroup::setFill ( const VFill &  fill)
virtual

Sets the fill to a given new fill.

Parameters
fillthe new fill

Reimplemented from VObject.

Definition at line 126 of file vgroup.cpp.

◆ setState()

void VGroup::setState ( const VState  state)
virtual

Sets the state to a specified new state.

Note that this will not have any visual effect until draw() is called on this object.

Parameters
statethe new state.

Reimplemented from VObject.

Definition at line 148 of file vgroup.cpp.

◆ setStroke()

void VGroup::setStroke ( const VStroke &  stroke)
virtual

Sets the stroke to a given new stroke.

Parameters
strokethe new stroke

Reimplemented from VObject.

Definition at line 137 of file vgroup.cpp.

◆ take()

void VGroup::take ( const VObject &  object)

Removes the reference to child object, not the object itself.

Parameters
objectthe child object to remove

Definition at line 364 of file vgroup.cpp.

Member Data Documentation

◆ m_objects

VObjectList VGroup::m_objects
protected

the list of grouped objects

Definition at line 113 of file vgroup.h.


The documentation for this class was generated from the following files: