QGIS API Documentation  2.12.0-Lyon
qgsauthmethodregistry.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsauthmethodregistry.h
3  ---------------------
4  begin : September 1, 2015
5  copyright : (C) 2015 by Boundless Spatial, Inc. USA
6  author : Larry Shaffer
7  email : lshaffer at boundlessgeo dot com
8  ***************************************************************************
9  * *
10  * This program is free software; you can redistribute it and/or modify *
11  * it under the terms of the GNU General Public License as published by *
12  * the Free Software Foundation; either version 2 of the License, or *
13  * (at your option) any later version. *
14  * *
15  ***************************************************************************/
16 
17 #ifndef QGSAUTHMETHODREGISTRY_H
18 #define QGSAUTHMETHODREGISTRY_H
19 
20 #include <QDir>
21 #include <QLibrary>
22 #include <QMap>
23 #include <QString>
24 
25 #include "qgsauthconfig.h"
26 
27 class QgsAuthMethod;
29 
30 
41 class CORE_EXPORT QgsAuthMethodRegistry
42 {
43 
44  public:
46  static QgsAuthMethodRegistry* instance( const QString& pluginPath = QString::null );
47 
49  virtual ~QgsAuthMethodRegistry();
50 
52  QString library( const QString & authMethodKey ) const;
53 
55  QString pluginList( bool asHtml = false ) const;
56 
58  const QDir & libraryDirectory() const;
59 
61  void setLibraryDirectory( const QDir & path );
62 
67  QgsAuthMethod *authMethod( const QString & authMethodKey );
68 
72 // int authMethodCapabilities( const QString& authMethodKey ) const;
73 
78  QWidget *editWidget( const QString & authMethodKey, QWidget * parent = 0 );
79 
80 #if QT_VERSION >= 0x050000
81 
86  QFunctionPointer function( const QString & authMethodKey,
87  const QString & functionName );
88 #else
89 
94  void *function( const QString & authMethodKey,
95  const QString & functionName );
96 #endif
97 
99  QLibrary *authMethodLibrary( const QString & authMethodKey ) const;
100 
102  QStringList authMethodList() const;
103 
105  const QgsAuthMethodMetadata* authMethodMetadata( const QString& authMethodKey ) const;
106 
107 // void registerGuis( QWidget *widget );
108 
110  typedef std::map<QString, QgsAuthMethodMetadata*> AuthMethods;
111 
112  private:
114  QgsAuthMethodRegistry( const QString& pluginPath );
115 
117  AuthMethods mAuthMethods;
118 
120  QDir mLibraryDirectory;
121 };
122 
123 #endif // QGSAUTHMETHODREGISTRY_H
Holds data auth method key, description, and associated shared library file information.
A registry / canonical manager of authentication methods.
std::map< QString, QgsAuthMethodMetadata * > AuthMethods
Type for auth method metadata associative container.
Abstract base class for authentication method plugins.
Definition: qgsauthmethod.h:33