1
/***************************************************************************
5
copyright : (C) 2008 by Marco Hugentobler
6
email : marco dot hugentobler at karto dot baug dot ethz dot ch
7
***************************************************************************/
9
/***************************************************************************
11
* This program is free software; you can redistribute it and/or modify *
12
* it under the terms of the GNU General Public License as published by *
13
* the Free Software Foundation; either version 2 of the License, or *
14
* (at your option) any later version. *
16
***************************************************************************/
18
#ifndef QGSMSLAYERBUILDER_H
19
#define QGSMSLAYERBUILDER_H
28
/**Abstract base class for layer builders.
29
Provides the possibility to create QGIS maplayers
31
class QgsMSLayerBuilder
35
virtual ~QgsMSLayerBuilder();
37
/**Creates a maplayer from xml tag
38
@param elem xml element containing description of datasource
39
@param layerName sld name of the maplayer
40
@param filesToRemove list to append files that should be removed after the request
41
@param layersToRemove list to append layers that should be removed after the request
42
@param allowCaching flag if layers are allowed to be fetched from layer cache or not
43
@return the created layer or 0 in case of error*/
44
virtual QgsMapLayer* createMapLayer( const QDomElement& elem, const QString& layerName, QList<QTemporaryFile*>& filesToRemove, QList<QgsMapLayer*>& layersToRemove, bool allowCaching = true ) const = 0;
46
/**Tries to create a suitable layer name from a URL. */
47
virtual QString layerNameFromUri( const QString& uri ) const;
48
/**Helper function that creates a new temporary file with random name under /tmp/qgis_wms_serv/
49
and returns the path of the file (Unix). On Windows, it is created in the current working directory \
50
and returns the filename only*/
51
QString createTempFile() const;
52
/**Resets the former symbology of a raster layer. This is important for single band layers (e.g. dems)
53
coming from the cash*/
54
void clearRasterSymbology( QgsRasterLayer* rl ) const;