Skip to content

Commit

Permalink
sipify batch
Browse files Browse the repository at this point in the history
 * QgsCredentials
 * QgsCrsCache
 * QgsDataSourceUri
 * QgsDateTimeStatisticalSummary
 * QgsDatumTransformStore
  • Loading branch information
3nids committed Apr 24, 2017
1 parent 419185b commit 5a19463
Show file tree
Hide file tree
Showing 11 changed files with 609 additions and 287 deletions.
5 changes: 0 additions & 5 deletions python/auto_sip.blacklist
@@ -1,15 +1,10 @@
core/conversions.sip
core/qgsexception.sip
core/qgis.sip
core/qgscredentials.sip
core/qgscrscache.sip
core/qgsdataitem.sip
core/qgsdataitemprovider.sip
core/qgsdataitemproviderregistry.sip
core/qgsdataprovider.sip
core/qgsdatasourceuri.sip
core/qgsdatetimestatisticalsummary.sip
core/qgsdatumtransformstore.sip
core/qgsdbfilterproxymodel.sip
core/qgseditformconfig.sip
core/qgseditorwidgetsetup.sip
Expand Down
139 changes: 96 additions & 43 deletions python/core/qgscredentials.sip
@@ -1,103 +1,156 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgscredentials.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/





class QgsCredentials
{
%TypeHeaderCode
#include <qgscredentials.h>
%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
%End

%TypeHeaderCode
#include "qgscredentials.h"
%End
public:
//! virtual destructor

virtual ~QgsCredentials();

bool get( const QString& realm, QString &username /In,Out/, QString &password /In,Out/, const QString& message = QString::null );
void put( const QString& realm, const QString& username, const QString& password );
bool get( const QString &realm, QString &username /In,Out/, QString &password /In,Out/, const QString &message = QString::null );
%Docstring
:rtype: bool
%End
void put( const QString &realm, const QString &username, const QString &password );

bool getMasterPassword( QString &password /In,Out/, bool stored = false );
%Docstring
:rtype: bool
%End

//! retrieves instance
static QgsCredentials *instance();
%Docstring
retrieves instance
:rtype: QgsCredentials
%End

/**
* 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.
* @note added in 2.4
*/
void lock();
%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

/**
* Unlock the instance after being locked.
* @note added in 2.4
*/
void unlock();
%Docstring
Unlock the instance after being locked.
.. versionadded:: 2.4
%End

/**
* Return pointer to mutex
* @note added in 2.4
*/
QMutex *mutex();
%Docstring
Return pointer to mutex
.. versionadded:: 2.4
:rtype: QMutex
%End

protected:
QgsCredentials();

//! request a password
virtual bool request( const QString& realm, QString &username /In,Out/, QString &password /In,Out/, const QString& message = QString::null ) = 0;
virtual bool request( const QString &realm, QString &username /In,Out/, QString &password /In,Out/, const QString &message = QString::null ) = 0;
%Docstring
request a password
:rtype: bool
%End

//! request a master password
virtual bool requestMasterPassword( QString &password /In,Out/, bool stored = false ) = 0;
%Docstring
request a master password
:rtype: bool
%End

//! register instance
void setInstance( QgsCredentials *instance );
%Docstring
register instance
%End

private:
QgsCredentials( const QgsCredentials& );
QgsCredentials( const QgsCredentials & );
};


/**
\brief Default implementation of credentials interface

This class doesn't prompt or return credentials
*/
class QgsCredentialsNone : QObject, QgsCredentials
{
%TypeHeaderCode
#include <qgscredentials.h>
%Docstring
Default implementation of credentials interface

This class doesn't prompt or return credentials
%End

%TypeHeaderCode
#include "qgscredentials.h"
%End
public:
QgsCredentialsNone();

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

protected:
virtual bool request( const QString& realm, QString &username /In,Out/, QString &password /In,Out/, const QString& message = QString::null );
virtual bool request( const QString &realm, QString &username /In,Out/, QString &password /In,Out/, const QString &message = QString::null );
virtual bool requestMasterPassword( QString &password /In,Out/, bool stored = false );
};


/**
\brief Implementation of credentials interface for the console
class QgsCredentialsConsole : QObject, QgsCredentials
{
%Docstring
Implementation of credentials interface for the console

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.
*/
class QgsCredentialsConsole : QObject, QgsCredentials
{
%TypeHeaderCode
#include <qgscredentials.h>
%End

%TypeHeaderCode
#include "qgscredentials.h"
%End
public:
QgsCredentialsConsole();

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

protected:
virtual bool request( const QString& realm, QString &username /In,Out/, QString &password /In,Out/, const QString& message = QString::null );
virtual bool request( const QString &realm, QString &username /In,Out/, QString &password /In,Out/, const QString &message = QString::null );
virtual bool requestMasterPassword( QString &password /In,Out/, bool stored = false );
};

/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgscredentials.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
61 changes: 45 additions & 16 deletions python/core/qgscrscache.sip
@@ -1,27 +1,56 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgscrscache.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/





class QgsCoordinateTransformCache
{
%Docstring
Cache coordinate transform by authid of source/dest transformation to avoid the
overhead of initialization for each redraw*
%End

%TypeHeaderCode
#include <qgscrscache.h>
#include "qgscrscache.h"
%End
public:
static QgsCoordinateTransformCache* instance();

~QgsCoordinateTransformCache();
static QgsCoordinateTransformCache *instance();
%Docstring
:rtype: QgsCoordinateTransformCache
%End

/** Returns coordinate transformation. Cache keeps ownership
@param srcAuthId auth id string of source crs
@param destAuthId auth id string of dest crs
@param srcDatumTransform id of source's datum transform
@param destDatumTransform id of destinations's datum transform
@returns matching transform, or an invalid transform if none could be created
*/
QgsCoordinateTransform transform( const QString& srcAuthId, const QString& destAuthId, int srcDatumTransform = -1, int destDatumTransform = -1 );
// QgsCoordinateTransformCache &operator=( const QgsCoordinateTransformCache &rh ) = delete;
QgsCoordinateTransform transform( const QString &srcAuthId, const QString &destAuthId, int srcDatumTransform = -1, int destDatumTransform = -1 );
%Docstring
Returns coordinate transformation. Cache keeps ownership
\param srcAuthId auth id string of source crs
\param destAuthId auth id string of dest crs
\param srcDatumTransform id of source's datum transform
\param destDatumTransform id of destinations's datum transform
:return: matching transform, or an invalid transform if none could be created
:rtype: QgsCoordinateTransform
%End

/** Removes transformations where a changed crs is involved from the cache*/
void invalidateCrs( const QString& crsAuthId );
void invalidateCrs( const QString &crsAuthId );
%Docstring
Removes transformations where a changed crs is involved from the cache
%End

private:

QgsCoordinateTransformCache( const QgsCoordinateTransformCache& rh );
QgsCoordinateTransformCache( const QgsCoordinateTransformCache &rh );
};

/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgscrscache.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

0 comments on commit 5a19463

Please sign in to comment.