karbon

vdefaulttools.cpp
1/* This file is part of the KDE project
2 Copyright (C) 2002, 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
21#include <kgenericfactory.h>
22
23#include "karbon_factory.h"
24#include "karbon_tool_factory.h"
25#include "karbon_tool_registry.h"
26
27#include "vdefaulttools.h"
28
29#include "vellipsetool.h"
30#include "vgradienttool.h"
31#include "vpatterntool.h"
32#include "vpenciltool.h"
33#include "vpolygontool.h"
34#include "vpolylinetool.h"
35#include "vrectangletool.h"
36#include "vrotatetool.h"
37#include "vroundrecttool.h"
38#include "vselectnodestool.h"
39#include "vselecttool.h"
40#include "vshapetool.h"
41#include "vsheartool.h"
42#include "vsinustool.h"
43#include "vspiraltool.h"
44#include "vstartool.h"
45#include "vtexttool.h"
46
47typedef KGenericFactory<VDefaultTools> VDefaultToolsFactory;
48K_EXPORT_COMPONENT_FACTORY( karbon_defaulttools, VDefaultToolsFactory( "karbon_defaulttools" ) )
49
50VDefaultTools::VDefaultTools(TQObject *parent, const char *name, const TQStringList &)
51 : KParts::Plugin(parent, name)
52{
53 setInstance(VDefaultToolsFactory::instance());
54
55 kdDebug() << "VDefaultTools. Class: "
56 << className()
57 << ", Parent: "
58 << parent -> className()
59 << "\n";
60
61 if ( parent->inherits("KarbonFactory") )
62 {
63 KarbonToolRegistry* r = KarbonToolRegistry::instance();
64 r->add(new KarbonToolFactory<VSelectTool>());
65 r->add(new KarbonToolFactory<VSelectNodesTool>());
66 r->add(new KarbonToolFactory<VRotateTool>());
67 r->add(new KarbonToolFactory<VShearTool>());
68 r->add(new KarbonToolFactory<VEllipseTool>());
69 r->add(new KarbonToolFactory<VGradientTool>());
70 r->add(new KarbonToolFactory<VPatternTool>());
71 r->add(new KarbonToolFactory<VPencilTool>());
72 r->add(new KarbonToolFactory<VPolygonTool>());
73 r->add(new KarbonToolFactory<VPolylineTool>());
74 r->add(new KarbonToolFactory<VRectangleTool>());
75 r->add(new KarbonToolFactory<VRoundRectTool>());
76 r->add(new KarbonToolFactory<VSinusTool>());
77 r->add(new KarbonToolFactory<VSpiralTool>());
78 r->add(new KarbonToolFactory<VStarTool>());
79 r->add(new KarbonToolFactory<VTextTool>());
80 }
81}
82
83VDefaultTools::~VDefaultTools()
84{
85}
86
87#include "vdefaulttools.moc"
A registry where new tool plugins can register themselves.
A module that provides the default tools.