lib Library API Documentation

KoChild Class Reference

KoChild is an abstract base class that represents the geometry associated with an embedded document. More...

#include <koChild.h>

Inheritance diagram for KoChild:

QObject KoDocumentChild KoViewChild List of all members.

Public Types

enum  Gadget {
  NoGadget, TopLeft, TopMid, TopRight,
  MidLeft, MidRight, BottomLeft, BottomMid,
  BottomRight, Move
}

Signals

void changed (KoChild *thisChild)

Public Member Functions

 KoChild (QObject *parent=0, const char *name=0)
virtual void setGeometry (const QRect &rect, bool noEmit=false)
virtual QRect geometry () const
virtual QRegion region (const QWMatrix &=QWMatrix()) const
virtual QPointArray pointArray (const QWMatrix &matrix=QWMatrix()) const
virtual bool contains (const QPoint &) const
virtual QRect boundingRect (const QWMatrix &matrix=QWMatrix()) const
virtual void setScaling (double x, double y)
virtual double xScaling () const
virtual double yScaling () const
virtual void setShearing (double x, double y)
virtual double xShearing () const
virtual double yShearing () const
virtual void setRotation (double)
virtual double rotation () const
virtual void setRotationPoint (const QPoint &pos)
virtual QPoint rotationPoint () const
virtual bool isRectangle () const
virtual void setClipRegion (QPainter &painter, bool combine=true)
virtual void transform (QPainter &painter)
void setContentsPos (int x, int y)
virtual QRect contentRect () const
virtual QRegion frameRegion (const QWMatrix &matrix, bool solid=false) const
virtual QPointArray framePointArray (const QWMatrix &matrix=QWMatrix()) const
virtual QWMatrix matrix () const
virtual void lock ()
virtual void unlock ()
bool locked () const
virtual QPointArray oldPointArray (const QWMatrix &matrix)
virtual void setTransparent (bool transparent)
virtual bool isTransparent () const
virtual Gadget gadgetHitTest (const QPoint &p, const QWMatrix &matrix)

Protected Member Functions

virtual QPointArray pointArray (const QRect &r, const QWMatrix &matrix) const
virtual void updateMatrix ()

Detailed Description

KoChild is an abstract base class that represents the geometry associated with an embedded document.

In general it handles its position relative to the embedded documents parent.

In detail it handles size, matrix operations and can give you a clip region. It can deal with scaling, rotation etc. because it makes heavy usage of QWMatrix.

See also:
KoDocumentChild

Definition at line 36 of file koChild.h.


Member Function Documentation

void KoChild::setGeometry const QRect rect,
bool  noEmit = false
[virtual]
 

Sets a new geometry for this child document.

Use noEmit = true if you do not want the 'changed'-signal to be emitted

Definition at line 72 of file koChild.cc.

References setGeometry().

Referenced by setGeometry().

QRect KoChild::geometry  )  const [virtual]
 

Returns:
the rectangle that would be used to display this child document if the child is not rotated or subject to some other geometric transformation. The rectangle is in the coordinate system of the parent.
See also:
setGeometry

Definition at line 92 of file koChild.cc.

Referenced by KoDocumentChild::save().

QRegion KoChild::region const QWMatrix = QWMatrix()  )  const [virtual]
 

Returns:
the region of this child part relative to the coordinate system of the parent. The region is transformed with the passed matrix.

Definition at line 97 of file koChild.cc.

References pointArray(), and region().

Referenced by contains(), region(), and setClipRegion().

QPointArray KoChild::pointArray const QWMatrix matrix = QWMatrix()  )  const [virtual]
 

Returns:
the polygon which surrounds the child part. The points are in coordinates of the parent. The points are transformed with the passed matrix.

Definition at line 102 of file koChild.cc.

References pointArray().

Referenced by boundingRect(), pointArray(), and region().

bool KoChild::contains const QPoint  )  const [virtual]
 

Tests whether the part contains a certain point.

The point is in the coordinate system of the parent.

Definition at line 107 of file koChild.cc.

References contains(), and region().

Referenced by contains().

QRect KoChild::boundingRect const QWMatrix matrix = QWMatrix()  )  const [virtual]
 

Returns:
the effective bounding rect after all transformations. The coordinates of the rectangle are in the coordinate system of the parent.

Definition at line 112 of file koChild.cc.

References boundingRect(), and pointArray().

Referenced by boundingRect().

void KoChild::setScaling double  x,
double  y
[virtual]
 

Scales the content of the child part.

However, that does not affect the size of the child part.

Definition at line 131 of file koChild.cc.

References setScaling().

Referenced by setScaling().

double KoChild::xScaling  )  const [virtual]
 

Returns:
the x axis scaling of the child part

Definition at line 149 of file koChild.cc.

Referenced by KoDocument::paintChild().

double KoChild::yScaling  )  const [virtual]
 

Returns:
the y axis scaling of the child part

Definition at line 154 of file koChild.cc.

Referenced by KoDocument::paintChild().

void KoChild::setShearing double  x,
double  y
[virtual]
 

Shears the content of the child part.

Definition at line 159 of file koChild.cc.

References setShearing().

Referenced by setShearing().

double KoChild::xShearing  )  const [virtual]
 

Returns:
the x axis shearing of the child part

Definition at line 173 of file koChild.cc.

double KoChild::yShearing  )  const [virtual]
 

Returns:
the y axis shearing of the child part

Definition at line 178 of file koChild.cc.

void KoChild::setRotation double   )  [virtual]
 

Sets the angle of rotation.

Definition at line 183 of file koChild.cc.

References setRotation().

Referenced by setRotation().

double KoChild::rotation  )  const [virtual]
 

Returns:
the angle of rotation

Definition at line 195 of file koChild.cc.

void KoChild::setRotationPoint const QPoint pos  )  [virtual]
 

Sets the center of the rotation to the point pos.

Definition at line 200 of file koChild.cc.

References setRotationPoint().

Referenced by setRotationPoint().

QPoint KoChild::rotationPoint  )  const [virtual]
 

Returns:
the center of the rotation

Definition at line 212 of file koChild.cc.

bool KoChild::isRectangle  )  const [virtual]
 

Returns:
true if the child part is an orthogonal rectangle relative to its parents coordinate system.

Definition at line 117 of file koChild.cc.

Referenced by KoView::partActivateEvent().

void KoChild::setClipRegion QPainter painter,
bool  combine = true
[virtual]
 

Sets the clip region of the painter, so that only pixels of the child part can be drawn.

Parameters:
combine tells whether the new clip region is an intersection of the current region with the childs region or whether only the childs region is set.

Definition at line 122 of file koChild.cc.

References region(), and setClipRegion().

Referenced by setClipRegion(), and transform().

void KoChild::transform QPainter painter  )  [virtual]
 

Transforms the painter (its worldmatrix and the clipping) in such a way that the painter can be passed to the child part for drawing.

Definition at line 217 of file koChild.cc.

References setClipRegion(), and transform().

Referenced by KoDocument::paintChild(), and transform().

QRect KoChild::contentRect  )  const [virtual]
 

Returns:
the contents rectangle that is visible. This value depends on the scaling and the geometry.
See also:
xScaling geometry

Definition at line 233 of file koChild.cc.

Referenced by KoDocument::paintChild().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for lib Library Version 1.3.3.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Tue Sep 28 04:04:04 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003