Skip to content

Commit

Permalink
add sip bindings to QgsCredentials
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Sep 17, 2012
1 parent 9117bf1 commit aad3f4e
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
1 change: 1 addition & 0 deletions python/core/core.sip
Expand Up @@ -98,6 +98,7 @@
%Include qgsvectorlayer.sip
%Include qgsvectorlayerimport.sip
%Include qgsvectoroverlay.sip
%Include qgscredentials.sip

%Include qgsnetworkaccessmanager.sip

Expand Down
40 changes: 40 additions & 0 deletions python/core/qgscredentials.sip
@@ -0,0 +1,40 @@
class QgsCredentials
{
%TypeHeaderCode
#include <qgscredentials.h>
%End
public:
//! virtual destructor
virtual ~QgsCredentials();

bool get( QString realm, QString &username, QString &password, QString message = QString::null );
void put( QString realm, QString username, QString password );

//! retrieves instance
static QgsCredentials *instance();

protected:
//! request a password
virtual bool request( QString realm, QString &username, QString &password, QString message = QString::null ) = 0;

//! register instance
void setInstance( QgsCredentials *theInstance );
};


class QgsCredentialsConsole : QObject, QgsCredentials
{
%TypeHeaderCode
#include <qgscredentials.h>
%End

public:
QgsCredentialsConsole();

signals:
//! signals that object will be destroyed and shouldn't be used anymore
void destroyed();

protected:
virtual bool request( QString realm, QString &username, QString &password, QString message = QString::null );
};

0 comments on commit aad3f4e

Please sign in to comment.