QGIS API Documentation  2.18.21-Las Palmas (9fba24a)
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 
42 class CORE_EXPORT QgsAuthMethodRegistry
43 {
44 
45  public:
47  static QgsAuthMethodRegistry* instance( const QString& pluginPath = QString::null );
48 
50  virtual ~QgsAuthMethodRegistry();
51 
53  QString library( const QString & authMethodKey ) const;
54 
56  QString pluginList( bool asHtml = false ) const;
57 
59  const QDir & libraryDirectory() const;
60 
62  void setLibraryDirectory( const QDir & path );
63 
68  QgsAuthMethod *authMethod( const QString & authMethodKey );
69 
73  // int authMethodCapabilities( const QString& authMethodKey ) const;
74 
79  QWidget *editWidget( const QString & authMethodKey, QWidget * parent = nullptr );
80 
81 #if QT_VERSION >= 0x050000
82 
87  QFunctionPointer function( const QString & authMethodKey,
88  const QString & functionName );
89 #else
90 
95  void *function( const QString & authMethodKey,
96  const QString & functionName );
97 #endif
98 
100  QLibrary *authMethodLibrary( const QString & authMethodKey ) const;
101 
103  QStringList authMethodList() const;
104 
106  const QgsAuthMethodMetadata* authMethodMetadata( const QString& authMethodKey ) const;
107 
108 // void registerGuis( QWidget *widget );
109 
111  typedef std::map<QString, QgsAuthMethodMetadata*> AuthMethods;
112 
113  private:
115  QgsAuthMethodRegistry( const QString& pluginPath );
116 
118  AuthMethods mAuthMethods;
119 
121  QDir mLibraryDirectory;
122 };
123 
124 #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