18 #ifndef QGSLEGENDMODEL_H
19 #define QGSLEGENDMODEL_H
21 #include <QStandardItemModel>
22 #include <QStringList>
56 void setLayerSetAndGroups(
const QStringList& layerIds,
const QList< GroupLayerInfo >& groupInfo );
57 void setLayerSet(
const QStringList& layerIds,
double scaleDenominator = -1, QString rule =
"" );
63 QStandardItem *addGroup( QString text = QString::null,
int position = -1 );
66 void updateItem( QStandardItem* item );
68 void updateLayer( QStandardItem* layerItem );
70 void updateVectorV2ClassificationItem( QStandardItem* classificationItem,
QgsSymbolV2* symbol, QString itemText )
71 { Q_UNUSED( classificationItem ); Q_UNUSED( symbol ); Q_UNUSED( itemText ); }
72 void updateRasterClassificationItem( QStandardItem* classificationItem )
73 { Q_UNUSED( classificationItem ); }
76 void updateItemText( QStandardItem* item );
79 bool writeXML( QDomElement& composerLegendElem, QDomDocument& doc )
const;
80 bool readXML(
const QDomElement& legendModelElem,
const QDomDocument& doc );
82 Qt::DropActions supportedDropActions()
const;
83 Qt::ItemFlags flags(
const QModelIndex &
index )
const;
86 virtual bool removeRows(
int row,
int count,
const QModelIndex & parent = QModelIndex() );
89 QMimeData* mimeData(
const QModelIndexList &indexes )
const;
90 QStringList mimeTypes()
const;
93 bool dropMimeData(
const QMimeData *data, Qt::DropAction action,
int row,
int column,
const QModelIndex &parent );
95 void setAutoUpdate(
bool autoUpdate );
99 void removeLayer(
const QString& layerId );
100 void addLayer(
QgsMapLayer* theMapLayer,
double scaleDenominator = -1, QString rule =
"" );
103 void layersChanged();
107 int addVectorLayerItemsV2( QStandardItem* layerItem,
QgsVectorLayer* vlayer,
double scaleDenominator = -1, QString rule =
"" );
111 int addRasterLayerItems( QStandardItem* layerItem,
QgsMapLayer* rlayer );
113 void updateLayerItemText( QStandardItem* layerItem );
114 void updateSymbolV2ItemText( QStandardItem* symbolItem );
115 void updateRasterSymbolItemText( QStandardItem* symbolItem );