karbon

vdefaulttools.cc

00001 /* This file is part of the KDE project
00002    Copyright (C) 2002, The Karbon Developers
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 
00021 #include <kgenericfactory.h>
00022 
00023 #include "karbon_factory.h"
00024 #include "karbon_tool_factory.h"
00025 #include "karbon_tool_registry.h"
00026 
00027 #include "vdefaulttools.h"
00028 
00029 #include "vellipsetool.h"
00030 #include "vgradienttool.h"
00031 #include "vpatterntool.h"
00032 #include "vpenciltool.h"
00033 #include "vpolygontool.h"
00034 #include "vpolylinetool.h"
00035 #include "vrectangletool.h"
00036 #include "vrotatetool.h"
00037 #include "vroundrecttool.h"
00038 #include "vselectnodestool.h"
00039 #include "vselecttool.h"
00040 #include "vshapetool.h"
00041 #include "vsheartool.h"
00042 #include "vsinustool.h"
00043 #include "vspiraltool.h"
00044 #include "vstartool.h"
00045 #include "vtexttool.h"
00046 
00047 typedef KGenericFactory<VDefaultTools> VDefaultToolsFactory;
00048 K_EXPORT_COMPONENT_FACTORY( karbon_defaulttools, VDefaultToolsFactory( "karbon_defaulttools" ) )
00049 
00050 VDefaultTools::VDefaultTools(QObject *parent, const char *name, const QStringList &)
00051     : KParts::Plugin(parent, name)
00052 {
00053     setInstance(VDefaultToolsFactory::instance());
00054 
00055     kdDebug() << "VDefaultTools. Class: "
00056         << className()
00057         << ", Parent: "
00058         << parent -> className()
00059         << "\n";
00060 
00061     if ( parent->inherits("KarbonFactory") )
00062     {
00063         KarbonToolRegistry* r = KarbonToolRegistry::instance();
00064         r->add(new KarbonToolFactory<VSelectTool>());
00065         r->add(new KarbonToolFactory<VSelectNodesTool>());
00066         r->add(new KarbonToolFactory<VRotateTool>());
00067         r->add(new KarbonToolFactory<VShearTool>());
00068         r->add(new KarbonToolFactory<VEllipseTool>());
00069         r->add(new KarbonToolFactory<VGradientTool>());
00070         r->add(new KarbonToolFactory<VPatternTool>());
00071         r->add(new KarbonToolFactory<VPencilTool>());
00072         r->add(new KarbonToolFactory<VPolygonTool>());
00073         r->add(new KarbonToolFactory<VPolylineTool>());
00074         r->add(new KarbonToolFactory<VRectangleTool>());
00075         r->add(new KarbonToolFactory<VRoundRectTool>());
00076         r->add(new KarbonToolFactory<VSinusTool>());
00077         r->add(new KarbonToolFactory<VSpiralTool>());
00078         r->add(new KarbonToolFactory<VStarTool>());
00079         r->add(new KarbonToolFactory<VTextTool>());
00080     }
00081 }
00082 
00083 VDefaultTools::~VDefaultTools()
00084 {
00085 }
00086 
00087 #include "vdefaulttools.moc"
KDE Home | KDE Accessibility Home | Description of Access Keys