QGIS API Documentation  2.18.21-Las Palmas (9fba24a)
qgsmimedatautils.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsmimedatautils.h
3  ---------------------
4  begin : November 2011
5  copyright : (C) 2011 by Martin Dobias
6  email : wonder dot sk at gmail dot com
7  ***************************************************************************
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  ***************************************************************************/
15 #ifndef QGSMIMEDATAUTILS_H
16 #define QGSMIMEDATAUTILS_H
17 
18 #include <QMimeData>
19 #include <QStringList>
20 
21 class QgsLayerItem;
22 
26 class CORE_EXPORT QgsMimeDataUtils
27 {
28  public:
29 
30  struct CORE_EXPORT Uri
31  {
32  Uri( QgsLayerItem* layer );
33  Uri( QString& encData );
34 
35  QString data() const;
36 
43  };
45 
46  static QMimeData* encodeUriList( const UriList& layers );
47 
48  static bool isUriList( const QMimeData* data );
49 
50  static UriList decodeUriList( const QMimeData* data );
51 
52  private:
53  static QString encode( const QStringList& items );
54  static QStringList decode( const QString& encoded );
55 
56 };
57 
59 
60 #endif // QGSMIMEDATAUTILS_H
61 
Q_DECLARE_METATYPE(QgsMimeDataUtils::UriList)
QStringList supportedFormats
Item that represents a layer that can be opened with one of the providers.
Definition: qgsdataitem.h:308
QList< Uri > UriList