Quantum GIS API Documentation  1.7.5-Wroclaw
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator 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 /* $Id$ */
19 
20 #ifndef QGSPROVIDERREGISTRY_H
21 #define QGSPROVIDERREGISTRY_H
22 
23 #include <map>
24 
25 #include <QDir>
26 #include <QString>
27 
28 
29 class QgsDataProvider;
31 
32 
33 
39 class CORE_EXPORT QgsProviderRegistry
40 {
41 
42  public:
43 
45  static QgsProviderRegistry* instance( QString pluginPath = QString::null );
46 
48  virtual ~QgsProviderRegistry();
49 
51  QString library( QString const & providerKey ) const;
52 
54  QString pluginList( bool asHtml = false ) const;
55 
57  const QDir & libraryDirectory() const;
58 
60  void setLibraryDirectory( QDir const & path );
61 
67  QgsDataProvider * getProvider( const QString & providerKey,
68  const QString & dataSource );
69 
71  QStringList providerList() const;
72 
74  const QgsProviderMetadata* providerMetadata( const QString& providerKey ) const;
75 
88  virtual QString fileVectorFilters() const;
92  virtual QString databaseDrivers() const;
96  virtual QString directoryDrivers() const;
100  virtual QString protocolDrivers() const;
101 
123  //QgsDataProvider * openVector( QString const & dataSource, QString const & providerKey );
124 
125 
127  typedef std::map<QString, QgsProviderMetadata*> Providers;
128 
129  private:
130 
132  QgsProviderRegistry( QString pluginPath );
133 
136 
139 
142 
170 
171 }; // class QgsProviderRegistry
172 
173 #endif //QGSPROVIDERREGISTRY_H
174