QGIS API Documentation  2.0.1-Dufour
 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::WFlags 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:
158 
160  QgsProviderRegistry( QString pluginPath );
161 
164 
167 
170 
201 
202 }; // class QgsProviderRegistry
203 
204 #endif //QGSPROVIDERREGISTRY_H
205