QGIS API Documentation  3.16.0-Hannover (43b64b13f3)
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 #define SIP_NO_FILE
21 
22 #include <QDir>
23 #include <QLibrary>
24 #include <QMap>
25 #include <QString>
26 #include <memory>
27 
28 #include "qgis_core.h"
29 
30 class QgsAuthMethod;
32 
33 
46 class CORE_EXPORT QgsAuthMethodRegistry
47 {
48 
49  public:
51  static QgsAuthMethodRegistry *instance( const QString &pluginPath = QString() );
52 
54  virtual ~QgsAuthMethodRegistry();
55 
57  QString library( const QString &authMethodKey ) const;
58 
60  QString pluginList( bool asHtml = false ) const;
61 
63  QDir libraryDirectory() const;
64 
66  void setLibraryDirectory( const QDir &path );
67 
73  std::unique_ptr< QgsAuthMethod > authMethod( const QString &authMethodKey );
74 
75 #if 0
76 
81  // int authMethodCapabilities( const QString& authMethodKey ) const;
82 #endif
83 
89  QWidget *editWidget( const QString &authMethodKey, QWidget *parent = nullptr );
90 
97  QFunctionPointer function( const QString &authMethodKey,
98  const QString &functionName );
99 
101  std::unique_ptr< QLibrary > authMethodLibrary( const QString &authMethodKey ) const;
102 
104  QStringList authMethodList() const;
105 
107  const QgsAuthMethodMetadata *authMethodMetadata( const QString &authMethodKey ) const;
108 
109 // void registerGuis( QWidget *widget );
110 
112  typedef std::map<QString, QgsAuthMethodMetadata *> AuthMethods;
113 
114  private:
116  QgsAuthMethodRegistry( const QString &pluginPath );
117 
119  AuthMethods mAuthMethods;
120 
122  QDir mLibraryDirectory;
123 };
124 
125 #endif // QGSAUTHMETHODREGISTRY_H
QgsAuthMethodMetadata
Holds data auth method key, description, and associated shared library file information.
Definition: qgsauthmethodmetadata.h:41
QgsAuthMethod
Abstract base class for authentication method plugins.
Definition: qgsauthmethod.h:37
QgsAuthMethodRegistry
A registry / canonical manager of authentication methods.
Definition: qgsauthmethodregistry.h:47
QgsAuthMethodRegistry::AuthMethods
std::map< QString, QgsAuthMethodMetadata * > AuthMethods
Type for auth method metadata associative container.
Definition: qgsauthmethodregistry.h:112