/
qgsrasterdataprovider.h
117 lines (83 loc) · 3.61 KB
/
qgsrasterdataprovider.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
/***************************************************************************
qgsrasterdataprovider.h - DataProvider Interface for raster layers
--------------------------------------
Date : Mar 11, 2005
Copyright : (C) 2005 by Brendan Morley
email : morb at ozemail dot com dot au
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
/* $Id$ */
/* Thank you to Marco Hugentobler for the original vector DataProvider */
#ifndef QGSRASTERDATAPROVIDER_H
#define QGSRASTERDATAPROVIDER_H
#include <set>
#include <map>
#include <qobject.h>
#include <qtextcodec.h>
#include <qimage.h>
#include "qgsdataprovider.h"
#include "qgspoint.h"
#include <qgsrasterviewport.h>
/** Base class for raster data providers
*
* \note This class has been copied and pasted from
* QgsVectorDataProvider, and does not yet make
* sense for Raster layers.
*/
class QgsRasterDataProvider : public QgsDataProvider
{
Q_OBJECT
public:
QgsRasterDataProvider();
QgsRasterDataProvider( QString const & uri );
virtual ~QgsRasterDataProvider() {};
/**
* Add the list of WMS layer names to be rendered by this server
*/
virtual void addLayers(QStringList const & layers,
QStringList const & styles = QStringList()) = 0;
//! get raster image encodings supported by (e.g.) the WMS Server, expressed as MIME types
virtual QStringList supportedImageEncodings() = 0;
/**
* Set the image encoding (as a MIME type) used in the transfer from (e.g.) the WMS server
*/
virtual void setImageEncoding(QString const & mimeType) = 0;
/**
* Set the image projection (in WMS CRS format) used in the transfer from (e.g.) the WMS server
*/
virtual void setImageCrs(QString const & crs) = 0;
// TODO: Document this better.
/** \brief Renders the layer as an image
*/
virtual QImage* draw(QgsRect const & viewExtent, int pixelWidth, int pixelHeight) = 0;
// TODO: Get the supported formats by this provider
// TODO: Get the file masks supported by this provider, suitable for feeding into the file open dialog box
/**
* Get metadata in a format suitable for feeding directly
* into a subset of the GUI raster properties "Metadata" tab.
*/
virtual QString getMetadata() = 0;
/**
* If an operation returns 0 (e.g. draw()), this function
* returns the text of the error associated with the failure.
* Interactive users of this provider can then, for example,
* call a QMessageBox to display the contents.
*/
virtual QString errorCaptionString() = 0;
/**
* If an operation returns 0 (e.g. draw()), this function
* returns the text of the error associated with the failure.
* Interactive users of this provider can then, for example,
* call a QMessageBox to display the contents.
*/
virtual QString errorString() = 0;
protected:
};
#endif