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

0001 /* This file is part of the KDE project
0002    SPDX-FileCopyrightText: 2011 Thorsten Zachmann <zachmann@kde.org>
0003 
0004    SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #ifndef KOMARKERCOLLECTION_H
0008 #define KOMARKERCOLLECTION_H
0009 
0010 #include "kritaflake_export.h"
0011 
0012 #include <QObject>
0013 #include <QList>
0014 #include <QHash>
0015 #include <QMetaType>
0016 
0017 class KoMarker;
0018 #include <QDomDocument>
0019 class KoShapeLoadingContext;
0020 
0021 class KRITAFLAKE_EXPORT KoMarkerCollection : public QObject
0022 {
0023     Q_OBJECT
0024 public:
0025     explicit KoMarkerCollection(QObject *parent = 0);
0026     ~KoMarkerCollection() override;
0027 
0028     QList<KoMarker*> markers() const;
0029 
0030     /**
0031      * Add marker to collection
0032      *
0033      * The collection checks if a marker with the same content exists and if so deletes the
0034      * passed marker and returns a pointer to an existing marker. If no such marker exists it
0035      * adds the marker and return the same pointer as passed.
0036      * Calling that function passes ownership of the marker to this class.
0037      *
0038      * @param marker Marker to add
0039      * @return pointer to marker that should be used. This might be different to the marker passed
0040      */
0041     KoMarker * addMarker(KoMarker *marker);
0042 
0043     void loadMarkersFromFile(const QString &svgFile);
0044 
0045 private:
0046     /// load the markers that are available per default.
0047     void loadDefaultMarkers();
0048 
0049     class Private;
0050     Private * const d;
0051 };
0052 
0053 Q_DECLARE_METATYPE(KoMarkerCollection *)
0054 
0055 #endif /* KOMARKERCOLLECTION_H */