File indexing completed on 2024-12-08 03:36:42

0001 // SPDX-License-Identifier: LGPL-2.1-or-later
0002 //
0003 // SPDX-FileCopyrightText: 2016 Akshat Tandon <akshat.tandon@research.iiit.ac.in>
0004 //
0005 
0006 
0007 #ifndef MARBLE_TAGSFILTER_H
0008 #define MARBLE_TAGSFILTER_H
0009 
0010 #include "OsmPlacemarkData.h"
0011 
0012 #include <QMap>
0013 #include <QString>
0014 
0015 namespace Marble {
0016 
0017 class GeoDataDocument;
0018 class GeoDataFeature;
0019 
0020 class TagsFilter
0021 {
0022 public:
0023     typedef QPair<QString, QString> Tag;
0024     using Tags = QVector<Tag>;
0025 
0026     enum FilterFlag {
0027         NoFlag = 0,
0028         FilterRailwayService
0029     };
0030 
0031     //Filters placemarks which have tags in the hash
0032     TagsFilter(GeoDataDocument* document, const Tags& tagsList, FilterFlag filterFlag = NoFlag);
0033     ~TagsFilter();
0034 
0035     QVector<GeoDataFeature*>::const_iterator rejectedObjectsBegin() const;
0036     QVector<GeoDataFeature*>::const_iterator rejectedObjectsEnd() const;
0037 
0038     GeoDataDocument* accepted();
0039 
0040     static void removeAnnotationTags(GeoDataDocument* document);
0041 
0042 private:
0043     static void removeAnnotationTags(OsmPlacemarkData &osmData);
0044 
0045     GeoDataDocument* m_accepted;
0046     QVector<GeoDataFeature*> m_rejectedObjects;
0047 };
0048 
0049 }
0050 
0051 #endif