QGIS API Documentation  2.7.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 
80 #if QT_VERSION >= 0x050000
81 
86  QFunctionPointer function( const QString & providerKey,
87  const QString & functionName );
88 #else
89 
94  void *function( const QString & providerKey,
95  const QString & functionName );
96 #endif
97 
98  QLibrary *providerLibrary( const QString & providerKey ) const;
99 
101  QStringList providerList() const;
102 
104  const QgsProviderMetadata* providerMetadata( const QString& providerKey ) const;
105 
118  virtual QString fileVectorFilters() const;
129  virtual QString fileRasterFilters() const;
131  virtual QString databaseDrivers() const;
133  virtual QString directoryDrivers() const;
135  virtual QString protocolDrivers() const;
136 
137  void registerGuis( QWidget *widget );
138 
160  //QgsDataProvider * openVector( QString const & dataSource, QString const & providerKey );
161 
162 
164  typedef std::map<QString, QgsProviderMetadata*> Providers;
165 
166  private:
168  QgsProviderRegistry( QString pluginPath );
169 
171  Providers mProviders;
172 
174  QDir mLibraryDirectory;
175 
184  QString mVectorFileFilters;
187  QString mRasterFileFilters;
193  QString mDatabaseDrivers;
199  QString mDirectoryDrivers;
205  QString mProtocolDrivers;
206 
207 }; // class QgsProviderRegistry
208 
209 #endif //QGSPROVIDERREGISTRY_H
210 
Abstract base class for spatial data provider implementations.
std::map< QString, QgsProviderMetadata * > Providers
open the given vector data source
A registry / canonical manager of data providers.
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.