karbon

vtoolcontroller.h
1/* This file is part of the KDE project
2 Copyright (C) 2001, 2002, 2003 The Karbon Developers
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 __VTOOLCONTROLLER_H__
21#define __VTOOLCONTROLLER_H__
22
23#include <tqdict.h>
24#include <KoPoint.h>
25
26class TQEvent;
27
28class VTool;
29class KarbonView;
30class VToolBox;
31
32class VToolController
33{
34public:
35 VToolController( KarbonView *view );
36 virtual ~VToolController();
37
38 void init();
39
40 void registerTool( VTool *tool );
41 void unregisterTool( VTool *tool );
42
43 void setCurrentTool( VTool * );
44 VTool *currentTool() const { return m_currentTool; }
45
46 bool mouseEvent( TQMouseEvent* event, const KoPoint& );
47 bool keyEvent( TQEvent* event );
48
49 const TQDict<VTool> &tools() { return m_tools; }
50
51 void setUp( TDEActionCollection *ac, VToolBox * toolbox );
52 void resetToolBox( VToolBox * toolbox );
53 VTool *findTool( const TQString &toolName ) const;
54
55 // Called when the toolbox is deleted because the view was made inactive in favour of another view
56 void youAintGotNoToolBox();
57
58private:
59 KarbonView *m_view;
60 VTool *m_currentTool;
61 TQDict<VTool> m_tools;
62 VToolBox *m_toolBox;
63 bool m_setup;
64};
65
66#endif
67
This class...
Definition vtoolbox.h:29
The base class for all karbon tools.
Definition vtool.h:52