QGIS API Documentation  2.14.0-Essen
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 
26 {
27  Q_OBJECT
28 
29  public:
31 
33  virtual void handleBadLayers( const QList<QDomNode>& layers, const 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 
99  void findLayers( const QString &fileFilters, const QList<QDomNode> &layerNodes );
100 
101 };
102 
103 #endif // QGSPROJECTBADLAYERGUIHANDLER_H
virtual void handleBadLayers(const QList< QDomNode > &layers, const QDomDocument &projectDom)=0
static bool mIgnore
Flag to store the Ignore button press of MessageBox used by QgsLegend.
Handler for missing layers within project.
ProviderType
the three flavors for data
Interface for classes that handle missing layer files when reading project file.
Definition: qgsproject.h:434