A registry / canonical manager of data providers.
More...
#include <qgsproviderregistry.h>
Public Member Functions |
virtual | ~QgsProviderRegistry () |
| Virtual dectructor.
|
QString | library (const QString &providerKey) const |
| Return path for the library of the provider.
|
QString | pluginList (bool asHtml=false) const |
| Return list of provider plugins found.
|
const QDir & | libraryDirectory () const |
| return library directory where plugins are found
|
void | setLibraryDirectory (const QDir &path) |
| Set library directory where to search for plugins.
|
QgsDataProvider * | provider (const QString &providerKey, const QString &dataSource) |
| Create an instance of the provider.
|
int | providerCapabilities (const QString &providerKey) const |
| Return the provider capabilities.
|
QWidget * | selectWidget (const QString &providerKey, QWidget *parent=0, Qt::WindowFlags fl=0) |
void * | function (const QString &providerKey, const QString &functionName) |
| Get pointer to provider function.
|
QLibrary * | providerLibrary (const QString &providerKey) const |
QStringList | providerList () const |
| Return list of available providers by their keys.
|
const QgsProviderMetadata * | providerMetadata (const QString &providerKey) const |
| Return metadata of the provider or NULL if not found.
|
virtual QString | fileVectorFilters () const |
| return vector file filter string
|
virtual QString | fileRasterFilters () const |
| return raster file filter string
|
virtual QString | databaseDrivers () const |
| return a string containing the available database drivers
|
virtual QString | directoryDrivers () const |
| return a string containing the available directory drivers
|
virtual QString | protocolDrivers () const |
| return a string containing the available protocol drivers
|
void | registerGuis (QWidget *widget) |
Static Public Member Functions |
static QgsProviderRegistry * | instance (QString pluginPath=QString::null) |
| means of accessing canonical single instance
|
Detailed Description
A registry / canonical manager of data providers.
This is a Singleton class that manages data provider access.
Member Typedef Documentation
open the given vector data source
Similar to open(QString const &), except that the user specifies a data provider with which to open the data source instead of using the default data provider that QgsDataManager would figure out to use. This should be useful when (and if) there will exist more than one data provider that can handle a given data source. (E.g., use GDAL to open an SDTS file, or a different data provider that uses sdts++.)
Called by QgsDataManager::open().
- Parameters
-
name | could be a file, URI |
provider | is the key for the dataprovider used to open name |
- Returns
- NULL if unable to open vector data source
Temporarily always returns false until finished implementing.
Eventually would be nice if could make QgsDataManager smart enough to figure out whether the given name mapped to a vector, raster, or database source.type for data provider metadata associative container
Constructor & Destructor Documentation
QgsProviderRegistry::~QgsProviderRegistry |
( |
| ) |
|
|
virtual |
Member Function Documentation
QString QgsProviderRegistry::databaseDrivers |
( |
| ) |
const |
|
virtual |
return a string containing the available database drivers
QString QgsProviderRegistry::directoryDrivers |
( |
| ) |
const |
|
virtual |
return a string containing the available directory drivers
QString QgsProviderRegistry::fileRasterFilters |
( |
| ) |
const |
|
virtual |
return raster file filter string
Returns a string suitable for a QFileDialog of raster file formats supported by all data providers.
This walks through all data providers appending calls to their buildSupportedRasterFileFilter to a string, which is then returned.
- Note
- This replaces QgsRasterLayer::buildSupportedRasterFileFilter()
QString QgsProviderRegistry::fileVectorFilters |
( |
| ) |
const |
|
virtual |
return vector file filter string
Returns a string suitable for a QFileDialog of vector file formats supported by all data providers.
This walks through all data providers appending calls to their fileVectorFilters to a string, which is then returned.
- Note
It'd be nice to eventually be raster/vector neutral.
void * QgsProviderRegistry::function |
( |
const QString & |
providerKey, |
|
|
const QString & |
functionName |
|
) |
| |
Get pointer to provider function.
- Parameters
-
providerKey | identificator of the provider |
functionName | name of function |
- Returns
- pointer to function or NULL on error
means of accessing canonical single instance
QString QgsProviderRegistry::library |
( |
const QString & |
providerKey | ) |
const |
Return path for the library of the provider.
QDir const & QgsProviderRegistry::libraryDirectory |
( |
| ) |
const |
return library directory where plugins are found
QString QgsProviderRegistry::pluginList |
( |
bool |
asHtml = false | ) |
const |
Return list of provider plugins found.
QString QgsProviderRegistry::protocolDrivers |
( |
| ) |
const |
|
virtual |
return a string containing the available protocol drivers
QgsDataProvider * QgsProviderRegistry::provider |
( |
const QString & |
providerKey, |
|
|
const QString & |
dataSource |
|
) |
| |
Create an instance of the provider.
Copied from QgsVectorLayer::setDataProvider TODO: Make it work in the generic environment.
- Parameters
-
providerKey | identificator of the provider |
dataSource | string containing data source for the provider |
- Returns
- instance of provider or NULL on error
TODO: Is this class really the best place to put a data provider loader? It seems more sensible to provide the code in one place rather than in qgsrasterlayer, qgsvectorlayer, serversourceselect, etc.
int QgsProviderRegistry::providerCapabilities |
( |
const QString & |
providerKey | ) |
const |
Return the provider capabilities.
- Parameters
-
providerKey | identificator of the provider |
- Note
- Added in 2.6
QLibrary * QgsProviderRegistry::providerLibrary |
( |
const QString & |
providerKey | ) |
const |
QStringList QgsProviderRegistry::providerList |
( |
| ) |
const |
Return list of available providers by their keys.
const QgsProviderMetadata * QgsProviderRegistry::providerMetadata |
( |
const QString & |
providerKey | ) |
const |
Return metadata of the provider or NULL if not found.
void QgsProviderRegistry::registerGuis |
( |
QWidget * |
widget | ) |
|
QWidget * QgsProviderRegistry::selectWidget |
( |
const QString & |
providerKey, |
|
|
QWidget * |
parent = 0 , |
|
|
Qt::WindowFlags |
fl = 0 |
|
) |
| |
void QgsProviderRegistry::setLibraryDirectory |
( |
const QDir & |
path | ) |
|
Set library directory where to search for plugins.
The documentation for this class was generated from the following files: