18 #ifndef QGSLEGENDMODEL_H
19 #define QGSLEGENDMODEL_H
21 #include <QStandardItemModel>
22 #include <QStringList>
63 Q_DECL_DEPRECATED
void setLayerSetAndGroups(
const QStringList& layerIds,
const QList< GroupLayerInfo >& groupInfo );
64 void setLayerSet(
const QStringList& layerIds,
double scaleDenominator = -1, QString rule =
"" );
71 QStandardItem *addGroup( QString text = QString::null,
int position = -1, QStandardItem* parentItem = 0 );
74 void updateItem( QStandardItem* item );
76 void updateLayer( QStandardItem* layerItem );
78 void updateVectorV2ClassificationItem( QStandardItem* classificationItem,
QgsSymbolV2* symbol, QString itemText )
79 { Q_UNUSED( classificationItem ); Q_UNUSED( symbol ); Q_UNUSED( itemText ); }
80 void updateRasterClassificationItem( QStandardItem* classificationItem )
81 { Q_UNUSED( classificationItem ); }
84 void updateItemText( QStandardItem* item );
87 bool writeXML( QDomElement& composerLegendElem, QDomDocument& doc )
const;
88 bool readXML(
const QDomElement& legendModelElem,
const QDomDocument& doc );
90 Qt::DropActions supportedDropActions()
const override;
91 Qt::ItemFlags flags(
const QModelIndex &
index )
const override;
94 virtual bool removeRows(
int row,
int count,
const QModelIndex & parent = QModelIndex() )
override;
97 QMimeData* mimeData(
const QModelIndexList &indexes )
const override;
98 QStringList mimeTypes()
const override;
101 bool dropMimeData(
const QMimeData *data, Qt::DropAction action,
int row,
int column,
const QModelIndex &parent )
override;
103 void setAutoUpdate(
bool autoUpdate );
107 void removeLayer(
const QString& layerId );
108 void addLayer(
QgsMapLayer* theMapLayer,
double scaleDenominator = -1, QString rule =
"", QStandardItem* parentItem = 0 );
114 void layersChanged();
118 int addVectorLayerItemsV2( QStandardItem* layerItem,
QgsVectorLayer* vlayer,
double scaleDenominator = -1, QString rule =
"" );
122 int addRasterLayerItems( QStandardItem* layerItem,
QgsMapLayer* rlayer );
124 void updateLayerItemText( QStandardItem* layerItem );
125 void updateSymbolV2ItemText( QStandardItem* symbolItem );
126 void updateRasterSymbolItemText( QStandardItem* symbolItem );
128 void addGroupFromLayerTree(
QgsLayerTreeGroup* parentGroup, QStandardItem* parentItem );