lib Library API Documentation

handler.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., 59 Temple Place - Suite 330,
00017    Boston, MA 02111-1307, 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 PartResizeHandlerPrivate;
00030 class PartMoveHandlerPrivate;
00031 
00043 class EventHandler : public QObject
00044 {
00045     Q_OBJECT
00046 public:
00047     EventHandler( QObject* target );
00048     ~EventHandler();
00049 
00050     QObject* target();
00051 
00052 private:
00053     QObject* m_target;
00054 };
00055 
00060 class PartResizeHandler : public EventHandler
00061 {
00062     Q_OBJECT
00063 public:
00064     PartResizeHandler( QWidget* widget, const QWMatrix& matrix, KoView* view, KoChild* child,
00065                        KoChild::Gadget gadget, const QPoint& point );
00066     ~PartResizeHandler();
00067 
00068 protected:
00069     void repaint(QRegion &rgn);
00070     bool eventFilter( QObject*, QEvent* );
00071 
00072 private:
00073     PartResizeHandlerPrivate *d;
00074 };
00075 
00080 class PartMoveHandler : public EventHandler
00081 {
00082     Q_OBJECT
00083 public:
00084     PartMoveHandler( QWidget* widget, const QWMatrix& matrix, KoView* view, KoChild* child,
00085                      const QPoint& point );
00086     ~PartMoveHandler();
00087 
00088 protected:
00089     bool eventFilter( QObject*, QEvent* );
00090 
00091 private:
00092     PartMoveHandlerPrivate *d;
00093 };
00094 
00109 class ContainerHandler : public EventHandler
00110 {
00111     Q_OBJECT
00112 public:
00113     ContainerHandler( KoView* view, QWidget* widget );
00114     ~ContainerHandler();
00115 
00116 signals:
00121     void popupMenu( KoChild*, const QPoint& global_pos );
00122     
00123 protected:
00124     bool eventFilter( QObject*, QEvent* );
00125 
00126 private:
00127     // This is a little helper function to get rid of some duplicated code
00128     KoChild *child(KoChild::Gadget &gadget, QPoint &pos, const QMouseEvent *ev);
00129     KoView* m_view;
00130 };
00131 
00132 #endif
KDE Logo
This file is part of the documentation for lib Library Version 1.3.5.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sun Mar 20 14:25:23 2005 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003