KoChild.h
1/* This file is part of the KDE project
2 Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18*/
19#ifndef __koChild_h__
20#define __koChild_h__
21
22#include <tqobject.h>
23#include <tqwmatrix.h>
24#include <koffice_export.h>
25
41class KOFFICECORE_EXPORT KoChild : public TQObject
42{
43 TQ_OBJECT
44
45public:
46
56 enum Gadget { NoGadget, TopLeft, TopMid, TopRight, MidLeft, MidRight,
57 BottomLeft, BottomMid, BottomRight, Move };
58
59 KoChild( TQObject *parent = 0, const char *name = 0 );
60 virtual ~KoChild();
61
66 void setGeometry( const TQRect &rect, bool noEmit = false );
67
77 TQRect geometry() const;
78
85 virtual TQRegion region( const TQWMatrix& = TQWMatrix() ) const;
86
93 virtual TQPointArray pointArray( const TQWMatrix &matrix = TQWMatrix() ) const;
94
99 //virtual bool contains( const TQPoint& ) const;
100
106 TQRect boundingRect() const;
107
112 virtual void setScaling( double x, double y );
113
117 virtual double xScaling() const;
118
122 virtual double yScaling() const;
123
127 virtual void setShearing( double x, double y );
128
132 virtual double xShearing() const;
133
137 virtual double yShearing() const;
138
142 virtual void setRotation( double );
143
147 virtual double rotation() const;
148
152 virtual void setRotationPoint( const TQPoint& pos );
153
157 virtual TQPoint rotationPoint() const;
158
163 bool isRectangle() const;
164
174 virtual void setClipRegion( TQPainter& painter, bool combine = true );
175
181 virtual void transform( TQPainter& painter );
182
188 virtual void setContentsPos( int x, int y );
189
197 virtual TQRect contentRect() const;
198
204 virtual TQRegion frameRegion( const TQWMatrix& matrix = TQWMatrix(), bool solid = false ) const;
205
210 virtual TQPointArray framePointArray( const TQWMatrix &matrix = TQWMatrix() ) const;
211
218 virtual TQWMatrix matrix() const;
219
229 void lock();
230
234 void unlock();
235
247 bool locked() const;
248
252 virtual TQPointArray oldPointArray( const TQWMatrix &matrix );
253
261 virtual void setTransparent( bool transparent );
262
268 virtual bool isTransparent() const;
269
279 virtual Gadget gadgetHitTest( const TQPoint& p );
280
281signals:
282
288 void changed( KoChild *thisChild );
289
290protected:
291
299 virtual TQPointArray pointArray( const TQRect& r, const TQWMatrix& matrix = TQWMatrix() ) const;
300
306 virtual void updateMatrix();
307private:
308
309 class KoChildPrivate;
310 KoChildPrivate *d;
311};
312
313#endif
KoChild is an abstract base class that represents the geometry associated with an embedded document.
Definition KoChild.h:42
void changed(KoChild *thisChild)
Emitted every time this child changes, but only if this child is not locked.
Gadget
The gadget generally identifies where a child has been hit (generally by the mouse pointer).
Definition KoChild.h:56