Quantum GIS API Documentation  1.8
src/gui/qgsprojectbadlayerguihandler.h
Go to the documentation of this file.
00001 /***************************************************************************
00002     qgsprojectbadlayerguihandler.h - handle bad layers
00003     ---------------------
00004     begin                : December 2009
00005     copyright            : (C) 2009 by Martin Dobias
00006     email                : wonder.sk at gmail.com
00007  ***************************************************************************
00008  *                                                                         *
00009  *   This program is free software; you can redistribute it and/or modify  *
00010  *   it under the terms of the GNU General Public License as published by  *
00011  *   the Free Software Foundation; either version 2 of the License, or     *
00012  *   (at your option) any later version.                                   *
00013  *                                                                         *
00014  ***************************************************************************/
00015 #ifndef QGSPROJECTBADLAYERGUIHANDLER_H
00016 #define QGSPROJECTBADLAYERGUIHANDLER_H
00017 
00018 #include "qgsproject.h"
00019 
00027 class GUI_EXPORT QgsProjectBadLayerGuiHandler : public QObject, public QgsProjectBadLayerHandler
00028 {
00029     Q_OBJECT
00030 
00031   public:
00032     QgsProjectBadLayerGuiHandler();
00033 
00035     virtual void handleBadLayers( QList<QDomNode> layers, QDomDocument projectDom );
00036 
00038     static bool mIgnore;
00039 
00040   protected:
00041 
00043     enum DataType { IS_VECTOR, IS_RASTER, IS_BOGUS };
00044 
00046     enum ProviderType { IS_FILE, IS_DATABASE, IS_URL, IS_Unknown };
00047 
00048 
00053     DataType dataType( QDomNode & layerNode );
00054 
00061     QString dataSource( QDomNode & layerNode );
00062 
00076     ProviderType providerType( QDomNode & layerNode );
00077 
00079     void setDataSource( QDomNode & layerNode, QString const & dataSource );
00080 
00082     bool findMissingFile( QString const & fileFilters, QDomNode & layerNode );
00083 
00096     bool findLayer( QString const & fileFilters, QDomNode const & constLayerNode );
00097 
00102     void findLayers( QString const & fileFilters, QList<QDomNode> const & layerNodes );
00103 
00104 };
00105 
00106 #endif // QGSPROJECTBADLAYERGUIHANDLER_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines