KoContainerHandler.h
1/* This file is part of the KDE project
2 Copyright (C) 1998, 1999, 2000 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
20#ifndef HANDLER_H
21#define HANDLER_H
22
23#include <tqobject.h>
24#include <KoDocumentChild.h>
25
26class TQWMatrix;
27
28class KoView;
29class KoPartResizeHandlerPrivate;
30class KoPartMoveHandlerPrivate;
31
43class KOFFICECORE_EXPORT KoEventHandler : public TQObject
44{
45 TQ_OBJECT
46
47public:
48 KoEventHandler( TQObject* target );
50
51 TQObject* target();
52
53private:
54 TQObject* m_target;
55};
56
62{
63 TQ_OBJECT
64
65public:
66 KoPartResizeHandler( TQWidget* widget, const TQWMatrix& matrix, KoView* view, KoChild* child,
67 KoChild::Gadget gadget, const TQPoint& point );
69
70protected:
71 void repaint(TQRegion &rgn);
72 bool eventFilter( TQObject*, TQEvent* );
73
74private:
75 KoPartResizeHandlerPrivate *d;
76};
77
83{
84 TQ_OBJECT
85
86public:
87 KoPartMoveHandler( TQWidget* widget, const TQWMatrix& matrix, KoView* view, KoChild* child,
88 const TQPoint& point );
90
91protected:
92 bool eventFilter( TQObject*, TQEvent* );
93
94private:
95 KoPartMoveHandlerPrivate *d;
96};
97
112class KOFFICECORE_EXPORT KoContainerHandler : public KoEventHandler
113{
114 TQ_OBJECT
115
116public:
117 KoContainerHandler( KoView* view, TQWidget* widget );
119
120signals:
125 void popupMenu( KoChild*, const TQPoint& global_pos );
126
131
132protected:
133 bool eventFilter( TQObject*, TQEvent* );
134
135private:
137 KoChild *child(KoChild::Gadget &gadget, TQPoint &pos, const TQMouseEvent *ev);
138 KoView* m_view;
139};
140
141#endif
KoChild is an abstract base class that represents the geometry associated with an embedded document.
Definition KoChild.h:42
Gadget
The gadget generally identifies where a child has been hit (generally by the mouse pointer).
Definition KoChild.h:56
This class can handle moving and resizing of embedded documents in your class derived from KoView.
void popupMenu(KoChild *, const TQPoint &global_pos)
Emitted if the user wants to open the popup menu for some child object.
void deleteChild(KoChild *)
Emitted if the user pressed the delete key whilst a child was selected.
An abstract base class for event handlers.
Used by KoContainerHandler internally to handle moving of embedded documents.
Used by KoContainerHandler internally to handle resizing of embedded documents.
This class is used to display a KoDocument.
Definition KoView.h:58