QGIS/python/core/qgsmimedatautils.sip

107 lines
3.0 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
explicit Uri( QString &encData );
2017-05-14 09:48:41 +02:00
%Docstring
Constructs URI from encoded data
%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
2017-12-15 10:36:55 -04:00
Get vector layer from uri if possible, otherwise returns 0 and error is set
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param owner: set to true if caller becomes owner
: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
2017-12-15 10:36:55 -04:00
Get raster layer from uri if possible, otherwise returns 0 and error is set
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param owner: set to true if caller becomes owner
:param error: set to error message if cannot get raster
2017-08-22 11:18:11 +02:00
%End
QString layerType;
2017-05-14 09:48:41 +02:00
%Docstring
Type of URI. Recognized types: "vector" / "raster" / "plugin" / "custom"
%End
QString providerKey;
2017-05-14 09:48:41 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
For "vector" / "raster" type: provider id.
For "plugin" type: plugin layer type name.
2017-12-19 11:43:52 -04:00
For "custom" type: key of its :py:class:`QgsCustomDropHandler`
2017-05-14 09:48:41 +02:00
%End
QString name;
2017-05-14 09:48:41 +02:00
%Docstring
Human readable name to be used e.g. in layer tree
%End
QString uri;
2017-05-14 09:48:41 +02:00
%Docstring
Identifier of the data source recognized by its providerKey
%End
2015-02-03 02:21:52 +01:00
QStringList supportedCrs;
QStringList supportedFormats;
};
2017-05-14 18:24:07 +02:00
typedef QList<QgsMimeDataUtils::Uri> UriList;
static QMimeData *encodeUriList( const UriList &layers );
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
};
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 *
************************************************************************/