diff --git a/python/core/core.sip b/python/core/core.sip index 4e88e1f22284..20b6885d3e3c 100644 --- a/python/core/core.sip +++ b/python/core/core.sip @@ -98,6 +98,7 @@ %Include qgsvectorlayer.sip %Include qgsvectorlayerimport.sip %Include qgsvectoroverlay.sip +%Include qgscredentials.sip %Include qgsnetworkaccessmanager.sip diff --git a/python/core/qgscredentials.sip b/python/core/qgscredentials.sip new file mode 100644 index 000000000000..4e48c0c3cd4b --- /dev/null +++ b/python/core/qgscredentials.sip @@ -0,0 +1,40 @@ +class QgsCredentials +{ +%TypeHeaderCode +#include +%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 +%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 ); +};