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

0001 /* This file is part of the KDE project
0002  * SPDX-FileCopyrightText: 2007 Jan Hambrecht <jaham@gmx.net>
0003  *
0004  * SPDX-License-Identifier: LGPL-2.0-or-later
0005  */
0006 
0007 #ifndef KOENHANCEDPATHSHAPEFACTORY_H
0008 #define KOENHANCEDPATHSHAPEFACTORY_H
0009 
0010 #include <KoShapeFactoryBase.h>
0011 
0012 class KoShape;
0013 
0014 /// Factory for path shapes
0015 class EnhancedPathShapeFactory : public KoShapeFactoryBase
0016 {
0017 public:
0018     /// constructor
0019     EnhancedPathShapeFactory();
0020     ~EnhancedPathShapeFactory() override {}
0021     KoShape *createShape(const KoProperties *params, KoDocumentResourceManager *documentResources = 0) const override;
0022     KoShape *createDefaultShape(KoDocumentResourceManager *documentResources = 0) const override;
0023     bool supports(const QDomElement &e, KoShapeLoadingContext &context) const override;
0024 private:
0025     void addCross();
0026     void addArrow();
0027     void addCallout();
0028     void addSmiley();
0029     void addCircularArrow();
0030     void addGearhead();
0031 
0032     typedef QMap<QString, QVariant > ComplexType;
0033     typedef QList<QVariant> ListType;
0034     KoProperties *dataToProperties(const QString &modifiers, const QStringList &commands,
0035                                    const ListType &handles, const ComplexType &formulae) const;
0036 
0037 };
0038 
0039 #endif // KOENHANCEDPATHSHAPEFACTORY_H