File indexing completed on 2024-05-12 15:56:44

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 _KOPATHSHAPELOADER_H_
0008 #define _KOPATHSHAPELOADER_H_
0009 
0010 #include "kritaflake_export.h"
0011 
0012 class KoPathShape;
0013 class KoPathShapeLoaderPrivate;
0014 class QString;
0015 
0016 /**
0017  * Parser for svg path data, passed by argument in the parseSvg() method
0018  * A helper class for parsing path data when loading from svg/odf
0019  */
0020 class KRITAFLAKE_EXPORT KoPathShapeLoader
0021 {
0022 public:
0023     explicit KoPathShapeLoader(KoPathShape *path);
0024     ~KoPathShapeLoader();
0025 
0026     /**
0027      * There are two operating modes. By default the parser just delivers unaltered
0028      * svg path data commands and parameters. In the second mode, it will convert all
0029      * relative coordinates to absolute ones, and convert all curves to cubic beziers.
0030      */
0031     void parseSvg(const QString &svgInputData, bool process = false);
0032 
0033 private:
0034     KoPathShapeLoaderPrivate* const d;
0035 };
0036 
0037 #endif // _KOPATHSHAPELOADER_H_