Changeset View
Changeset View
Standalone View
Standalone View
libs/flake/KoMarkerCollection.h
Show All 32 Lines | |||||
33 | 33 | | |||
34 | class KRITAFLAKE_EXPORT KoMarkerCollection : public QObject | 34 | class KRITAFLAKE_EXPORT KoMarkerCollection : public QObject | ||
35 | { | 35 | { | ||
36 | Q_OBJECT | 36 | Q_OBJECT | ||
37 | public: | 37 | public: | ||
38 | explicit KoMarkerCollection(QObject *parent = 0); | 38 | explicit KoMarkerCollection(QObject *parent = 0); | ||
39 | virtual ~KoMarkerCollection(); | 39 | virtual ~KoMarkerCollection(); | ||
40 | 40 | | |||
41 | bool loadOdf(KoShapeLoadingContext &context); | | |||
42 | // For now we only save the used markers and that is done with a KoSharedSavingData when a marker usage is encountered. | | |||
43 | //void saveOdf(KoShapeSavingContext &context) const; | | |||
44 | | ||||
45 | QList<KoMarker*> markers() const; | 41 | QList<KoMarker*> markers() const; | ||
46 | 42 | | |||
47 | /** | 43 | /** | ||
48 | * Add marker to collection | 44 | * Add marker to collection | ||
49 | * | 45 | * | ||
50 | * The collection checks if a marker with the same content exists and if so deletes the | 46 | * The collection checks if a marker with the same content exists and if so deletes the | ||
51 | * passed marker and returns a pointer to an existing marker. If no such marker exists it | 47 | * passed marker and returns a pointer to an existing marker. If no such marker exists it | ||
52 | * adds the marker and return the same pointer as passed. | 48 | * adds the marker and return the same pointer as passed. | ||
53 | * Calling that function passes ownership of the marker to this class. | 49 | * Calling that function passes ownership of the marker to this class. | ||
54 | * | 50 | * | ||
55 | * @param marker Marker to add | 51 | * @param marker Marker to add | ||
56 | * @return pointer to marker that should be used. This might be different to the marker passed | 52 | * @return pointer to marker that should be used. This might be different to the marker passed | ||
57 | */ | 53 | */ | ||
58 | KoMarker * addMarker(KoMarker *marker); | 54 | KoMarker * addMarker(KoMarker *marker); | ||
59 | 55 | | |||
56 | void loadMarkersFromFile(const QString &svgFile); | ||||
57 | | ||||
60 | private: | 58 | private: | ||
61 | /// load the markers that are available per default. | 59 | /// load the markers that are available per default. | ||
62 | void loadDefaultMarkers(); | 60 | void loadDefaultMarkers(); | ||
63 | void loadOdfMarkers(const QHash<QString, KoXmlElement*> &markers, KoShapeLoadingContext &context, QHash<QString, KoMarker*> &lookupTable); | | |||
64 | 61 | | |||
65 | class Private; | 62 | class Private; | ||
66 | Private * const d; | 63 | Private * const d; | ||
67 | }; | 64 | }; | ||
68 | 65 | | |||
69 | Q_DECLARE_METATYPE(KoMarkerCollection *) | 66 | Q_DECLARE_METATYPE(KoMarkerCollection *) | ||
70 | 67 | | |||
71 | #endif /* KOMARKERCOLLECTION_H */ | 68 | #endif /* KOMARKERCOLLECTION_H */ |