QGIS API Documentation  2.8.2-Wien
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
qgslayertreeutils.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgslayertreeutils.h
3  --------------------------------------
4  Date : May 2014
5  Copyright : (C) 2014 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 
16 #ifndef QGSLAYERTREEUTILS_H
17 #define QGSLAYERTREEUTILS_H
18 
19 #include <qnamespace.h>
20 #include <QList>
21 
22 class QDomElement;
23 class QDomDocument;
24 class QStringList;
25 
26 class QgsLayerTreeNode;
27 class QgsLayerTreeGroup;
28 class QgsLayerTreeLayer;
29 
35 class CORE_EXPORT QgsLayerTreeUtils
36 {
37  public:
38 
40  static bool readOldLegend( QgsLayerTreeGroup* root, const QDomElement& legendElem );
42  static bool readOldLegendLayerOrder( const QDomElement& legendElem, bool& hasCustomOrder, QStringList& order );
44  static QDomElement writeOldLegend( QDomDocument& doc, QgsLayerTreeGroup* root, bool hasCustomOrder, const QStringList& order );
45 
47  static QString checkStateToXml( Qt::CheckState state );
49  static Qt::CheckState checkStateFromXml( QString txt );
50 
52  static bool layersEditable( const QList<QgsLayerTreeLayer*>& layerNodes );
54  static bool layersModified( const QList<QgsLayerTreeLayer*>& layerNodes );
55 
57  static void removeInvalidLayers( QgsLayerTreeGroup* group );
58 
60  static void replaceChildrenOfEmbeddedGroups( QgsLayerTreeGroup* group );
61 
63  static void updateEmbeddedGroupsProjectPath( QgsLayerTreeGroup* group );
64 
66  static QStringList invisibleLayerList( QgsLayerTreeNode *node );
67 };
68 
69 #endif // QGSLAYERTREEUTILS_H