QGIS API Documentation  2.2.0-Valmiera
 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 
27 class GUI_EXPORT QgsProjectBadLayerGuiHandler : public QObject, public QgsProjectBadLayerHandler
28 {
29  Q_OBJECT
30 
31  public:
33 
35  virtual void handleBadLayers( QList<QDomNode> layers, QDomDocument projectDom );
36 
38  static bool mIgnore;
39 
40  protected:
41 
43  enum DataType { IS_VECTOR, IS_RASTER, IS_BOGUS };
44 
46  enum ProviderType { IS_FILE, IS_DATABASE, IS_URL, IS_Unknown };
47 
48 
53  DataType dataType( QDomNode & layerNode );
54 
61  QString dataSource( QDomNode & layerNode );
62 
76  ProviderType providerType( QDomNode & layerNode );
77 
79  void setDataSource( QDomNode & layerNode, QString const & dataSource );
80 
82  bool findMissingFile( QString const & fileFilters, QDomNode & layerNode );
83 
96  bool findLayer( QString const & fileFilters, QDomNode const & constLayerNode );
97 
102  void findLayers( QString const & fileFilters, QList<QDomNode> const & layerNodes );
103 
104 };
105 
106 #endif // QGSPROJECTBADLAYERGUIHANDLER_H