1/************************************************************************ 2 * This file has been generated automatically from * 3 * * 4 * src/core/qgsprojectbadlayerhandler.h * 5 * * 6 * Do not edit manually ! Edit header and run scripts/sipify.pl again * 7 ************************************************************************/ 8 9 10 11class QgsProjectBadLayerHandler 12{ 13%Docstring 14Interface for classes that handle missing layer files when reading project file. 15%End 16 17%TypeHeaderCode 18#include "qgsprojectbadlayerhandler.h" 19%End 20 public: 21 22 virtual void handleBadLayers( const QList<QDomNode> &layers ); 23%Docstring 24This method will be called whenever the project tries to load layers which 25cannot be accessed. It should inform the user about this and if possible offer 26to fix the unavailable layers by setting a valid datasource, e.g. by showing a file 27dialog. 28 29The default implementation will dismiss all bad layers and write information to the 30log. 31 32.. versionadded:: 3.0 33%End 34 virtual ~QgsProjectBadLayerHandler(); 35 36 37 protected: 38 39 enum DataType 40 { 41 IS_VECTOR, 42 IS_RASTER, 43 IS_BOGUS 44 }; 45 46 enum ProviderType 47 { 48 IS_FILE, 49 IS_DATABASE, 50 IS_URL, 51 IS_Unknown 52 }; 53 54 55 DataType dataType( const QDomNode &layerNode ); 56%Docstring 57Returns data type associated with the given QgsProject file Dom node 58 59The Dom node should represent the state associated with a specific layer. 60 61.. versionadded:: 3.0 62%End 63 64 QString dataSource( const QDomNode &layerNode ); 65%Docstring 66Returns the data source for the given layer 67 68The QDomNode is a QgsProject Dom node corresponding to a map layer state. 69 70Essentially dumps datasource tag. 71 72.. versionadded:: 3.0 73%End 74 75 ProviderType providerType( const QDomNode &layerNode ); 76%Docstring 77Returns the physical storage type associated with the given layer 78 79The QDomNode is a QgsProject Dom node corresponding to a map layer state. 80 81If the provider tag is "ogr", then it's a file type. 82 83However, if the layer is a raster, then there won't be a 84provider tag. It will always have an associated file. 85 86If the layer doesn't fall into either of the previous two categories, then 87it's either a database or URL. If the datasource tag has "url=", then it's 88URL based and if it has "dbname=">, then the layer data is in a database. 89 90.. versionadded:: 3.0 91%End 92 93 void setDataSource( QDomNode &layerNode, const QString &dataSource ); 94%Docstring 95Set the datasource element to the new value 96 97.. versionadded:: 3.0 98%End 99}; 100 101/************************************************************************ 102 * This file has been generated automatically from * 103 * * 104 * src/core/qgsprojectbadlayerhandler.h * 105 * * 106 * Do not edit manually ! Edit header and run scripts/sipify.pl again * 107 ************************************************************************/ 108