QGIS API Documentation  2.8.2-Wien
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
qgsprojectbadlayerguihandler.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsprojectbadlayerguihandler.h - handle bad layers
3  ---------------------
4  begin : December 2009
5  copyright : (C) 2009 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 QGSPROJECTBADLAYERGUIHANDLER_H
16 #define QGSPROJECTBADLAYERGUIHANDLER_H
17 
18 #include "qgsproject.h"
19 
25 class GUI_EXPORT QgsProjectBadLayerGuiHandler : public QObject, public QgsProjectBadLayerHandler
26 {
27  Q_OBJECT
28 
29  public:
31 
33  virtual void handleBadLayers( QList<QDomNode> layers, QDomDocument projectDom ) override;
34 
36  static bool mIgnore;
37 
38  protected:
39 
41  enum DataType { IS_VECTOR, IS_RASTER, IS_BOGUS };
42 
44  enum ProviderType { IS_FILE, IS_DATABASE, IS_URL, IS_Unknown };
45 
46 
51  DataType dataType( QDomNode & layerNode );
52 
59  QString dataSource( QDomNode & layerNode );
60 
74  ProviderType providerType( QDomNode & layerNode );
75 
77  void setDataSource( QDomNode & layerNode, const QString &dataSource );
78 
80  bool findMissingFile( const QString &fileFilters, QDomNode &layerNode );
81 
94  bool findLayer( const QString &fileFilters, const QDomNode &constLayerNode );
95 
100  void findLayers( const QString &fileFilters, const QList<QDomNode> &layerNodes );
101 
102 };
103 
104 #endif // QGSPROJECTBADLAYERGUIHANDLER_H