lib

KoChild.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
00003 
00004    This library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Library General Public
00006    License as published by the Free Software Foundation; either
00007    version 2 of the License, or (at your option) any later version.
00008 
00009    This library is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012    Library General Public License for more details.
00013 
00014    You should have received a copy of the GNU Library General Public License
00015    along with this library; see the file COPYING.LIB.  If not, write to
00016    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017  * Boston, MA 02110-1301, USA.
00018 */
00019 #ifndef __koChild_h__
00020 #define __koChild_h__
00021 
00022 #include <qobject.h>
00023 #include <qwmatrix.h>
00024 #include <koffice_export.h>
00025 
00041 class KOFFICECORE_EXPORT KoChild : public QObject
00042 {
00043   Q_OBJECT
00044 public:
00045 
00055   enum Gadget { NoGadget, TopLeft, TopMid, TopRight, MidLeft, MidRight,
00056         BottomLeft, BottomMid, BottomRight, Move };
00057 
00058   KoChild( QObject *parent = 0, const char *name = 0 );
00059   virtual ~KoChild();
00060 
00065   void setGeometry( const QRect &rect, bool noEmit = false );
00066 
00076   QRect geometry() const;
00077 
00084   virtual QRegion region( const QWMatrix& = QWMatrix() ) const;
00085 
00092   virtual QPointArray pointArray( const QWMatrix &matrix = QWMatrix() ) const;
00093 
00098   //virtual bool contains( const QPoint& ) const;
00099 
00105   QRect boundingRect() const;
00106 
00111   virtual void setScaling( double x, double y );
00112 
00116   virtual double xScaling() const;
00117 
00121   virtual double yScaling() const;
00122 
00126   virtual void setShearing( double x, double y );
00127 
00131   virtual double xShearing() const;
00132 
00136   virtual double yShearing() const;
00137 
00141   virtual void setRotation( double );
00142 
00146   virtual double rotation() const;
00147 
00151   virtual void setRotationPoint( const QPoint& pos );
00152 
00156   virtual QPoint rotationPoint() const;
00157 
00162   bool isRectangle() const;
00163 
00173   virtual void setClipRegion( QPainter& painter, bool combine = true );
00174 
00180   virtual void transform( QPainter& painter );
00181 
00187   virtual void setContentsPos( int x, int y );
00188 
00196   virtual QRect contentRect() const;
00197 
00203   virtual QRegion frameRegion( const QWMatrix& matrix = QWMatrix(), bool solid = false ) const;
00204 
00209   virtual QPointArray framePointArray( const QWMatrix &matrix = QWMatrix() ) const;
00210 
00217   virtual QWMatrix matrix() const;
00218 
00228   void lock();
00229 
00233   void unlock();
00234 
00246   bool locked() const;
00247 
00251   virtual QPointArray oldPointArray( const QWMatrix &matrix );
00252 
00260   virtual void setTransparent( bool transparent );
00261 
00267   virtual bool isTransparent() const;
00268 
00278   virtual Gadget gadgetHitTest( const QPoint& p );
00279 
00280 signals:
00281 
00287   void changed( KoChild *thisChild );
00288 
00289 protected:
00290 
00298   virtual QPointArray pointArray( const QRect& r, const QWMatrix& matrix = QWMatrix() ) const;
00299 
00305   virtual void updateMatrix();
00306 private:
00307 
00308   class KoChildPrivate;
00309   KoChildPrivate *d;
00310 };
00311 
00312 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys