#include <KoChild.h>
Public Types | |
| enum | Gadget { NoGadget , TopLeft , TopMid , TopRight , MidLeft , MidRight , BottomLeft , BottomMid , BottomRight , Move } |
Signals | |
| void | changed (KoChild *thisChild) |
Public Member Functions | |
| KoChild (TQObject *parent=0, const char *name=0) | |
| void | setGeometry (const TQRect &rect, bool noEmit=false) |
| TQRect | geometry () const |
| virtual TQRegion | region (const TQWMatrix &=TQWMatrix()) const |
| virtual TQPointArray | pointArray (const TQWMatrix &matrix=TQWMatrix()) const |
| TQRect | boundingRect () 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 TQPoint &pos) |
| virtual TQPoint | rotationPoint () const |
| bool | isRectangle () const |
| virtual void | setClipRegion (TQPainter &painter, bool combine=true) |
| virtual void | transform (TQPainter &painter) |
| virtual void | setContentsPos (int x, int y) |
| virtual TQRect | contentRect () const |
| virtual TQRegion | frameRegion (const TQWMatrix &matrix=TQWMatrix(), bool solid=false) const |
| virtual TQPointArray | framePointArray (const TQWMatrix &matrix=TQWMatrix()) const |
| virtual TQWMatrix | matrix () const |
| void | lock () |
| void | unlock () |
| bool | locked () const |
| virtual TQPointArray | oldPointArray (const TQWMatrix &matrix) |
| virtual void | setTransparent (bool transparent) |
| virtual bool | isTransparent () const |
| virtual Gadget | gadgetHitTest (const TQPoint &p) |
Protected Member Functions | |
| virtual TQPointArray | pointArray (const TQRect &r, const TQWMatrix &matrix=TQWMatrix()) 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 document's 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 TQWMatrix.
After applying the matrix, viewGeometry() applies zooming, but can be reimplemented to also apply e.g. some translation by the application (e.g. for centering the page).
- See also
- KoDocumentChild KoViewChild
Member Enumeration Documentation
◆ Gadget
| enum KoChild::Gadget |
The gadget generally identifies where a child has been hit (generally by the mouse pointer).
Based on this information different actions can be taken, for example moving the child or opening a context menu. NoGadget means that this child has not been hit.
- See also
- gadgetHitTest
Constructor & Destructor Documentation
◆ KoChild()
| KoChild::KoChild | ( | TQObject * | parent = 0, |
| const char * | name = 0 ) |
Definition at line 53 of file KoChild.cpp.
◆ ~KoChild()
|
virtual |
Definition at line 67 of file KoChild.cpp.
Member Function Documentation
◆ boundingRect()
| TQRect KoChild::boundingRect | ( | ) | const |
Tests whether the part contains a certain point.
The point is in the coordinate system of the parent.
- 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.cpp.
◆ changed
|
signal |
Emitted every time this child changes, but only if this child is not locked.
- See also
- locked
◆ contentRect()
|
virtual |
- Returns
- the contents rectangle that is visible. This value depends on the scaling and the geometry. This is the value that is passed to KoDocument::paintContent.
Definition at line 233 of file KoChild.cpp.
◆ framePointArray()
|
virtual |
- Returns
- the frame geometry including a border (6 pixels) as a point array with 4 points, one for each corner, transformed by given matrix.
Definition at line 239 of file KoChild.cpp.
◆ frameRegion()
|
virtual |
- Returns
- the region of the child frame. If solid is set to true the complete area of the child region is returned, otherwise only the child border is returned.
Definition at line 244 of file KoChild.cpp.
◆ gadgetHitTest()
|
virtual |
Different actions are taken depending on where a child frame is hit.
Two gadgets are known: one for the border (5 pixels) and one for the inner area.
- Returns
- the gadget identification for the hit area.
- Parameters
-
p the hit position.
- See also
- Gadget
Definition at line 339 of file KoChild.cpp.
◆ geometry()
| TQRect KoChild::geometry | ( | ) | const |
- 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, using unzoomed coordinates in points.
- See also
- setGeometry
Definition at line 92 of file KoChild.cpp.
◆ isRectangle()
| bool KoChild::isRectangle | ( | ) | const |
- Returns
- true if the child part is an orthogonal rectangle relative to its parents coordinate system.
Definition at line 117 of file KoChild.cpp.
◆ isTransparent()
|
virtual |
It might be interesting for view updates and repainting in general whether a child is transparent or not.
- Returns
- true when this child is marked as transparent.
Definition at line 334 of file KoChild.cpp.
◆ lock()
| void KoChild::lock | ( | ) |
Locks this child and stores the current transformation.
A locked child does not emit changed signals.
This is useful if a series of changes are done on this child and only the final result is of interest (GUI updating,...).
Definition at line 296 of file KoChild.cpp.
◆ locked()
| bool KoChild::locked | ( | ) | const |
If the child is locked, geometry changes (including scaling, rotation, ...) are not backed up.
As long as this child is locked, the backed up geometry state can be recovered with oldPointArray.
- Returns
- true when this child is locked.
- See also
- locked unlock oldPointArray
Definition at line 314 of file KoChild.cpp.
◆ matrix()
|
virtual |
- Returns
- the current transformation of this child as matrix. This includes translation, scale, rotation, shearing.
- See also
- updateMatrix
Definition at line 291 of file KoChild.cpp.
◆ oldPointArray()
|
virtual |
- Returns
- the backed up geometry transformed by given matrix.
Definition at line 319 of file KoChild.cpp.
◆ pointArray() [1/2]
|
protectedvirtual |
- Returns
- point array with the 4 corners of given rectangle, which is transformed by given matrix.
- Parameters
-
matrix the transformation of r. r the rectangle for which the point array should be created.
Definition at line 256 of file KoChild.cpp.
◆ pointArray() [2/2]
|
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.cpp.
◆ region()
|
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.cpp.
◆ rotation()
|
virtual |
- Returns
- the angle of rotation
Definition at line 195 of file KoChild.cpp.
◆ rotationPoint()
|
virtual |
- Returns
- the center of the rotation
Definition at line 212 of file KoChild.cpp.
◆ setClipRegion()
|
virtual |
Sets the clip region of the painter, so that only pixels of the child part can be drawn.
- Parameters
-
painter the painter do modify. 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.cpp.
◆ setContentsPos()
|
virtual |
Sets the position of the content relative to the child frame.
This can be used to create a border between the frame border and the actual content.
Definition at line 227 of file KoChild.cpp.
◆ setGeometry()
| void KoChild::setGeometry | ( | const TQRect & | rect, |
| bool | noEmit = false ) |
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.cpp.
◆ setRotation()
|
virtual |
Sets the angle of rotation.
Definition at line 183 of file KoChild.cpp.
◆ setRotationPoint()
|
virtual |
Sets the center of the rotation to the point pos.
Definition at line 200 of file KoChild.cpp.
◆ setScaling()
|
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.cpp.
◆ setShearing()
|
virtual |
Shears the content of the child part.
Definition at line 159 of file KoChild.cpp.
◆ setTransparent()
|
virtual |
Marks this child as either transparent or not.
- Parameters
-
transparent set this child to transparent (true) or opaque (false).
- See also
- isTransparent
Definition at line 329 of file KoChild.cpp.
◆ transform()
|
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.cpp.
◆ unlock()
| void KoChild::unlock | ( | ) |
Unlocks this child and emits a changed signal.
Definition at line 305 of file KoChild.cpp.
◆ updateMatrix()
|
protectedvirtual |
Stores the current transformation of this child into a matrix.
- See also
- matrix
Definition at line 275 of file KoChild.cpp.
◆ xScaling()
|
virtual |
- Returns
- the x axis scaling of the child part
Definition at line 149 of file KoChild.cpp.
◆ xShearing()
|
virtual |
- Returns
- the x axis shearing of the child part
Definition at line 173 of file KoChild.cpp.
◆ yScaling()
|
virtual |
- Returns
- the y axis scaling of the child part
Definition at line 154 of file KoChild.cpp.
◆ yShearing()
|
virtual |
- Returns
- the y axis shearing of the child part
Definition at line 178 of file KoChild.cpp.
The documentation for this class was generated from the following files:
