1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148
|
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsmimedatautils.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
class QgsMimeDataUtils
{
%Docstring(signature="appended")
Contains utility functions for working with MIME data.
%End
%TypeHeaderCode
#include "qgsmimedatautils.h"
%End
public:
struct Uri
{
Uri();
%Docstring
Constructs invalid URI
%End
explicit Uri( const QString &encData );
%Docstring
Constructs URI from encoded data
%End
explicit Uri( QgsMapLayer *layer );
%Docstring
Constructs a URI corresponding to the specified ``layer``.
.. versionadded:: 3.8
%End
bool isValid() const;
%Docstring
Returns whether the object contains valid data
%End
QString data() const;
%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
:param owner: set to ``True`` if caller becomes owner
:param error: set to error message if cannot get vector
%End
QgsRasterLayer *rasterLayer( bool &owner, QString &error ) const;
%Docstring
Gets raster layer from uri if possible, otherwise returns ``None`` and
error is set
: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
:param owner: set to ``True`` if caller becomes owner
: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 :py:func:`~QgsMimeDataUtils.vectorLayer`,
:py:func:`~QgsMimeDataUtils.rasterLayer`, or
:py:func:`~QgsMimeDataUtils.meshLayer`, this method will not attempt to
create a new layer corresponding to the URI.
.. versionadded:: 3.8
%End
QString layerType;
QString providerKey;
QString name;
QString uri;
QStringList supportedCrs;
QStringList supportedFormats;
QString layerId;
QString pId;
Qgis::WkbType wkbType;
QString filePath;
SIP_PYOBJECT __repr__();
%MethodCode
QString str = QStringLiteral( "<QgsMimeDataUtils::Uri (%1): %2>" ).arg( sipCpp->providerKey, sipCpp->uri );
sipRes = PyUnicode_FromString( str.toUtf8().constData() );
%End
};
typedef QList<QgsMimeDataUtils::Uri> UriList;
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 );
static QByteArray layerTreeNodesToUriList( const QList<QgsLayerTreeNode *> &nodes );
%Docstring
Returns encoded URI list from a list of layer tree nodes.
%End
static bool hasOriginatedFromCurrentAppInstance( const QgsMimeDataUtils::Uri &uri );
%Docstring
Returns ``True`` if ``uri`` originated from the current QGIS application
instance.
.. versionadded:: 3.8
%End
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsmimedatautils.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
|