lib

KoContainerHandler.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 1998, 1999, 2000 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 
00020 #ifndef HANDLER_H
00021 #define HANDLER_H
00022 
00023 #include <qobject.h>
00024 #include <KoDocumentChild.h>
00025 
00026 class QWMatrix;
00027 
00028 class KoView;
00029 class KoPartResizeHandlerPrivate;
00030 class KoPartMoveHandlerPrivate;
00031 
00043 class KOFFICECORE_EXPORT KoEventHandler : public QObject
00044 {
00045     Q_OBJECT
00046 public:
00047     KoEventHandler( QObject* target );
00048     ~KoEventHandler();
00049 
00050     QObject* target();
00051 
00052 private:
00053     QObject* m_target;
00054 };
00055 
00060 class KoPartResizeHandler : public KoEventHandler
00061 {
00062     Q_OBJECT
00063 public:
00064     KoPartResizeHandler( QWidget* widget, const QWMatrix& matrix, KoView* view, KoChild* child,
00065                        KoChild::Gadget gadget, const QPoint& point );
00066     ~KoPartResizeHandler();
00067 
00068 protected:
00069     void repaint(QRegion &rgn);
00070     bool eventFilter( QObject*, QEvent* );
00071 
00072 private:
00073     KoPartResizeHandlerPrivate *d;
00074 };
00075 
00080 class KoPartMoveHandler : public KoEventHandler
00081 {
00082     Q_OBJECT
00083 public:
00084     KoPartMoveHandler( QWidget* widget, const QWMatrix& matrix, KoView* view, KoChild* child,
00085                      const QPoint& point );
00086     ~KoPartMoveHandler();
00087 
00088 protected:
00089     bool eventFilter( QObject*, QEvent* );
00090 
00091 private:
00092     KoPartMoveHandlerPrivate *d;
00093 };
00094 
00109 class KOFFICECORE_EXPORT KoContainerHandler : public KoEventHandler
00110 {
00111     Q_OBJECT
00112 public:
00113     KoContainerHandler( KoView* view, QWidget* widget );
00114     ~KoContainerHandler();
00115 
00116 signals:
00121     void popupMenu( KoChild*, const QPoint& global_pos );
00122 
00126     void deleteChild( KoChild* );
00127 
00128 protected:
00129     bool eventFilter( QObject*, QEvent* );
00130 
00131 private:
00133     KoChild *child(KoChild::Gadget &gadget, QPoint &pos, const QMouseEvent *ev);
00134     KoView* m_view;
00135 };
00136 
00137 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys