QGIS API Documentation 3.99.0-Master (a5475b57e34)
Loading...
Searching...
No Matches
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
21#include <memory>
22
23#include "qgis_core.h"
24#include "qgis_sip.h"
25
26#include <QDir>
27#include <QLibrary>
28#include <QMap>
29#include <QString>
30
31#define SIP_NO_FILE
32
33class QgsAuthMethod;
35
36
49class CORE_EXPORT QgsAuthMethodRegistry
50{
51
52 public:
54 static QgsAuthMethodRegistry *instance( const QString &pluginPath = QString() );
55
56 virtual ~QgsAuthMethodRegistry();
57
62 Q_DECL_DEPRECATED QString library( const QString &authMethodKey ) const SIP_DEPRECATED;
63
65 QString pluginList( bool asHtml = false ) const;
66
68 QDir libraryDirectory() const;
69
71 void setLibraryDirectory( const QDir &path );
72
78 QgsAuthMethod *createAuthMethod( const QString &authMethodKey );
79
80#if 0
81
86 // int authMethodCapabilities( const QString& authMethodKey ) const;
87#endif
88
94 QWidget *editWidget( const QString &authMethodKey, QWidget *parent = nullptr );
95
97 QStringList authMethodList() const;
98
100 const QgsAuthMethodMetadata *authMethodMetadata( const QString &authMethodKey ) const;
101
103 typedef std::map<QString, QgsAuthMethodMetadata *> AuthMethods;
104
105 private:
106
108 QgsAuthMethodRegistry( const QString &pluginPath );
109
110 void init();
111 void clean();
112
114 AuthMethods mAuthMethods;
115
117 QDir mLibraryDirectory;
118};
119
120#endif // QGSAUTHMETHODREGISTRY_H
Holds data auth method key, description, and associated shared library file information.
const QgsAuthMethodMetadata * authMethodMetadata(const QString &authMethodKey) const
Returns metadata of the auth method or nullptr if not found.
static QgsAuthMethodRegistry * instance(const QString &pluginPath=QString())
Means of accessing canonical single instance.
QWidget * editWidget(const QString &authMethodKey, QWidget *parent=nullptr)
Returns the GUI edit widget associated with the auth method.
QString pluginList(bool asHtml=false) const
Returns list of auth method plugins found.
void setLibraryDirectory(const QDir &path)
Sets library directory where to search for plugins.
QDir libraryDirectory() const
Returns library directory where plugins are found.
Q_DECL_DEPRECATED QString library(const QString &authMethodKey) const
Returns path for the library of the auth method.
QStringList authMethodList() const
Returns list of available auth methods by their keys.
std::map< QString, QgsAuthMethodMetadata * > AuthMethods
Type for auth method metadata associative container.
QgsAuthMethod * createAuthMethod(const QString &authMethodKey)
Create an instance of the auth method.
Abstract base class for authentication method plugins.
#define SIP_DEPRECATED
Definition qgis_sip.h:113