File indexing completed on 2024-06-23 04:27:04

0001 /* This file is part of the KDE project
0002  * SPDX-FileCopyrightText: 2007 Rob Buis <buis@kde.org>
0003  *
0004  * SPDX-License-Identifier: LGPL-2.0-or-later
0005  */
0006 
0007 #include "SpiralShapeFactory.h"
0008 #include "SpiralShape.h"
0009 #include "SpiralShapeConfigWidget.h"
0010 #include <KoShapeStroke.h>
0011 #include <KoShapeLoadingContext.h>
0012 
0013 #include <KoIcon.h>
0014 #include <klocalizedstring.h>
0015 
0016 #include "kis_pointer_utils.h"
0017 
0018 SpiralShapeFactory::SpiralShapeFactory()
0019     : KoShapeFactoryBase(SpiralShapeId, i18n("Spiral"))
0020 {
0021     setToolTip(i18n("A spiral shape"));
0022     setIconName(koIconNameCStr("spiral-shape"));
0023     setFamily("geometric");
0024     setLoadingPriority(1);
0025 }
0026 
0027 KoShape *SpiralShapeFactory::createDefaultShape(KoDocumentResourceManager *) const
0028 {
0029     SpiralShape *spiral = new SpiralShape();
0030 
0031     spiral->setStroke(toQShared(new KoShapeStroke(1.0)));
0032     spiral->setShapeId(KoPathShapeId);
0033 
0034     return spiral;
0035 }
0036 
0037 bool SpiralShapeFactory::supports(const QDomElement &e, KoShapeLoadingContext &context) const
0038 {
0039     Q_UNUSED(e);
0040     Q_UNUSED(context);
0041     return false;
0042 }
0043 
0044 QList<KoShapeConfigWidgetBase *> SpiralShapeFactory::createShapeOptionPanels()
0045 {
0046     QList<KoShapeConfigWidgetBase *> panels;
0047     panels.append(new SpiralShapeConfigWidget());
0048     return panels;
0049 }