17 #ifndef QGSLEGENDINTERFACE_H 
   18 #define QGSLEGENDINTERFACE_H 
   22 #include <QStringList> 
   23 #include <QModelIndex> 
   26 class QTreeWidgetItem;
 
   55     virtual QStringList groups() = 0;
 
   63     virtual QList<QgsMapLayer *> selectedLayers( 
bool inDrawOrder = 
false ) 
const = 0;
 
   67     virtual QList< QgsMapLayer * > layers() 
const = 0;
 
   71     virtual bool groupExists( 
int groupIndex ) = 0;
 
   75     virtual bool isGroupExpanded( 
int groupIndex ) = 0;
 
   79     virtual bool isGroupVisible( 
int groupIndex ) = 0;
 
   83     virtual bool isLayerExpanded( 
QgsMapLayer * ml ) = 0;
 
   87     virtual bool isLayerVisible( 
QgsMapLayer * ml ) = 0;
 
   92     virtual void addLegendLayerAction( QAction* action, QString menu, QString 
id,
 
   99     virtual void addLegendLayerActionForLayer( QAction* action, 
QgsMapLayer* layer ) = 0;
 
  104     virtual bool removeLegendLayerAction( QAction* action ) = 0;
 
  115     virtual bool setCurrentLayer( 
QgsMapLayer *layer ) = 0;
 
  120     void groupIndexChanged( 
int oldIndex, 
int newIndex );
 
  123     void groupRelationsChanged( );
 
  126     void itemAdded( QModelIndex 
index );
 
  140     virtual int addGroup( QString name, 
bool expand = 
true, QTreeWidgetItem* parent = 0 ) = 0;
 
  144     virtual int addGroup( QString name, 
bool expand, 
int parentIndex ) = 0;
 
  147     virtual void removeGroup( 
int groupIndex ) = 0;
 
  150     virtual void moveLayer( 
QgsMapLayer * ml, 
int groupIndex ) = 0;
 
  154     virtual void setGroupExpanded( 
int groupIndex, 
bool expand ) = 0;
 
  158     virtual void setLayerExpanded( 
QgsMapLayer * ml, 
bool expand ) = 0;
 
  162     virtual void setGroupVisible( 
int groupIndex, 
bool visible ) = 0;
 
  166     virtual void setLayerVisible( 
QgsMapLayer * ml, 
bool visible ) = 0;
 
  170     virtual void refreshLayerSymbology( 
QgsMapLayer *ml ) = 0;
 
QgsLegendInterface Abstract base class to make QgsLegend available to plugins. 
Base class for all map layer types. 
LayerType
Layers enum defining the types of layers that can be added to a map. 
virtual QList< GroupLayerInfo > groupLayerRelationship()
Return the relationship between groups and layers in the legend. 
QPair< QString, QList< QString > > GroupLayerInfo