24 #include "qgis_core.h" 33 #include <QStringList> 85 Q_PROPERTY( QStringList nonIdentifiableLayers READ nonIdentifiableLayers WRITE setNonIdentifiableLayers NOTIFY nonIdentifiableLayersChanged )
86 Q_PROPERTY( QString fileName READ fileName WRITE setFileName NOTIFY fileNameChanged )
87 Q_PROPERTY( QString homePath READ homePath NOTIFY homePathChanged )
89 Q_PROPERTY( QString ellipsoid READ ellipsoid WRITE setEllipsoid NOTIFY ellipsoidChanged )
90 Q_PROPERTY(
QgsMapThemeCollection *mapThemeCollection READ mapThemeCollection NOTIFY mapThemeCollectionChanged )
91 Q_PROPERTY(
QgsSnappingConfig snappingConfig READ snappingConfig WRITE setSnappingConfig NOTIFY snappingConfigChanged )
93 Q_PROPERTY( QList<
QgsVectorLayer *> avoidIntersectionsLayers READ avoidIntersectionsLayers WRITE setAvoidIntersectionsLayers NOTIFY avoidIntersectionsLayersChanged )
114 void setTitle( const QString &title );
120 QString title() const;
125 bool isDirty() const;
133 void setFileName( const QString &name );
141 QString fileName() const;
148 QFileInfo fileInfo() const;
172 QString ellipsoid() const;
180 void setEllipsoid( const QString &ellipsoid );
216 bool read( const QString &filename );
233 bool readLayer( const QDomNode &layerNode );
243 bool write( const QString &filename );
261 bool writeEntry( const QString &scope, const QString &key,
bool value )
SIP_PYNAME( writeEntryBool );
272 bool writeEntry( const QString &scope, const QString &key,
double value )
SIP_PYNAME( writeEntryDouble );
282 bool writeEntry( const QString &scope, const QString &key,
int value );
292 bool writeEntry( const QString &scope, const QString &key, const QString &value );
302 bool writeEntry( const QString &scope, const QString &key, const QStringList &value );
310 QStringList readListEntry( const QString &scope, const QString &key, const QStringList &def = QStringList(),
bool *ok =
nullptr ) const;
312 QString readEntry( const QString &scope, const QString &key, const QString &def = QString(),
bool *ok =
nullptr ) const;
313 int readNumEntry( const QString &scope, const QString &key,
int def = 0,
bool *ok =
nullptr ) const;
314 double readDoubleEntry( const QString &scope, const QString &key,
double def = 0,
bool *ok =
nullptr ) const;
315 bool readBoolEntry( const QString &scope, const QString &key,
bool def = false,
bool *ok =
nullptr ) const;
319 bool removeEntry( const QString &scope, const QString &key );
327 QStringList entryList( const QString &scope, const QString &key ) const;
334 QStringList subkeyList( const QString &scope, const QString &key ) const;
342 void dumpProperties() const;
356 QString writePath( const QString &filename ) const;
359 QString readPath( const QString &filename ) const;
362 QString error() const;
371 QString layerIsEmbedded( const QString &
id ) const;
378 bool createEmbeddedLayer( const QString &layerId, const QString &projectFilePath, QList<QDomNode> &brokenNodes,
385 QgsLayerTreeGroup *createEmbeddedGroup( const QString &groupName, const QString &projectFilePath, const QStringList &invisibleLayers );
388 void setTopologicalEditing(
bool enabled );
391 bool topologicalEditing() const;
407 void setDistanceUnits(
QgsUnitTypes::DistanceUnit unit );
427 QString homePath() const;
480 void setNonIdentifiableLayers(
const QList<QgsMapLayer *> &layers );
485 void setNonIdentifiableLayers(
const QStringList &layerIds );
490 QStringList nonIdentifiableLayers()
const;
499 bool autoTransaction()
const;
510 void setAutoTransaction(
bool autoTransaction );
527 bool evaluateDefaultValues()
const;
535 void setEvaluateDefaultValues(
bool evaluateDefaultValues );
551 QList<QgsVectorLayer *> avoidIntersectionsLayers()
const;
558 void setAvoidIntersectionsLayers(
const QList<QgsVectorLayer *> &layers );
565 QVariantMap customVariables()
const;
571 void setCustomVariables(
const QVariantMap &customVariables );
611 QgsMapLayer *mapLayer(
const QString &layerId )
const;
620 QList<QgsMapLayer *> mapLayersByName(
const QString &layerName )
const;
628 QMap<QString, QgsMapLayer *> mapLayers()
const;
633 bool isZipped()
const;
648 template <
typename T>
651 return mLayerStore->layers<T>();
680 QList<QgsMapLayer *> addMapLayers(
const QList<QgsMapLayer *> &mapLayers
SIP_TRANSFER,
681 bool addToLegend =
true,
712 bool addToLegend =
true,
729 void removeMapLayers(
const QStringList &layerIds );
745 void removeMapLayers(
const QList<QgsMapLayer *> &layers );
760 void removeMapLayer(
const QString &layerId );
796 void removeAllMapLayers();
803 void reloadAllLayers();
822 void setTrustLayerMetadata(
bool trust );
852 void readProject(
const QDomDocument & );
855 void writeProject( QDomDocument & );
865 void readMapLayer(
QgsMapLayer *mapLayer,
const QDomElement &layerNode );
875 void writeMapLayer(
QgsMapLayer *mapLayer, QDomElement &layerElem, QDomDocument &doc );
881 void oldProjectVersionWarning(
const QString & );
888 void layerLoaded(
int i,
int n );
890 void loadingLayer(
const QString & );
893 void nonIdentifiableLayersChanged( QStringList nonIdentifiableLayers );
896 void fileNameChanged();
899 void homePathChanged();
908 void customVariablesChanged();
924 void ellipsoidChanged(
const QString &ellipsoid );
933 void transformContextChanged();
939 void missingDatumTransforms(
const QStringList &missingTransforms );
947 void transactionGroupsChanged();
954 void topologicalEditingChanged();
961 void avoidIntersectionsLayersChanged();
974 void mapThemeCollectionChanged();
980 void labelingEngineSettingsChanged();
993 void layersWillBeRemoved(
const QStringList &layerIds );
1002 void layersWillBeRemoved(
const QList<QgsMapLayer *> &layers );
1013 void layerWillBeRemoved(
const QString &layerId );
1032 void layersRemoved(
const QStringList &layerIds );
1042 void layerRemoved(
const QString &layerId );
1063 void layersAdded(
const QList<QgsMapLayer *> &layers );
1081 void legendLayersAdded(
const QList<QgsMapLayer *> &layers );
1101 void setDirty(
bool b =
true );
1104 void onMapLayersAdded(
const QList<QgsMapLayer *> &layers );
1105 void onMapLayersRemoved(
const QList<QgsMapLayer *> &layers );
1106 void cleanTransactionGroups(
bool force =
false );
1119 bool _getMapLayers(
const QDomDocument &doc, QList<QDomNode> &brokenNodes );
1125 void setError(
const QString &errorMessage )
SIP_SKIP;
1146 bool readProjectFile(
const QString &filename );
1149 bool writeProjectFile(
const QString &filename );
1152 bool unzip(
const QString &filename );
1155 bool zip(
const QString &filename );
1158 bool saveAuxiliaryStorage(
const QString &filename = QString() );
1160 std::unique_ptr< QgsMapLayerStore > mLayerStore;
1162 QString mErrorMessage;
1171 QHash< QString, QPair< QString, bool> > mEmbeddedLayers;
1177 std::unique_ptr<QgsAnnotationManager> mAnnotationManager;
1178 std::unique_ptr<QgsLayoutManager> mLayoutManager;
1187 std::unique_ptr<QgsMapThemeCollection> mMapThemeCollection;
1189 std::unique_ptr<QgsLabelingEngineSettings> mLabelingEngineSettings;
1191 QVariantMap mCustomVariables;
1193 std::unique_ptr<QgsProjectArchive> mArchive;
1195 std::unique_ptr<QgsAuxiliaryStorage> mAuxiliaryStorage;
1200 bool mAutoTransaction =
false;
1201 bool mEvaluateDefaultValues =
false;
1203 bool mDirty =
false;
1204 bool mTrustLayerMetadata =
false;
Layer tree group node serves as a container for layers and further groups.
The class is used as a container of context for various read/write operations on other objects...
Base class for all map layer types.
Manages storage of a set of QgsAnnotation annotation objects.
Helper functions for various unit types.
Class providing some utility methods to manage auxiliary storage.
virtual QgsExpressionContext createExpressionContext() const =0
This method needs to be reimplemented in all classes which implement this interface and return an exp...
bool trustLayerMetadata() const
Returns true if the trust option is activated, false otherwise.
Namespace with helper functions for layer tree operations.
CORE_EXPORT bool unzip(const QString &zip, const QString &dir, QStringList &files)
Unzip a zip file in an output directory.
CORE_EXPORT QgsProjectVersion getVersion(QDomDocument const &doc)
Return the version string found in the given DOM document.
A class to describe the version of a project.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
This is the class is providing tolerance value in map unit values.
Listens to the updates in map layer registry and does changes in layer tree.
Reads and writes project states.
Contains information about the context in which a coordinate transform is executed.
Manages storage of a set of layouts.
Abstract interface for generating an expression context.
Project property key node.
QVector< T > layers() const
Returns a list of registered map layers with a specified layer type.
This class manages a set of relations between layers.
Stores global configuration for labeling engine.
This class represents a coordinate reference system (CRS).
A storage object for map layers, in which the layers are owned by the store and have their lifetime b...
Container class that allows storage of map themes consisting of visible map layers and layer styles...
This is a container for configuration of the snapping of the project.
Resolves relative paths into absolute paths and vice versa.
Represents a vector layer which manages a vector based data sets.
CORE_EXPORT bool zip(const QString &zip, const QStringList &files)
Zip the list of files in the zip file.
Interface for classes that handle missing layer files when reading project file.