1 /* 2 SPDX-FileCopyrightText: 2008 Torsten Rahn <rahn@kde.org> 3 4 SPDX-License-Identifier: LGPL-2.0-or-later 5 */ 6 7 #ifndef MARBLE_GEOSCENEMAP_H 8 #define MARBLE_GEOSCENEMAP_H 9 10 #include <QVector> 11 12 #include <geodata_export.h> 13 14 #include "GeoDocument.h" 15 16 class QColor; 17 class QString; 18 19 namespace Marble 20 { 21 22 class GeoSceneLayer; 23 class GeoSceneFilter; 24 25 class GeoSceneMapPrivate; 26 27 /** 28 * @short Map layer structure of a GeoScene document. 29 */ 30 class GEODATA_EXPORT GeoSceneMap : public GeoNode 31 { 32 public: 33 GeoSceneMap(); 34 ~GeoSceneMap() override; 35 const char* nodeType() const override; 36 37 QColor backgroundColor() const; 38 void setBackgroundColor( const QColor& ); 39 40 QColor labelColor() const; 41 void setLabelColor( const QColor& ); 42 43 QColor highlightBrushColor() const; 44 void setHighlightBrushColor( const QColor& ); 45 46 QColor highlightPenColor() const; 47 void setHighlightPenColor( const QColor& ); 48 /** 49 * @brief Add a new layer to the map 50 * @param layer The new layer 51 */ 52 void addLayer( GeoSceneLayer* ); 53 54 /** 55 * @brief Return a layer by its name 56 * @param name The name of the layer 57 * @return A pointer to the layer request by its name 58 */ 59 GeoSceneLayer* layer( const QString& name ); 60 const GeoSceneLayer* layer( const QString& name ) const; 61 62 /** 63 * @brief Return all layers 64 * @return A vector that contains pointers to all available layers 65 */ 66 QVector<GeoSceneLayer*> layers() const; 67 68 /** 69 * @brief Add a new filter to the map 70 * @param filter The new filter 71 */ 72 void addFilter( GeoSceneFilter* ); 73 74 /** 75 * @brief Return a filter by its name 76 * @param name The name of the filter 77 * @return A pointer to the filter request by its name 78 */ 79 GeoSceneFilter* filter( const QString& name ); 80 81 /** 82 * @brief Return all filters 83 * @return A vector that contains pointers to all available filters 84 */ 85 QVector<GeoSceneFilter*> filters() const; 86 87 /** 88 * @brief Checks for valid layers that contain texture data 89 * @return Whether a texture layer got created internally 90 * 91 * NOTE: The existence of the file(s) that contain the actual data 92 * still needs to get checked at runtime! 93 */ 94 bool hasTextureLayers() const; 95 96 /** 97 * @brief Checks for valid layers that contain vector data 98 * @return Whether a vector layer got created internally 99 * 100 * NOTE: The existence of the file(s) that contain the actual data 101 * still needs to get checked at runtime! 102 */ 103 bool hasVectorLayers() const; 104 105 private: 106 Q_DISABLE_COPY( GeoSceneMap ) 107 GeoSceneMapPrivate * const d; 108 }; 109 110 } 111 112 #endif 113