QGIS API Documentation  2.8.2-Wien
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 
23 class CORE_EXPORT QgsMimeDataUtils
24 {
25  public:
26 
27  struct CORE_EXPORT Uri
28  {
29  Uri( QgsLayerItem* layer );
30  Uri( QString& encData );
31 
32  QString data() const;
33 
34  QString layerType;
35  QString providerKey;
36  QString name;
37  QString uri;
38  QStringList supportedCrs;
39  QStringList supportedFormats;
40  };
41  typedef QList<Uri> UriList;
42 
43  static QMimeData* encodeUriList( UriList layers );
44 
45  static bool isUriList( const QMimeData* data );
46 
47  static UriList decodeUriList( const QMimeData* data );
48 
49  private:
50  static QString encode( const QStringList& items );
51  static QStringList decode( const QString& encoded );
52 
53 };
54 
55 #endif // QGSMIMEDATAUTILS_H
56