16 #ifndef QGSLAYERTREENODE_H
17 #define QGSLAYERTREENODE_H
19 #include "qgis_core.h"
80 if ( sipCpp->inherits(
"QgsLayerTreeNode" ) )
82 sipType = sipType_QgsLayerTreeNode;
85 sipType = sipType_QgsLayerTreeLayer;
86 else if ( qobject_cast<QgsLayerTree *>( sipCpp ) )
87 sipType = sipType_QgsLayerTree;
89 sipType = sipType_QgsLayerTreeGroup;
112 QList<QgsLayerTreeNode *>
children() {
return mChildren; }
120 virtual QString name()
const = 0;
126 virtual void setName(
const QString &name ) = 0;
142 virtual void writeXml( QDomElement &parentElement,
const QgsReadWriteContext &context ) = 0;
145 virtual QString dump()
const = 0;
159 virtual void resolveReferences(
const QgsProject *project,
bool looseMatching =
false ) = 0;
165 bool isVisible()
const;
180 void setItemVisibilityChecked(
bool checked );
186 virtual void setItemVisibilityCheckedRecursive(
bool checked );
192 void setItemVisibilityCheckedParentRecursive(
bool checked );
198 bool isItemVisibilityCheckedRecursive()
const;
204 bool isItemVisibilityUncheckedRecursive()
const;
211 QList< QgsMapLayer * > checkedLayers()
const;
220 bool isExpanded()
const;
222 void setExpanded(
bool expanded );
225 void setCustomProperty(
const QString &key,
const QVariant &value );
227 QVariant customProperty(
const QString &key,
const QVariant &defaultValue = QVariant() )
const;
229 void removeCustomProperty(
const QString &key );
231 QStringList customProperties()
const;
242 void willRemoveChildren(
QgsLayerTreeNode *node,
int indexFrom,
int indexTo );
267 void readCommonXml( QDomElement &element );
269 void writeCommonXml( QDomElement &element );
272 void insertChildrenPrivate(
int index, QList<QgsLayerTreeNode *> nodes );
274 void removeChildrenPrivate(
int from,
int count,
bool destroy =
true );
296 #endif // QGSLAYERTREENODE_H