QGIS API Documentation  2.6.0-Brighton
 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 QgsLayerTreeGroup;
27 class QgsLayerTreeLayer;
28 
34 class CORE_EXPORT QgsLayerTreeUtils
35 {
36  public:
37 
39  static bool readOldLegend( QgsLayerTreeGroup* root, const QDomElement& legendElem );
41  static bool readOldLegendLayerOrder( const QDomElement& legendElem, bool& hasCustomOrder, QStringList& order );
43  static QDomElement writeOldLegend( QDomDocument& doc, QgsLayerTreeGroup* root, bool hasCustomOrder, const QStringList& order );
44 
46  static QString checkStateToXml( Qt::CheckState state );
48  static Qt::CheckState checkStateFromXml( QString txt );
49 
51  static bool layersEditable( const QList<QgsLayerTreeLayer*>& layerNodes );
53  static bool layersModified( const QList<QgsLayerTreeLayer*>& layerNodes );
54 
56  static void removeInvalidLayers( QgsLayerTreeGroup* group );
57 
59  static void removeChildrenOfEmbeddedGroups( QgsLayerTreeGroup* group );
60 
62  static void updateEmbeddedGroupsProjectPath( QgsLayerTreeGroup* group );
63 
64 };
65 
66 #endif // QGSLAYERTREEUTILS_H