|
| 1 | +/*************************************************************************** |
| 2 | + qgsrasterrendererregistry.h |
| 3 | + --------------------------- |
| 4 | + begin : January 2012 |
| 5 | + copyright : (C) 2012 by Marco Hugentobler |
| 6 | + email : marco at sourcepole dot ch |
| 7 | + ***************************************************************************/ |
| 8 | + |
| 9 | +/*************************************************************************** |
| 10 | + * * |
| 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. * |
| 15 | + * * |
| 16 | + ***************************************************************************/ |
| 17 | + |
| 18 | +#ifndef QGSRASTERRENDERERREGISTRY_H |
| 19 | +#define QGSRASTERRENDERERREGISTRY_H |
| 20 | + |
| 21 | +#include <QHash> |
| 22 | +#include <QString> |
| 23 | + |
| 24 | +class QgsRasterDataProvider; |
| 25 | +class QgsRasterRenderer; |
| 26 | + |
| 27 | +typedef QgsRasterRenderer*(*QgsRasterRendererCreateFunc)(const QDomElement&); |
| 28 | + |
| 29 | +struct QgsRasterRendererRegistryEntry |
| 30 | +{ |
| 31 | + QString name; |
| 32 | + QgsRasterRendererCreateFunc rendererCreateFunction; //pointer to create function |
| 33 | + //pointer to create function for renderer widget |
| 34 | +}; |
| 35 | + |
| 36 | +class QgsRasterRendererRegistry |
| 37 | +{ |
| 38 | + public: |
| 39 | + static QgsRasterRendererRegistry* instance(); |
| 40 | + ~QgsRasterRendererRegistry(); |
| 41 | + |
| 42 | + void insert( QgsRasterRendererRegistryEntry entry ); |
| 43 | + bool rendererData( const QString& rendererName, QgsRasterRendererRegistryEntry& data ) const; |
| 44 | + |
| 45 | + protected: |
| 46 | + QgsRasterRendererRegistry(); |
| 47 | + |
| 48 | + private: |
| 49 | + static QgsRasterRendererRegistry* mInstance; |
| 50 | + QHash< QString, QgsRasterRendererRegistryEntry > mEntries; |
| 51 | +}; |
| 52 | + |
| 53 | +#endif // QGSRASTERRENDERERREGISTRY_H |
0 commit comments