QGIS API Documentation  2.5.0-Master
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules 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 
75  int providerCapabilities( const QString& providerKey ) const;
76 
77  QWidget *selectWidget( const QString & providerKey,
78  QWidget * parent = 0, Qt::WindowFlags fl = 0 );
79 
85  void *function( const QString & providerKey,
86  const QString & functionName );
87 
88  QLibrary *providerLibrary( const QString & providerKey ) const;
89 
91  QStringList providerList() const;
92 
94  const QgsProviderMetadata* providerMetadata( const QString& providerKey ) const;
95 
108  virtual QString fileVectorFilters() const;
120  virtual QString fileRasterFilters() const;
124  virtual QString databaseDrivers() const;
128  virtual QString directoryDrivers() const;
132  virtual QString protocolDrivers() const;
133 
134  void registerGuis( QWidget *widget );
135 
157  //QgsDataProvider * openVector( QString const & dataSource, QString const & providerKey );
158 
159 
161  typedef std::map<QString, QgsProviderMetadata*> Providers;
162 
163  private:
165  QgsProviderRegistry( QString pluginPath );
166 
168  Providers mProviders;
169 
171  QDir mLibraryDirectory;
172 
181  QString mVectorFileFilters;
184  QString mRasterFileFilters;
190  QString mDatabaseDrivers;
196  QString mDirectoryDrivers;
202  QString mProtocolDrivers;
203 
204 }; // class QgsProviderRegistry
205 
206 #endif //QGSPROVIDERREGISTRY_H
207 
Abstract base class for spatial data provider implementations.
Definition: qgsdataprovider.h:46
std::map< QString, QgsProviderMetadata * > Providers
open the given vector data source
Definition: qgsproviderregistry.h:161
A registry / canonical manager of data providers.
Definition: qgsproviderregistry.h:40
Holds data provider key, description, and associated shared library file information.
Definition: qgsprovidermetadata.h:37
Class for storing a coordinate reference system (CRS)
Definition: qgscoordinatereferencesystem.h:50
Represents a vector layer which manages a vector based data sets.
Definition: qgsvectorlayer.h:470