Quantum GIS API Documentation
1.7.4
|
00001 /*************************************************************************** 00002 qgsproviderregistry.h - Singleton class for 00003 registering data providers. 00004 ------------------- 00005 begin : Sat Jan 10 2004 00006 copyright : (C) 2004 by Gary E.Sherman 00007 email : sherman at mrcc.com 00008 ***************************************************************************/ 00009 00010 /*************************************************************************** 00011 * * 00012 * This program is free software; you can redistribute it and/or modify * 00013 * it under the terms of the GNU General Public License as published by * 00014 * the Free Software Foundation; either version 2 of the License, or * 00015 * (at your option) any later version. * 00016 * * 00017 ***************************************************************************/ 00018 /* $Id$ */ 00019 00020 #ifndef QGSPROVIDERREGISTRY_H 00021 #define QGSPROVIDERREGISTRY_H 00022 00023 #include <map> 00024 00025 #include <QDir> 00026 #include <QString> 00027 00028 00029 class QgsDataProvider; 00030 class QgsProviderMetadata; 00031 00032 00033 00039 class CORE_EXPORT QgsProviderRegistry 00040 { 00041 00042 public: 00043 00045 static QgsProviderRegistry* instance( QString pluginPath = QString::null ); 00046 00048 virtual ~QgsProviderRegistry(); 00049 00051 QString library( QString const & providerKey ) const; 00052 00054 QString pluginList( bool asHtml = false ) const; 00055 00057 const QDir & libraryDirectory() const; 00058 00060 void setLibraryDirectory( QDir const & path ); 00061 00067 QgsDataProvider * getProvider( const QString & providerKey, 00068 const QString & dataSource ); 00069 00071 QStringList providerList() const; 00072 00074 const QgsProviderMetadata* providerMetadata( const QString& providerKey ) const; 00075 00088 virtual QString fileVectorFilters() const; 00092 virtual QString databaseDrivers() const; 00096 virtual QString directoryDrivers() const; 00100 virtual QString protocolDrivers() const; 00101 00123 //QgsDataProvider * openVector( QString const & dataSource, QString const & providerKey ); 00124 00125 00127 typedef std::map<QString, QgsProviderMetadata*> Providers; 00128 00129 private: 00130 00132 QgsProviderRegistry( QString pluginPath ); 00133 00135 static QgsProviderRegistry* _instance; 00136 00138 Providers mProviders; 00139 00141 QDir mLibraryDirectory; 00142 00151 QString mVectorFileFilters; 00157 QString mDatabaseDrivers; 00163 QString mDirectoryDrivers; 00169 QString mProtocolDrivers; 00170 00171 }; // class QgsProviderRegistry 00172 00173 #endif //QGSPROVIDERREGISTRY_H 00174