2017-04-24 11:51:09 +02:00
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/core/qgscredentials.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-09-17 12:41:29 +02:00
|
|
|
class QgsCredentials
|
|
|
|
{
|
2017-04-24 11:51:09 +02:00
|
|
|
%Docstring
|
|
|
|
Interface for requesting credentials in QGIS in GUI independent way.
|
|
|
|
This class provides abstraction of a dialog for requesting credentials to the user.
|
|
|
|
By default QgsCredentials will be used if not overridden with other
|
|
|
|
credential creator function.
|
|
|
|
|
|
|
|
QGIS application uses QgsCredentialDialog class for displaying a dialog to the user.
|
|
|
|
|
|
|
|
Object deletes itself when it's not needed anymore. Children should use
|
|
|
|
signal destroyed() to be notified of the deletion
|
2012-09-17 12:41:29 +02:00
|
|
|
%End
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2017-04-24 11:51:09 +02:00
|
|
|
%TypeHeaderCode
|
|
|
|
#include "qgscredentials.h"
|
|
|
|
%End
|
2012-09-17 12:41:29 +02:00
|
|
|
public:
|
2017-04-24 11:51:09 +02:00
|
|
|
|
2012-09-17 12:41:29 +02:00
|
|
|
virtual ~QgsCredentials();
|
2017-09-11 21:43:15 +10:00
|
|
|
%Docstring
|
|
|
|
Destructor.
|
|
|
|
%End
|
2012-09-17 12:41:29 +02:00
|
|
|
|
2017-06-06 09:59:20 +02:00
|
|
|
bool get( const QString &realm, QString &username /In,Out/, QString &password /In,Out/, const QString &message = QString() );
|
2017-04-24 11:51:09 +02:00
|
|
|
%Docstring
|
|
|
|
:rtype: bool
|
|
|
|
%End
|
|
|
|
void put( const QString &realm, const QString &username, const QString &password );
|
2012-09-17 12:41:29 +02:00
|
|
|
|
2015-09-21 04:43:15 -06:00
|
|
|
bool getMasterPassword( QString &password /In,Out/, bool stored = false );
|
2017-04-24 11:51:09 +02:00
|
|
|
%Docstring
|
|
|
|
:rtype: bool
|
|
|
|
%End
|
2015-09-21 04:43:15 -06:00
|
|
|
|
2012-09-17 12:41:29 +02:00
|
|
|
static QgsCredentials *instance();
|
2017-04-24 11:51:09 +02:00
|
|
|
%Docstring
|
|
|
|
retrieves instance
|
|
|
|
:rtype: QgsCredentials
|
|
|
|
%End
|
2012-09-17 12:41:29 +02:00
|
|
|
|
2014-06-20 17:17:37 +07:00
|
|
|
void lock();
|
2017-04-24 11:51:09 +02:00
|
|
|
%Docstring
|
|
|
|
Lock the instance against access from multiple threads. This does not really lock access to get/put methds,
|
|
|
|
it will just prevent other threads to lock the instance and continue the execution. When the class is used
|
|
|
|
from non-GUI threads, they should call lock() before the get/put calls to avoid race conditions.
|
|
|
|
.. versionadded:: 2.4
|
|
|
|
%End
|
2014-06-22 17:54:40 +02:00
|
|
|
|
2014-06-20 17:17:37 +07:00
|
|
|
void unlock();
|
2017-04-24 11:51:09 +02:00
|
|
|
%Docstring
|
|
|
|
Unlock the instance after being locked.
|
|
|
|
.. versionadded:: 2.4
|
|
|
|
%End
|
2014-06-20 17:17:37 +07:00
|
|
|
|
2014-06-22 17:54:40 +02:00
|
|
|
QMutex *mutex();
|
2017-04-24 11:51:09 +02:00
|
|
|
%Docstring
|
|
|
|
Return pointer to mutex
|
|
|
|
.. versionadded:: 2.4
|
|
|
|
:rtype: QMutex
|
|
|
|
%End
|
2014-06-22 17:54:40 +02:00
|
|
|
|
2012-09-17 12:41:29 +02:00
|
|
|
protected:
|
2017-09-11 21:55:20 +10:00
|
|
|
|
2014-06-20 17:17:37 +07:00
|
|
|
QgsCredentials();
|
2017-09-11 21:55:20 +10:00
|
|
|
%Docstring
|
|
|
|
Constructor for QgsCredentials.
|
|
|
|
%End
|
2014-06-20 17:17:37 +07:00
|
|
|
|
2017-06-06 09:59:20 +02:00
|
|
|
virtual bool request( const QString &realm, QString &username /In,Out/, QString &password /In,Out/, const QString &message = QString() ) = 0;
|
2017-04-24 11:51:09 +02:00
|
|
|
%Docstring
|
|
|
|
request a password
|
|
|
|
:rtype: bool
|
|
|
|
%End
|
2012-09-17 12:41:29 +02:00
|
|
|
|
2015-09-21 04:43:15 -06:00
|
|
|
virtual bool requestMasterPassword( QString &password /In,Out/, bool stored = false ) = 0;
|
2017-04-24 11:51:09 +02:00
|
|
|
%Docstring
|
|
|
|
request a master password
|
|
|
|
:rtype: bool
|
|
|
|
%End
|
2015-09-21 04:43:15 -06:00
|
|
|
|
2017-02-21 18:14:58 +01:00
|
|
|
void setInstance( QgsCredentials *instance );
|
2017-04-24 11:51:09 +02:00
|
|
|
%Docstring
|
|
|
|
register instance
|
|
|
|
%End
|
2014-06-20 17:17:37 +07:00
|
|
|
|
|
|
|
private:
|
2017-04-24 11:51:09 +02:00
|
|
|
QgsCredentials( const QgsCredentials & );
|
2012-09-17 12:41:29 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2016-02-16 13:29:36 +01:00
|
|
|
class QgsCredentialsNone : QObject, QgsCredentials
|
|
|
|
{
|
2017-04-24 11:51:09 +02:00
|
|
|
%Docstring
|
|
|
|
Default implementation of credentials interface
|
|
|
|
|
|
|
|
This class doesn't prompt or return credentials
|
2016-02-16 13:29:36 +01:00
|
|
|
%End
|
|
|
|
|
2017-04-24 11:51:09 +02:00
|
|
|
%TypeHeaderCode
|
|
|
|
#include "qgscredentials.h"
|
|
|
|
%End
|
2016-02-16 13:29:36 +01:00
|
|
|
public:
|
|
|
|
QgsCredentialsNone();
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void destroyed();
|
2017-04-24 11:51:09 +02:00
|
|
|
%Docstring
|
|
|
|
signals that object will be destroyed and shouldn't be used anymore
|
|
|
|
%End
|
2016-02-16 13:29:36 +01:00
|
|
|
|
|
|
|
protected:
|
2017-06-06 09:59:20 +02:00
|
|
|
virtual bool request( const QString &realm, QString &username /In,Out/, QString &password /In,Out/, const QString &message = QString() );
|
2016-02-16 13:29:36 +01:00
|
|
|
virtual bool requestMasterPassword( QString &password /In,Out/, bool stored = false );
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2017-04-24 11:51:09 +02:00
|
|
|
class QgsCredentialsConsole : QObject, QgsCredentials
|
|
|
|
{
|
|
|
|
%Docstring
|
|
|
|
Implementation of credentials interface for the console
|
2016-02-16 13:29:36 +01:00
|
|
|
|
2014-01-27 09:22:24 +01:00
|
|
|
This class outputs message to the standard output and retrieves input from
|
|
|
|
standard input. Therefore it won't be the right choice for apps without
|
|
|
|
GUI.
|
2012-09-17 12:41:29 +02:00
|
|
|
%End
|
|
|
|
|
2017-04-24 11:51:09 +02:00
|
|
|
%TypeHeaderCode
|
|
|
|
#include "qgscredentials.h"
|
|
|
|
%End
|
2012-09-17 12:41:29 +02:00
|
|
|
public:
|
|
|
|
QgsCredentialsConsole();
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void destroyed();
|
2017-04-24 11:51:09 +02:00
|
|
|
%Docstring
|
|
|
|
signals that object will be destroyed and shouldn't be used anymore
|
|
|
|
%End
|
2012-09-17 12:41:29 +02:00
|
|
|
|
|
|
|
protected:
|
2017-06-06 09:59:20 +02:00
|
|
|
virtual bool request( const QString &realm, QString &username /In,Out/, QString &password /In,Out/, const QString &message = QString() );
|
2015-09-21 04:43:15 -06:00
|
|
|
virtual bool requestMasterPassword( QString &password /In,Out/, bool stored = false );
|
2012-09-17 12:41:29 +02:00
|
|
|
};
|
2017-04-24 11:51:09 +02:00
|
|
|
|
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/core/qgscredentials.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|