QGIS/python/core/auto_generated/qgsmimedatautils.sip.in

143 lines
3.9 KiB
Plaintext
Raw Normal View History

2017-05-14 09:48:41 +02:00
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsmimedatautils.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsMimeDataUtils
{
2017-05-14 09:48:41 +02:00
%TypeHeaderCode
2017-05-14 09:48:41 +02:00
#include "qgsmimedatautils.h"
%End
public:
struct Uri
{
Uri();
2017-05-14 09:48:41 +02:00
%Docstring
Constructs invalid URI
%End
2019-04-04 11:29:50 +02:00
explicit Uri( const QString &encData );
2017-05-14 09:48:41 +02:00
%Docstring
Constructs URI from encoded data
%End
explicit Uri( QgsMapLayer *layer );
%Docstring
Constructs a URI corresponding to the specified ``layer``.
.. versionadded:: 3.8
2017-05-14 09:48:41 +02:00
%End
bool isValid() const;
2017-05-14 09:48:41 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns whether the object contains valid data
2017-05-14 09:48:41 +02:00
.. versionadded:: 3.0
%End
QString data() const;
2017-05-14 09:48:41 +02:00
%Docstring
Returns encoded representation of the object
%End
QgsVectorLayer *vectorLayer( bool &owner, QString &error ) const;
%Docstring
Gets vector layer from uri if possible, otherwise returns ``None`` and error is set
2017-12-15 21:36:08 -04:00
2019-02-26 19:54:09 +10:00
:param owner: set to ``True`` if caller becomes owner
2017-12-15 10:36:55 -04:00
:param error: set to error message if cannot get vector
%End
2017-08-22 11:18:11 +02:00
QgsRasterLayer *rasterLayer( bool &owner, QString &error ) const;
%Docstring
Gets raster layer from uri if possible, otherwise returns ``None`` and error is set
2017-12-15 21:36:08 -04:00
2019-02-26 19:54:09 +10:00
:param owner: set to ``True`` if caller becomes owner
:param error: set to error message if cannot get raster
%End
QgsMeshLayer *meshLayer( bool &owner, QString &error ) const;
%Docstring
Gets mesh layer from uri if possible, otherwise returns ``None`` and error is set
2019-02-26 19:54:09 +10:00
:param owner: set to ``True`` if caller becomes owner
2017-12-15 10:36:55 -04:00
:param error: set to error message if cannot get raster
%End
QgsMapLayer *mapLayer() const;
%Docstring
Returns the layer from the active project corresponding to this uri (if possible),
otherwise returns ``None``.
Unlike vectorLayer(), rasterLayer(), or meshLayer(), this method will not attempt
to create a new layer corresponding to the URI.
.. versionadded:: 3.8
2017-08-22 11:18:11 +02:00
%End
QString layerType;
QString providerKey;
2019-02-08 19:23:40 +10:00
QString name;
QString uri;
2015-02-03 02:21:52 +01:00
QStringList supportedCrs;
QStringList supportedFormats;
QString layerId;
QString pId;
QgsWkbTypes::Type wkbType;
SIP_PYOBJECT __repr__();
%MethodCode
QString str = QStringLiteral( "<QgsMimeDataUtils::Uri (%1): %2>" ).arg( sipCpp->providerKey, sipCpp->uri );
sipRes = PyUnicode_FromString( str.toUtf8().constData() );
%End
};
2017-05-14 18:24:07 +02:00
typedef QList<QgsMimeDataUtils::Uri> UriList;
2018-11-05 20:02:09 +10:00
static QMimeData *encodeUriList( const UriList &layers ) /Factory/;
%Docstring
Encodes a URI list to a new QMimeData object.
%End
static bool isUriList( const QMimeData *data );
static UriList decodeUriList( const QMimeData *data );
2017-05-14 09:48:41 +02:00
static QByteArray layerTreeNodesToUriList( const QList<QgsLayerTreeNode *> &nodes );
%Docstring
2017-12-15 10:36:55 -04:00
Returns encoded URI list from a list of layer tree nodes.
2017-05-14 09:48:41 +02:00
.. versionadded:: 3.0
%End
static bool hasOriginatedFromCurrentAppInstance( const QgsMimeDataUtils::Uri &uri );
%Docstring
Returns ``True`` if ``uri`` originated from the current QGIS application
instance.
.. versionadded:: 3.8
2017-05-14 09:48:41 +02:00
%End
};
2017-05-14 09:48:41 +02:00
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsmimedatautils.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/