QGIS API Documentation 3.40.0-Bratislava (b56115d8743)
Loading...
Searching...
No Matches
qgszipitem.h
Go to the documentation of this file.
1/***************************************************************************
2 qgszipitem.h
3 -------------------
4 begin : 2011-04-01
5 copyright : (C) 2011 Radim Blazek
6 email : radim dot blazek at gmail dot com
7 ***************************************************************************/
8
9/***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17#ifndef QGSZIPITEM_H
18#define QGSZIPITEM_H
19
20#include "qgis_sip.h"
21#include "qgis_core.h"
22#include "qgis.h"
24
29class CORE_EXPORT QgsZipItem : public QgsDataCollectionItem
30{
31 Q_OBJECT
32
33 protected:
34 QString mFilePath;
35 QString mVsiPrefix;
36 QStringList mZipFileList;
37
38 public:
40 QgsZipItem( QgsDataItem *parent, const QString &name, const QString &path );
41
43 QgsZipItem( QgsDataItem *parent, const QString &name, const QString &filePath, const QString &path, const QString &providerKey = QString() );
44
45#ifdef SIP_RUN
46 SIP_PYOBJECT __repr__();
47 % MethodCode
48 QString str = QStringLiteral( "<QgsZipItem: \"%1\" %2>" ).arg( sipCpp->name(), sipCpp->path() );
49 sipRes = PyUnicode_FromString( str.toUtf8().constData() );
50 % End
51#endif
52
53 QVector<QgsDataItem *> createChildren() override;
54 QStringList getZipFileList();
55
56 bool hasDragEnabled() const override;
57 QgsMimeDataUtils::UriList mimeUris() const override;
58
60 static QVector<dataItem_t *> sDataItemPtr SIP_SKIP;
61 static QStringList sProviderNames;
62
66 Q_DECL_DEPRECATED static QString vsiPrefix( const QString &uri ) SIP_DEPRECATED;
67
71 static QgsDataItem *itemFromPath( QgsDataItem *parent, const QString &path, const QString &name ) SIP_FACTORY;
72
77 static QgsDataItem *itemFromPath( QgsDataItem *parent, const QString &filePath, const QString &name, const QString &path ) SIP_FACTORY SIP_PYNAME( itemFromFilePath );
78
79 static QIcon iconZip();
80
81 private:
82 void init();
83};
84
85
86
87#endif // QGSZIPITEM_H
88
89
A Collection: logical collection of layers or subcollections, e.g.
Base class for all items in the model.
Definition qgsdataitem.h:46
virtual QVector< QgsDataItem * > createChildren()
Create children.
virtual bool hasDragEnabled() const
Returns true if the item may be dragged.
virtual QgsMimeDataUtils::UriList mimeUris() const
Returns mime URIs for the data item, most data providers will only return a single URI but some data ...
QList< QgsMimeDataUtils::Uri > UriList
A zip file: contains layers, using GDAL/OGR VSIFILE mechanism.
Definition qgszipitem.h:30
QStringList mZipFileList
Definition qgszipitem.h:36
QString mFilePath
Definition qgszipitem.h:34
QString mVsiPrefix
Definition qgszipitem.h:35
static QStringList sProviderNames
Definition qgszipitem.h:61
#define str(x)
Definition qgis.cpp:38
#define SIP_DEPRECATED
Definition qgis_sip.h:106
#define SIP_SKIP
Definition qgis_sip.h:126
#define SIP_PYNAME(name)
Definition qgis_sip.h:81
#define SIP_FACTORY
Definition qgis_sip.h:76