QGIS API Documentation  2.4.0-Chugiak
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
qgsproviderregistry.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsproviderregistry.h - Singleton class for
3  registering data providers.
4  -------------------
5  begin : Sat Jan 10 2004
6  copyright : (C) 2004 by Gary E.Sherman
7  email : sherman at mrcc.com
8  ***************************************************************************/
9 
10 /***************************************************************************
11  * *
12  * This program is free software; you can redistribute it and/or modify *
13  * it under the terms of the GNU General Public License as published by *
14  * the Free Software Foundation; either version 2 of the License, or *
15  * (at your option) any later version. *
16  * *
17  ***************************************************************************/
18 
19 #ifndef QGSPROVIDERREGISTRY_H
20 #define QGSPROVIDERREGISTRY_H
21 
22 #include <map>
23 
24 #include <QDir>
25 #include <QLibrary>
26 #include <QString>
27 
28 
29 class QgsDataProvider;
31 class QgsVectorLayer;
33 
34 
40 class CORE_EXPORT QgsProviderRegistry
41 {
42 
43  public:
44 
46  static QgsProviderRegistry* instance( QString pluginPath = QString::null );
47 
49  virtual ~QgsProviderRegistry();
50 
52  QString library( const QString & providerKey ) const;
53 
55  QString pluginList( bool asHtml = false ) const;
56 
58  const QDir & libraryDirectory() const;
59 
61  void setLibraryDirectory( const QDir & path );
62 
68  QgsDataProvider *provider( const QString & providerKey,
69  const QString & dataSource );
70 
71  QWidget *selectWidget( const QString & providerKey,
72  QWidget * parent = 0, Qt::WindowFlags fl = 0 );
73 
79  void *function( const QString & providerKey,
80  const QString & functionName );
81 
82  QLibrary *providerLibrary( const QString & providerKey ) const;
83 
85  QStringList providerList() const;
86 
88  const QgsProviderMetadata* providerMetadata( const QString& providerKey ) const;
89 
102  virtual QString fileVectorFilters() const;
114  virtual QString fileRasterFilters() const;
118  virtual QString databaseDrivers() const;
122  virtual QString directoryDrivers() const;
126  virtual QString protocolDrivers() const;
127 
128  void registerGuis( QWidget *widget );
129 
151  //QgsDataProvider * openVector( QString const & dataSource, QString const & providerKey );
152 
153 
155  typedef std::map<QString, QgsProviderMetadata*> Providers;
156 
157  private:
159  QgsProviderRegistry( QString pluginPath );
160 
163 
166 
197 
198 }; // class QgsProviderRegistry
199 
200 #endif //QGSPROVIDERREGISTRY_H
201 
QString mRasterFileFilters
file filter string for raster files
QString mVectorFileFilters
file filter string for vector files
Providers mProviders
associative container of provider metadata handles
QString mProtocolDrivers
Available protocol drivers string for vector databases.
Abstract base class for spatial data provider implementations.
QString mDirectoryDrivers
Available directory drivers string for vector databases.
QDir mLibraryDirectory
directory in which provider plugins are installed
std::map< QString, QgsProviderMetadata * > Providers
open the given vector data source
A registry / canonical manager of data providers.
QString mDatabaseDrivers
Available database drivers string for vector databases.
Holds data provider key, description, and associated shared library file information.
Class for storing a coordinate reference system (CRS)
Represents a vector layer which manages a vector based data sets.