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 *
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
class QgsMimeDataUtils
|
|
|
|
{
|
2017-05-14 09:48:41 +02:00
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
%TypeHeaderCode
|
2017-05-14 09:48:41 +02:00
|
|
|
#include "qgsmimedatautils.h"
|
2012-09-24 02:28:15 +02:00
|
|
|
%End
|
|
|
|
public:
|
|
|
|
|
|
|
|
struct Uri
|
|
|
|
{
|
2016-08-09 08:49:42 +02:00
|
|
|
Uri();
|
2017-05-14 09:48:41 +02:00
|
|
|
%Docstring
|
|
|
|
Constructs invalid URI
|
|
|
|
%End
|
2017-05-01 16:42:33 +02:00
|
|
|
explicit Uri( QString &encData );
|
2017-05-14 09:48:41 +02:00
|
|
|
%Docstring
|
|
|
|
Constructs URI from encoded data
|
|
|
|
%End
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2016-08-09 08:49:42 +02:00
|
|
|
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
|
2016-08-09 08:49:42 +02:00
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
QString data() const;
|
2017-05-14 09:48:41 +02:00
|
|
|
%Docstring
|
|
|
|
Returns encoded representation of the object
|
|
|
|
%End
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2017-06-21 15:11:11 +02:00
|
|
|
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
|
2017-06-21 15:11:11 +02:00
|
|
|
%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
|
|
|
|
2018-04-06 16:11:50 +02: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
|
|
|
|
Get mesh layer from uri if possible, otherwise returns 0 and error is set
|
|
|
|
|
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
|
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
QString layerType;
|
2017-10-05 11:51:04 +10:00
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
QString providerKey;
|
|
|
|
QString name;
|
|
|
|
QString uri;
|
2015-02-03 02:21:52 +01:00
|
|
|
QStringList supportedCrs;
|
|
|
|
QStringList supportedFormats;
|
2012-09-24 02:28:15 +02:00
|
|
|
};
|
2017-05-14 18:24:07 +02:00
|
|
|
typedef QList<QgsMimeDataUtils::Uri> UriList;
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2017-05-01 16:42:33 +02:00
|
|
|
static QMimeData *encodeUriList( const UriList &layers );
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2017-05-01 16:42:33 +02:00
|
|
|
static bool isUriList( const QMimeData *data );
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2017-05-01 16:42:33 +02:00
|
|
|
static UriList decodeUriList( const QMimeData *data );
|
2012-09-24 02:28:15 +02:00
|
|
|
|
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
|
2016-08-21 13:24:07 +02:00
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
};
|
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 *
|
|
|
|
************************************************************************/
|