QGIS API Documentation  master-59fd5e0
src/core/qgsproviderregistry.h
Go to the documentation of this file.
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 
00019 #ifndef QGSPROVIDERREGISTRY_H
00020 #define QGSPROVIDERREGISTRY_H
00021 
00022 #include <map>
00023 
00024 #include <QDir>
00025 #include <QLibrary>
00026 #include <QString>
00027 
00028 
00029 class QgsDataProvider;
00030 class QgsProviderMetadata;
00031 class QgsVectorLayer;
00032 class QgsCoordinateReferenceSystem;
00033 
00034 
00040 class CORE_EXPORT QgsProviderRegistry
00041 {
00042 
00043   public:
00044 
00046     static QgsProviderRegistry* instance( QString pluginPath = QString::null );
00047 
00049     virtual ~QgsProviderRegistry();
00050 
00052     QString library( const QString & providerKey ) const;
00053 
00055     QString pluginList( bool asHtml = false ) const;
00056 
00058     const QDir & libraryDirectory() const;
00059 
00061     void setLibraryDirectory( const QDir & path );
00062 
00068     QgsDataProvider *provider( const QString & providerKey,
00069                                const QString & dataSource );
00070 
00071     QWidget *selectWidget( const QString & providerKey,
00072                            QWidget * parent = 0, Qt::WFlags fl = 0 );
00073 
00079     void *function( const QString & providerKey,
00080                     const QString & functionName );
00081 
00082     QLibrary *providerLibrary( const QString & providerKey ) const;
00083 
00085     QStringList providerList() const;
00086 
00088     const QgsProviderMetadata* providerMetadata( const QString& providerKey ) const;
00089 
00102     virtual QString fileVectorFilters() const;
00114     virtual QString fileRasterFilters() const;
00118     virtual QString databaseDrivers() const;
00122     virtual QString directoryDrivers() const;
00126     virtual QString protocolDrivers() const;
00127 
00128     void registerGuis( QWidget *widget );
00129 
00151     //QgsDataProvider * openVector( QString const & dataSource, QString const & providerKey );
00152 
00153 
00155     typedef std::map<QString, QgsProviderMetadata*> Providers;
00156 
00157   private:
00158 
00160     QgsProviderRegistry( QString pluginPath );
00161 
00163     static QgsProviderRegistry* _instance;
00164 
00166     Providers mProviders;
00167 
00169     QDir mLibraryDirectory;
00170 
00179     QString mVectorFileFilters;
00182     QString mRasterFileFilters;
00188     QString mDatabaseDrivers;
00194     QString mDirectoryDrivers;
00200     QString mProtocolDrivers;
00201 
00202 }; // class QgsProviderRegistry
00203 
00204 #endif //QGSPROVIDERREGISTRY_H
00205 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines